diff --git a/CMakeLists.txt b/CMakeLists.txt index 00c557a..f6eb9f0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,10 +70,11 @@ endif() # Build libraries find_package(Threads REQUIRED) +add_subdirectory(include/asio) + add_library(${PROJECT_NAME} src/asyncio/async_serial.cpp src/asyncio/async_can.cpp - src/asyncio/asyncio_utils.cpp # agilex mobile platforms src/platforms/mobile_base.cpp src/platforms/hunter_base.cpp @@ -82,8 +83,7 @@ add_library(${PROJECT_NAME} src/platforms/scout_can_parser.c src/platforms/scout_uart_parser.c ) -target_compile_definitions(${PROJECT_NAME} PUBLIC "-DASIO_ENABLE_OLD_SERVICES -DASIO_HAS_POSIX_STREAM_DESCRIPTOR") -target_link_libraries(${PROJECT_NAME} Threads::Threads) +target_link_libraries(${PROJECT_NAME} asio Threads::Threads) target_include_directories(${PROJECT_NAME} PUBLIC $ $ @@ -137,14 +137,14 @@ if(BUILD_WITHOUT_ROS) # BUILD_WITHOUT_ROS endforeach() # targets to install - install(TARGETS ${PROJECT_NAME} + install(TARGETS ${PROJECT_NAME} asio EXPORT wrp_sdkTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include) - install(DIRECTORY include/wrp_sdk + install(DIRECTORY include/wrp_sdk include/asio/include DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # export target configuration @@ -189,8 +189,8 @@ if(BUILD_WITHOUT_ROS) # BUILD_WITHOUT_ROS else() # BUILD_WITHOUT_ROS catkin_package( - LIBRARIES ${PROJECT_NAME} - INCLUDE_DIRS include + LIBRARIES ${PROJECT_NAME} asio + INCLUDE_DIRS include include/asio/include # CATKIN_DEPENDS rospy scout_msgs std_msgs # DEPENDS system_lib ) diff --git a/include/asio/CMakeLists.txt b/include/asio/CMakeLists.txt new file mode 100644 index 0000000..27c112f --- /dev/null +++ b/include/asio/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.10.2) +project(asio) + +# ascent library +add_library(asio INTERFACE) +target_compile_definitions(asio INTERFACE "-DASIO_STANDALONE") +target_include_directories(asio INTERFACE + $ + $) \ No newline at end of file diff --git a/include/asio/COPYING b/include/asio/COPYING new file mode 100644 index 0000000..2bb5eb2 --- /dev/null +++ b/include/asio/COPYING @@ -0,0 +1,4 @@ +Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) + +Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/asio/INSTALL b/include/asio/INSTALL new file mode 100644 index 0000000..f045678 --- /dev/null +++ b/include/asio/INSTALL @@ -0,0 +1,5 @@ +See doc/index.html for information on: + - External dependencies + - Using asio + - Supported platforms + - How to build the tests and examples diff --git a/include/asio/LICENSE_1_0.txt b/include/asio/LICENSE_1_0.txt new file mode 100644 index 0000000..36b7cd9 --- /dev/null +++ b/include/asio/LICENSE_1_0.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/include/asio/Makefile.am b/include/asio/Makefile.am new file mode 100644 index 0000000..0acdc02 --- /dev/null +++ b/include/asio/Makefile.am @@ -0,0 +1,19 @@ +AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip + +SUBDIRS = include src + +MAINTAINERCLEANFILES = \ + $(srcdir)/aclocal.m4 \ + $(srcdir)/configure \ + $(srcdir)/config.guess \ + $(srcdir)/config.sub \ + $(srcdir)/depcomp \ + $(srcdir)/install-sh \ + $(srcdir)/missing \ + $(srcdir)/mkinstalldirs \ + $(srcdir)/Makefile.in \ + asio-*.tar.gz + +EXTRA_DIST = \ + LICENSE_1_0.txt \ + doc diff --git a/include/asio/Makefile.in b/include/asio/Makefile.in new file mode 100644 index 0000000..6d79b0e --- /dev/null +++ b/include/asio/Makefile.in @@ -0,0 +1,780 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in COPYING INSTALL README compile \ + config.guess config.sub depcomp install-sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip +GZIP_ENV = --best +DIST_TARGETS = dist-bzip2 dist-gzip dist-zip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip +SUBDIRS = include src +MAINTAINERCLEANFILES = \ + $(srcdir)/aclocal.m4 \ + $(srcdir)/configure \ + $(srcdir)/config.guess \ + $(srcdir)/config.sub \ + $(srcdir)/depcomp \ + $(srcdir)/install-sh \ + $(srcdir)/missing \ + $(srcdir)/mkinstalldirs \ + $(srcdir)/Makefile.in \ + asio-*.tar.gz + +EXTRA_DIST = \ + LICENSE_1_0.txt \ + doc + +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/include/asio/README b/include/asio/README new file mode 100644 index 0000000..82ba8fb --- /dev/null +++ b/include/asio/README @@ -0,0 +1,4 @@ +asio version 1.18.0 +Released Saturday, 15 August 2020. + +See doc/index.html for API documentation and a tutorial. diff --git a/include/asio/aclocal.m4 b/include/asio/aclocal.m4 new file mode 100644 index 0000000..a49964a --- /dev/null +++ b/include/asio/aclocal.m4 @@ -0,0 +1,1171 @@ +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/include/asio/compile b/include/asio/compile new file mode 100755 index 0000000..531136b --- /dev/null +++ b/include/asio/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/include/asio/config.guess b/include/asio/config.guess new file mode 100755 index 0000000..9afd676 --- /dev/null +++ b/include/asio/config.guess @@ -0,0 +1,1568 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2013 Free Software Foundation, Inc. + +timestamp='2013-11-29' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2013 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/include/asio/config.sub b/include/asio/config.sub new file mode 100755 index 0000000..61cb4bc --- /dev/null +++ b/include/asio/config.sub @@ -0,0 +1,1793 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2013 Free Software Foundation, Inc. + +timestamp='2013-10-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2013 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 \ + | or1k | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or1k-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/include/asio/configure b/include/asio/configure new file mode 100755 index 0000000..3352e5a --- /dev/null +++ b/include/asio/configure @@ -0,0 +1,6574 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for asio 1.18.0. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='asio' +PACKAGE_TARNAME='asio' +PACKAGE_VERSION='1.18.0' +PACKAGE_STRING='asio 1.18.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="include/asio.hpp" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +HAVE_COROUTINES_FALSE +HAVE_COROUTINES_TRUE +HAVE_CXX17_FALSE +HAVE_CXX17_TRUE +HAVE_CXX14_FALSE +HAVE_CXX14_TRUE +HAVE_CXX11_FALSE +HAVE_CXX11_TRUE +WINDOWS_TARGET_FALSE +WINDOWS_TARGET_TRUE +HAVE_BOOST_COROUTINE_FALSE +HAVE_BOOST_COROUTINE_TRUE +SEPARATE_COMPILATION_FALSE +SEPARATE_COMPILATION_TRUE +STANDALONE_FALSE +STANDALONE_TRUE +HAVE_OPENSSL_FALSE +HAVE_OPENSSL_TRUE +EGREP +GREP +CXXCPP +RANLIB +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_silent_rules +enable_dependency_tracking +with_boost +enable_separate_compilation +enable_boost_coroutine +with_openssl +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CXXCPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures asio 1.18.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/asio] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of asio 1.18.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-separate-compilation separate compilation of asio source + --enable-boost-coroutine use Boost.Coroutine to implement stackful coroutines + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-boost=DIR location of boost distribution + --with-openssl=DIR location of openssl + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +asio configure 1.18.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_mongrel + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by asio $as_me 1.18.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='asio' + VERSION='1.18.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test $am_uid -le $am_max_uid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test $am_gid -le $am_max_gid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if ${am_cv_prog_tar_ustar+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_ustar=$_am_tool +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +$as_echo "$am_cv_prog_tar_ustar" >&6; } + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + +$as_echo "#define _REENTRANT 1" >>confdefs.h + + + +# Check whether --with-boost was given. +if test "${with_boost+set}" = set; then : + withval=$with_boost; + if test "${withval}" = no; then + STANDALONE="yes" + else + if test "${withval}" != system; then + CPPFLAGS="$CPPFLAGS -I${withval}" + LIBS="$LIBS -L${withval}/stage/lib" + fi + CPPFLAGS="$CPPFLAGS -DASIO_ENABLE_BOOST -DBOOST_CHRONO_HEADER_ONLY -DBOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING" + fi + +else + + STANDALONE="yes" + +fi + + +# Check whether --enable-separate-compilation was given. +if test "${enable_separate_compilation+set}" = set; then : + enableval=$enable_separate_compilation; + SEPARATE_COMPILATION=yes + +fi + + +# Check whether --enable-boost-coroutine was given. +if test "${enable_boost_coroutine+set}" = set; then : + enableval=$enable_boost_coroutine; + HAVE_BOOST_COROUTINE=yes + +fi + + +if test "$STANDALONE" != yes; then + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_cxx_check_header_mongrel "$LINENO" "boost/noncopyable.hpp" "ac_cv_header_boost_noncopyable_hpp" "$ac_includes_default" +if test "x$ac_cv_header_boost_noncopyable_hpp" = xyes; then : + +else + + echo "Can't find boost headers. Please check the location of the boost" + echo "distribution and rerun configure using the --with-boost=DIR option." + echo "Alternatively, run with --without-boost to enable standalone build." + exit 1 + +fi + + +fi + + +# Check whether --with-openssl was given. +if test "${with_openssl+set}" = set; then : + withval=$with_openssl; + CPPFLAGS="$CPPFLAGS -I${withval}/include" + LIBS="$LIBS -L${withval}/lib" + +fi + + +ac_fn_cxx_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : + +else + + OPENSSL_FOUND=no + +fi + + + +if test x$OPENSSL_FOUND != xno; then + LIBS="$LIBS -lssl -lcrypto" +fi + + if test x$OPENSSL_FOUND != xno; then + HAVE_OPENSSL_TRUE= + HAVE_OPENSSL_FALSE='#' +else + HAVE_OPENSSL_TRUE='#' + HAVE_OPENSSL_FALSE= +fi + + +WINDOWS=no +case $host in + *-*-linux*) + CXXFLAGS="$CXXFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + LIBS="$LIBS -lrt" + ;; + *-*-solaris*) + if test "$GXX" = yes; then + CXXFLAGS="$CXXFLAGS -D_PTHREADS" + else + # We'll assume Sun's CC. + CXXFLAGS="$CXXFLAGS -mt" + fi + LIBS="$LIBS -lsocket -lnsl -lpthread" + ;; + *-*-mingw32*) + CXXFLAGS="$CXXFLAGS -mthreads" + LDFLAGS="$LDFLAGS -mthreads" + LIBS="$LIBS -lws2_32 -lmswsock" + WINDOWS=yes + ;; + *-*-mingw64*) + CXXFLAGS="$CXXFLAGS -mthreads" + LDFLAGS="$LDFLAGS -mthreads" + LIBS="$LIBS -lws2_32 -lmswsock" + WINDOWS=yes + ;; + *-pc-cygwin*) + CXXFLAGS="$CXXFLAGS -D__USE_W32_SOCKETS -D_WIN32_WINNT=0x0601" + LIBS="$LIBS -lws2_32 -lmswsock" + WINDOWS=yes + ;; + *-apple-darwin*) + CXXFLAGS="$CXXFLAGS" + LDFLAGS="$LDFLAGS" + ;; + *-*-freebsd*) + CXXFLAGS="$CXXFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + ;; + *-*-netbsd*) + CXXFLAGS="$CXXFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + ;; + *-*-haiku*) + CXXFLAGS="$CXXFLAGS -lnetwork" + LDFLAGS="$LDFLAGS -lnetwork" + +esac + +if test "$GXX" = yes; then + CXXFLAGS="$CXXFLAGS -ftemplate-depth-256" +fi + +if test "$STANDALONE" = yes; then + CPPFLAGS="$CPPFLAGS -DASIO_STANDALONE" +fi + +if test "$SEPARATE_COMPILATION" = yes; then + CPPFLAGS="$CPPFLAGS -DASIO_SEPARATE_COMPILATION" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++11 is enabled" >&5 +$as_echo_n "checking whether C++11 is enabled... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if __cplusplus < 201103L + #error C++11 not available + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_CXX11=yes; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_CXX11=no; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++14 is enabled" >&5 +$as_echo_n "checking whether C++14 is enabled... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined(__GNUC__) && !defined(__clang__) + # if (__GNUC__ <= 6) + # error C++14 support on this compiler not sufficiently compliant + # endif + #endif + #if __cplusplus < 201402L + #error C++14 not available + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_CXX14=yes; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_CXX14=no; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++17 is enabled" >&5 +$as_echo_n "checking whether C++17 is enabled... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if __cplusplus < 201703L + #error C++17 not available + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_CXX17=yes; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_CXX17=no; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether coroutines are enabled" >&5 +$as_echo_n "checking whether coroutines are enabled... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined(__clang__) + # if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703) + # if __has_include() + # define ASIO_HAS_CO_AWAIT 1 + # endif + # endif + #elif defined(__GNUC__) + # if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) + # if __has_include() + # define ASIO_HAS_CO_AWAIT 1 + # endif + # endif + #endif + #ifndef ASIO_HAS_CO_AWAIT + # error coroutines not available + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_COROUTINES=yes; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_COROUTINES=no; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test "$GXX" = yes; then + if test "$STANDALONE" = yes; then + if test "$HAVE_CXX11" = no; then + HAVE_CXX11=yes + CPPFLAGS="-std=c++0x $CPPFLAGS" + fi + fi +fi + + if test x$STANDALONE = xyes; then + STANDALONE_TRUE= + STANDALONE_FALSE='#' +else + STANDALONE_TRUE='#' + STANDALONE_FALSE= +fi + + + if test x$SEPARATE_COMPILATION = xyes; then + SEPARATE_COMPILATION_TRUE= + SEPARATE_COMPILATION_FALSE='#' +else + SEPARATE_COMPILATION_TRUE='#' + SEPARATE_COMPILATION_FALSE= +fi + + + if test x$HAVE_BOOST_COROUTINE = xyes; then + HAVE_BOOST_COROUTINE_TRUE= + HAVE_BOOST_COROUTINE_FALSE='#' +else + HAVE_BOOST_COROUTINE_TRUE='#' + HAVE_BOOST_COROUTINE_FALSE= +fi + + + if test x$WINDOWS != xno; then + WINDOWS_TARGET_TRUE= + WINDOWS_TARGET_FALSE='#' +else + WINDOWS_TARGET_TRUE='#' + WINDOWS_TARGET_FALSE= +fi + + + if test x$HAVE_CXX11 = xyes; then + HAVE_CXX11_TRUE= + HAVE_CXX11_FALSE='#' +else + HAVE_CXX11_TRUE='#' + HAVE_CXX11_FALSE= +fi + + + if test x$HAVE_CXX14 = xyes; then + HAVE_CXX14_TRUE= + HAVE_CXX14_FALSE='#' +else + HAVE_CXX14_TRUE='#' + HAVE_CXX14_FALSE= +fi + + + if test x$HAVE_CXX17 = xyes; then + HAVE_CXX17_TRUE= + HAVE_CXX17_FALSE='#' +else + HAVE_CXX17_TRUE='#' + HAVE_CXX17_FALSE= +fi + + + if test x$HAVE_COROUTINES = xyes; then + HAVE_COROUTINES_TRUE= + HAVE_COROUTINES_FALSE='#' +else + HAVE_COROUTINES_TRUE='#' + HAVE_COROUTINES_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile src/tests/Makefile src/tests/properties/Makefile src/examples/cpp03/Makefile src/examples/cpp11/Makefile src/examples/cpp14/Makefile src/examples/cpp17/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENSSL_TRUE}" && test -z "${HAVE_OPENSSL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENSSL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${STANDALONE_TRUE}" && test -z "${STANDALONE_FALSE}"; then + as_fn_error $? "conditional \"STANDALONE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SEPARATE_COMPILATION_TRUE}" && test -z "${SEPARATE_COMPILATION_FALSE}"; then + as_fn_error $? "conditional \"SEPARATE_COMPILATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_BOOST_COROUTINE_TRUE}" && test -z "${HAVE_BOOST_COROUTINE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_BOOST_COROUTINE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WINDOWS_TARGET_TRUE}" && test -z "${WINDOWS_TARGET_FALSE}"; then + as_fn_error $? "conditional \"WINDOWS_TARGET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_TRUE}" && test -z "${HAVE_CXX11_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX14_TRUE}" && test -z "${HAVE_CXX14_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX14\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX17_TRUE}" && test -z "${HAVE_CXX17_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX17\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_COROUTINES_TRUE}" && test -z "${HAVE_COROUTINES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_COROUTINES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by asio $as_me 1.18.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +asio config.status 1.18.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;; + "src/tests/properties/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/properties/Makefile" ;; + "src/examples/cpp03/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp03/Makefile" ;; + "src/examples/cpp11/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp11/Makefile" ;; + "src/examples/cpp14/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp14/Makefile" ;; + "src/examples/cpp17/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp17/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/include/asio/configure.ac b/include/asio/configure.ac new file mode 100644 index 0000000..3de14ee --- /dev/null +++ b/include/asio/configure.ac @@ -0,0 +1,230 @@ +AC_INIT(asio, [1.18.0]) +AC_CONFIG_SRCDIR(include/asio.hpp) +AM_MAINTAINER_MODE +AM_INIT_AUTOMAKE([tar-ustar]) + +AC_CANONICAL_HOST +AM_PROG_CC_C_O +AC_PROG_CXX +AC_LANG(C++) +AC_PROG_RANLIB + +AC_DEFINE(_REENTRANT, [1], [Define this]) + +AC_ARG_WITH(boost, + AC_HELP_STRING([--with-boost=DIR],[location of boost distribution]), +[ + if test "${withval}" = no; then + STANDALONE="yes" + else + if test "${withval}" != system; then + CPPFLAGS="$CPPFLAGS -I${withval}" + LIBS="$LIBS -L${withval}/stage/lib" + fi + CPPFLAGS="$CPPFLAGS -DASIO_ENABLE_BOOST -DBOOST_CHRONO_HEADER_ONLY -DBOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING" + fi +], +[ + STANDALONE="yes" +]) + +AC_ARG_ENABLE(separate-compilation, +[ --enable-separate-compilation separate compilation of asio source], +[ + SEPARATE_COMPILATION=yes +]) + +AC_ARG_ENABLE(boost-coroutine, +[ --enable-boost-coroutine use Boost.Coroutine to implement stackful coroutines], +[ + HAVE_BOOST_COROUTINE=yes +]) + +if test "$STANDALONE" != yes; then + AC_CHECK_HEADER([boost/noncopyable.hpp],, + [ + echo "Can't find boost headers. Please check the location of the boost" + echo "distribution and rerun configure using the --with-boost=DIR option." + echo "Alternatively, run with --without-boost to enable standalone build." + exit 1 + ],[]) +fi + +AC_ARG_WITH(openssl, + AC_HELP_STRING([--with-openssl=DIR],[location of openssl]), +[ + CPPFLAGS="$CPPFLAGS -I${withval}/include" + LIBS="$LIBS -L${withval}/lib" +],[]) + +AC_CHECK_HEADER([openssl/ssl.h],, +[ + OPENSSL_FOUND=no +],[]) + +if test x$OPENSSL_FOUND != xno; then + LIBS="$LIBS -lssl -lcrypto" +fi + +AM_CONDITIONAL(HAVE_OPENSSL,test x$OPENSSL_FOUND != xno) + +WINDOWS=no +case $host in + *-*-linux*) + CXXFLAGS="$CXXFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + LIBS="$LIBS -lrt" + ;; + *-*-solaris*) + if test "$GXX" = yes; then + CXXFLAGS="$CXXFLAGS -D_PTHREADS" + else + # We'll assume Sun's CC. + CXXFLAGS="$CXXFLAGS -mt" + fi + LIBS="$LIBS -lsocket -lnsl -lpthread" + ;; + *-*-mingw32*) + CXXFLAGS="$CXXFLAGS -mthreads" + LDFLAGS="$LDFLAGS -mthreads" + LIBS="$LIBS -lws2_32 -lmswsock" + WINDOWS=yes + ;; + *-*-mingw64*) + CXXFLAGS="$CXXFLAGS -mthreads" + LDFLAGS="$LDFLAGS -mthreads" + LIBS="$LIBS -lws2_32 -lmswsock" + WINDOWS=yes + ;; + *-pc-cygwin*) + CXXFLAGS="$CXXFLAGS -D__USE_W32_SOCKETS -D_WIN32_WINNT=0x0601" + LIBS="$LIBS -lws2_32 -lmswsock" + WINDOWS=yes + ;; + *-apple-darwin*) + CXXFLAGS="$CXXFLAGS" + LDFLAGS="$LDFLAGS" + ;; + *-*-freebsd*) + CXXFLAGS="$CXXFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + ;; + *-*-netbsd*) + CXXFLAGS="$CXXFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + ;; + *-*-haiku*) + CXXFLAGS="$CXXFLAGS -lnetwork" + LDFLAGS="$LDFLAGS -lnetwork" + +esac + +if test "$GXX" = yes; then + CXXFLAGS="$CXXFLAGS -ftemplate-depth-256" +fi + +if test "$STANDALONE" = yes; then + CPPFLAGS="$CPPFLAGS -DASIO_STANDALONE" +fi + +if test "$SEPARATE_COMPILATION" = yes; then + CPPFLAGS="$CPPFLAGS -DASIO_SEPARATE_COMPILATION" +fi + +AC_MSG_CHECKING([whether C++11 is enabled]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if __cplusplus < 201103L]] + [[#error C++11 not available]] + [[#endif]])], + [AC_MSG_RESULT([yes]) + HAVE_CXX11=yes;], + [AC_MSG_RESULT([no]) + HAVE_CXX11=no;]) + +AC_MSG_CHECKING([whether C++14 is enabled]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if defined(__GNUC__) && !defined(__clang__)]] + [[# if (__GNUC__ <= 6)]] + [[# error C++14 support on this compiler not sufficiently compliant]] + [[# endif]] + [[#endif]] + [[#if __cplusplus < 201402L]] + [[#error C++14 not available]] + [[#endif]])], + [AC_MSG_RESULT([yes]) + HAVE_CXX14=yes;], + [AC_MSG_RESULT([no]) + HAVE_CXX14=no;]) + +AC_MSG_CHECKING([whether C++17 is enabled]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if __cplusplus < 201703L]] + [[#error C++17 not available]] + [[#endif]])], + [AC_MSG_RESULT([yes]) + HAVE_CXX17=yes;], + [AC_MSG_RESULT([no]) + HAVE_CXX17=no;]) + +AC_MSG_CHECKING([whether coroutines are enabled]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if defined(__clang__)]] + [[# if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)]] + [[# if __has_include()]] + [[# define ASIO_HAS_CO_AWAIT 1]] + [[# endif]] + [[# endif]] + [[#elif defined(__GNUC__)]] + [[# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)]] + [[# if __has_include()]] + [[# define ASIO_HAS_CO_AWAIT 1]] + [[# endif]] + [[# endif]] + [[#endif]] + [[#ifndef ASIO_HAS_CO_AWAIT]] + [[# error coroutines not available]] + [[#endif]])], + [AC_MSG_RESULT([yes]) + HAVE_COROUTINES=yes;], + [AC_MSG_RESULT([no]) + HAVE_COROUTINES=no;]) + +if test "$GXX" = yes; then + if test "$STANDALONE" = yes; then + if test "$HAVE_CXX11" = no; then + HAVE_CXX11=yes + CPPFLAGS="-std=c++0x $CPPFLAGS" + fi + fi +fi + +AM_CONDITIONAL(STANDALONE,test x$STANDALONE = xyes) + +AM_CONDITIONAL(SEPARATE_COMPILATION,test x$SEPARATE_COMPILATION = xyes) + +AM_CONDITIONAL(HAVE_BOOST_COROUTINE,test x$HAVE_BOOST_COROUTINE = xyes) + +AM_CONDITIONAL(WINDOWS_TARGET,test x$WINDOWS != xno) + +AM_CONDITIONAL(HAVE_CXX11,test x$HAVE_CXX11 = xyes) + +AM_CONDITIONAL(HAVE_CXX14,test x$HAVE_CXX14 = xyes) + +AM_CONDITIONAL(HAVE_CXX17,test x$HAVE_CXX17 = xyes) + +AM_CONDITIONAL(HAVE_COROUTINES,test x$HAVE_COROUTINES = xyes) + +AC_OUTPUT([ + Makefile + include/Makefile + src/Makefile + src/tests/Makefile + src/tests/properties/Makefile + src/examples/cpp03/Makefile + src/examples/cpp11/Makefile + src/examples/cpp14/Makefile + src/examples/cpp17/Makefile]) diff --git a/include/asio/depcomp b/include/asio/depcomp new file mode 100755 index 0000000..4ebd5b3 --- /dev/null +++ b/include/asio/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/include/asio/doc/asio.png b/include/asio/doc/asio.png new file mode 100644 index 0000000..c05fd3a Binary files /dev/null and b/include/asio/doc/asio.png differ diff --git a/include/asio/doc/asio/examples.html b/include/asio/doc/asio/examples.html new file mode 100644 index 0000000..e9a87e8 --- /dev/null +++ b/include/asio/doc/asio/examples.html @@ -0,0 +1,61 @@ + + + +Examples + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
    +
  • + C++03 Examples: Illustrates + the use of Asio using only C++03 language and library features. Where necessary, + the examples make use of selected Boost C++ libraries. +
  • +
  • + C++11 Examples: Contains + a limited set of the C++03 Asio examples, updated to use only C++11 library + and language facilities. These examples do not make direct use of Boost + C++ libraries. To show the changes between C++03 and C++11, these examples + include a diff between the C++03 and C++11 versions. +
  • +
  • + C++14 Examples: Contains + a limited set of the C++03 Asio examples, updated to use only C++14 library + and language facilities. These examples do not make direct use of Boost + C++ libraries. +
  • +
  • + C++17 Examples: Selected + examples illustrating C++17 usage in conjunction with Technical Specifications. +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/examples/cpp03_examples.html b/include/asio/doc/asio/examples/cpp03_examples.html new file mode 100644 index 0000000..a64db1c --- /dev/null +++ b/include/asio/doc/asio/examples/cpp03_examples.html @@ -0,0 +1,636 @@ + + + +C++03 Examples + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ + Allocation +
+

+ This example shows how to customise the allocation of memory associated with + asynchronous operations. +

+ +
+ + Buffers +
+

+ This example demonstrates how to create reference counted buffers that can + be used with socket read and write operations. +

+ +
+ + Chat +
+

+ This example implements a chat server and client. The programs use a custom + protocol with a fixed length message header and variable length message body. +

+ +

+ The following POSIX-specific chat client demonstrates how to use the posix::stream_descriptor + class to perform console input and output. +

+ +
+ + Echo +
+

+ A collection of simple clients and servers, showing the use of both synchronous + and asynchronous operations. +

+ +
+ + Fork +
+

+ These POSIX-specific examples show how to use Asio in conjunction with the + fork() system call. The first example illustrates the steps + required to start a daemon process: +

+ +

+ The second example demonstrates how it is possible to fork a process from + within a completion handler. +

+ +
+ + HTTP + Client +
+

+ Example programs implementing simple HTTP 1.0 clients. These examples show + how to use the read_until + and async_read_until + functions. +

+ +
+ + HTTP + Server +
+

+ This example illustrates the use of asio in a simple single-threaded server + implementation of HTTP 1.0. It demonstrates how to perform a clean shutdown + by cancelling all outstanding asynchronous operations. +

+ +
+ + HTTP + Server 2 +
+

+ An HTTP server using an io_context-per-CPU design. +

+ +
+ + HTTP + Server 3 +
+

+ An HTTP server using a single io_context and a thread pool calling io_context::run(). +

+ +
+ + HTTP + Server 4 +
+

+ A single-threaded HTTP server implemented using stackless coroutines. +

+ +
+ + ICMP +
+

+ This example shows how to use raw sockets with ICMP to ping a remote host. +

+ +
+ + Invocation +
+

+ This example shows how to customise handler invocation. Completion handlers + are added to a priority queue rather than executed immediately. +

+ +
+ + Iostreams +
+

+ Two examples showing how to use ip::tcp::iostream. +

+ +
+ + Multicast +
+

+ An example showing the use of multicast to transmit packets to a group of + subscribers. +

+ +
+ + Serialization +
+

+ This example shows how Boost.Serialization can be used with asio to encode + and decode structures for transmission over a socket. +

+ +
+ + Services +
+

+ This example demonstrates how to integrate custom functionality (in this + case, for logging) into asio's io_context, + and how to use a custom service with basic_stream_socket<>. +

+ +
+ + SOCKS + 4 +
+

+ Example client program implementing the SOCKS 4 protocol for communication + via a proxy. +

+ +
+ + SSL +
+

+ Example client and server programs showing the use of the ssl::stream<> + template with asynchronous operations. +

+ +
+ + Timeouts +
+

+ A collection of examples showing how to cancel long running asynchronous + operations after a period of time. +

+ +
+ + Timers +
+

+ Example showing how to customise basic_waitable_timer using a different clock + type. +

+ +
+ + Porthopper +
+

+ Example illustrating mixed synchronous and asynchronous operations, and how + to use Boost.Lambda with Asio. +

+ +
+ + Nonblocking +
+

+ Example demonstrating reactor-style operations for integrating a third-party + library that wants to perform the I/O operations itself. +

+ +
+ + Spawn +
+

+ Example of using the asio::spawn() function, a wrapper around the Boost.Coroutine + library, to implement a chain of asynchronous operations using stackful coroutines. +

+ +
+ + UNIX + Domain Sockets +
+

+ Examples showing how to use UNIX domain (local) sockets. +

+ +
+ + Windows +
+

+ An example showing how to use the Windows-specific function TransmitFile + with Asio. +

+ +
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/examples/cpp11_examples.html b/include/asio/doc/asio/examples/cpp11_examples.html new file mode 100644 index 0000000..b2f3be2 --- /dev/null +++ b/include/asio/doc/asio/examples/cpp11_examples.html @@ -0,0 +1,451 @@ + + + +C++11 Examples + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ + Allocation +
+

+ This example shows how to customise the allocation of memory associated with + asynchronous operations. +

+ +
+ + Buffers +
+

+ This example demonstrates how to create reference counted buffers that can + be used with socket read and write operations. +

+ +
+ + Chat +
+

+ This example implements a chat server and client. The programs use a custom + protocol with a fixed length message header and variable length message body. +

+ +
+ + Echo +
+

+ A collection of simple clients and servers, showing the use of both synchronous + and asynchronous operations. +

+ +
+ + Fork +
+

+ These POSIX-specific examples show how to use Asio in conjunction with the + fork() system call. The first example illustrates the steps + required to start a daemon process: +

+ +

+ The second example demonstrates how it is possible to fork a process from + within a completion handler. +

+ +
+ + Futures +
+

+ This example demonstrates how to use std::future in conjunction with Asio's + asynchronous operations. +

+ +
+ + Handler + Tracking +
+

+ This example header file shows how to implement custom handler tracking. +

+ +

+ This example program shows how to include source location information in + the handler tracking output. +

+ +
+ + HTTP + Server +
+

+ This example illustrates the use of asio in a simple single-threaded server + implementation of HTTP 1.0. It demonstrates how to perform a clean shutdown + by cancelling all outstanding asynchronous operations. +

+ +
+ + Multicast +
+

+ An example showing the use of multicast to transmit packets to a group of + subscribers. +

+ +
+ + Nonblocking +
+

+ Example demonstrating reactor-style operations for integrating a third-party + library that wants to perform the I/O operations itself. +

+ +
+ + Operations +
+

+ Examples showing how to implement composed asynchronous operations as reusable + library functions. +

+ +
+ + SOCKS + 4 +
+

+ Example client program implementing the SOCKS 4 protocol for communication + via a proxy. +

+ +
+ + Spawn +
+

+ Example of using the asio::spawn() function, a wrapper around the Boost.Coroutine + library, to implement a chain of asynchronous operations using stackful coroutines. +

+ +
+ + SSL +
+

+ Example client and server programs showing the use of the ssl::stream<> + template with asynchronous operations. +

+ +
+ + Timeouts +
+

+ A collection of examples showing how to cancel long running asynchronous + operations after a period of time. +

+ +
+ + Timers +
+

+ Example showing how to customise basic_waitable_timer using a different clock + type. +

+ +
+ + UNIX + Domain Sockets +
+

+ Examples showing how to use UNIX domain (local) sockets. +

+ +
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/examples/cpp14_examples.html b/include/asio/doc/asio/examples/cpp14_examples.html new file mode 100644 index 0000000..2e77764 --- /dev/null +++ b/include/asio/doc/asio/examples/cpp14_examples.html @@ -0,0 +1,71 @@ + + + +C++14 Examples + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/examples/cpp17_examples.html b/include/asio/doc/asio/examples/cpp17_examples.html new file mode 100644 index 0000000..be74734 --- /dev/null +++ b/include/asio/doc/asio/examples/cpp17_examples.html @@ -0,0 +1,63 @@ + + + +C++17 Examples + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/history.html b/include/asio/doc/asio/history.html new file mode 100644 index 0000000..9eb4b54 --- /dev/null +++ b/include/asio/doc/asio/history.html @@ -0,0 +1,2999 @@ + + + +Revision History + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ + Asio + 1.18.0 +

+
    +
  • + Marked the basic_socket_acceptor move constructor as noexcept. +
  • +
  • + Added workarounds for various issues in gcc 10's coroutine + support. +
  • +
  • + Added standard executor support to windows::overlapped_ptr. +
  • +
  • + Added missing compatibility macros for the execution::receiver_of + concept. +
  • +
  • + Added short-circuited evaluation to execution::executor, + execution::operation_state,execution::sender, + execution::receiver, execution::receiver_of, + and execution::scheduler concepts and the corresponding traits. + These now test first for well-formed CPO expressions (or, in the case of + senders, a specialised sender_traits template) and, if not + valid, short-circuit the remainder of the evaluation. This helps prevent + recursive template instantiations that can occur in some contexts. +
  • +
  • + Added constraints to the strand template's constructor, to + prevent template instantiation recursion. +
  • +
  • + Changed Asio's internal executor adapters to prevent template instantiation + recursion. +
  • +
  • + Added constraints to the execution::any_executor template's + converting constructors, as per the specification. +
  • +
  • + Added missing execution::sender_traits specialisation and + connect() member function to the thread_pool + executor, as per the specification. +
  • +
  • + Changed execution::blocking_t::always_t::is_preferable to + be false as per the specification. +
  • +
  • + Added shape_type and index_type to thread_pool + executors, as per the specification. +
  • +
  • + Ensured that the standard executor concept-related traits (such as execution::is_executor) + work with void. +
  • +
  • + Fixed async_compose support for standard executors. +
  • +
  • + Fixed the forward declaration of any_io_executor in asio/ts/netfwd.hpp. +
  • +
  • + Fixed use_future compatibility with older compilers. +
  • +
  • + Fixed compatibility with MinGW. +
  • +
  • + Improved compatibility with older versions of gcc. +
  • +
  • + Added compatiblity with clang-cl on Windows. +
  • +
  • + Fixed various compiler warnings. +
  • +
  • + Added basic overview documentation for the standard executors support. +
  • +
  • + Added detailed descriptions to the standard executor-related member functions + of io_context executors, thread_pool executors, + system_executor, and strand<>. +
  • +
  • + Changed introductory documentation to reflect that there our now multiple + types of I/O execution context. +
  • +
  • + Marked constructors, destructors, and static data members in class synopses + in the reference documentation. +
  • +
  • + Fixed various minor documentation errors. +
  • +
+

+ + Asio + 1.17.0 +

+
    +
  • + Added an implementation of the proposed standard executors (P0443r13, + P1348r0, and P1393r0). +
  • +
  • + Added support for the proposed standard executors to Asio's I/O facilities: +
      +
    • + The io_context::executor_type, thread_pool::executor_type, + system_executor, and strand executors now + meet the requirements for the proposed standard executors. These + classes also continue to meet the existing requirements for the Networking + TS model of executors. +
    • +
    • + All I/O objects, asynchronous operations, and utilities including + dispatch, post, defer, get_associated_executor, + bind_executor, make_work_guard, spawn, + co_spawn, async_compose, use_future, + etc., can interoperate with both new proposed standard executors, + and with existing Networking TS executors. The implementation determines + at compile time which model a particular executor meets; the proposed + standard executor model is used in preference if both are detected. +
    • +
    • + The any_io_executor type alias has been introduced as + the new default runtime-polymorphic executor for all I/O objects. + This type alias points to the execution::any_executor<> + template with a set of supportable properties specified for use with + I/O. This change may break existing code that directly uses the old + polymorphic wrapper, executor. If required for backward + compatibility, ASIO_USE_TS_EXECUTOR_AS_DEFAULT can be + defined, which changes the any_io_executor type alias + to instead point to the executor polymorphic wrapper. +
    • +
    • + Support for the existing Networking TS model of executors can be + disabled by defining ASIO_NO_TS_EXECUTORS. +
    • +
    +
  • +
  • + Added converting move construction and assignment to basic_waitable_timer. + This enables move construction and assignment between different timer types, + provided the executor types are convertible. For example:
    +
    basic_waitable_timer<
    +    clock_type,
    +    traits_type,
    +    io_context::executor_type
    +  > timer1(my_io_context);
    +
    +basic_waitable_timer<
    +    clock_type,
    +    traits_type,
    +    any_io_executor // polymorphic wrapper
    +  > timer2(std::move(timer1));
    +
    +
    +
  • +
  • + Enabled C++20 coroutine support when using gcc 10. +
  • +
  • + Added overloads of co_spawn that launch an awaitable. This + change allows us to write:
    +
    co_spawn(executor,
    +    echo(std::move(socket)),
    +    detached);
    +
    +
    instead of:
    +
    co_spawn(executor,
    +    [socket = std::move(socket)]() mutable
    +    {
    +      return echo(std::move(socket));
    +    },
    +    detached);
    +
    +
    +
  • +
  • + Added a new constructor overload to use_awaitable_t's default + executor adapter, to enable conversion between executor types. +
  • +
  • + Added support for using detached_t as a default completion + token, by adding members as_default_on() and as_default_on_t<>. +
  • +
  • + Added a move constructor to ssl::stream<>. +
  • +
  • + Changed ssl::stream<> write operations to linearise + gather-write buffer sequences. +
  • +
  • + Added compile-time detection of the deprecated asio_handler_invoke + hook. This hook was deprecated with the introduction of the Networking + TS trait associated_executor and function get_associated_executor(). + Compiling an application with ASIO_NO_DEPRECATED will now + trigger a compile error if any handler implements the asio_handler_invoke + hook. +
  • +
  • + Added compile-time detection of the deprecated asio_handler_allocate + and asio_handle_deallocate hooks. These hooks were deprecated + with the introduction of the Networking TS trait associated_allocator + and function get_associated_allocator(). Compiling an application + with ASIO_NO_DEPRECATED will now trigger a compile error if + any handler implements the asio_handler_allocate or asio_handler_deallocate + hooks. +
  • +
  • + Implemented a number of performance optimisations, including: +
      +
    • + Specialising single-buffer operations to use recv rather + than recvmsg, send rather than sendmsg, + read rather than readv, and write + rather than writev. +
    • +
    • + Lightening the reference counting overhead of the polymorphic wrapper + executor. +
    • +
    • + Returning from system call operation wrappers as early as possible, + and only accessing errno and error codes when on an + error path. +
    • +
    • + Applying additional optimisations if a "native" I/O executor + (such as io_context::exeutor_type) is detected. +
    • +
    +
  • +
  • + Added source location support to handler tracking. The new ASIO_HANDLER_LOCATION((file_name, + line, function_name)) macro may be used to inform the handler tracking + mechanism of a source location. This macro declares an object that is placed + on the stack. Then, when an asynchronous operation is launched with location + information, it outputs lines using the <action> + n^m, prior to the n*m line that signifies + the beginning of the asynchronous operation. For example: +
    @asio|1589423304.861944|>7|ec=system:0,bytes_transferred=5
    +@asio|1589423304.861952|7^8|in 'async_write' (./../../../include/asio/impl/write.hpp:330)
    +@asio|1589423304.861952|7^8|called from 'do_write' (handler_tracking/async_tcp_echo_server.cpp:62)
    +@asio|1589423304.861952|7^8|called from 'operator()' (handler_tracking/async_tcp_echo_server.cpp:51)
    +@asio|1589423304.861952|7*8|socket@0x7ff61c008230.async_send
    +@asio|1589423304.861975|.8|non_blocking_send,ec=system:0,bytes_transferred=5
    +@asio|1589423304.861980|<7|
    +
    +
    If std::source_location or std::experimental::source_location + are available, the use_awaitable_t token (when default-constructed + or used as a default completion token) will also cause handler tracking + to output a source location for each newly created asynchronous operation. + A use_awaitable_t object may also be explicitly constructed + with location information. +
  • +
  • + Implemented various improvements to the handlerviz.pl + tool. +
      +
    • + Add nodes for pending handlers at bottom of graph, outlined in red. +
    • +
    • + Display source location in a tooltip on the edge label (for SVG). +
    • +
    • + Use invisible nodes to enforce order to keep related control flow + vertical. +
    • +
    +
  • +
  • + Added the handlerlive.pl tool, which processes handler + tracking output to produce a list of "live" handlers. Live handlers + are those that are associated with pending asynchronous operations, as + well as handlers that are currently executing. For example: +
    cat output.txt | perl handlerlive.pl
    +
    + or: +
    perl handerlive.pl < output.txt
    +
    + or: +
    perl handlerlive.pl output.txt
    +
    +
    +
  • +
  • + Added the handlertree.pl tool, which filters handler + tracking output to include only those events in the tree that produced + the nominated handlers. For example, to filter the output to include only + the events associated with handlers 123, 456, + and their predecessors: +
    cat output.txt | perl handlertree.pl 123 456
    +
    + or: +
    perl handlertree.pl 123 456 < output.txt
    +
    +
    This script may be combined with handerlive.pl and handlerviz.pl + to produce a graph of the "live" asynchronous operation chains. + For example: +
    cat output.txt | \
    +  perl handlertree.pl `perl handlerlive.pl output.txt` | \
    +  perl handlerviz.pl | \
    +  dot -Tsvg > output.svg
    +
    +
    +
  • +
  • + Added changes for clang-based Embarcadero C++ compilers. +
  • +
  • + Fixed a deadlock that can occur when multiple threads concurrently initialise + the Windows I/O completion port backend. +
  • +
  • + Fixed async_compose to work with copyable handlers when passed + by lvalue. +
  • +
  • + Fixed completion signature deduction in co_spawn. +
  • +
  • + Removed a spurious Executor base class from the executor_binder + implementation. +
  • +
  • + Various fixes and improvements in the documentation and examples. +
  • +
+

+ + Asio + 1.16.1 +

+
    +
  • + Fixed compatibility with C++20 concept syntax. +
  • +
  • + Marked the POSIX descriptor classes' move constructors as noexcept. +
  • +
  • + Added the ssl::host_name_verification class, which is a drop-in + replacement for ssl::rfc2818_verification. The ssl::rfc2818_verification + class has been marked as deprecated. As a consequence of this change, SSL + support now depends on functions that were introduced in OpenSSL 1.0.2. +
  • +
  • + Added an ssl::context constructor to take ownership of a native + handle. +
  • +
  • + Changed C++ language version detection with gcc to use + __cplusplus macro. +
  • +
  • + Fixed a work counting issue in the asynchronous resolve operation for endpoints. +
  • +
  • + Fixed the strand<> converting constructors and assignment + operators. +
  • +
  • + Ensured that resolvers are restarted correctly after a fork. +
  • +
  • + Fixed compatibility with the current NetBSD release. +
  • +
  • + Removed spurious handler requirement checks in some async_read + overloads. +
  • +
  • + Changed the ssl::context class to propagate non-EOF errors + from the add_certificate_authority function. +
  • +
  • + Fixed a Windows-specific thread_pool destructor hang that + occurred when the pool had an associated I/O object. +
  • +
  • + Changed the select reactor to recreate the "self + pipe trick" sockets on error. This addresses an issue on some versions + of Windows, where these sockets are discconected after a system sleep. +
  • +
  • + Fixed a compile error in the buffered streams due to the lack of reference + collapsing in C++98. +
  • +
  • + Changed the priority_scheduler example to demonstrate calls + to shutdown() and destroy(). +
  • +
  • + Removed some unnecessary null pointer checks. +
  • +
  • + Changed Windows platform detection to recognise TV titles as Windows apps. +
  • +
  • + Added some emscripten compatibility patches. +
  • +
  • + Fixed a compile error in the use_awaitable_t::as_default_on + function. +
  • +
  • + Changed all uses of the boost.bind placeholders to use the boost::placeholders + namespace. +
  • +
  • + Fixed a potential compile error in the async_compose implementation + due to incorrect overload selection. +
  • +
  • + Suppressed some non-virtual destructor warnings. +
  • +
  • + Various documentation fixes and improvements. +
  • +
+

+ + Asio + 1.16.0 +

+
    +
  • + Changed the async_initiate helper function to automatically + deduce its return type. This is enabled for C++11 or later. +
  • +
  • + Changed all asynchronous operations to use automatically deduced return + types. This allows completion token implementations to incorporate the + asynchronous operation initiation into the initiating function's return + type, without type erasure. Note that C++14 or later is required to support + completion tokens that use per-operation return type deduction. For C++11 + or earlier, a completion token's async_result specialisation must still + provide the nested typedef return_type. +
  • +
  • + Introduced three new concepts to support async_initiate. +
      +
    • + completion_signature<T>: Checks if T + is a signature of the form R(Args...). +
    • +
    • + completion_handler_for<T, Signature>: Checks if + T is usable as a completion handler with the specified + signature. +
    • +
    • + completion_token_for<T, Signature>: Checks if + T is a completion token that can be used with async_initiate + and the specified signature. +
    • +
    • + For backward compatibility with pre-concepts C++, the macros (BOOST_)ASIO_COMPLETION_SIGNATURE, + (BOOST_)ASIO_COMPLETION_HANDLER_FOR, and (BOOST_)ASIO_COMPLETION_TOKEN_FOR + are provided. These macros expand to typename when concepts + are unsupported. +
    • +
    +
  • +
  • + Added the nested template type rebind_executor to all I/O + object types, as a way to generically rebind them to use alternative I/O + executors. For example: +
    using my_socket_type = tcp::socket::rebind_executor<my_executor_type>::other;
    +
    +
    +
  • +
  • + Changed the asynchronous operations' initiation function objects to report + their associated I/O executor via the nested type executor_type + and member function get_executor(). Note that the presence + of executor_type and get_executor() should be + treated as optional, and consequently it may be preferable to access them + via the associated_executor trait and the get_associated_executor() + helper function. +
  • +
  • + Added the default_completion_token trait, so that every I/O + executor type now has an associated default completion token type. This + trait may be used in asynchronous operation declarations as follows: +
    template <
    +    typename IoObject,
    +    typename CompletionToken =
    +      typename default_completion_token<
    +        typename IoObject::executor_type
    +      >::type
    +  >
    +auto async_xyz(
    +    IoObject& io_object,
    +    CompletionToken&& token =
    +      typename default_completion_token<
    +        typename IoObject::executor_type
    +      >::type{}
    +  );
    +
    +
    If not specialised, this trait type is void, meaning + no default completion token type is available for the given I/O executor. +
  • +
  • + Specialised the default_completion_token trait for the use_awaitable + completion token, so that it may be used as shown in the following example: +
    auto socket = use_awaitable.as_default_on(tcp::socket(my_context));
    +// ...
    +co_await socket.async_connect(my_endpoint); // Defaults to use_awaitable.
    +
    +
    In this example, the type of the socket object is transformed + from tcp::socket to have an I/O executor with the default + completion token set to use_awaitable. Alternatively, the + socket type may be computed directly: +
    using tcp_socket = use_awaitable_t<>::as_default_on_t<tcp::socket>;
    +tcp_socket socket(my_context);
    +// ...
    +co_await socket.async_connect(my_endpoint); // Defaults to use_awaitable.
    +
    +
    +
  • +
  • + Added missing async_initiate to the Windows-specific I/O objects' + asynchronous operations. +
  • +
  • + Ensured that the executor type is propagated to newly accepted sockets. + When synchronously or asynchronously accepting a new connection, but without + specifying an executor or execution context, the accept operation will + now correctly propagate the executor type from the acceptor to the socket. + For example, if your acceptor type is: +
    basic_socket_acceptor<ip::tcp, my_executor_type>
    +
    +
    then your accepted socket type will be: +
    basic_stream_socket<ip::tcp, my_executor_type>
    +
    +
    +
  • +
  • + Changed to require that Protocol copy and move operations + never throw. +
  • +
  • + Changed to require that Endpoint default constructor and move + operations never throw. +
  • +
  • + Added the noexcept qualifier to protocol accessors. +
  • +
  • + Added the noexcept qualifier to socket move constructors. +
  • +
  • + Fixed issues associated with opening serial ports on Windows: +
      +
    • + Use the correct constant to initialise the RTS control flag. +
    • +
    • + Specify a default baud rate (9600). +
    • +
    +
  • +
  • + Fixed a lost "outstanding work count" that can occur when an + asynchronous accept operation is automatically restarted. +
  • +
+

+ + Asio + 1.14.1 +

+
    +
  • + Improved performance slightly by eliminating a redundant move construction + when completed handlers are dispatched. +
  • +
  • + Eliminated a compiler warning by annotating a case fall-through + in the free function connect() implementation. +
  • +
  • + Fixed the is_*_buffer_sequence detection traits for user-defined + sequence types. +
  • +
  • + Fixed some Windows-specific warnings about an incompatible pointer cast + when obtaining the CancelIoEx entry point. +
  • +
  • + Changed to automatically set the defaults when opening a serial port on + Windows. +
  • +
  • + Changed the serial port get_option() member function to be + const. +
  • +
  • + Fixed a name hiding issue with the WinRT stream-oriented socket backend's + shutdown function. +
  • +
  • + Applied a minor fix to the documentation for is_dynamic_buffer. +
  • +
  • + Added some support for Haiku OS. +
  • +
  • + Added wolfSSL compatability. +
  • +
  • + Changed to require C++17 or later for coroutines TS support with clang. +
  • +
  • + Fixed a doxygen generation problem in the tutorial. +
  • +
+

+ + Asio + 1.14.0 +

+
    +
  • + Improved I/O object performance by adding runtime detection of native I/O + executors when using the polymorphic executor wrapper. +
  • +
  • + Changed I/O object move constructors so that the executor is copied, not + moved. This ensures that the moved-from I/O object is left in the same + state as if constructed with a valid executor but without a resource. +
  • +
  • + On Windows, fixed an issue where global object destructors were not being + run. +
  • +
  • + Fixed move-based async_accept between sockets with different + executor types. +
  • +
+

+ + Asio + 1.13.0 +

+
    +
  • + Added custom I/O executor support to I/O objects. +
      +
    • + All I/O objects now have an additional Executor template + parameter. This template parameter defaults to the asio::executor + type (the polymorphic executor wrapper) but can be used to specify + a user-defined executor type. +
    • +
    • + I/O objects' constructors and functions that previously took an + asio::io_context& now accept either an Executor + or a reference to a concrete ExecutionContext (such + as asio::io_context or asio::thread_pool). +
    • +
    • + Note: One potential source of breakage in existing user code is when + reusing an I/O object's io_context for constructing + another I/O object, as in: +
      asio::steady_timer my_timer(my_socket.get_executor().context());
      +
      +
      To fix this, either construct the second I/O object using + the first I/O object's executor:
      +
      asio::steady_timer my_timer(my_socket.get_executor());
      +
      +
      or otherwise explicitly pass the io_context:
      +
      asio::steady_timer my_timer(my_io_context);
      +
      +
      +
    • +
    • + The previously deprecated get_io_context and get_io_service + member functions have now been removed. +
    • +
    • + The previously deprecated service template parameters, and the corresponding + classes, have now been removed. +
    • +
    +
  • +
  • + Added a new async_result form with an initiate + static member function. +
      +
    • + The async_result template now supports a new form: +
      template <typename CompletionToken, typename Signature>
      +struct async_result
      +{
      +  typedef /* ... */ return_type;
      +
      +  template <typename Initiation,
      +      typename RawCompletionToken,
      +      typename... Args>
      +  static return_type initiate(
      +      Initiation&& initiation,
      +      RawCompletionToken&& token,
      +      Args&&... args);
      +};
      +
      +
      +
    • +
    • + The initiate member function must: (a) transform the + token into a completion handler object handler; (b) + cause the invocation of the function object initiation + as if by calling std::forward<Initiation>(initiation)(std::move(handler), + std::forward<Args>(args)...). Note that the invocation + of initiation may be deferred (e.g. lazily evaluated), + in which case initiation and args must + be decay-copied and moved as required. +
    • +
    • + A helper function template async_initiate has also been + added as a wrapper for the invocation of async_result<>::initiate. + For backward compatibility, this function supports both the old and + new async_result forms. +
    • +
    • + The composed operations examples have been updated to use async_initiate. +
    • +
    • + The previously deprecated handler_type trait and single-argument + form of async_result have now been removed. +
    • +
    +
  • +
  • + Updated the Coroutines TS support and promoted it to the asio + namespace. +
      +
    • + The awaitable<>, co_spawn, this_coro, + detached, and redirect_error facilities + have been moved from the asio::experimental namespace + to namespace asio. As part of this change, the this_coro::token() + awaitable has been superseded by the asio::use_awaitable + completion token. +
    • +
    • + Please note that the use_awaitable and redirect_error + completion tokens work only with asynchronous operations that use + the new form of async_result with member function initiate. + Furthermore, when using use_awaitable, please be aware + that the asynchronous operation is not initiated until co_await + is applied to the awaitable<>. +
    • +
    +
  • +
  • + Added a new DynamicBuffer_v2 concept which is CopyConstructible. +
      +
    • + This change adds a new set of type requirements for dynamic buffers, + DynamicBuffer_v2, which supports copy construction. + These new type requirements enable dynamic buffers to be used as + arguments to user-defined composed operations, where the same dynamic + buffer object is used repeatedly for multiple underlying operations. + For example:
      +
      template <typename DynamicBuffer>
      +void echo_line(tcp::socket& sock, DynamicBuffer buf)
      +{
      +  n = asio::read_until(sock, buf, '\n');
      +  asio::write(sock, buf, asio::transfer_exactly(n));
      +}
      +
      +
      +
    • +
    • + The original DynamicBuffer type requirements have been + renamed to DynamicBuffer_v1. These requirements continue + to be compatible with the Networking TS. +
    • +
    • + New type traits is_dynamic_buffer_v1 and is_dynamic_buffer_v2 + have been added to test for conformance to DynamicBuffer_v1 + and DynamicBuffer_v2 respectively. The existing is_dynamic_buffer + trait has been retained and delegates to is_dynamic_buffer_v1 + (unless ASIO_NO_DYNAMIC_BUFFER_V1 is explicitly defined, + in which case it delegates to is_dynamic_buffer_v2). +
    • +
    • + For convenience, the dynamic_string_buffer and dynamic_vector_buffer + classes conform to both DynamicBuffer_v1 and DynamicBuffer_v2 + requirements. +
    • +
    • + When ASIO_NO_DYNAMIC_BUFFER_V1 is defined, all support + for DynamicBuffer_v1 types and functions is #ifdef-ed + out. Support for using basic_streambuf with the read, + async_read, read_until, async_read_until, + write, and async_write functions is also + disabled as a consequence. +
    • +
    • + Note: This change should have no impact on existing source code that + simply uses dynamic buffers in conjunction with Asio's composed operations. +
    • +
    +
  • +
  • + Added a new async_compose function that simplifies the implementation + of user-defined asynchronous operations. +
  • +
  • + Added a make_strand function, which creates a strand + with a deduced Executor template argument. +
  • +
  • + Relaxed the completion condition type requirements to only require move-constructibility + rather than copy-constructibility. +
  • +
  • + Added a constructor for local::basic_endpoint that takes a + string_view. +
  • +
  • + Added the noexcept qualifier to various member functions of the ip::address, + ip::address_v4, ip::address_v6, ip::basic_endpoint, + and executor_work_guard classes. +
  • +
  • + Added the noexcept qualifier to the buffer_sequence_begin + and buffer_sequence_end functions. +
  • +
  • + Added a new ASIO_DISABLE_VISIBILITY configuration #define + that allows visibility pragmas to be disabled. (Note: If symbols are hidden, + extra care must be taken to ensure that Asio types are not passed across + shared library API boundaries.) +
  • +
  • + Changed compile-time feature detection to define ASIO_STANDALONE + automatically if C++11 or later is detected. +
      +
    • + Users should define ASIO_ENABLE_BOOST to explicitly + disable standalone mode when compiling with C++11 or later. +
    • +
    • + The configure script now defaults to a standalone build + unless Boost is specified or detected. +
    • +
    +
  • +
  • + Enabled recycling of the memory used to type-erase a function object with + the polymorphic executor. +
  • +
  • + Changed receive operations to return the correct number of bytes transferred + when truncation (error::message_size) occurs on a datagram-oriented + socket. +
  • +
  • + Fixed multicast behaviour on QNX by automatically applying SO_REUSEPORT + when the reuse_address option is set. +
  • +
  • + Added inclusion of unistd.h when targeting Haiku OS, to fix + feature detection. +
  • +
  • + Added the network_v[46].hpp headers to the top-level convenience + header. +
  • +
  • + Fixed calculation of absolute timeout when the backend uses pthread_cond_timedwait. +
  • +
  • + Changed the range-based asynchronous connect operation to deduce the EndpointSequence + iterator type rather than assume the presence of a const_iterator + typedef. +
  • +
  • + Fixed buffer_sequence_begin and buffer_sequence_end + to prevent implicit conversion. This change addresses an issue where a + call to buffer_sequence_begin or buffer_sequence_end + could trigger an implicit conversion to const_buffer or mutable_buffer. + Whenever this implicit conversion occurred, the return value of buffer_sequence_begin + or buffer_sequence_end would point to a temporary object. +
  • +
  • + Ensured SSL handshake errors are propagated to the peer before the local + operation completes. +
  • +
  • + Suppressed the eof error on SSL shutdown as it actually indicates + success. +
  • +
  • + Added a fallback error code for when we OpenSSL produces an SSL_ERROR_SYSCALL + result without an associated error. +
  • +
  • + Changed composed asynchronous read and write operations to move, rather + than copy, the buffer sequence objects when the composed operation implementation + is moved. +
  • +
  • + Changed to use <atomic> when targeting apple/clang/libc++ + with recent Xcode versions, even for C++03. This fixes a warning about + the deprecation of OSMemoryBarrier. +
  • +
  • + Fixed compile errors that occur when using the composed read and write + operations with MSVC 11.0, by disabling decltype support for + that compiler. +
  • +
  • + Increased the default value of _WIN32_WINNT to 0x0601 + (Windows 7). +
  • +
  • + Fixed dispatch documentation to note that it may call the + supplied function object in the current thread. +
  • +
  • + Updated post and defer documentation to clarify + the the distinction between them. +
  • +
+

+ + Asio + 1.12.2 +

+
    +
  • + Fixed a problem with the detection of std::future availability + with libstdc++. +
  • +
  • + Fixed compile error in regex overload of read_until. +
  • +
  • + Fixed a timer heap corruption issue that can occur when moving a cancelled + timer. +
  • +
  • + Fixed detection of std::experimental::string_view and std::string_view + with newer clang/libc++. +
  • +
  • + Fixed MSVC version detection for availability of std::invoke_result. +
  • +
  • + Fixed the buffer sequence traits to test the new requirements, if decltype + is available. +
  • +
  • + Fixed an MSVC issue when building with exceptions disabled. +
  • +
  • + Added SSL context options for TLS v1.3. +
  • +
  • + Added a compile-time test for TLS v1 support. +
  • +
  • + Fixed the macro used to test for TLS v1.2 support. +
  • +
  • + Prevented global objects from being created once per thread on Windows. +
  • +
  • + Fixed a crash when using size(), max_size() or + empty() on default-constructed resolver results. +
  • +
  • + Changed to move the return value in basic_resolver_results::begin() to + avoid copying. +
  • +
  • + Enabled move support for the Intel Compiler. +
  • +
  • + Fixed std::string_view detection issue when using clang-cl. +
  • +
  • + Fixed the handler tracking operation name for io_context::executor_type::dispatch. +
  • +
  • + Fixed a buffer overflow that could occur when parsing an address string + with a 64-bit scope id. +
  • +
  • + Added examples showing how to write composed operations. +
  • +
  • + Added C++11 versions of the Timeouts, Timers, SOCKS4 and SSL examples. +
  • +
  • + Fixed minor issues in documentation and examples. +
  • +
+

+ + Asio + 1.12.1 +

+
    +
  • + Added missing const qualifier to basic_socket_acceptor::get_option. +
  • +
  • + Worked around a parsing error that occurs with some versions of gcc. +
  • +
  • + Fixed broken code samples in tutorial. +
  • +
  • + Added new experimental features. (Note that "experimental" features + may be changed without notice in subsequent releases.) +
      +
    • + Added experimental::detached completion token. +
    • +
    • + Added experimental::redirect_error completion token. +
    • +
    • + Added experimental::co_spawn facility for integration + with the coroutines technical specification. +
    • +
    +
  • +
  • + Updated timeout examples to use latest features. +
      +
    • + Used asio::steady_timer rather than asio::deadline_timer. +
    • +
    • + Used asio::dynamic_buffer rather than asio::streambuf. +
    • +
    • + Used timed asio::io_context::run_for() function for + blocking clients. +
    • +
    • + Added example showing a custom completion token for blocking with + timeouts. +
    • +
    +
  • +
  • + Fixed unit tests to compile when (BOOST_)ASIO_NO_DEPRECATED + is defined. +
  • +
  • + Changed socket iostreams to use chrono by default, to fix compatibility + with the Networking TS. Define (BOOST_)ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM + to enable the old Boost.Date_Time interface in basic_socket_streambuf + and basic_socket_iostream. +
  • +
  • + Updated examples to use chrono rather than Boost.Date_Time. +
  • +
  • + Fixed an incorrect member function detector in the is_dynamic_buffer + trait. +
  • +
  • + Fixed an async_result incompatibility with deprecated handler_type. +
  • +
  • + Added a missing move optimisation in the SSL stream implementation. +
  • +
  • + Fixed incorrect basic_resolver_results::value_type typedef. +
  • +
  • + Fixed a compile error with some OpenSSL versions when SSL_OP_NO_COMPRESSION + is defined. +
  • +
  • + Changed add_certificate_authority to process multiple certificates + in a bundle. +
  • +
  • + Eliminated deprecation warning with MSVC by using std::invoke_result + rather than std::result_of. +
  • +
  • + Changed to use std::string_view for C++17 or later, and std::experimental::string_view + for C++14. Define the preprocessor macro (BOOST_)ASIO_DISABLE_STD_STRING_VIEW + to force the use of std::experimental::string_view (assuming it is available) + when compiling in C++17 mode. +
  • +
  • + Ensured DynamicBuffer template arguments are decayed before + using in enable_if tests. +
  • +
  • + Changed documentation to distinguish legacy completion handlers (which + are still required to be CopyConstructible) from new MoveConstructible + handlers. +
  • +
  • + Suppressed a discarded return value warning in the buffer debugging support. +
  • +
  • + Fixed basic_yield_context to work with completion signatures + containing reference parameters. +
  • +
  • + Ensured that stackful coroutines launched using spawn() correctly + store decayed copies of their function and handler arguments. +
  • +
  • + Fixed some compatibility issues with Android. +
  • +
  • + Fixed some minor portability issues in examples. +
  • +
+

+ + Asio + 1.12.0 +

+
    +
  • + Completed the interface changes to reflect the Networking TS (N4656). +
      +
    • + See the list of new interfaces + and, where applicable, the corresponding old interfaces that have + been superseded. +
    • +
    • + The service template parameters, and the corresponding classes, are + disabled by default. For example, instead of basic_socket<Protocol, + SocketService> we now have simply basic_socket<Protocol>. + The old interface can be enabled by defining the (BOOST_)ASIO_ENABLE_OLD_SERVICES + macro. +
    • +
    +
  • +
  • + Added support for customised handler tracking. +
  • +
  • + Added reactor-related (i.e. descriptor readiness) events to handler tracking. +
  • +
  • + Added special concurrency + hint values that may be used to disable locking on a per io_context + basis. +
  • +
  • + Enabled perfect forwarding for the first ssl::stream<> + constructor argument. +
  • +
  • + Added ability to release ownership of the underlying native socket. (Requires + Windows 8.1 or later when using the I/O completion port backend.) +
  • +
+

+ + Asio + 1.11.0 +

+
    +
  • + Implemented changes to substantially reflect the Networking Library Proposal + (N4370). +
      +
    • + New Executor type requirements and classes to support + an executor framework, including the execution_context + base class, the executor_work class for tracking outstanding + work, and the executor polymorphic wrapper. Free functions + dispatch(), post() and defer() + have been added and are used to submit function objects to executors. +
    • +
    • + Completion handlers now have an associated executor and associated + allocator. The free function wrap() is used to associate + an executor with a handler or other object. The handler hooks for + allocation, invocation and continuation have been deprecated. +
    • +
    • + A system_executor class has been added as a default + executor. +
    • +
    • + The io_service class is now derived from execution_context + and implements the executor type requirements in its nested executor_type + class. The member functions dispatch(), post(), + defer() and wrap() have been deprecated. + The io_service::work class has been deprecated. +
    • +
    • + The io_service member function reset() + has been renamed to restart(). The old name is retained + for backward compatibility but has been deprecated. +
    • +
    • + The make_service<>() function is now used to add + a new service to an execution context such as an io_service. + The add_service() function has been deprecated. +
    • +
    • + A new strand<> template has been added to allow + strand functionality to be used with generic executor types. +
    • +
    • + I/O objects (such as sockets and timers) now provide access to their + associated io_service via a context() member + function. The get_io_service() member function is deprecated. +
    • +
    • + All asynchronous operations and executor operations now support move-only + handlers. However, the deprecated io_service::post(), + io_service::dispatch(), io_service::strand::post() + and io_service::strand::dispatch() functions still require + copyable handlers. +
    • +
    • + Waitable timer objects are now movable. +
    • +
    • + Waitable timers, socket iostreams and socket streambufs now provide + an expiry() member function for obtaining the expiry + time. The accessors expires_at() and expires_after() + have been deprecated, though those names are retained for the mutating + members. +
    • +
    • + The std::packaged_task class template is now supported + as a completion handler. The initiating operation automatically returns + the future associated with the task. The package() function + has been added as a convenient factory for packaged tasks. +
    • +
    • + Sockets, socket acceptors and descriptors now provide wait() + and async_wait() operations that may be used to wait + for readiness. The null_buffers type has been deprecated. +
    • +
    • + The proposed error code enum classes are simulated using namespaces. + Existing asio error codes now have a correspondence with the standard + error conditions. +
    • +
    • + Conversion between IP address types, and conversion from string to + address, is now supported via the address_cast<>(), + make_address(), make_address_v4() and + make_address_v6() free functions. The from_string(), + to_v4(), to_v6() and v4_mapped() + member functions have been deprecated. +
    • +
    • + A default-constructed ip::address now represents an + invalid address value that is neither IPv4 nor IPv6. +
    • +
    • + New buffer() overloads that generate mutable buffers + for non-const string objects. +
    • +
    • + Support for dynamic buffer sequences that automatically grow and + shrink to accomodate data as it is read or written. This is a generic + facility similar to the existing asio::streambuf class. + This support includes: +
        +
      • + New dynamic_string_buffer and dynamic_vector_buffer + adapter classes that meet the DynamicBufferSequence + type requirements. +
      • +
      • + New dynamic_buffer() factory functions for creating + a dynamic buffer adapter for a vector or string. +
      • +
      • + New overloads for the read(), async_read(), + write() and async_write(), read_until() + and async_read_until() free functions that directly + support dynamic buffer sequences. +
      • +
      +
    • +
    • + Support for networks and address ranges. Thanks go to Oliver Kowalke + for contributing to the design and providing the implementation on + which this facility is based. The following new classes have been + added: +
        +
      • + address_iterator_v4 for iterating across IPv4 + addresses +
      • +
      • + address_iterator_v6 for iterating across IPv6 + addresses +
      • +
      • + address_range_v4 to represent a range of IPv4 + addresses +
      • +
      • + address_range_v6 to represent a range of IPv6 + addresses +
      • +
      • + network_v4 for manipulating IPv4 CIDR addresses, + e.g. 1.2.3.0/24 +
      • +
      • + network_v6 for manipulating IPv6 CIDR addresses, + e.g. ffe0:/120 +
      • +
      +
    • +
    • + New convenience headers in <asio/ts/*.hpp> + that correspond to the headers in the proposal. +
    • +
    +
  • +
  • + Added a new, executor-aware thread_pool class. +
  • +
  • + Changed spawn() to be executor-aware. +
  • +
  • + Added a new spawn() overload that takes only a function object. +
  • +
  • + Changed spawn() and yield_context to permit nested + calls to the completion handler. +
  • +
  • + Removed previously deprecated functions. +
  • +
  • + Added options for disabling TLS v1.1 and v1.2. +
  • +
  • + Changed the SSL wrapper to call the password callback when loading an in-memory + key. +
  • +
  • + Changed the tutorial to use std::endl to ensure output is + flushed. +
  • +
  • + Fixed false SSL error reports by ensuring that the SSL error queue is cleared + prior to each operation. +
  • +
  • + Fixed an ssl::stream<> bug that may result in spurious + 'short read' errors. +
  • +
  • + Enabled perfect forwarding for the first ssl::stream<> + constructor argument. +
  • +
  • + Added standalone Asio support for Clang when used with libstdc++ and C++11. +
  • +
  • + Fixed an unsigned integer overflow reported by Clang's integer sanitizer. +
  • +
  • + Added support for move-only return types when using a yield_context + object with asynchronous operations. +
  • +
  • + Ensured errors generated by Windows' ConnectEx function are + mapped to their portable equivalents. +
  • +
  • + Changed multicast test to treat certain join_group failures + as non-fatal. +
  • +
+

+ + Asio + 1.10.5 +

+
    +
  • + Fixed the kqueue reactor so that it works on FreeBSD. +
  • +
  • + Fixed an issue in the kqueue reactor which resulted + in spinning when using serial ports on Mac OS. +
  • +
  • + Fixed kqueue reactor support for read-only file descriptors. +
  • +
  • + Fixed a compile error when using the /dev/poll reactor. +
  • +
  • + Changed the Windows backend to use WSASocketW, as WSASocketA + has been deprecated. +
  • +
  • + Fixed some warnings reported by Visual C++ 2013. +
  • +
  • + Fixed integer type used in the WinRT version of the byte-order conversion + functions. +
  • +
  • + Changed documentation to indicate that use_future and spawn() + are not made available when including the asio.hpp convenience + header. +
  • +
  • + Explicitly marked asio::strand as deprecated. Use asio::io_service::strand + instead. +
  • +
+

+ + Asio + 1.10.4 +

+
    +
  • + Stopped using certain Winsock functions that are marked as deprecated in + the latest Visual C++ and Windows SDK. +
  • +
  • + Fixed a shadow variable warning on Windows. +
  • +
  • + Fixed a regression in the kqueue backend that was introduced + in Asio 1.10.2. +
  • +
  • + Added a workaround for building the unit tests with gcc + on AIX. +
  • +
+

+ + Asio + 1.10.3 +

+
    +
  • + Worked around a gcc problem to do with anonymous enums. +
  • +
  • + Reverted the Windows HANDLE backend change to ignore ERROR_MORE_DATA. + Instead, the error will be propagated as with any other (i.e. in an error_code + or thrown as a system_error), and the number of bytes transferred + will be returned. For code that needs to handle partial messages, the + error_code overload should be used. +
  • +
  • + Fixed an off-by-one error in the signal_set implementation's + signal number check. +
  • +
  • + Changed the Windows IOCP backend to not assume that SO_UPDATE_CONNECT_CONTEXT + is defined. +
  • +
  • + Fixed a Windows-specific issue, introduced in Asio 1.10.2, by using VerifyVersionInfo + rather than GetVersionEx, as GetVersionEx has + been deprecated. +
  • +
  • + Changed to use SSE2 intrinsics rather than inline assembly, to allow the + Cray compiler to work. +
  • +
+

+ + Asio + 1.10.2 +

+
    +
  • + Fixed asio::spawn() to work correctly with new Boost.Coroutine + interface. +
  • +
  • + Ensured that incomplete asio::spawn() coroutines are correctly + unwound when cleaned up by the io_service destructor. +
  • +
  • + Fixed delegation of continuation hook for handlers produced by io_service::wrap() + and strand::wrap(). +
  • +
  • + Changed the Windows I/O completion port backend to use ConnectEx, + if available, for connection-oriented IP sockets. +
  • +
  • + Changed the io_service backend for non-Windows (and non-IOCP + Windows) platforms to use a single condition variable per io_service + instance. This addresses a potential race condition when run_one() + is used from multiple threads. +
  • +
  • + Prevented integer overflow when computing timeouts based on some boost::chrono + and std::chrono clocks. +
  • +
  • + Made further changes to EV_CLEAR handling in the kqueue backend, + to address other cases where the close() system call may hang + on Mac OS X. +
  • +
  • + Fixed infinite recursion in implementation of resolver_query_base::flags::operator~. +
  • +
  • + Made the select reactor more efficient on Windows for large + numbers of sockets. +
  • +
  • + Fixed a Windows-specific type-aliasing issue reported by gcc. +
  • +
  • + Prevented execution of compile-time-only buffer test to avoid triggering + an address sanitiser warning. +
  • +
  • + Disabled the GetQueuedCompletionStatus timeout workaround + on recent versions of Windows. +
  • +
  • + Changed implementation for Windows Runtime to use FormatMessageW + rather than FormatMessageA, as the Windows store does not + permit the latter. +
  • +
  • + Added support for string-based scope IDs when using link-local multicast + addresses. +
  • +
  • + Changed IPv6 multicast group join to use the address's scope ID as the + interface, if an interface is not explicitly specified. +
  • +
  • + Fixed multicast test failure on Mac OS X and the BSDs by using a link-local + multicast address. +
  • +
  • + Various minor documentation improvements. +
  • +
+

+ + Asio + 1.10.1 +

+
    +
  • + Implemented a limited port to Windows Runtime. This support requires that + the language extensions be enabled. Due to the restricted facilities exposed + by the Windows Runtime API, the port also comes with the following caveats: +
      +
    • + The core facilities such as the io_service, strand, + buffers, composed operations, timers, etc., should all work as normal. +
    • +
    • + For sockets, only client-side TCP is supported. +
    • +
    • + Explicit binding of a client-side TCP socket is not supported. +
    • +
    • + The cancel() function is not supported for sockets. + Asynchronous operations may only be cancelled by closing the socket. +
    • +
    • + Operations that use null_buffers are not supported. +
    • +
    • + Only tcp::no_delay and socket_base::keep_alive + options are supported. +
    • +
    • + Resolvers do not support service names, only numbers. I.e. you must + use "80" rather than "http". +
    • +
    • + Most resolver query flags have no effect. +
    • +
    +
  • +
  • + Extended the ability to use Asio without Boost to include Microsoft Visual + Studio 2012. When using a C++11 compiler, most of Asio may now be used + without a dependency on Boost header files or libraries. To use Asio in + this way, define ASIO_STANDALONE on your compiler command + line or as part of the project options. This standalone configuration has + been tested for the following platforms and compilers: +
      +
    • + Microsoft Visual Studio 2012 +
    • +
    • + Linux with g++ 4.7 or 4.8 (requires -std=c++11) +
    • +
    • + Mac OS X with clang++ / Xcode 4.6 (requires -std=c++11 -stdlib=libc++) +
    • +
    +
  • +
  • + Fixed a regression (introduced in 1.10.0) where, on some platforms, errors + from async_connect were not correctly propagated through to + the completion handler. +
  • +
  • + Fixed a Windows-specific regression (introduced in 1.10.0) that occurs + when multiple threads are running an io_service. When the + bug occurs, the result of an asynchronous operation (error and bytes tranferred) + is incorrectly discarded and zero values used instead. For TCP sockets + this results in spurious end-of-file notifications. +
  • +
  • + Fixed a bug in handler tracking, where it was not correctly printing out + some handler IDs. +
  • +
  • + Fixed the comparison used to test for successful synchronous accept operations + so that it works correctly with unsigned socket descriptors. +
  • +
  • + Ensured the signal number is correctly passed to the completion handler + when starting an async_wait on a signal that is already raised. +
  • +
  • + Suppressed a g++ 4.8+ warning about unused typedefs. +
  • +
  • + Enabled the move optimisation for handlers that use the default invocation + hook. +
  • +
  • + Clarified that programs must not issue overlapping async_write_at + operations. +
  • +
  • + Changed the Windows HANDLE backend to treat ERROR_MORE_DATA + as a non-fatal error when returned by GetOverlappedResult + for a synchronous read. +
  • +
  • + Visual C++ language extensions use generic as a keyword. Added + a workaround that renames the namespace to cpp_generic when + those language extensions are in effect. +
  • +
  • + Fixed some asynchronous operations that missed out on getting async_result + support in 1.10.0. In particular, the buffered stream templates have been + updated so that they adhere to current handler patterns. +
  • +
  • + Enabled move support for Microsoft Visual Studio 2012. +
  • +
  • + Added use_future support for Microsoft Visual Studio 2012. +
  • +
  • + Removed a use of std::min in the Windows IOCP backend to avoid + a dependency on the <algorithm> header. +
  • +
  • + Eliminated some unnecessary handler copies. +
  • +
  • + Fixed support for older versions of OpenSSL that do not provide the SSL_CTX_clear_options + function. +
  • +
  • + Fixed various minor and cosmetic issues in code and documentation. +
  • +
+

+ + Asio + 1.10.0 +

+
    +
  • + Added new traits classes, handler_type and async_result, + that allow the customisation of the return type of an initiating function. +
  • +
  • + Added the asio::spawn() function, a high-level wrapper for + running stackful coroutines, based on the Boost.Coroutine library. The + spawn() function enables programs to implement asynchronous + logic in a synchronous manner. For example: size_t n = my_socket.async_read_some(my_buffer, + yield);. For further information, see Stackful + Coroutines. +
  • +
  • + Added the asio::use_future special value, which provides first-class + support for returning a C++11 std::future from an asynchronous + operation's initiating function. For example: future<size_t> + = my_socket.async_read_some(my_buffer, asio::use_future);. For further + information, see C++ 2011 + Support - Futures. +
  • +
  • + Promoted the stackless coroutine class and macros to be part of Asio's + documented interface, rather than part of the HTTP server 4 example. For + further information, see Stackless + Coroutines. +
  • +
  • + Added a new handler hook called asio_handler_is_continuation. + Asynchronous operations may represent a continuation of the asynchronous + control flow associated with the current executing handler. The asio_handler_is_continuation + hook can be customised to return true if this is the case, + and Asio's implementation can use this knowledge to optimise scheduling + of the new handler. To cover common cases, Asio customises the hook for + strands, spawn() and composed asynchronous operations. +
  • +
  • + Added four new generic protocol classes, generic::datagram_protocol, + generic::raw_protocol, generic::seq_packet_protocol + and generic::stream_protocol, which implement the Protocol + type requirements, but allow the user to specify the address family (e.g. + AF_INET) and protocol type (e.g. IPPROTO_TCP) + at runtime. For further information, see Support + for Other Protocols. +
  • +
  • + Added C++11 move constructors that allow the conversion of a socket (or + acceptor) into a more generic type. For example, an ip::tcp::socket + can be converted into a generic::stream_protocol::socket via + move construction. For further information, see Support + for Other Protocols. +
  • +
  • + Extended the basic_socket_acceptor<>'s accept() + and async_accept() functions to allow a new connection to + be accepted directly into a socket of a more generic type. For example, + an ip::tcp::acceptor can be used to accept into a generic::stream_protocol::socket + object. For further information, see Support + for Other Protocols. +
  • +
  • + Moved existing examples into a C++03-specific directory, and added a new + directory for C++11-specific examples. A limited subset of the C++03 examples + have been converted to their C++11 equivalents. +
  • +
  • + Add the ability to use Asio without Boost, for a limited set of platforms. + When using a C++11 compiler, most of Asio may now be used without a dependency + on Boost header files or libraries. To use Asio in this way, define ASIO_STANDALONE + on your compiler command line or as part of the project options. This standalone + configuration has currently been tested for the following platforms and + compilers: +
      +
    • + Linux with g++ 4.7 (requires -std=c++11) +
    • +
    • + Mac OS X with clang++ / Xcode 4.6 (requires -std=c++11 -stdlib=libc++) +
    • +
    +
  • +
  • + Various SSL enhancements. Thanks go to Nick Jones, on whose work these + changes are based. +
      +
    • + Added support for SSL handshakes with re-use of data already read + from the wire. New overloads of the ssl::stream<> + class's handshake() and async_handshake() + functions have been added. These accept a ConstBufferSequence + to be used as initial input to the ssl engine for the handshake procedure. +
    • +
    • + Added support for creation of TLSv1.1 and TLSv1.2 ssl::context + objects. +
    • +
    • + Added a set_verify_depth() function to the ssl::context + and ssl::stream<> classes. +
    • +
    • + Added the ability to load SSL certificate and key data from memory + buffers. New functions, add_certificate_authority(), + use_certificate(), use_certificate_chain(), + use_private_key(), use_rsa_private_key() + and use_tmp_dh(), have been added to the ssl::context + class. +
    • +
    • + Changed ssl::context to automatically disable SSL compression + by default. To enable, use the new ssl::context::clear_options() + function, as in my_context.clear_options(ssl::context::no_compression). +
    • +
    +
  • +
  • + Fixed a potential deadlock in signal_set implementation. +
  • +
  • + Fixed an error in acceptor example in documentation. +
  • +
  • + Fixed copy-paste errors in waitable timer documentation. +
  • +
  • + Added assertions to satisfy some code analysis tools. +
  • +
  • + Fixed a malformed #warning directive. +
  • +
  • + Fixed a potential data race in the Linux epoll implementation. +
  • +
  • + Fixed a Windows-specific bug, where certain operations might generate an + error_code with an invalid (i.e. NULL) error_category. +
  • +
  • + Fixed basic_waitable_timer's underlying implementation so + that it can handle any time_point value without overflowing + the intermediate duration objects. +
  • +
  • + Fixed a problem with lost thread wakeups that can occur when making concurrent + calls to run() and poll() on the same io_service + object. +
  • +
  • + Fixed implementation of asynchronous connect operation so that it can cope + with spurious readiness notifications from the reactor. +
  • +
  • + Fixed a memory leak in the ssl::rfc2818_verification class. +
  • +
  • + Added a mechanism for disabling automatic Winsock initialisation. See the + header file asio/detail/winsock_init.hpp for details. +
  • +
+

+ + Asio + 1.8.3 +

+
    +
  • + Fixed some 64-to-32-bit conversion warnings. +
  • +
  • + Fixed various small errors in documentation and comments. +
  • +
  • + Fixed an error in the example embedded in basic_socket::get_option's + documentation. +
  • +
  • + Changed to use long rather than int for SSL_CTX + options, to match OpenSSL. +
  • +
  • + Changed to use _snwprintf to address a compile error due to + the changed swprintf signature in recent versions of MinGW. +
  • +
  • + Fixed a deadlock that can occur on Windows when shutting down a pool of + io_service threads due to running out of work. +
  • +
  • + Changed UNIX domain socket example to treat errors from accept + as non-fatal. +
  • +
  • + Added a small block recycling optimisation to improve default memory allocation + behaviour. +
  • +
+

+ + Asio + 1.8.2 +

+
    +
  • + Fixed an incompatibility between ip::tcp::iostream and C++11. +
  • +
  • + Decorated GCC attribute names with underscores to prevent interaction with + user-defined macros. +
  • +
  • + Added missing #include <cctype>, needed for some versions + of MinGW. +
  • +
  • + Changed to use gcc's atomic builtins on ARM CPUs, when + available. +
  • +
  • + Changed strand destruction to be a no-op, to allow strand objects to be + destroyed after their associated io_service has been destroyed. +
  • +
  • + Added support for some newer versions of glibc which provide the epoll_create1() + function but always fail with ENOSYS. +
  • +
  • + Changed the SSL implementation to throw an exception if SSL engine initialisation + fails. +
  • +
  • + Fixed another regression in buffered_write_stream. +
  • +
  • + Implemented various minor performance improvements, primarily targeted + at Linux x86 and x86-64 platforms. +
  • +
+

+ + Asio + 1.8.1 +

+
    +
  • + Changed the epoll_reactor backend to do lazy registration + for EPOLLOUT events. +
  • +
  • + Fixed the epoll_reactor handling of out-of-band data, which + was broken by an incomplete fix in the last release. +
  • +
  • + Changed Asio's SSL wrapper to respect OpenSSL's OPENSSL_NO_ENGINE + feature test #define. +
  • +
  • + Fixed windows::object_handle so that it works with Windows + compilers that support C++11 move semantics (such as g++). +
  • +
  • + Improved the performance of strand rescheduling. +
  • +
  • + Added support for g++ 4.7 when compiling in C++11 mode. +
  • +
  • + Fixed a problem where signal_set handlers were not being delivered + when the io_service was constructed with a concurrency_hint + of 1. +
  • +
+

+ + Asio + 1.8.0 +

+
    +
  • + Added a new class template basic_waitable_timer based around + the C++11 clock type requirements. It may be used with the clocks from + the C++11 <chrono> library facility or, if those are + not available, Boost.Chrono. The typedefs high_resolution_timer, + steady_timer and system_timer may be used to + create timer objects for the standard clock types. +
  • +
  • + Added a new windows::object_handle class for performing waits + on Windows kernel objects. Thanks go to Boris Schaeling for contributing + substantially to the development of this feature. +
  • +
  • + On Linux, connect() can return EAGAIN in certain circumstances. + Remapped this to another error so that it doesn't look like a non-blocking + operation. +
  • +
  • + Fixed a compile error on NetBSD. +
  • +
  • + Fixed deadlock on Mac OS X. +
  • +
  • + Fixed a regression in buffered_write_stream. +
  • +
  • + Fixed a non-paged pool "leak" on Windows when an io_service + is repeatedly run without anything to do. +
  • +
  • + Reverted earlier change to allow some speculative operations to be performed + without holding the lock, as it introduced a race condition in some multithreaded + scenarios. +
  • +
  • + Fixed a bug where the second buffer in an array of two buffers may be ignored + if the first buffer is empty. +
  • +
+

+ + Asio + 1.6.1 +

+
    +
  • + Implemented various performance improvements, including: +
      +
    • + Using thread-local operation queues in single-threaded use cases + (i.e. when concurrency_hint is 1) to eliminate a lock/unlock + pair. +
    • +
    • + Allowing some epoll_reactor speculative operations to + be performed without holding the lock. +
    • +
    • + Improving locality of reference by performing an epoll_reactor's + I/O operation immediately before the corresponding handler is called. + This also improves scalability across CPUs when multiple threads + are running the io_service. +
    • +
    • + Specialising asynchronous read and write operations for buffer sequences + that are arrays (boost::array or std::array) + of exactly two buffers. +
    • +
    +
  • +
  • + Fixed a compile error in the regex overload of async_read_until. +
  • +
  • + Fixed a Windows-specific compile error by explicitly specifying the signal() + function from the global namespace. +
  • +
  • + Changed the deadline_timer implementation so that it does + not read the clock unless the timer heap is non-empty. +
  • +
  • + Changed the SSL stream's buffers' sizes so that they are large enough to + hold a complete TLS record. +
  • +
  • + Fixed the behaviour of the synchronous null_buffers operations + so that they obey the user's non-blocking setting. +
  • +
  • + Changed to set the size of the select fd_set at runtime when + using Windows. +
  • +
  • + Disabled an MSVC warning due to const qualifier being applied to function + type. +
  • +
  • + Fixed a crash that occurs when using the Intel C++ compiler. +
  • +
  • + Changed the initialisation of the OpenSSL library so that it supports all + available algorithms. +
  • +
  • + Fixed the SSL error mapping used when the session is gracefully shut down. +
  • +
  • + Added some latency test programs. +
  • +
  • + Clarified that a read operation ends when the buffer is full. +
  • +
  • + Fixed an exception safety issue in epoll_reactor initialisation. +
  • +
  • + Made the number of strand implementations configurable by defining (BOOST_)ASIO_STRAND_IMPLEMENTATIONS + to the desired number. +
  • +
  • + Added support for a new (BOOST_)ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION + flag which switches the allocation of strand implementations to use a round-robin + approach rather than hashing. +
  • +
  • + Fixed potential strand starvation issue that can occur when strand.post() + is used. +
  • +
+

+ + Asio + 1.6.0 +

+
    +
  • + Improved support for C++0x move construction to further reduce copying + of handler objects. In certain designs it is possible to eliminate virtually + all copies. Move support is now enabled when compiling in -std=c++0x + mode on g++ 4.5 or higher. +
  • +
  • + Added build support for platforms that don't provide either of signal() + or sigaction(). +
  • +
  • + Changed to use C++0x variadic templates when they are available, rather + than generating function overloads using the Boost.Preprocessor library. +
  • +
  • + Ensured the value of errno is preserved across the implementation's + signal handler. +
  • +
  • + On Windows, ensured the count of outstanding work is decremented for abandoned + operations (i.e. operations that are being cleaned up within the io_service + destructor). +
  • +
  • + Fixed behaviour of zero-length reads and writes in the new SSL implementation. +
  • +
  • + Added support for building with OpenSSL 1.0 when OPENSSL_NO_SSL2 + is defined. +
  • +
  • + Changed most examples to treat a failure by an accept operation as non-fatal. +
  • +
  • + Fixed an error in the tick_count_timer example by making + the duration type signed. Previously, a wait on an already-passed deadline + would not return for a very long time. +
  • +
+

+ + Asio + 1.5.3 +

+
    +
  • + Added a new, completely rewritten SSL implementation. The new implementation + compiles faster, shows substantially improved performance, and supports + custom memory allocation and handler invocation. It includes new API features + such as certificate verification callbacks and has improved error reporting. + The new implementation is source-compatible with the old for most uses. + However, if necessary, the old implementation may still be used by defining + (BOOST_)ASIO_ENABLE_OLD_SSL. +
  • +
  • + Added new asio::buffer() overloads for std::array, + when available. The support is automatically enabled when compiling in + -std=c++0x mode on g++ 4.3 or higher, or when using + MSVC 10. The support may be explicitly enabled by defining (BOOST_)ASIO_HAS_STD_ARRAY, + or disabled by defining (BOOST_)ASIO_DISABLE_STD_ARRAY. +
  • +
  • + Changed to use the C++0x standard library templates array, + shared_ptr, weak_ptr and atomic + when they are available, rather than the Boost equivalents. +
  • +
  • + Support for std::error_code and std::system_error + is no longer enabled by default for g++ 4.5, as that compiler's standard + library does not implement std::system_error::what() correctly. +
  • +
+

+ + Asio + 1.5.2 +

+
    +
  • + Added support for C++0x move construction and assignment to sockets, serial + ports, POSIX descriptors and Windows handles. +
  • +
  • + Added support for the fork() system call. Programs that use + fork() must call io_service.notify_fork() at + the appropriate times. Two new examples have been added showing how to + use this feature. +
  • +
  • + Cleaned up the handling of errors reported by the close() + system call. In particular, assume that most operating systems won't have + close() fail with EWOULDBLOCK, but if it does + then set the blocking mode and restart the call. If any other error occurs, + assume the descriptor is closed. +
  • +
  • + The kqueue flag EV_ONESHOT seems to cause problems on some + versions of Mac OS X, with the io_service destructor getting + stuck inside the close() system call. Changed the kqueue backend + to use EV_CLEAR instead. +
  • +
  • + Changed exception reporting to include the function name in exception + what() messages. +
  • +
  • + Fixed an insufficient initialisers warning with MinGW. +
  • +
  • + Changed the shutdown_service() member functions to be private. +
  • +
  • + Added archetypes for testing socket option functions. +
  • +
  • + Added a missing lock in signal_set_service::cancel(). +
  • +
  • + Fixed a copy/paste error in SignalHandler example. +
  • +
  • + Added the inclusion of the signal header to signal_set_service.hpp + so that constants like NSIG may be used. +
  • +
  • + Changed the signal_set_service implementation so that it doesn't + assume that SIGRTMAX is a compile-time constant. +
  • +
  • + Changed the Boost.Asio examples so that they don't use Boost.Thread's convenience + header. Use the header file that is specifically for the boost::thread + class instead. +
  • +
+

+ + Asio + 1.5.1 +

+
    +
  • + Added support for signal handling, using a new class called signal_set. + Programs may add one or more signals to the set, and then perform an async_wait() + operation. The specified handler will be called when one of the signals + occurs. The same signal number may registered with multiple signal_set + objects, however the signal number must be used only with Asio. +
  • +
  • + Added handler tracking, a new debugging aid. When enabled by defining + (BOOST_)ASIO_ENABLE_HANDLER_TRACKING, Asio writes debugging + output to the standard error stream. The output records asynchronous operations + and the relationships between their handlers. It may be post-processed + using the included handlerviz.pl tool to create a visual + representation of the handlers (requires GraphViz). +
  • +
  • + Fixed a bug in asio::streambuf where the consume() + function did not always update the internal buffer pointers correctly. + The problem may occur when the asio::streambuf is filled with + data using the standard C++ member functions such as sputn(). + (Note: the problem does not manifest when the streambuf is populated by + the Asio free functions read(), async_read(), + read_until() or async_read_until().) +
  • +
  • + Fixed a bug on kqueue-based platforms, where reactor read operations that + return false from their perform() function are not correctly + re-registered with kqueue. +
  • +
  • + Support for std::error_code and std::system_error + is no longer enabled by default for MSVC10, as that compiler's standard + library does not implement std::system_error::what() correctly. +
  • +
  • + Modified the buffers_iterator<> and ip::basic_resolver_iterator + classes so that the value_type typedefs are non-const byte types. +
  • +
+

+ + Asio + 1.5.0 +

+
    +
  • + Added support for timeouts on socket iostreams, such as ip::tcp::iostream. + A timeout is set by calling expires_at() or expires_from_now() + to establish a deadline. Any socket operations which occur past the deadline + will put the iostream into a bad state. +
  • +
  • + Added a new error() member function to socket iostreams, for + retrieving the error code from the most recent system call. +
  • +
  • + Added a new basic_deadline_timer::cancel_one() function. This + function lets you cancel a single waiting handler on a timer. Handlers + are cancelled in FIFO order. +
  • +
  • + Added a new transfer_exactly() completion condition. This + can be used to send or receive a specified number of bytes even if the + total size of the buffer (or buffer sequence) is larger. +
  • +
  • + Added new free functions connect() and async_connect(). + These operations try each endpoint in a list until the socket is successfully + connected. +
  • +
  • + Extended the buffer_size() function so that it works for buffer + sequences in addition to individual buffers. +
  • +
  • + Added a new buffer_copy() function that can be used to copy + the raw bytes between individual buffers and buffer sequences. +
  • +
  • + Added new non-throwing overloads of read(), read_at(), + write() and write_at() that do not require a + completion condition. +
  • +
  • + Added friendlier compiler errors for when a completion handler does not + meet the necessary type requirements. When C++0x is available (currently + supported for g++ 4.5 or later, and MSVC 10), static_assert + is also used to generate an informative error message. This checking may + be disabled by defining (BOOST_)ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS. +
  • +
  • + Added support for using std::error_code and std::system_error, + when available. The support is automatically enabled when compiling in + -std=c++0x mode on g++ 4.5 or higher, or when using + MSVC 10. The support may be explicitly enabled by defining ASIO_HAS_STD_SYSTEM_ERROR, + or disabled by defining ASIO_DISABLE_STD_SYSTEM_ERROR. (Available + in non-Boost version of Asio only.) +
  • +
  • + Made the is_loopback(), is_unspecified() and + is_multicast() functions consistently available across the + ip::address, ip::address_v4 and ip::address_v6 + classes. +
  • +
  • + Added new non_blocking() functions for managing the non-blocking + behaviour of a socket or descriptor. The io_control() commands + named non_blocking_io are now deprecated in favour of these + new functions. +
  • +
  • + Added new native_non_blocking() functions for managing the + non-blocking mode of the underlying socket or descriptor. These functions + are intended to allow the encapsulation of arbitrary non-blocking system + calls as asynchronous operations, in a way that is transparent to the user + of the socket object. The functions have no effect on the behaviour of + the synchronous operations of the socket or descriptor. +
  • +
  • + Added the io_control() member function for socket acceptors. +
  • +
  • + For consistency with the C++0x standard library, deprecated the native_type + typedefs in favour of native_handle_type, and the native() + member functions in favour of native_handle(). +
  • +
  • + Added a release() member function to posix descriptors. This + function releases ownership of the underlying native descriptor to the + caller. +
  • +
  • + Added support for sequenced packet sockets (SOCK_SEQPACKET). +
  • +
  • + Added a new io_service::stopped() function that can be used + to determine whether the io_service has stopped (i.e. a reset() + call is needed prior to any further calls to run(), run_one(), + poll() or poll_one()). +
  • +
  • + Reduced the copying of handler function objects. +
  • +
  • + Added support for C++0x move construction to further reduce copying of + handler objects. Move support is enabled when compiling in -std=c++0x + mode on g++ 4.5 or higher, or when using MSVC10. +
  • +
  • + Removed the dependency on OS-provided macros for the well-known IPv4 and + IPv6 addresses. This should eliminate the annoying "missing braces + around initializer" warnings. +
  • +
  • + Reduced the size of ip::basic_endpoint<> objects (such + as ip::tcp::endpoint and ip::udp::endpoint). +
  • +
  • + Changed the reactor backends to assume that any descriptors or sockets + added using assign() may have been dup()-ed, + and so require explicit deregistration from the reactor. +
  • +
  • + Changed the SSL error category to return error strings from the OpenSSL + library. +
  • +
  • + Changed the separate compilation support such that, to use Asio's SSL capabilities, + you should also include 'asio/ssl/impl/src.hpp` in one source file in your + program. +
  • +
  • + Removed the deprecated member functions named io_service(). + The get_io_service() member functions should be used instead. +
  • +
  • + Removed the deprecated typedefs resolver_query and resolver_iterator + from the ip::tcp, ip::udp and ip::icmp + classes. +
  • +
  • + Fixed a compile error on some versions of g++ due to anonymous enums. +
  • +
  • + Added an explicit cast to the FIONBIO constant to int to suppress + a compiler warning on some platforms. +
  • +
  • + Fixed warnings reported by g++'s -Wshadow compiler option. +
  • +
+

+ + Asio + 1.4.8 +

+
    +
  • + Fixed an integer overflow problem that occurs when ip::address_v4::broadcast() + is used on 64-bit platforms. +
  • +
  • + Fixed a problem on older Linux kernels (where epoll is used without timerfd + support) that prevents timely delivery of deadline_timer handlers, + after the program has been running for some time. +
  • +
+

+ + Asio + 1.4.7 +

+
    +
  • + Fixed a problem on kqueue-based platforms where a deadline_timer + may never fire if the io_service is running in a background + thread. +
  • +
  • + Fixed a const-correctness issue that prevented valid uses of has_service<> + from compiling. +
  • +
  • + Fixed MinGW cross-compilation. +
  • +
  • + Removed dependency on deprecated Boost.System functions (Boost.Asio only). +
  • +
  • + Ensured close()/closesocket() failures are correctly + propagated. +
  • +
  • + Added a check for errors returned by InitializeCriticalSectionAndSpinCount. +
  • +
  • + Added support for hardware flow control on QNX. +
  • +
  • + Always use pselect() on HP-UX, if it is available. +
  • +
  • + Ensured handler arguments are passed as lvalues. +
  • +
  • + Fixed Windows build when thread support is disabled. +
  • +
  • + Fixed a Windows-specific problem where deadline_timer objects + with expiry times set more than 5 minutes in the future may never expire. +
  • +
  • + Fixed the resolver backend on BSD platforms so that an empty service name + resolves to port number 0, as per the documentation. +
  • +
  • + Fixed read operations so that they do not accept buffer sequences of type + const_buffers_1. +
  • +
  • + Redefined Protocol and id to avoid clashing with + Objective-C++ keywords. +
  • +
  • + Fixed a vector reallocation performance issue that can occur + when there are many active deadline_timer objects. +
  • +
  • + Fixed the kqueue backend so that it compiles on NetBSD. +
  • +
  • + Fixed the socket io_control() implementation on 64-bit Mac + OS X and BSD platforms. +
  • +
  • + Fixed a Windows-specific problem where failures from accept() + are incorrectly treated as successes. +
  • +
  • + Deprecated the separate compilation header asio/impl/src.cpp + in favour of asio/impl/src.hpp. +
  • +
+

+ + Asio + 1.4.6 +

+
    +
  • + Reduced compile times. (Note that some programs may need to add additional + #includes, e.g. if the program uses boost::array but does + not explicitly include <boost/array.hpp>.) +
  • +
  • + Reduced the size of generated code. +
  • +
  • + Refactored deadline_timer implementation to improve performance. +
  • +
  • + Improved multiprocessor scalability on Windows by using a dedicated hidden + thread to wait for timers. +
  • +
  • + Improved performance of asio::streambuf with async_read() + and async_read_until(). These read operations now use the + existing capacity of the streambuf when reading, rather than + limiting the read to 512 bytes. +
  • +
  • + Added optional separate compilation. To enable, include asio/impl/src.cpp + in one source file in a program, then build the program with (BOOST_)ASIO_SEPARATE_COMPILATION + defined in the project/compiler settings. Alternatively, (BOOST_)ASIO_DYN_LINK + may be defined to build a separately-compiled Asio as part of a shared + library. +
  • +
  • + Added new macro (BOOST_)ASIO_DISABLE_FENCED_BLOCK to permit + the disabling of memory fences around completion handlers, even if thread + support is enabled. +
  • +
  • + Reworked timeout examples to better illustrate typical use cases. +
  • +
  • + Ensured that handler arguments are passed as const types. +
  • +
  • + Fixed incorrect parameter order in null_buffers variant of + async_send_to. +
  • +
  • + Ensured unsigned char is used with isdigit in getaddrinfo + emulation. +
  • +
  • + Fixed handling of very small but non-zero timeouts. +
  • +
  • + Fixed crash that occurred when an empty buffer sequence was passed to a + composed read or write operation. +
  • +
  • + Added missing operator+ overload in buffers_iterator. +
  • +
  • + Implemented cancellation of null_buffers operations on Windows. +
  • +
+

+ + Asio + 1.4.5 +

+
    +
  • + Improved performance. +
  • +
  • + Reduced compile times. +
  • +
  • + Reduced the size of generated code. +
  • +
  • + Extended the guarantee that background threads don't call user code to + all asynchronous operations. +
  • +
  • + Changed to use edge-triggered epoll on Linux. +
  • +
  • + Changed to use timerfd for dispatching timers on Linux, when + available. +
  • +
  • + Changed to use one-shot notifications with kqueue on Mac OS X and BSD platforms. +
  • +
  • + Added a bitmask type ip::resolver_query_base::flags as per + the TR2 proposal. This type prevents implicit conversion from int + to flags, allowing the compiler to catch cases where users + incorrectly pass a numeric port number as the service name. +
  • +
  • + Added #define NOMINMAX for all Windows compilers. Users can + define (BOOST_)ASIO_NO_NOMINMAX to suppress this definition. +
  • +
  • + Fixed a bug where 0-byte asynchronous reads were incorrectly passing an + error::eof result to the completion handler. +
  • +
  • + Changed the io_control() member functions to always call + ioctl on the underlying descriptor when modifying blocking + mode. +
  • +
  • + Changed the resolver implementation so that it no longer requires the typedefs + InternetProtocol::resolver_query and InternetProtocol::resolver_iterator, + as neither typedef is part of the documented InternetProtocol + requirements. The corresponding typedefs in the ip::tcp, + ip::udp and ip::icmp classes have been deprecated. +
  • +
  • + Fixed out-of-band handling for reactors not based on select(). +
  • +
  • + Added new (BOOST_)ASIO_DISABLE_THREADS macro that allows Asio's + threading support to be independently disabled. +
  • +
  • + Minor documentation improvements. +
  • +
+

+ + Asio + 1.4.4 +

+
    +
  • + Added a new HTTP Server 4 example illustrating the use of stackless coroutines + with Asio. +
  • +
  • + Changed handler allocation and invocation to use boost::addressof + to get the address of handler objects, rather than applying operator& + directly. +
  • +
  • + Restricted MSVC buffer debugging workaround to 2008, as it causes a crash + with 2010 beta 2. +
  • +
  • + Fixed a problem with the lifetime of handler memory, where Windows needs + the OVERLAPPED structure to be valid until both the initiating + function call has returned and the completion packet has been delivered. +
  • +
  • + Don't block signals while performing system calls, but instead restart + the calls if they are interrupted. +
  • +
  • + Documented the guarantee made by strand objects with respect to order of + handler invocation. +
  • +
  • + Changed strands to use a pool of implementations, to make copying of strands + cheaper. +
  • +
  • + Ensured that kqueue support is enabled for BSD platforms. +
  • +
  • + Added a boost_ prefix to the extern "C" + thread entry point function. +
  • +
  • + In getaddrinfo emulation, only check the socket type (SOCK_STREAM + or SOCK_DGRAM) if a service name has been specified. This + should allow the emulation to work with raw sockets. +
  • +
  • + Added a workaround for some broken Windows firewalls that make a socket + appear bound to 0.0.0.0 when it is in fact bound to 127.0.0.1. +
  • +
  • + Applied a fix for reported excessive CPU usage under Solaris. +
  • +
  • + Added some support for platforms that use older compilers such as g++ 2.95. +
  • +
+

+ + Asio + 1.4.3 +

+
    +
  • + Added a new ping example to illustrate the use of ICMP sockets. +
  • +
  • + Changed the buffered*_stream<> templates to treat 0-byte + reads and writes as no-ops, to comply with the documented type requirements + for SyncReadStream, AsyncReadStream, SyncWriteStream + and AsyncWriteStream. +
  • +
  • + Changed some instances of the throw keyword to boost::throw_exception() + to allow Asio to be used when exception support is disabled. Note that + the SSL wrappers still require exception support. +
  • +
  • + Made Asio compatible with the OpenSSL 1.0 beta. +
  • +
  • + Eliminated a redundant system call in the Solaris /dev/poll backend. +
  • +
  • + Fixed a bug in resizing of the bucket array in the internal hash maps. +
  • +
  • + Ensured correct propagation of the error code when a synchronous accept + fails. +
  • +
  • + Ensured correct propagation of the error code when a synchronous read or + write on a Windows HANDLE fails. +
  • +
  • + Fixed failures reported when _GLIBCXX_DEBUG is defined. +
  • +
  • + Fixed custom memory allocation support for timers. +
  • +
  • + Tidied up various warnings reported by g++. +
  • +
  • + Various documentation improvements, including more obvious hyperlinks to + function overloads, header file information, examples for the handler type + requirements, and adding enum values to the index. +
  • +
+

+ + Asio + 1.4.2 +

+
    +
  • + Implement automatic resizing of the bucket array in the internal hash maps. + This is to improve performance for very large numbers of asynchronous operations + and also to reduce memory usage for very small numbers. A new macro (BOOST_)ASIO_HASH_MAP_BUCKETS + may be used to tweak the sizes used for the bucket arrays. (N.B. this feature + introduced a bug which was fixed in Asio 1.4.3 / Boost 1.40.) +
  • +
  • + Add performance optimisation for the Windows IOCP backend for when no timers + are used. +
  • +
  • + Prevent locale settings from affecting formatting of TCP and UDP endpoints. +
  • +
  • + Fix a memory leak that occurred when an asynchronous SSL operation's completion + handler threw an exception. +
  • +
  • + Fix the implementation of io_control() so that it adheres + to the documented type requirements for IoControlCommand. +
  • +
  • + Fix incompatibility between Asio and ncurses.h. +
  • +
  • + On Windows, specifically handle the case when an overlapped ReadFile + call fails with ERROR_MORE_DATA. This enables a hack where + a windows::stream_handle can be used with a message-oriented + named pipe. +
  • +
  • + Fix system call wrappers to always clear the error on success, as POSIX + allows successful system calls to modify errno. +
  • +
  • + Don't include termios.h if (BOOST_)ASIO_DISABLE_SERIAL_PORT + is defined. +
  • +
  • + Cleaned up some more MSVC level 4 warnings. +
  • +
  • + Various documentation fixes. +
  • +
+

+ + Asio + 1.4.1 +

+
    +
  • + Improved compatibility with some Windows firewall software. +
  • +
  • + Ensured arguments to windows::overlapped_ptr::complete() are + correctly passed to the completion handler. +
  • +
  • + Fixed a link problem and multicast failure on QNX. +
  • +
  • + Fixed a compile error in SSL support on MinGW / g++ 3.4.5. +
  • +
  • + Drop back to using a pipe for notification if eventfd is not available + at runtime on Linux. +
  • +
  • + Various minor bug and documentation fixes. +
  • +
+

+ + Asio + 1.4.0 +

+
    +
  • + Enhanced CompletionCondition concept with the signature size_t CompletionCondition(error_code + ec, size_t total), where the return value indicates the maximum + number of bytes to be transferred on the next read or write operation. + (The old CompletionCondition signature is still supported for backwards + compatibility). +
  • +
  • + New windows::overlapped_ptr class to allow arbitrary overlapped + I/O functions (such as TransmitFile) to be used with Asio. +
  • +
  • + On recent versions of Linux, an eventfd descriptor is now + used (rather than a pipe) to interrupt a blocked select/epoll reactor. +
  • +
  • + Added const overloads of lowest_layer(). +
  • +
  • + Synchronous read, write, accept and connect operations are now thread safe + (meaning that it is now permitted to perform concurrent synchronous operations + on an individual socket, if supported by the OS). +
  • +
  • + Reactor-based io_service implementations now use lazy initialisation + to reduce the memory usage of an io_service object used only + as a message queue. +
  • +
+

+ + Asio + 1.2.0 +

+
    +
  • + Added support for serial ports. +
  • +
  • + Added support for UNIX domain sockets. +
  • +
  • + Added support for raw sockets and ICMP. +
  • +
  • + Added wrappers for POSIX stream-oriented file descriptors (excluding regular + files). +
  • +
  • + Added wrappers for Windows stream-oriented HANDLEs such as + named pipes (requires HANDLEs that work with I/O completion + ports). +
  • +
  • + Added wrappers for Windows random-access HANDLEs such as files + (requires HANDLEs that work with I/O completion ports). +
  • +
  • + Added support for reactor-style operations (i.e. they report readiness + but perform no I/O) using a new null_buffers type. +
  • +
  • + Added an iterator type for bytewise traversal of buffer sequences. +
  • +
  • + Added new read_until() and async_read_until() + overloads that take a user-defined function object for locating message + boundaries. +
  • +
  • + Added an experimental two-lock queue (enabled by defining (BOOST_)ASIO_ENABLE_TWO_LOCK_QUEUE) + that may provide better io_service scalability across many + processors. +
  • +
  • + Various fixes, performance improvements, and more complete coverage of + the custom memory allocation support. +
  • +
+

+ + Asio + 1.0.0 +

+

+ First stable release of Asio. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/index.html b/include/asio/doc/asio/index.html new file mode 100644 index 0000000..9fb975f --- /dev/null +++ b/include/asio/doc/asio/index.html @@ -0,0 +1,5585 @@ + + + + + + + + + + + +
asio C++ library
+
+
+PrevUpHome +
+
+
+
+

+Index

+
+
+

Symbols

+
+
~any_executor
+
execution::any_executor, execution::any_executor::~any_executor +
+
~awaitable
+
awaitable, awaitable::~awaitable +
+
~bad_address_cast
+
ip::bad_address_cast, ip::bad_address_cast::~bad_address_cast +
+
~basic_datagram_socket
+
basic_datagram_socket, basic_datagram_socket::~basic_datagram_socket +
+
~basic_deadline_timer
+
basic_deadline_timer, basic_deadline_timer::~basic_deadline_timer +
+
~basic_descriptor
+
posix::basic_descriptor, posix::basic_descriptor::~basic_descriptor +
+
~basic_executor_type
+
+
io_context::basic_executor_type, io_context::basic_executor_type::~basic_executor_type +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::~basic_executor_type +
+
+
~basic_io_object
+
basic_io_object, basic_io_object::~basic_io_object +
+
~basic_overlapped_handle
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::~basic_overlapped_handle +
+
~basic_raw_socket
+
basic_raw_socket, basic_raw_socket::~basic_raw_socket +
+
~basic_resolver
+
ip::basic_resolver, ip::basic_resolver::~basic_resolver +
+
~basic_seq_packet_socket
+
basic_seq_packet_socket, basic_seq_packet_socket::~basic_seq_packet_socket +
+
~basic_serial_port
+
basic_serial_port, basic_serial_port::~basic_serial_port +
+
~basic_signal_set
+
basic_signal_set, basic_signal_set::~basic_signal_set +
+
~basic_socket
+
basic_socket, basic_socket::~basic_socket +
+
~basic_socket_acceptor
+
basic_socket_acceptor, basic_socket_acceptor::~basic_socket_acceptor +
+
~basic_socket_streambuf
+
basic_socket_streambuf, basic_socket_streambuf::~basic_socket_streambuf +
+
~basic_stream_socket
+
basic_stream_socket, basic_stream_socket::~basic_stream_socket +
+
~basic_waitable_timer
+
basic_waitable_timer, basic_waitable_timer::~basic_waitable_timer +
+
~context
+
ssl::context, ssl::context::~context +
+
~context_base
+
ssl::context_base, ssl::context_base::~context_base +
+
~descriptor_base
+
posix::descriptor_base, posix::descriptor_base::~descriptor_base +
+
~error_category
+
error_category, error_category::~error_category +
+
~execution_context
+
execution_context, execution_context::~execution_context +
+
~executor
+
executor, executor::~executor +
+
~executor_binder
+
executor_binder, executor_binder::~executor_binder +
+
~executor_work_guard
+
executor_work_guard, executor_work_guard::~executor_work_guard +
+
~io_context
+
io_context, io_context::~io_context +
+
~overlapped_ptr
+
windows::overlapped_ptr, windows::overlapped_ptr::~overlapped_ptr +
+
~resolver_base
+
ip::resolver_base, ip::resolver_base::~resolver_base +
+
~resolver_query_base
+
ip::resolver_query_base, ip::resolver_query_base::~resolver_query_base +
+
~serial_port_base
+
serial_port_base, serial_port_base::~serial_port_base +
+
~service
+
+
execution_context::service, execution_context::service::~service +
+
io_context::service, io_context::service::~service +
+
+
~socket_base
+
socket_base, socket_base::~socket_base +
+
~strand
+
+
io_context::strand, io_context::strand::~strand +
+
strand, strand::~strand +
+
+
~stream
+
ssl::stream, ssl::stream::~stream +
+
~stream_base
+
ssl::stream_base, ssl::stream_base::~stream_base +
+
~system_context
+
system_context, system_context::~system_context +
+
~system_error
+
system_error, system_error::~system_error +
+
~thread
+
thread, thread::~thread +
+
~thread_pool
+
thread_pool, thread_pool::~thread_pool +
+
~work
+
io_context::work, io_context::work::~work +
+
+
+
+

A

+
+
accept
+
basic_socket_acceptor, basic_socket_acceptor::accept +
+
acceptor
+
+
ip::tcp, ip::tcp::acceptor +
+
local::stream_protocol, local::stream_protocol::acceptor +
+
+
access_denied
+
error::basic_errors, error::basic_errors +
+
add
+
+
basic_signal_set, basic_signal_set::add +
+
time_traits< boost::posix_time::ptime + >, time_traits< + boost::posix_time::ptime >::add +
+
+
address
+
+
ip::address, ip::address::address +
+
ip::basic_endpoint, ip::basic_endpoint::address +
+
ip::network_v4, ip::network_v4::address +
+
ip::network_v6, ip::network_v6::address +
+
+
address_configured
+
+
ip::basic_resolver, ip::basic_resolver::address_configured +
+
ip::basic_resolver_query, ip::basic_resolver_query::address_configured +
+
ip::resolver_base, ip::resolver_base::address_configured +
+
ip::resolver_query_base, ip::resolver_query_base::address_configured +
+
+
address_family_not_supported
+
error::basic_errors, error::basic_errors +
+
address_in_use
+
error::basic_errors, error::basic_errors +
+
address_v4
+
ip::address_v4, ip::address_v4::address_v4 +
+
address_v6
+
ip::address_v6, ip::address_v6::address_v6 +
+
add_certificate_authority
+
ssl::context, ssl::context::add_certificate_authority +
+
add_service
+
+
execution_context, execution_context::add_service +
+
io_context, io_context::add_service +
+
system_context, system_context::add_service +
+
thread_pool, thread_pool::add_service +
+
+
add_verify_path
+
ssl::context, ssl::context::add_verify_path +
+
allocator_t
+
execution::allocator_t, execution::allocator_t::allocator_t +
+
allocator_type
+
use_future_t, use_future_t::allocator_type +
+
allowed
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::allowed +
+
allowed_t
+
execution::blocking_adaptation_t::allowed_t, execution::blocking_adaptation_t::allowed_t::allowed_t +
+
all_matching
+
+
ip::basic_resolver, ip::basic_resolver::all_matching +
+
ip::basic_resolver_query, ip::basic_resolver_query::all_matching +
+
ip::resolver_base, ip::resolver_base::all_matching +
+
ip::resolver_query_base, ip::resolver_query_base::all_matching +
+
+
already_connected
+
error::basic_errors, error::basic_errors +
+
already_open
+
error::misc_errors, error::misc_errors +
+
already_started
+
error::basic_errors, error::basic_errors +
+
always
+
execution::blocking_t, execution::blocking_t::always +
+
always_t
+
execution::blocking_t::always_t, execution::blocking_t::always_t::always_t +
+
any
+
+
ip::address_v4, ip::address_v4::any +
+
ip::address_v6, ip::address_v6::any +
+
+
any_executor
+
execution::any_executor, execution::any_executor::any_executor +
+
any_io_executor, any_io_executor +
+
argument_type
+
executor_binder, executor_binder::argument_type +
+
asio_handler_allocate, asio_handler_allocate +
+
asio_handler_deallocate, asio_handler_deallocate +
+
asio_handler_invoke, asio_handler_invoke +
+
asio_handler_is_continuation, asio_handler_is_continuation +
+
asn1
+
+
ssl::context, ssl::context::file_format +
+
ssl::context_base, ssl::context_base::file_format +
+
+
assign
+
+
basic_datagram_socket, basic_datagram_socket::assign +
+
basic_raw_socket, basic_raw_socket::assign +
+
basic_seq_packet_socket, basic_seq_packet_socket::assign +
+
basic_serial_port, basic_serial_port::assign +
+
basic_socket, basic_socket::assign +
+
basic_socket_acceptor, basic_socket_acceptor::assign +
+
basic_stream_socket, basic_stream_socket::assign +
+
error_code, error_code::assign +
+
posix::basic_descriptor, posix::basic_descriptor::assign +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::assign +
+
windows::basic_object_handle, windows::basic_object_handle::assign +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::assign +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::assign +
+
windows::basic_stream_handle, windows::basic_stream_handle::assign +
+
+
async_accept
+
basic_socket_acceptor, basic_socket_acceptor::async_accept +
+
async_completion
+
async_completion, async_completion::async_completion +
+
async_compose, async_compose +
+
async_connect, async_connect +
+
+
basic_datagram_socket, basic_datagram_socket::async_connect +
+
basic_raw_socket, basic_raw_socket::async_connect +
+
basic_seq_packet_socket, basic_seq_packet_socket::async_connect +
+
basic_socket, basic_socket::async_connect +
+
basic_stream_socket, basic_stream_socket::async_connect +
+
+
async_fill
+
+
buffered_read_stream, buffered_read_stream::async_fill +
+
buffered_stream, buffered_stream::async_fill +
+
+
async_flush
+
+
buffered_stream, buffered_stream::async_flush +
+
buffered_write_stream, buffered_write_stream::async_flush +
+
+
async_handshake
+
ssl::stream, ssl::stream::async_handshake +
+
async_initiate, async_initiate +
+
async_read, async_read +
+
async_read_at, async_read_at +
+
async_read_some
+
+
basic_serial_port, basic_serial_port::async_read_some +
+
basic_stream_socket, basic_stream_socket::async_read_some +
+
buffered_read_stream, buffered_read_stream::async_read_some +
+
buffered_stream, buffered_stream::async_read_some +
+
buffered_write_stream, buffered_write_stream::async_read_some +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::async_read_some +
+
ssl::stream, ssl::stream::async_read_some +
+
windows::basic_stream_handle, windows::basic_stream_handle::async_read_some +
+
+
async_read_some_at
+
windows::basic_random_access_handle, windows::basic_random_access_handle::async_read_some_at +
+
async_read_until, async_read_until +
+
async_receive
+
+
basic_datagram_socket, basic_datagram_socket::async_receive +
+
basic_raw_socket, basic_raw_socket::async_receive +
+
basic_seq_packet_socket, basic_seq_packet_socket::async_receive +
+
basic_stream_socket, basic_stream_socket::async_receive +
+
+
async_receive_from
+
+
basic_datagram_socket, basic_datagram_socket::async_receive_from +
+
basic_raw_socket, basic_raw_socket::async_receive_from +
+
+
async_resolve
+
ip::basic_resolver, ip::basic_resolver::async_resolve +
+
async_result
+
+
async_result, async_result::async_result +
+
async_result< + std::packaged_task< Result(Args...)>, Signature >, async_result< + std::packaged_task< Result(Args...)>, Signature >::async_result +
+
+
async_send
+
+
basic_datagram_socket, basic_datagram_socket::async_send +
+
basic_raw_socket, basic_raw_socket::async_send +
+
basic_seq_packet_socket, basic_seq_packet_socket::async_send +
+
basic_stream_socket, basic_stream_socket::async_send +
+
+
async_send_to
+
+
basic_datagram_socket, basic_datagram_socket::async_send_to +
+
basic_raw_socket, basic_raw_socket::async_send_to +
+
+
async_shutdown
+
ssl::stream, ssl::stream::async_shutdown +
+
async_wait
+
+
basic_datagram_socket, basic_datagram_socket::async_wait +
+
basic_deadline_timer, basic_deadline_timer::async_wait +
+
basic_raw_socket, basic_raw_socket::async_wait +
+
basic_seq_packet_socket, basic_seq_packet_socket::async_wait +
+
basic_signal_set, basic_signal_set::async_wait +
+
basic_socket, basic_socket::async_wait +
+
basic_socket_acceptor, basic_socket_acceptor::async_wait +
+
basic_stream_socket, basic_stream_socket::async_wait +
+
basic_waitable_timer, basic_waitable_timer::async_wait +
+
posix::basic_descriptor, posix::basic_descriptor::async_wait +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::async_wait +
+
windows::basic_object_handle, windows::basic_object_handle::async_wait +
+
+
async_write, async_write +
+
async_write_at, async_write_at +
+
async_write_some
+
+
basic_serial_port, basic_serial_port::async_write_some +
+
basic_stream_socket, basic_stream_socket::async_write_some +
+
buffered_read_stream, buffered_read_stream::async_write_some +
+
buffered_stream, buffered_stream::async_write_some +
+
buffered_write_stream, buffered_write_stream::async_write_some +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::async_write_some +
+
ssl::stream, ssl::stream::async_write_some +
+
windows::basic_stream_handle, windows::basic_stream_handle::async_write_some +
+
+
async_write_some_at
+
windows::basic_random_access_handle, windows::basic_random_access_handle::async_write_some_at +
+
as_default_on
+
+
detached_t, detached_t::as_default_on +
+
use_awaitable_t, use_awaitable_t::as_default_on +
+
+
attach
+
thread_pool, thread_pool::attach +
+
at_mark
+
+
basic_datagram_socket, basic_datagram_socket::at_mark +
+
basic_raw_socket, basic_raw_socket::at_mark +
+
basic_seq_packet_socket, basic_seq_packet_socket::at_mark +
+
basic_socket, basic_socket::at_mark +
+
basic_stream_socket, basic_stream_socket::at_mark +
+
+
available
+
+
basic_datagram_socket, basic_datagram_socket::available +
+
basic_raw_socket, basic_raw_socket::available +
+
basic_seq_packet_socket, basic_seq_packet_socket::available +
+
basic_socket, basic_socket::available +
+
basic_stream_socket, basic_stream_socket::available +
+
+
awaitable
+
awaitable, awaitable::awaitable +
+
+
+
+

B

+
+
bad_address_cast
+
ip::bad_address_cast, ip::bad_address_cast::bad_address_cast +
+
bad_descriptor
+
error::basic_errors, error::basic_errors +
+
bad_executor
+
+
bad_executor, bad_executor::bad_executor +
+
execution::bad_executor, execution::bad_executor::bad_executor +
+
+
basic_address_iterator
+
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::basic_address_iterator +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::basic_address_iterator +
+
+
basic_address_range
+
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::basic_address_range +
+
ip::basic_address_range< + address_v6 >, ip::basic_address_range< + address_v6 >::basic_address_range +
+
+
basic_datagram_socket
+
basic_datagram_socket, basic_datagram_socket::basic_datagram_socket +
+
basic_deadline_timer
+
basic_deadline_timer, basic_deadline_timer::basic_deadline_timer +
+
basic_descriptor
+
posix::basic_descriptor, posix::basic_descriptor::basic_descriptor +
+
basic_endpoint
+
+
generic::basic_endpoint, generic::basic_endpoint::basic_endpoint +
+
ip::basic_endpoint, ip::basic_endpoint::basic_endpoint +
+
local::basic_endpoint, local::basic_endpoint::basic_endpoint +
+
+
basic_executor_type
+
+
io_context::basic_executor_type, io_context::basic_executor_type::basic_executor_type +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::basic_executor_type +
+
+
basic_io_object
+
basic_io_object, basic_io_object::basic_io_object +
+
basic_object_handle
+
windows::basic_object_handle, windows::basic_object_handle::basic_object_handle +
+
basic_overlapped_handle
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::basic_overlapped_handle +
+
basic_random_access_handle
+
windows::basic_random_access_handle, windows::basic_random_access_handle::basic_random_access_handle +
+
basic_raw_socket
+
basic_raw_socket, basic_raw_socket::basic_raw_socket +
+
basic_resolver
+
ip::basic_resolver, ip::basic_resolver::basic_resolver +
+
basic_resolver_entry
+
ip::basic_resolver_entry, ip::basic_resolver_entry::basic_resolver_entry +
+
basic_resolver_iterator
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::basic_resolver_iterator +
+
basic_resolver_query
+
ip::basic_resolver_query, ip::basic_resolver_query::basic_resolver_query +
+
basic_resolver_results
+
ip::basic_resolver_results, ip::basic_resolver_results::basic_resolver_results +
+
basic_seq_packet_socket
+
basic_seq_packet_socket, basic_seq_packet_socket::basic_seq_packet_socket +
+
basic_serial_port
+
basic_serial_port, basic_serial_port::basic_serial_port +
+
basic_signal_set
+
basic_signal_set, basic_signal_set::basic_signal_set +
+
basic_socket
+
basic_socket, basic_socket::basic_socket +
+
basic_socket_acceptor
+
basic_socket_acceptor, basic_socket_acceptor::basic_socket_acceptor +
+
basic_socket_iostream
+
basic_socket_iostream, basic_socket_iostream::basic_socket_iostream +
+
basic_socket_streambuf
+
basic_socket_streambuf, basic_socket_streambuf::basic_socket_streambuf +
+
basic_streambuf
+
basic_streambuf, basic_streambuf::basic_streambuf +
+
basic_streambuf_ref
+
basic_streambuf_ref, basic_streambuf_ref::basic_streambuf_ref +
+
basic_stream_descriptor
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::basic_stream_descriptor +
+
basic_stream_handle
+
windows::basic_stream_handle, windows::basic_stream_handle::basic_stream_handle +
+
basic_stream_socket
+
basic_stream_socket, basic_stream_socket::basic_stream_socket +
+
basic_system_executor
+
basic_system_executor, basic_system_executor::basic_system_executor +
+
basic_waitable_timer
+
basic_waitable_timer, basic_waitable_timer::basic_waitable_timer +
+
basic_yield_context
+
basic_yield_context, basic_yield_context::basic_yield_context +
+
baud_rate
+
serial_port_base::baud_rate, serial_port_base::baud_rate::baud_rate +
+
begin
+
+
buffers_iterator, buffers_iterator::begin +
+
const_buffers_1, const_buffers_1::begin +
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::begin +
+
ip::basic_address_range< + address_v6 >, ip::basic_address_range< + address_v6 >::begin +
+
ip::basic_resolver_results, ip::basic_resolver_results::begin +
+
mutable_buffers_1, mutable_buffers_1::begin +
+
null_buffers, null_buffers::begin +
+
+
bind
+
+
basic_datagram_socket, basic_datagram_socket::bind +
+
basic_raw_socket, basic_raw_socket::bind +
+
basic_seq_packet_socket, basic_seq_packet_socket::bind +
+
basic_socket, basic_socket::bind +
+
basic_socket_acceptor, basic_socket_acceptor::bind +
+
basic_stream_socket, basic_stream_socket::bind +
+
+
bind_executor, bind_executor +
+
blocking_adaptation_t
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::blocking_adaptation_t +
+
blocking_t
+
execution::blocking_t, execution::blocking_t::blocking_t +
+
broadcast
+
+
basic_datagram_socket, basic_datagram_socket::broadcast +
+
basic_raw_socket, basic_raw_socket::broadcast +
+
basic_seq_packet_socket, basic_seq_packet_socket::broadcast +
+
basic_socket, basic_socket::broadcast +
+
basic_socket_acceptor, basic_socket_acceptor::broadcast +
+
basic_stream_socket, basic_stream_socket::broadcast +
+
ip::address_v4, ip::address_v4::broadcast +
+
ip::network_v4, ip::network_v4::broadcast +
+
socket_base, socket_base::broadcast +
+
+
broken_pipe
+
error::basic_errors, error::basic_errors +
+
buffer, buffer +
+
buffered_read_stream
+
buffered_read_stream, buffered_read_stream::buffered_read_stream +
+
buffered_stream
+
buffered_stream, buffered_stream::buffered_stream +
+
buffered_write_stream
+
buffered_write_stream, buffered_write_stream::buffered_write_stream +
+
buffers_begin, buffers_begin +
+
buffers_end, buffers_end +
+
buffers_iterator
+
buffers_iterator, buffers_iterator::buffers_iterator +
+
buffer_cast, buffer_cast +
+
buffer_copy, buffer_copy +
+
buffer_sequence_begin, buffer_sequence_begin +
+
buffer_sequence_end, buffer_sequence_end +
+
buffer_size, buffer_size +
+
bulk_execute
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::bulk_execute +
+
bulk_guarantee_t
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::bulk_guarantee_t +
+
bytes_readable
+
+
basic_datagram_socket, basic_datagram_socket::bytes_readable +
+
basic_raw_socket, basic_raw_socket::bytes_readable +
+
basic_seq_packet_socket, basic_seq_packet_socket::bytes_readable +
+
basic_socket, basic_socket::bytes_readable +
+
basic_socket_acceptor, basic_socket_acceptor::bytes_readable +
+
basic_stream_socket, basic_stream_socket::bytes_readable +
+
posix::basic_descriptor, posix::basic_descriptor::bytes_readable +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::bytes_readable +
+
posix::descriptor_base, posix::descriptor_base::bytes_readable +
+
socket_base, socket_base::bytes_readable +
+
+
bytes_type
+
+
ip::address_v4, ip::address_v4::bytes_type +
+
ip::address_v6, ip::address_v6::bytes_type +
+
+
+
+
+

C

+
+
callee_type
+
basic_yield_context, basic_yield_context::callee_type +
+
caller_type
+
basic_yield_context, basic_yield_context::caller_type +
+
cancel
+
+
basic_datagram_socket, basic_datagram_socket::cancel +
+
basic_deadline_timer, basic_deadline_timer::cancel +
+
basic_raw_socket, basic_raw_socket::cancel +
+
basic_seq_packet_socket, basic_seq_packet_socket::cancel +
+
basic_serial_port, basic_serial_port::cancel +
+
basic_signal_set, basic_signal_set::cancel +
+
basic_socket, basic_socket::cancel +
+
basic_socket_acceptor, basic_socket_acceptor::cancel +
+
basic_stream_socket, basic_stream_socket::cancel +
+
basic_waitable_timer, basic_waitable_timer::cancel +
+
ip::basic_resolver, ip::basic_resolver::cancel +
+
posix::basic_descriptor, posix::basic_descriptor::cancel +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::cancel +
+
windows::basic_object_handle, windows::basic_object_handle::cancel +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::cancel +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::cancel +
+
windows::basic_stream_handle, windows::basic_stream_handle::cancel +
+
+
cancel_one
+
+
basic_deadline_timer, basic_deadline_timer::cancel_one +
+
basic_waitable_timer, basic_waitable_timer::cancel_one +
+
+
canonical
+
+
ip::network_v4, ip::network_v4::canonical +
+
ip::network_v6, ip::network_v6::canonical +
+
+
canonical_name
+
+
ip::basic_resolver, ip::basic_resolver::canonical_name +
+
ip::basic_resolver_query, ip::basic_resolver_query::canonical_name +
+
ip::resolver_base, ip::resolver_base::canonical_name +
+
ip::resolver_query_base, ip::resolver_query_base::canonical_name +
+
+
capacity
+
+
basic_streambuf, basic_streambuf::capacity +
+
basic_streambuf_ref, basic_streambuf_ref::capacity +
+
dynamic_string_buffer, dynamic_string_buffer::capacity +
+
dynamic_vector_buffer, dynamic_vector_buffer::capacity +
+
generic::basic_endpoint, generic::basic_endpoint::capacity +
+
ip::basic_endpoint, ip::basic_endpoint::capacity +
+
local::basic_endpoint, local::basic_endpoint::capacity +
+
+
category
+
error_code, error_code::category +
+
cbegin
+
ip::basic_resolver_results, ip::basic_resolver_results::cbegin +
+
cend
+
ip::basic_resolver_results, ip::basic_resolver_results::cend +
+
character_size
+
serial_port_base::character_size, serial_port_base::character_size::character_size +
+
clear
+
+
basic_signal_set, basic_signal_set::clear +
+
error_code, error_code::clear +
+
+
clear_options
+
ssl::context, ssl::context::clear_options +
+
client
+
+
ssl::stream, ssl::stream::handshake_type +
+
ssl::stream_base, ssl::stream_base::handshake_type +
+
+
clock_type
+
+
basic_socket_iostream, basic_socket_iostream::clock_type +
+
basic_socket_streambuf, basic_socket_streambuf::clock_type +
+
basic_waitable_timer, basic_waitable_timer::clock_type +
+
+
close
+
+
basic_datagram_socket, basic_datagram_socket::close +
+
basic_raw_socket, basic_raw_socket::close +
+
basic_seq_packet_socket, basic_seq_packet_socket::close +
+
basic_serial_port, basic_serial_port::close +
+
basic_socket, basic_socket::close +
+
basic_socket_acceptor, basic_socket_acceptor::close +
+
basic_socket_iostream, basic_socket_iostream::close +
+
basic_socket_streambuf, basic_socket_streambuf::close +
+
basic_stream_socket, basic_stream_socket::close +
+
buffered_read_stream, buffered_read_stream::close +
+
buffered_stream, buffered_stream::close +
+
buffered_write_stream, buffered_write_stream::close +
+
posix::basic_descriptor, posix::basic_descriptor::close +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::close +
+
windows::basic_object_handle, windows::basic_object_handle::close +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::close +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::close +
+
windows::basic_stream_handle, windows::basic_stream_handle::close +
+
+
code
+
system_error, system_error::code +
+
commit
+
+
basic_streambuf, basic_streambuf::commit +
+
basic_streambuf_ref, basic_streambuf_ref::commit +
+
dynamic_string_buffer, dynamic_string_buffer::commit +
+
dynamic_vector_buffer, dynamic_vector_buffer::commit +
+
+
complete
+
windows::overlapped_ptr, windows::overlapped_ptr::complete +
+
completion_handler
+
async_completion, async_completion::completion_handler +
+
completion_handler_type
+
+
async_completion, async_completion::completion_handler_type +
+
async_result, async_result::completion_handler_type +
+
async_result< + std::packaged_task< Result(Args...)>, Signature >, async_result< + std::packaged_task< Result(Args...)>, Signature >::completion_handler_type +
+
+
connect, connect +
+
+
basic_datagram_socket, basic_datagram_socket::connect +
+
basic_raw_socket, basic_raw_socket::connect +
+
basic_seq_packet_socket, basic_seq_packet_socket::connect +
+
basic_socket, basic_socket::connect +
+
basic_socket_iostream, basic_socket_iostream::connect +
+
basic_socket_streambuf, basic_socket_streambuf::connect +
+
basic_stream_socket, basic_stream_socket::connect +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::connect +
+
+
connection_aborted
+
error::basic_errors, error::basic_errors +
+
connection_refused
+
error::basic_errors, error::basic_errors +
+
connection_reset
+
error::basic_errors, error::basic_errors +
+
const_buffer
+
const_buffer, const_buffer::const_buffer +
+
const_buffers_1
+
const_buffers_1, const_buffers_1::const_buffers_1 +
+
const_buffers_type
+
+
basic_streambuf, basic_streambuf::const_buffers_type +
+
basic_streambuf_ref, basic_streambuf_ref::const_buffers_type +
+
dynamic_string_buffer, dynamic_string_buffer::const_buffers_type +
+
dynamic_vector_buffer, dynamic_vector_buffer::const_buffers_type +
+
+
const_iterator
+
+
const_buffers_1, const_buffers_1::const_iterator +
+
ip::basic_resolver_results, ip::basic_resolver_results::const_iterator +
+
mutable_buffers_1, mutable_buffers_1::const_iterator +
+
null_buffers, null_buffers::const_iterator +
+
+
const_reference
+
ip::basic_resolver_results, ip::basic_resolver_results::const_reference +
+
consume
+
+
basic_streambuf, basic_streambuf::consume +
+
basic_streambuf_ref, basic_streambuf_ref::consume +
+
dynamic_string_buffer, dynamic_string_buffer::consume +
+
dynamic_vector_buffer, dynamic_vector_buffer::consume +
+
+
context
+
+
basic_system_executor, basic_system_executor::context +
+
execution::any_executor, execution::any_executor::context +
+
execution_context::service, execution_context::service::context +
+
executor, executor::context +
+
io_context::basic_executor_type, io_context::basic_executor_type::context +
+
io_context::strand, io_context::strand::context +
+
ssl::context, ssl::context::context +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::context +
+
+
continuation
+
execution::relationship_t, execution::relationship_t::continuation +
+
continuation_t
+
execution::relationship_t::continuation_t, execution::relationship_t::continuation_t::continuation_t +
+
coroutine
+
coroutine, coroutine::coroutine +
+
count_type
+
io_context, io_context::count_type +
+
co_spawn, co_spawn +
+
+
+
+

D

+
+
data
+
+
basic_streambuf, basic_streambuf::data +
+
basic_streambuf_ref, basic_streambuf_ref::data +
+
const_buffer, const_buffer::data +
+
const_buffers_1, const_buffers_1::data +
+
dynamic_string_buffer, dynamic_string_buffer::data +
+
dynamic_vector_buffer, dynamic_vector_buffer::data +
+
generic::basic_endpoint, generic::basic_endpoint::data +
+
ip::basic_endpoint, ip::basic_endpoint::data +
+
local::basic_endpoint, local::basic_endpoint::data +
+
mutable_buffer, mutable_buffer::data +
+
mutable_buffers_1, mutable_buffers_1::data +
+
+
datagram_protocol
+
generic::datagram_protocol, generic::datagram_protocol::datagram_protocol +
+
data_type
+
+
generic::basic_endpoint, generic::basic_endpoint::data_type +
+
ip::basic_endpoint, ip::basic_endpoint::data_type +
+
local::basic_endpoint, local::basic_endpoint::data_type +
+
+
deadline_timer, deadline_timer +
+
debug
+
+
basic_datagram_socket, basic_datagram_socket::debug +
+
basic_raw_socket, basic_raw_socket::debug +
+
basic_seq_packet_socket, basic_seq_packet_socket::debug +
+
basic_socket, basic_socket::debug +
+
basic_socket_acceptor, basic_socket_acceptor::debug +
+
basic_stream_socket, basic_stream_socket::debug +
+
socket_base, socket_base::debug +
+
+
default_buffer_size
+
+
buffered_read_stream, buffered_read_stream::default_buffer_size +
+
buffered_write_stream, buffered_write_stream::default_buffer_size +
+
+
default_completion_token_type
+
+
detached_t::executor_with_default, detached_t::executor_with_default::default_completion_token_type +
+
use_awaitable_t::executor_with_default, use_awaitable_t::executor_with_default::default_completion_token_type +
+
+
default_workarounds
+
+
ssl::context, ssl::context::default_workarounds +
+
ssl::context_base, ssl::context_base::default_workarounds +
+
+
defer, defer +
+
+
basic_system_executor, basic_system_executor::defer +
+
executor, executor::defer +
+
io_context::basic_executor_type, io_context::basic_executor_type::defer +
+
io_context::strand, io_context::strand::defer +
+
strand, strand::defer +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::defer +
+
+
dereference
+
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::dereference +
+
ip::basic_resolver_results, ip::basic_resolver_results::dereference +
+
+
destroy
+
+
execution_context, execution_context::destroy +
+
io_context, io_context::destroy +
+
system_context, system_context::destroy +
+
thread_pool, thread_pool::destroy +
+
+
detached, detached +
+
detached_t
+
detached_t, detached_t::detached_t +
+
difference_type
+
+
buffers_iterator, buffers_iterator::difference_type +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::difference_type +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::difference_type +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::difference_type +
+
ip::basic_resolver_results, ip::basic_resolver_results::difference_type +
+
+
disallowed
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::disallowed +
+
disallowed_t
+
execution::blocking_adaptation_t::disallowed_t, execution::blocking_adaptation_t::disallowed_t::disallowed_t +
+
dispatch, dispatch +
+
+
basic_system_executor, basic_system_executor::dispatch +
+
executor, executor::dispatch +
+
io_context, io_context::dispatch +
+
io_context::basic_executor_type, io_context::basic_executor_type::dispatch +
+
io_context::strand, io_context::strand::dispatch +
+
strand, strand::dispatch +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::dispatch +
+
+
do_not_route
+
+
basic_datagram_socket, basic_datagram_socket::do_not_route +
+
basic_raw_socket, basic_raw_socket::do_not_route +
+
basic_seq_packet_socket, basic_seq_packet_socket::do_not_route +
+
basic_socket, basic_socket::do_not_route +
+
basic_socket_acceptor, basic_socket_acceptor::do_not_route +
+
basic_stream_socket, basic_stream_socket::do_not_route +
+
socket_base, socket_base::do_not_route +
+
+
duration
+
+
basic_socket_iostream, basic_socket_iostream::duration +
+
basic_socket_streambuf, basic_socket_streambuf::duration +
+
basic_waitable_timer, basic_waitable_timer::duration +
+
+
duration_type
+
+
basic_deadline_timer, basic_deadline_timer::duration_type +
+
basic_socket_iostream, basic_socket_iostream::duration_type +
+
basic_socket_streambuf, basic_socket_streambuf::duration_type +
+
time_traits< + boost::posix_time::ptime >, time_traits< + boost::posix_time::ptime >::duration_type +
+
+
dynamic_buffer, dynamic_buffer +
+
dynamic_string_buffer
+
dynamic_string_buffer, dynamic_string_buffer::dynamic_string_buffer +
+
dynamic_vector_buffer
+
dynamic_vector_buffer, dynamic_vector_buffer::dynamic_vector_buffer +
+
+
+
+

E

+
+
ec_
+
redirect_error_t, redirect_error_t::ec_ +
+
empty
+
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::empty +
+
ip::basic_address_range< + address_v6 >, ip::basic_address_range< + address_v6 >::empty +
+
ip::basic_resolver_results, ip::basic_resolver_results::empty +
+
+
enable_connection_aborted
+
+
basic_datagram_socket, basic_datagram_socket::enable_connection_aborted +
+
basic_raw_socket, basic_raw_socket::enable_connection_aborted +
+
basic_seq_packet_socket, basic_seq_packet_socket::enable_connection_aborted +
+
basic_socket, basic_socket::enable_connection_aborted +
+
basic_socket_acceptor, basic_socket_acceptor::enable_connection_aborted +
+
basic_stream_socket, basic_stream_socket::enable_connection_aborted +
+
socket_base, socket_base::enable_connection_aborted +
+
+
end
+
+
buffers_iterator, buffers_iterator::end +
+
const_buffers_1, const_buffers_1::end +
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::end +
+
ip::basic_address_range< + address_v6 >, ip::basic_address_range< + address_v6 >::end +
+
ip::basic_resolver_results, ip::basic_resolver_results::end +
+
mutable_buffers_1, mutable_buffers_1::end +
+
null_buffers, null_buffers::end +
+
+
endpoint
+
+
generic::datagram_protocol, generic::datagram_protocol::endpoint +
+
generic::raw_protocol, generic::raw_protocol::endpoint +
+
generic::seq_packet_protocol, generic::seq_packet_protocol::endpoint +
+
generic::stream_protocol, generic::stream_protocol::endpoint +
+
ip::basic_resolver_entry, ip::basic_resolver_entry::endpoint +
+
ip::icmp, ip::icmp::endpoint +
+
ip::tcp, ip::tcp::endpoint +
+
ip::udp, ip::udp::endpoint +
+
local::datagram_protocol, local::datagram_protocol::endpoint +
+
local::stream_protocol, local::stream_protocol::endpoint +
+
+
endpoint_type
+
+
basic_datagram_socket, basic_datagram_socket::endpoint_type +
+
basic_raw_socket, basic_raw_socket::endpoint_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::endpoint_type +
+
basic_socket, basic_socket::endpoint_type +
+
basic_socket_acceptor, basic_socket_acceptor::endpoint_type +
+
basic_socket_iostream, basic_socket_iostream::endpoint_type +
+
basic_socket_streambuf, basic_socket_streambuf::endpoint_type +
+
basic_stream_socket, basic_stream_socket::endpoint_type +
+
ip::basic_resolver, ip::basic_resolver::endpoint_type +
+
ip::basic_resolver_entry, ip::basic_resolver_entry::endpoint_type +
+
ip::basic_resolver_results, ip::basic_resolver_results::endpoint_type +
+
+
eof
+
error::misc_errors, error::misc_errors +
+
equal
+
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::equal +
+
ip::basic_resolver_results, ip::basic_resolver_results::equal +
+
+
error
+
+
basic_socket_iostream, basic_socket_iostream::error +
+
basic_socket_streambuf, basic_socket_streambuf::error +
+
+
error::addrinfo_category, error::addrinfo_category +
+
error::addrinfo_errors, error::addrinfo_errors +
+
error::basic_errors, error::basic_errors +
+
error::get_addrinfo_category, error::get_addrinfo_category +
+
error::get_misc_category, error::get_misc_category +
+
error::get_netdb_category, error::get_netdb_category +
+
error::get_ssl_category, error::get_ssl_category +
+
error::get_system_category, error::get_system_category +
+
error::make_error_code, error::make_error_code +
+
error::misc_category, error::misc_category +
+
error::misc_errors, error::misc_errors +
+
error::netdb_category, error::netdb_category +
+
error::netdb_errors, error::netdb_errors +
+
error::ssl_category, error::ssl_category +
+
error::ssl_errors, error::ssl_errors +
+
error::system_category, error::system_category +
+
error_code
+
error_code, error_code::error_code +
+
even
+
serial_port_base::parity, serial_port_base::parity::type +
+
execute
+
+
basic_system_executor, basic_system_executor::execute +
+
execution::any_executor, execution::any_executor::execute +
+
io_context::basic_executor_type, io_context::basic_executor_type::execute +
+
strand, strand::execute +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::execute +
+
+
execution::allocator, execution::allocator +
+
execution::blocking, execution::blocking +
+
execution::blocking_adaptation, execution::blocking_adaptation +
+
execution::bulk_execute, execution::bulk_execute +
+
execution::bulk_guarantee, execution::bulk_guarantee +
+
execution::connect, execution::connect +
+
execution::context, execution::context +
+
execution::context_as, execution::context_as +
+
execution::execute, execution::execute +
+
execution::mapping, execution::mapping +
+
execution::occupancy, execution::occupancy +
+
execution::outstanding_work, execution::outstanding_work +
+
execution::relationship, execution::relationship +
+
execution::schedule, execution::schedule +
+
execution::sender_base, execution::sender_base +
+
execution::set_done, execution::set_done +
+
execution::set_error, execution::set_error +
+
execution::set_value, execution::set_value +
+
execution::start, execution::start +
+
execution::submit, execution::submit +
+
execution_context
+
execution_context, execution_context::execution_context +
+
executor
+
+
executor, executor::executor +
+
thread_pool, thread_pool::executor +
+
+
executor_arg, executor_arg +
+
executor_arg_t
+
executor_arg_t, executor_arg_t::executor_arg_t +
+
executor_binder
+
executor_binder, executor_binder::executor_binder +
+
executor_t
+
this_coro::executor_t, this_coro::executor_t::executor_t +
+
executor_type
+
+
awaitable, awaitable::executor_type +
+
basic_datagram_socket, basic_datagram_socket::executor_type +
+
basic_deadline_timer, basic_deadline_timer::executor_type +
+
basic_io_object, basic_io_object::executor_type +
+
basic_raw_socket, basic_raw_socket::executor_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::executor_type +
+
basic_serial_port, basic_serial_port::executor_type +
+
basic_signal_set, basic_signal_set::executor_type +
+
basic_socket, basic_socket::executor_type +
+
basic_socket_acceptor, basic_socket_acceptor::executor_type +
+
basic_stream_socket, basic_stream_socket::executor_type +
+
basic_waitable_timer, basic_waitable_timer::executor_type +
+
buffered_read_stream, buffered_read_stream::executor_type +
+
buffered_stream, buffered_stream::executor_type +
+
buffered_write_stream, buffered_write_stream::executor_type +
+
executor_binder, executor_binder::executor_type +
+
executor_work_guard, executor_work_guard::executor_type +
+
io_context, io_context::executor_type +
+
ip::basic_resolver, ip::basic_resolver::executor_type +
+
posix::basic_descriptor, posix::basic_descriptor::executor_type +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::executor_type +
+
ssl::stream, ssl::stream::executor_type +
+
system_context, system_context::executor_type +
+
thread_pool, thread_pool::executor_type +
+
windows::basic_object_handle, windows::basic_object_handle::executor_type +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::executor_type +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::executor_type +
+
windows::basic_stream_handle, windows::basic_stream_handle::executor_type +
+
+
executor_with_default
+
+
detached_t::executor_with_default, detached_t::executor_with_default::executor_with_default +
+
use_awaitable_t::executor_with_default, use_awaitable_t::executor_with_default::executor_with_default +
+
+
executor_work_guard
+
executor_work_guard, executor_work_guard::executor_work_guard +
+
expires_after
+
+
basic_socket_iostream, basic_socket_iostream::expires_after +
+
basic_socket_streambuf, basic_socket_streambuf::expires_after +
+
basic_waitable_timer, basic_waitable_timer::expires_after +
+
+
expires_at
+
+
basic_deadline_timer, basic_deadline_timer::expires_at +
+
basic_socket_iostream, basic_socket_iostream::expires_at +
+
basic_socket_streambuf, basic_socket_streambuf::expires_at +
+
basic_waitable_timer, basic_waitable_timer::expires_at +
+
+
expires_from_now
+
+
basic_deadline_timer, basic_deadline_timer::expires_from_now +
+
basic_socket_iostream, basic_socket_iostream::expires_from_now +
+
basic_socket_streambuf, basic_socket_streambuf::expires_from_now +
+
basic_waitable_timer, basic_waitable_timer::expires_from_now +
+
+
expiry
+
+
basic_socket_iostream, basic_socket_iostream::expiry +
+
basic_socket_streambuf, basic_socket_streambuf::expiry +
+
basic_waitable_timer, basic_waitable_timer::expiry +
+
+
+
+
+

F

+
+
family
+
+
generic::datagram_protocol, generic::datagram_protocol::family +
+
generic::raw_protocol, generic::raw_protocol::family +
+
generic::seq_packet_protocol, generic::seq_packet_protocol::family +
+
generic::stream_protocol, generic::stream_protocol::family +
+
ip::icmp, ip::icmp::family +
+
ip::tcp, ip::tcp::family +
+
ip::udp, ip::udp::family +
+
local::datagram_protocol, local::datagram_protocol::family +
+
local::stream_protocol, local::stream_protocol::family +
+
+
fault
+
error::basic_errors, error::basic_errors +
+
fd_set_failure
+
error::misc_errors, error::misc_errors +
+
file_format
+
+
ssl::context, ssl::context::file_format +
+
ssl::context_base, ssl::context_base::file_format +
+
+
fill
+
+
buffered_read_stream, buffered_read_stream::fill +
+
buffered_stream, buffered_stream::fill +
+
+
find
+
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::find +
+
ip::basic_address_range< + address_v6 >, ip::basic_address_range< + address_v6 >::find +
+
+
first_argument_type
+
executor_binder, executor_binder::first_argument_type +
+
first_exception
+
multiple_exceptions, multiple_exceptions::first_exception +
+
flags
+
+
ip::basic_resolver, ip::basic_resolver::flags +
+
ip::basic_resolver_query, ip::basic_resolver_query::flags +
+
ip::resolver_base, ip::resolver_base::flags +
+
ip::resolver_query_base, ip::resolver_query_base::flags +
+
+
flow_control
+
serial_port_base::flow_control, serial_port_base::flow_control::flow_control +
+
flush
+
+
buffered_stream, buffered_stream::flush +
+
buffered_write_stream, buffered_write_stream::flush +
+
+
fork
+
execution::relationship_t, execution::relationship_t::fork +
+
fork_child
+
+
execution_context, execution_context::fork_event +
+
io_context, io_context::fork_event +
+
system_context, system_context::fork_event +
+
thread_pool, thread_pool::fork_event +
+
+
fork_event
+
+
execution_context, execution_context::fork_event +
+
io_context, io_context::fork_event +
+
system_context, system_context::fork_event +
+
thread_pool, thread_pool::fork_event +
+
+
fork_parent
+
+
execution_context, execution_context::fork_event +
+
io_context, io_context::fork_event +
+
system_context, system_context::fork_event +
+
thread_pool, thread_pool::fork_event +
+
+
fork_prepare
+
+
execution_context, execution_context::fork_event +
+
io_context, io_context::fork_event +
+
system_context, system_context::fork_event +
+
thread_pool, thread_pool::fork_event +
+
+
fork_t
+
execution::relationship_t::fork_t, execution::relationship_t::fork_t::fork_t +
+
for_reading
+
+
ssl::context, ssl::context::password_purpose +
+
ssl::context_base, ssl::context_base::password_purpose +
+
+
for_writing
+
+
ssl::context, ssl::context::password_purpose +
+
ssl::context_base, ssl::context_base::password_purpose +
+
+
from_string
+
+
ip::address, ip::address::from_string +
+
ip::address_v4, ip::address_v4::from_string +
+
ip::address_v6, ip::address_v6::from_string +
+
+
+
+
+

G

+
+
get
+
+
associated_allocator, associated_allocator::get +
+
associated_executor, associated_executor::get +
+
async_result, async_result::get +
+
async_result< + std::packaged_task< Result(Args...)>, Signature >, async_result< + std::packaged_task< Result(Args...)>, Signature >::get +
+
executor_binder, executor_binder::get +
+
windows::overlapped_ptr, windows::overlapped_ptr::get +
+
+
get_allocator
+
use_future_t, use_future_t::get_allocator +
+
get_associated_allocator, get_associated_allocator +
+
get_associated_executor, get_associated_executor +
+
get_executor
+
+
basic_datagram_socket, basic_datagram_socket::get_executor +
+
basic_deadline_timer, basic_deadline_timer::get_executor +
+
basic_io_object, basic_io_object::get_executor +
+
basic_raw_socket, basic_raw_socket::get_executor +
+
basic_seq_packet_socket, basic_seq_packet_socket::get_executor +
+
basic_serial_port, basic_serial_port::get_executor +
+
basic_signal_set, basic_signal_set::get_executor +
+
basic_socket, basic_socket::get_executor +
+
basic_socket_acceptor, basic_socket_acceptor::get_executor +
+
basic_stream_socket, basic_stream_socket::get_executor +
+
basic_waitable_timer, basic_waitable_timer::get_executor +
+
buffered_read_stream, buffered_read_stream::get_executor +
+
buffered_stream, buffered_stream::get_executor +
+
buffered_write_stream, buffered_write_stream::get_executor +
+
executor_binder, executor_binder::get_executor +
+
executor_work_guard, executor_work_guard::get_executor +
+
io_context, io_context::get_executor +
+
ip::basic_resolver, ip::basic_resolver::get_executor +
+
posix::basic_descriptor, posix::basic_descriptor::get_executor +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::get_executor +
+
ssl::stream, ssl::stream::get_executor +
+
system_context, system_context::get_executor +
+
thread_pool, thread_pool::get_executor +
+
windows::basic_object_handle, windows::basic_object_handle::get_executor +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::get_executor +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::get_executor +
+
windows::basic_stream_handle, windows::basic_stream_handle::get_executor +
+
+
get_implementation
+
basic_io_object, basic_io_object::get_implementation +
+
get_inner_executor
+
strand, strand::get_inner_executor +
+
get_io_context
+
+
basic_io_object, basic_io_object::get_io_context +
+
io_context::service, io_context::service::get_io_context +
+
io_context::work, io_context::work::get_io_context +
+
+
get_io_service
+
basic_io_object, basic_io_object::get_io_service +
+
get_option
+
+
basic_datagram_socket, basic_datagram_socket::get_option +
+
basic_raw_socket, basic_raw_socket::get_option +
+
basic_seq_packet_socket, basic_seq_packet_socket::get_option +
+
basic_serial_port, basic_serial_port::get_option +
+
basic_socket, basic_socket::get_option +
+
basic_socket_acceptor, basic_socket_acceptor::get_option +
+
basic_stream_socket, basic_stream_socket::get_option +
+
+
get_service
+
basic_io_object, basic_io_object::get_service +
+
grow
+
+
dynamic_string_buffer, dynamic_string_buffer::grow +
+
dynamic_vector_buffer, dynamic_vector_buffer::grow +
+
+
+
+
+

H

+
+
handshake
+
ssl::stream, ssl::stream::handshake +
+
handshake_type
+
+
ssl::stream, ssl::stream::handshake_type +
+
ssl::stream_base, ssl::stream_base::handshake_type +
+
+
hardware
+
serial_port_base::flow_control, serial_port_base::flow_control::type +
+
has_service
+
+
execution_context, execution_context::has_service +
+
io_context, io_context::has_service +
+
system_context, system_context::has_service +
+
thread_pool, thread_pool::has_service +
+
+
high_resolution_timer, high_resolution_timer +
+
hints
+
ip::basic_resolver_query, ip::basic_resolver_query::hints +
+
hosts
+
+
ip::network_v4, ip::network_v4::hosts +
+
ip::network_v6, ip::network_v6::hosts +
+
+
host_name
+
+
ip::basic_resolver_entry, ip::basic_resolver_entry::host_name +
+
ip::basic_resolver_query, ip::basic_resolver_query::host_name +
+
+
host_name_verification
+
ssl::host_name_verification, ssl::host_name_verification::host_name_verification +
+
host_not_found
+
error::netdb_errors, error::netdb_errors +
+
host_not_found_try_again
+
error::netdb_errors, error::netdb_errors +
+
host_unreachable
+
error::basic_errors, error::basic_errors +
+
+
+
+

I

+
+
id
+
execution_context::id, execution_context::id::id +
+
implementation_type
+
basic_io_object, basic_io_object::implementation_type +
+
increment
+
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::increment +
+
ip::basic_resolver_results, ip::basic_resolver_results::increment +
+
+
index_
+
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::index_ +
+
ip::basic_resolver_results, ip::basic_resolver_results::index_ +
+
+
index_type
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::index_type +
+
initiate
+
async_result, async_result::initiate +
+
inner_executor_type
+
strand, strand::inner_executor_type +
+
interrupted
+
error::basic_errors, error::basic_errors +
+
invalid_argument
+
error::basic_errors, error::basic_errors +
+
invalid_service_owner
+
invalid_service_owner, invalid_service_owner::invalid_service_owner +
+
in_avail
+
+
buffered_read_stream, buffered_read_stream::in_avail +
+
buffered_stream, buffered_stream::in_avail +
+
buffered_write_stream, buffered_write_stream::in_avail +
+
+
in_progress
+
error::basic_errors, error::basic_errors +
+
iostream
+
+
generic::stream_protocol, generic::stream_protocol::iostream +
+
ip::tcp, ip::tcp::iostream +
+
local::stream_protocol, local::stream_protocol::iostream +
+
+
io_context
+
io_context, io_context::io_context +
+
io_control
+
+
basic_datagram_socket, basic_datagram_socket::io_control +
+
basic_raw_socket, basic_raw_socket::io_control +
+
basic_seq_packet_socket, basic_seq_packet_socket::io_control +
+
basic_socket, basic_socket::io_control +
+
basic_socket_acceptor, basic_socket_acceptor::io_control +
+
basic_stream_socket, basic_stream_socket::io_control +
+
posix::basic_descriptor, posix::basic_descriptor::io_control +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::io_control +
+
+
io_service, io_service +
+
ip::address_v4_iterator, ip::address_v4_iterator +
+
ip::address_v4_range, ip::address_v4_range +
+
ip::address_v6_iterator, ip::address_v6_iterator +
+
ip::address_v6_range, ip::address_v6_range +
+
ip::host_name, ip::host_name +
+
ip::multicast::enable_loopback, ip::multicast::enable_loopback +
+
ip::multicast::hops, ip::multicast::hops +
+
ip::multicast::join_group, ip::multicast::join_group +
+
ip::multicast::leave_group, ip::multicast::leave_group +
+
ip::multicast::outbound_interface, ip::multicast::outbound_interface +
+
ip::unicast::hops, ip::unicast::hops +
+
ip::v4_mapped_t, ip::v4_mapped_t +
+
ip::v6_only, ip::v6_only +
+
is_applicable_property_v
+
+
execution::allocator_t, execution::allocator_t::is_applicable_property_v +
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::is_applicable_property_v +
+
execution::blocking_adaptation_t::allowed_t, execution::blocking_adaptation_t::allowed_t::is_applicable_property_v +
+
execution::blocking_adaptation_t::disallowed_t, execution::blocking_adaptation_t::disallowed_t::is_applicable_property_v +
+
execution::blocking_t, execution::blocking_t::is_applicable_property_v +
+
execution::blocking_t::always_t, execution::blocking_t::always_t::is_applicable_property_v +
+
execution::blocking_t::never_t, execution::blocking_t::never_t::is_applicable_property_v +
+
execution::blocking_t::possibly_t, execution::blocking_t::possibly_t::is_applicable_property_v +
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::is_applicable_property_v +
+
execution::bulk_guarantee_t::parallel_t, execution::bulk_guarantee_t::parallel_t::is_applicable_property_v +
+
execution::bulk_guarantee_t::sequenced_t, execution::bulk_guarantee_t::sequenced_t::is_applicable_property_v +
+
execution::bulk_guarantee_t::unsequenced_t, execution::bulk_guarantee_t::unsequenced_t::is_applicable_property_v +
+
execution::context_as_t, execution::context_as_t::is_applicable_property_v +
+
execution::context_t, execution::context_t::is_applicable_property_v +
+
execution::mapping_t, execution::mapping_t::is_applicable_property_v +
+
execution::mapping_t::new_thread_t, execution::mapping_t::new_thread_t::is_applicable_property_v +
+
execution::mapping_t::other_t, execution::mapping_t::other_t::is_applicable_property_v +
+
execution::mapping_t::thread_t, execution::mapping_t::thread_t::is_applicable_property_v +
+
execution::occupancy_t, execution::occupancy_t::is_applicable_property_v +
+
execution::outstanding_work_t, execution::outstanding_work_t::is_applicable_property_v +
+
execution::outstanding_work_t::tracked_t, execution::outstanding_work_t::tracked_t::is_applicable_property_v +
+
execution::outstanding_work_t::untracked_t, execution::outstanding_work_t::untracked_t::is_applicable_property_v +
+
execution::prefer_only, execution::prefer_only::is_applicable_property_v +
+
execution::relationship_t, execution::relationship_t::is_applicable_property_v +
+
execution::relationship_t::continuation_t, execution::relationship_t::continuation_t::is_applicable_property_v +
+
execution::relationship_t::fork_t, execution::relationship_t::fork_t::is_applicable_property_v +
+
+
is_child
+
coroutine, coroutine::is_child +
+
is_class_a
+
ip::address_v4, ip::address_v4::is_class_a +
+
is_class_b
+
ip::address_v4, ip::address_v4::is_class_b +
+
is_class_c
+
ip::address_v4, ip::address_v4::is_class_c +
+
is_complete
+
coroutine, coroutine::is_complete +
+
is_host
+
+
ip::network_v4, ip::network_v4::is_host +
+
ip::network_v6, ip::network_v6::is_host +
+
+
is_link_local
+
ip::address_v6, ip::address_v6::is_link_local +
+
is_loopback
+
+
ip::address, ip::address::is_loopback +
+
ip::address_v4, ip::address_v4::is_loopback +
+
ip::address_v6, ip::address_v6::is_loopback +
+
+
is_multicast
+
+
ip::address, ip::address::is_multicast +
+
ip::address_v4, ip::address_v4::is_multicast +
+
ip::address_v6, ip::address_v6::is_multicast +
+
+
is_multicast_global
+
ip::address_v6, ip::address_v6::is_multicast_global +
+
is_multicast_link_local
+
ip::address_v6, ip::address_v6::is_multicast_link_local +
+
is_multicast_node_local
+
ip::address_v6, ip::address_v6::is_multicast_node_local +
+
is_multicast_org_local
+
ip::address_v6, ip::address_v6::is_multicast_org_local +
+
is_multicast_site_local
+
ip::address_v6, ip::address_v6::is_multicast_site_local +
+
is_open
+
+
basic_datagram_socket, basic_datagram_socket::is_open +
+
basic_raw_socket, basic_raw_socket::is_open +
+
basic_seq_packet_socket, basic_seq_packet_socket::is_open +
+
basic_serial_port, basic_serial_port::is_open +
+
basic_socket, basic_socket::is_open +
+
basic_socket_acceptor, basic_socket_acceptor::is_open +
+
basic_stream_socket, basic_stream_socket::is_open +
+
posix::basic_descriptor, posix::basic_descriptor::is_open +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::is_open +
+
windows::basic_object_handle, windows::basic_object_handle::is_open +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::is_open +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::is_open +
+
windows::basic_stream_handle, windows::basic_stream_handle::is_open +
+
+
is_parent
+
coroutine, coroutine::is_parent +
+
is_preferable
+
+
execution::allocator_t, execution::allocator_t::is_preferable +
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::is_preferable +
+
execution::blocking_adaptation_t::allowed_t, execution::blocking_adaptation_t::allowed_t::is_preferable +
+
execution::blocking_adaptation_t::disallowed_t, execution::blocking_adaptation_t::disallowed_t::is_preferable +
+
execution::blocking_t, execution::blocking_t::is_preferable +
+
execution::blocking_t::always_t, execution::blocking_t::always_t::is_preferable +
+
execution::blocking_t::never_t, execution::blocking_t::never_t::is_preferable +
+
execution::blocking_t::possibly_t, execution::blocking_t::possibly_t::is_preferable +
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::is_preferable +
+
execution::bulk_guarantee_t::parallel_t, execution::bulk_guarantee_t::parallel_t::is_preferable +
+
execution::bulk_guarantee_t::sequenced_t, execution::bulk_guarantee_t::sequenced_t::is_preferable +
+
execution::bulk_guarantee_t::unsequenced_t, execution::bulk_guarantee_t::unsequenced_t::is_preferable +
+
execution::context_as_t, execution::context_as_t::is_preferable +
+
execution::context_t, execution::context_t::is_preferable +
+
execution::mapping_t, execution::mapping_t::is_preferable +
+
execution::mapping_t::new_thread_t, execution::mapping_t::new_thread_t::is_preferable +
+
execution::mapping_t::other_t, execution::mapping_t::other_t::is_preferable +
+
execution::mapping_t::thread_t, execution::mapping_t::thread_t::is_preferable +
+
execution::occupancy_t, execution::occupancy_t::is_preferable +
+
execution::outstanding_work_t, execution::outstanding_work_t::is_preferable +
+
execution::outstanding_work_t::tracked_t, execution::outstanding_work_t::tracked_t::is_preferable +
+
execution::outstanding_work_t::untracked_t, execution::outstanding_work_t::untracked_t::is_preferable +
+
execution::prefer_only, execution::prefer_only::is_preferable +
+
execution::relationship_t, execution::relationship_t::is_preferable +
+
execution::relationship_t::continuation_t, execution::relationship_t::continuation_t::is_preferable +
+
execution::relationship_t::fork_t, execution::relationship_t::fork_t::is_preferable +
+
+
is_requirable
+
+
execution::allocator_t, execution::allocator_t::is_requirable +
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::is_requirable +
+
execution::blocking_adaptation_t::allowed_t, execution::blocking_adaptation_t::allowed_t::is_requirable +
+
execution::blocking_adaptation_t::disallowed_t, execution::blocking_adaptation_t::disallowed_t::is_requirable +
+
execution::blocking_t, execution::blocking_t::is_requirable +
+
execution::blocking_t::always_t, execution::blocking_t::always_t::is_requirable +
+
execution::blocking_t::never_t, execution::blocking_t::never_t::is_requirable +
+
execution::blocking_t::possibly_t, execution::blocking_t::possibly_t::is_requirable +
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::is_requirable +
+
execution::bulk_guarantee_t::parallel_t, execution::bulk_guarantee_t::parallel_t::is_requirable +
+
execution::bulk_guarantee_t::sequenced_t, execution::bulk_guarantee_t::sequenced_t::is_requirable +
+
execution::bulk_guarantee_t::unsequenced_t, execution::bulk_guarantee_t::unsequenced_t::is_requirable +
+
execution::context_as_t, execution::context_as_t::is_requirable +
+
execution::context_t, execution::context_t::is_requirable +
+
execution::mapping_t, execution::mapping_t::is_requirable +
+
execution::mapping_t::new_thread_t, execution::mapping_t::new_thread_t::is_requirable +
+
execution::mapping_t::other_t, execution::mapping_t::other_t::is_requirable +
+
execution::mapping_t::thread_t, execution::mapping_t::thread_t::is_requirable +
+
execution::occupancy_t, execution::occupancy_t::is_requirable +
+
execution::outstanding_work_t, execution::outstanding_work_t::is_requirable +
+
execution::outstanding_work_t::tracked_t, execution::outstanding_work_t::tracked_t::is_requirable +
+
execution::outstanding_work_t::untracked_t, execution::outstanding_work_t::untracked_t::is_requirable +
+
execution::prefer_only, execution::prefer_only::is_requirable +
+
execution::relationship_t, execution::relationship_t::is_requirable +
+
execution::relationship_t::continuation_t, execution::relationship_t::continuation_t::is_requirable +
+
execution::relationship_t::fork_t, execution::relationship_t::fork_t::is_requirable +
+
+
is_site_local
+
ip::address_v6, ip::address_v6::is_site_local +
+
is_subnet_of
+
+
ip::network_v4, ip::network_v4::is_subnet_of +
+
ip::network_v6, ip::network_v6::is_subnet_of +
+
+
is_unspecified
+
+
ip::address, ip::address::is_unspecified +
+
ip::address_v4, ip::address_v4::is_unspecified +
+
ip::address_v6, ip::address_v6::is_unspecified +
+
+
is_v4
+
ip::address, ip::address::is_v4 +
+
is_v4_compatible
+
ip::address_v6, ip::address_v6::is_v4_compatible +
+
is_v4_mapped
+
ip::address_v6, ip::address_v6::is_v4_mapped +
+
is_v6
+
ip::address, ip::address::is_v6 +
+
iterator
+
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::iterator +
+
ip::basic_address_range< + address_v6 >, ip::basic_address_range< + address_v6 >::iterator +
+
ip::basic_resolver, ip::basic_resolver::iterator +
+
ip::basic_resolver_results, ip::basic_resolver_results::iterator +
+
+
iterator_category
+
+
buffers_iterator, buffers_iterator::iterator_category +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::iterator_category +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::iterator_category +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::iterator_category +
+
ip::basic_resolver_results, ip::basic_resolver_results::iterator_category +
+
+
+
+
+

J

+
+
join
+
+
system_context, system_context::join +
+
thread, thread::join +
+
thread_pool, thread_pool::join +
+
+
+
+
+

K

+
+
keep_alive
+
+
basic_datagram_socket, basic_datagram_socket::keep_alive +
+
basic_raw_socket, basic_raw_socket::keep_alive +
+
basic_seq_packet_socket, basic_seq_packet_socket::keep_alive +
+
basic_socket, basic_socket::keep_alive +
+
basic_socket_acceptor, basic_socket_acceptor::keep_alive +
+
basic_stream_socket, basic_stream_socket::keep_alive +
+
socket_base, socket_base::keep_alive +
+
+
+
+
+

L

+
+
less_than
+
time_traits< + boost::posix_time::ptime >, time_traits< + boost::posix_time::ptime >::less_than +
+
linger
+
+
basic_datagram_socket, basic_datagram_socket::linger +
+
basic_raw_socket, basic_raw_socket::linger +
+
basic_seq_packet_socket, basic_seq_packet_socket::linger +
+
basic_socket, basic_socket::linger +
+
basic_socket_acceptor, basic_socket_acceptor::linger +
+
basic_stream_socket, basic_stream_socket::linger +
+
socket_base, socket_base::linger +
+
+
listen
+
basic_socket_acceptor, basic_socket_acceptor::listen +
+
load
+
+
serial_port_base::baud_rate, serial_port_base::baud_rate::load +
+
serial_port_base::character_size, serial_port_base::character_size::load +
+
serial_port_base::flow_control, serial_port_base::flow_control::load +
+
serial_port_base::parity, serial_port_base::parity::load +
+
serial_port_base::stop_bits, serial_port_base::stop_bits::load +
+
+
load_verify_file
+
ssl::context, ssl::context::load_verify_file +
+
local::connect_pair, local::connect_pair +
+
local_endpoint
+
+
basic_datagram_socket, basic_datagram_socket::local_endpoint +
+
basic_raw_socket, basic_raw_socket::local_endpoint +
+
basic_seq_packet_socket, basic_seq_packet_socket::local_endpoint +
+
basic_socket, basic_socket::local_endpoint +
+
basic_socket_acceptor, basic_socket_acceptor::local_endpoint +
+
basic_stream_socket, basic_stream_socket::local_endpoint +
+
+
loopback
+
+
ip::address_v4, ip::address_v4::loopback +
+
ip::address_v6, ip::address_v6::loopback +
+
+
lowest_layer
+
+
basic_datagram_socket, basic_datagram_socket::lowest_layer +
+
basic_raw_socket, basic_raw_socket::lowest_layer +
+
basic_seq_packet_socket, basic_seq_packet_socket::lowest_layer +
+
basic_serial_port, basic_serial_port::lowest_layer +
+
basic_socket, basic_socket::lowest_layer +
+
basic_stream_socket, basic_stream_socket::lowest_layer +
+
buffered_read_stream, buffered_read_stream::lowest_layer +
+
buffered_stream, buffered_stream::lowest_layer +
+
buffered_write_stream, buffered_write_stream::lowest_layer +
+
posix::basic_descriptor, posix::basic_descriptor::lowest_layer +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::lowest_layer +
+
ssl::stream, ssl::stream::lowest_layer +
+
windows::basic_object_handle, windows::basic_object_handle::lowest_layer +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::lowest_layer +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::lowest_layer +
+
windows::basic_stream_handle, windows::basic_stream_handle::lowest_layer +
+
+
lowest_layer_type
+
+
basic_datagram_socket, basic_datagram_socket::lowest_layer_type +
+
basic_raw_socket, basic_raw_socket::lowest_layer_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::lowest_layer_type +
+
basic_serial_port, basic_serial_port::lowest_layer_type +
+
basic_socket, basic_socket::lowest_layer_type +
+
basic_stream_socket, basic_stream_socket::lowest_layer_type +
+
buffered_read_stream, buffered_read_stream::lowest_layer_type +
+
buffered_stream, buffered_stream::lowest_layer_type +
+
buffered_write_stream, buffered_write_stream::lowest_layer_type +
+
posix::basic_descriptor, posix::basic_descriptor::lowest_layer_type +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::lowest_layer_type +
+
ssl::stream, ssl::stream::lowest_layer_type +
+
windows::basic_object_handle, windows::basic_object_handle::lowest_layer_type +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::lowest_layer_type +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::lowest_layer_type +
+
windows::basic_stream_handle, windows::basic_stream_handle::lowest_layer_type +
+
+
+
+
+

M

+
+
make_address
+
ip::address, ip::address::make_address +
+
make_address_v4
+
ip::address_v4, ip::address_v4::make_address_v4 +
+
make_address_v6
+
ip::address_v6, ip::address_v6::make_address_v6 +
+
make_network_v4
+
+
ip::address_v4, ip::address_v4::make_network_v4 +
+
ip::network_v4, ip::network_v4::make_network_v4 +
+
+
make_network_v6
+
+
ip::address_v6, ip::address_v6::make_network_v6 +
+
ip::network_v6, ip::network_v6::make_network_v6 +
+
+
make_service
+
+
execution_context, execution_context::make_service +
+
io_context, io_context::make_service +
+
system_context, system_context::make_service +
+
thread_pool, thread_pool::make_service +
+
+
make_strand, make_strand +
+
make_work_guard, make_work_guard +
+
mapping_t
+
execution::mapping_t, execution::mapping_t::mapping_t +
+
max_connections
+
+
basic_datagram_socket, basic_datagram_socket::max_connections +
+
basic_raw_socket, basic_raw_socket::max_connections +
+
basic_seq_packet_socket, basic_seq_packet_socket::max_connections +
+
basic_socket, basic_socket::max_connections +
+
basic_socket_acceptor, basic_socket_acceptor::max_connections +
+
basic_stream_socket, basic_stream_socket::max_connections +
+
socket_base, socket_base::max_connections +
+
+
max_listen_connections
+
+
basic_datagram_socket, basic_datagram_socket::max_listen_connections +
+
basic_raw_socket, basic_raw_socket::max_listen_connections +
+
basic_seq_packet_socket, basic_seq_packet_socket::max_listen_connections +
+
basic_socket, basic_socket::max_listen_connections +
+
basic_socket_acceptor, basic_socket_acceptor::max_listen_connections +
+
basic_stream_socket, basic_stream_socket::max_listen_connections +
+
socket_base, socket_base::max_listen_connections +
+
+
max_size
+
+
basic_streambuf, basic_streambuf::max_size +
+
basic_streambuf_ref, basic_streambuf_ref::max_size +
+
dynamic_string_buffer, dynamic_string_buffer::max_size +
+
dynamic_vector_buffer, dynamic_vector_buffer::max_size +
+
ip::basic_resolver_results, ip::basic_resolver_results::max_size +
+
+
message
+
+
error_category, error_category::message +
+
error_code, error_code::message +
+
+
message_do_not_route
+
+
basic_datagram_socket, basic_datagram_socket::message_do_not_route +
+
basic_raw_socket, basic_raw_socket::message_do_not_route +
+
basic_seq_packet_socket, basic_seq_packet_socket::message_do_not_route +
+
basic_socket, basic_socket::message_do_not_route +
+
basic_socket_acceptor, basic_socket_acceptor::message_do_not_route +
+
basic_stream_socket, basic_stream_socket::message_do_not_route +
+
socket_base, socket_base::message_do_not_route +
+
+
message_end_of_record
+
+
basic_datagram_socket, basic_datagram_socket::message_end_of_record +
+
basic_raw_socket, basic_raw_socket::message_end_of_record +
+
basic_seq_packet_socket, basic_seq_packet_socket::message_end_of_record +
+
basic_socket, basic_socket::message_end_of_record +
+
basic_socket_acceptor, basic_socket_acceptor::message_end_of_record +
+
basic_stream_socket, basic_stream_socket::message_end_of_record +
+
socket_base, socket_base::message_end_of_record +
+
+
message_flags
+
+
basic_datagram_socket, basic_datagram_socket::message_flags +
+
basic_raw_socket, basic_raw_socket::message_flags +
+
basic_seq_packet_socket, basic_seq_packet_socket::message_flags +
+
basic_socket, basic_socket::message_flags +
+
basic_socket_acceptor, basic_socket_acceptor::message_flags +
+
basic_stream_socket, basic_stream_socket::message_flags +
+
socket_base, socket_base::message_flags +
+
+
message_out_of_band
+
+
basic_datagram_socket, basic_datagram_socket::message_out_of_band +
+
basic_raw_socket, basic_raw_socket::message_out_of_band +
+
basic_seq_packet_socket, basic_seq_packet_socket::message_out_of_band +
+
basic_socket, basic_socket::message_out_of_band +
+
basic_socket_acceptor, basic_socket_acceptor::message_out_of_band +
+
basic_stream_socket, basic_stream_socket::message_out_of_band +
+
socket_base, socket_base::message_out_of_band +
+
+
message_peek
+
+
basic_datagram_socket, basic_datagram_socket::message_peek +
+
basic_raw_socket, basic_raw_socket::message_peek +
+
basic_seq_packet_socket, basic_seq_packet_socket::message_peek +
+
basic_socket, basic_socket::message_peek +
+
basic_socket_acceptor, basic_socket_acceptor::message_peek +
+
basic_stream_socket, basic_stream_socket::message_peek +
+
socket_base, socket_base::message_peek +
+
+
message_size
+
error::basic_errors, error::basic_errors +
+
method
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
multiple_exceptions
+
multiple_exceptions, multiple_exceptions::multiple_exceptions +
+
mutable_buffer
+
mutable_buffer, mutable_buffer::mutable_buffer +
+
mutable_buffers_1
+
mutable_buffers_1, mutable_buffers_1::mutable_buffers_1 +
+
mutable_buffers_type
+
+
basic_streambuf, basic_streambuf::mutable_buffers_type +
+
basic_streambuf_ref, basic_streambuf_ref::mutable_buffers_type +
+
dynamic_string_buffer, dynamic_string_buffer::mutable_buffers_type +
+
dynamic_vector_buffer, dynamic_vector_buffer::mutable_buffers_type +
+
+
+
+
+

N

+
+
name
+
error_category, error_category::name +
+
name_too_long
+
error::basic_errors, error::basic_errors +
+
native_handle
+
+
basic_datagram_socket, basic_datagram_socket::native_handle +
+
basic_raw_socket, basic_raw_socket::native_handle +
+
basic_seq_packet_socket, basic_seq_packet_socket::native_handle +
+
basic_serial_port, basic_serial_port::native_handle +
+
basic_socket, basic_socket::native_handle +
+
basic_socket_acceptor, basic_socket_acceptor::native_handle +
+
basic_stream_socket, basic_stream_socket::native_handle +
+
posix::basic_descriptor, posix::basic_descriptor::native_handle +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::native_handle +
+
ssl::context, ssl::context::native_handle +
+
ssl::stream, ssl::stream::native_handle +
+
ssl::verify_context, ssl::verify_context::native_handle +
+
windows::basic_object_handle, windows::basic_object_handle::native_handle +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::native_handle +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::native_handle +
+
windows::basic_stream_handle, windows::basic_stream_handle::native_handle +
+
+
native_handle_type
+
+
basic_datagram_socket, basic_datagram_socket::native_handle_type +
+
basic_raw_socket, basic_raw_socket::native_handle_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::native_handle_type +
+
basic_serial_port, basic_serial_port::native_handle_type +
+
basic_socket, basic_socket::native_handle_type +
+
basic_socket_acceptor, basic_socket_acceptor::native_handle_type +
+
basic_stream_socket, basic_stream_socket::native_handle_type +
+
posix::basic_descriptor, posix::basic_descriptor::native_handle_type +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::native_handle_type +
+
ssl::context, ssl::context::native_handle_type +
+
ssl::stream, ssl::stream::native_handle_type +
+
ssl::verify_context, ssl::verify_context::native_handle_type +
+
windows::basic_object_handle, windows::basic_object_handle::native_handle_type +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::native_handle_type +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::native_handle_type +
+
windows::basic_stream_handle, windows::basic_stream_handle::native_handle_type +
+
+
native_non_blocking
+
+
basic_datagram_socket, basic_datagram_socket::native_non_blocking +
+
basic_raw_socket, basic_raw_socket::native_non_blocking +
+
basic_seq_packet_socket, basic_seq_packet_socket::native_non_blocking +
+
basic_socket, basic_socket::native_non_blocking +
+
basic_socket_acceptor, basic_socket_acceptor::native_non_blocking +
+
basic_stream_socket, basic_stream_socket::native_non_blocking +
+
posix::basic_descriptor, posix::basic_descriptor::native_non_blocking +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::native_non_blocking +
+
+
netmask
+
+
ip::address_v4, ip::address_v4::netmask +
+
ip::network_v4, ip::network_v4::netmask +
+
+
network
+
+
ip::network_v4, ip::network_v4::network +
+
ip::network_v6, ip::network_v6::network +
+
+
network_down
+
error::basic_errors, error::basic_errors +
+
network_reset
+
error::basic_errors, error::basic_errors +
+
network_unreachable
+
error::basic_errors, error::basic_errors +
+
network_v4
+
ip::network_v4, ip::network_v4::network_v4 +
+
network_v6
+
ip::network_v6, ip::network_v6::network_v6 +
+
never
+
execution::blocking_t, execution::blocking_t::never +
+
never_t
+
execution::blocking_t::never_t, execution::blocking_t::never_t::never_t +
+
new_thread
+
execution::mapping_t, execution::mapping_t::new_thread +
+
new_thread_t
+
execution::mapping_t::new_thread_t, execution::mapping_t::new_thread_t::new_thread_t +
+
next_layer
+
+
buffered_read_stream, buffered_read_stream::next_layer +
+
buffered_stream, buffered_stream::next_layer +
+
buffered_write_stream, buffered_write_stream::next_layer +
+
ssl::stream, ssl::stream::next_layer +
+
+
next_layer_type
+
+
buffered_read_stream, buffered_read_stream::next_layer_type +
+
buffered_stream, buffered_stream::next_layer_type +
+
buffered_write_stream, buffered_write_stream::next_layer_type +
+
ssl::stream, ssl::stream::next_layer_type +
+
+
none
+
+
serial_port_base::flow_control, serial_port_base::flow_control::type +
+
serial_port_base::parity, serial_port_base::parity::type +
+
+
non_blocking
+
+
basic_datagram_socket, basic_datagram_socket::non_blocking +
+
basic_raw_socket, basic_raw_socket::non_blocking +
+
basic_seq_packet_socket, basic_seq_packet_socket::non_blocking +
+
basic_socket, basic_socket::non_blocking +
+
basic_socket_acceptor, basic_socket_acceptor::non_blocking +
+
basic_stream_socket, basic_stream_socket::non_blocking +
+
posix::basic_descriptor, posix::basic_descriptor::non_blocking +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::non_blocking +
+
+
notify_fork
+
+
execution_context, execution_context::notify_fork +
+
execution_context::service, execution_context::service::notify_fork +
+
io_context, io_context::notify_fork +
+
system_context, system_context::notify_fork +
+
thread_pool, thread_pool::notify_fork +
+
+
not_connected
+
error::basic_errors, error::basic_errors +
+
not_found
+
error::misc_errors, error::misc_errors +
+
not_socket
+
error::basic_errors, error::basic_errors +
+
now
+
time_traits< boost::posix_time::ptime + >, time_traits< + boost::posix_time::ptime >::now +
+
no_buffer_space
+
error::basic_errors, error::basic_errors +
+
no_compression
+
+
ssl::context, ssl::context::no_compression +
+
ssl::context_base, ssl::context_base::no_compression +
+
+
no_data
+
error::netdb_errors, error::netdb_errors +
+
no_delay
+
ip::tcp, ip::tcp::no_delay +
+
no_descriptors
+
error::basic_errors, error::basic_errors +
+
no_memory
+
error::basic_errors, error::basic_errors +
+
no_permission
+
error::basic_errors, error::basic_errors +
+
no_protocol_option
+
error::basic_errors, error::basic_errors +
+
no_recovery
+
error::netdb_errors, error::netdb_errors +
+
no_sslv2
+
+
ssl::context, ssl::context::no_sslv2 +
+
ssl::context_base, ssl::context_base::no_sslv2 +
+
+
no_sslv3
+
+
ssl::context, ssl::context::no_sslv3 +
+
ssl::context_base, ssl::context_base::no_sslv3 +
+
+
no_such_device
+
error::basic_errors, error::basic_errors +
+
no_tlsv1
+
+
ssl::context, ssl::context::no_tlsv1 +
+
ssl::context_base, ssl::context_base::no_tlsv1 +
+
+
no_tlsv1_1
+
+
ssl::context, ssl::context::no_tlsv1_1 +
+
ssl::context_base, ssl::context_base::no_tlsv1_1 +
+
+
no_tlsv1_2
+
+
ssl::context, ssl::context::no_tlsv1_2 +
+
ssl::context_base, ssl::context_base::no_tlsv1_2 +
+
+
no_tlsv1_3
+
+
ssl::context, ssl::context::no_tlsv1_3 +
+
ssl::context_base, ssl::context_base::no_tlsv1_3 +
+
+
numeric_host
+
+
ip::basic_resolver, ip::basic_resolver::numeric_host +
+
ip::basic_resolver_query, ip::basic_resolver_query::numeric_host +
+
ip::resolver_base, ip::resolver_base::numeric_host +
+
ip::resolver_query_base, ip::resolver_query_base::numeric_host +
+
+
numeric_service
+
+
ip::basic_resolver, ip::basic_resolver::numeric_service +
+
ip::basic_resolver_query, ip::basic_resolver_query::numeric_service +
+
ip::resolver_base, ip::resolver_base::numeric_service +
+
ip::resolver_query_base, ip::resolver_query_base::numeric_service +
+
+
+
+
+

O

+
+
odd
+
serial_port_base::parity, serial_port_base::parity::type +
+
one
+
serial_port_base::stop_bits, serial_port_base::stop_bits::type +
+
onepointfive
+
serial_port_base::stop_bits, serial_port_base::stop_bits::type +
+
on_work_finished
+
+
basic_system_executor, basic_system_executor::on_work_finished +
+
executor, executor::on_work_finished +
+
io_context::basic_executor_type, io_context::basic_executor_type::on_work_finished +
+
io_context::strand, io_context::strand::on_work_finished +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::on_work_finished +
+
+
on_work_started
+
+
basic_system_executor, basic_system_executor::on_work_started +
+
executor, executor::on_work_started +
+
io_context::basic_executor_type, io_context::basic_executor_type::on_work_started +
+
io_context::strand, io_context::strand::on_work_started +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::on_work_started +
+
+
open
+
+
basic_datagram_socket, basic_datagram_socket::open +
+
basic_raw_socket, basic_raw_socket::open +
+
basic_seq_packet_socket, basic_seq_packet_socket::open +
+
basic_serial_port, basic_serial_port::open +
+
basic_socket, basic_socket::open +
+
basic_socket_acceptor, basic_socket_acceptor::open +
+
basic_stream_socket, basic_stream_socket::open +
+
+
operation_aborted
+
error::basic_errors, error::basic_errors +
+
operation_not_supported
+
error::basic_errors, error::basic_errors +
+
operator *
+
+
buffers_iterator, buffers_iterator::operator + * +
+
ip::basic_address_iterator< address_v4 >, ip::basic_address_iterator< + address_v4 >::operator * +
+
ip::basic_address_iterator< address_v6 >, ip::basic_address_iterator< + address_v6 >::operator * +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::operator + * +
+
ip::basic_resolver_results, ip::basic_resolver_results::operator + * +
+
+
operator bool
+
execution::any_executor, execution::any_executor::operator + bool +
+
operator + endpoint_type
+
ip::basic_resolver_entry, ip::basic_resolver_entry::operator + endpoint_type +
+
operator unspecified_bool_type
+
+
error_code, error_code::operator + unspecified_bool_type +
+
executor, executor::operator + unspecified_bool_type +
+
+
operator!
+
error_code, error_code::operator! +
+
operator!=
+
+
basic_system_executor, basic_system_executor::operator!= +
+
buffers_iterator, buffers_iterator::operator!= +
+
error_category, error_category::operator!= +
+
error_code, error_code::operator!= +
+
execution::any_executor, execution::any_executor::operator!= +
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::operator!= +
+
execution::blocking_t, execution::blocking_t::operator!= +
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::operator!= +
+
execution::mapping_t, execution::mapping_t::operator!= +
+
execution::outstanding_work_t, execution::outstanding_work_t::operator!= +
+
execution::relationship_t, execution::relationship_t::operator!= +
+
executor, executor::operator!= +
+
generic::basic_endpoint, generic::basic_endpoint::operator!= +
+
generic::datagram_protocol, generic::datagram_protocol::operator!= +
+
generic::raw_protocol, generic::raw_protocol::operator!= +
+
generic::seq_packet_protocol, generic::seq_packet_protocol::operator!= +
+
generic::stream_protocol, generic::stream_protocol::operator!= +
+
io_context::basic_executor_type, io_context::basic_executor_type::operator!= +
+
io_context::strand, io_context::strand::operator!= +
+
ip::address, ip::address::operator!= +
+
ip::address_v4, ip::address_v4::operator!= +
+
ip::address_v6, ip::address_v6::operator!= +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::operator!= +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::operator!= +
+
ip::basic_endpoint, ip::basic_endpoint::operator!= +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::operator!= +
+
ip::basic_resolver_results, ip::basic_resolver_results::operator!= +
+
ip::icmp, ip::icmp::operator!= +
+
ip::network_v4, ip::network_v4::operator!= +
+
ip::network_v6, ip::network_v6::operator!= +
+
ip::tcp, ip::tcp::operator!= +
+
ip::udp, ip::udp::operator!= +
+
local::basic_endpoint, local::basic_endpoint::operator!= +
+
strand, strand::operator!= +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::operator!= +
+
+
operator()
+
+
execution::invocable_archetype, execution::invocable_archetype::operator() +
+
executor_binder, executor_binder::operator() +
+
ssl::host_name_verification, ssl::host_name_verification::operator() +
+
ssl::rfc2818_verification, ssl::rfc2818_verification::operator() +
+
use_future_t, use_future_t::operator() +
+
+
operator+
+
+
buffers_iterator, buffers_iterator::operator+ +
+
const_buffer, const_buffer::operator+ +
+
const_buffers_1, const_buffers_1::operator+ +
+
mutable_buffer, mutable_buffer::operator+ +
+
mutable_buffers_1, mutable_buffers_1::operator+ +
+
+
operator++
+
+
buffers_iterator, buffers_iterator::operator++ +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::operator++ +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::operator++ +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::operator++ +
+
ip::basic_resolver_results, ip::basic_resolver_results::operator++ +
+
+
operator+=
+
+
buffers_iterator, buffers_iterator::operator+= +
+
const_buffer, const_buffer::operator+= +
+
const_buffers_1, const_buffers_1::operator+= +
+
mutable_buffer, mutable_buffer::operator+= +
+
mutable_buffers_1, mutable_buffers_1::operator+= +
+
+
operator-
+
buffers_iterator, buffers_iterator::operator- +
+
operator--
+
+
buffers_iterator, buffers_iterator::operator-- +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::operator-- +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::operator-- +
+
+
operator-=
+
buffers_iterator, buffers_iterator::operator-= +
+
operator->
+
+
buffers_iterator, buffers_iterator::operator-> +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::operator-> +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::operator-> +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::operator-> +
+
ip::basic_resolver_results, ip::basic_resolver_results::operator-> +
+
+
operator<
+
+
buffers_iterator, buffers_iterator::operator< +
+
generic::basic_endpoint, generic::basic_endpoint::operator< +
+
ip::address, ip::address::operator< +
+
ip::address_v4, ip::address_v4::operator< +
+
ip::address_v6, ip::address_v6::operator< +
+
ip::basic_endpoint, ip::basic_endpoint::operator< +
+
local::basic_endpoint, local::basic_endpoint::operator< +
+
+
operator<<, operator<< +
+
+
ip::address, ip::address::operator<< +
+
ip::address_v4, ip::address_v4::operator<< +
+
ip::address_v6, ip::address_v6::operator<< +
+
ip::basic_endpoint, ip::basic_endpoint::operator<< +
+
local::basic_endpoint, local::basic_endpoint::operator<< +
+
+
operator<=
+
+
buffers_iterator, buffers_iterator::operator<= +
+
generic::basic_endpoint, generic::basic_endpoint::operator<= +
+
ip::address, ip::address::operator<= +
+
ip::address_v4, ip::address_v4::operator<= +
+
ip::address_v6, ip::address_v6::operator<= +
+
ip::basic_endpoint, ip::basic_endpoint::operator<= +
+
local::basic_endpoint, local::basic_endpoint::operator<= +
+
+
operator=
+
+
basic_datagram_socket, basic_datagram_socket::operator= +
+
basic_deadline_timer, basic_deadline_timer::operator= +
+
basic_io_object, basic_io_object::operator= +
+
basic_raw_socket, basic_raw_socket::operator= +
+
basic_seq_packet_socket, basic_seq_packet_socket::operator= +
+
basic_serial_port, basic_serial_port::operator= +
+
basic_socket, basic_socket::operator= +
+
basic_socket_acceptor, basic_socket_acceptor::operator= +
+
basic_socket_iostream, basic_socket_iostream::operator= +
+
basic_socket_streambuf, basic_socket_streambuf::operator= +
+
basic_stream_socket, basic_stream_socket::operator= +
+
basic_waitable_timer, basic_waitable_timer::operator= +
+
execution::any_executor, execution::any_executor::operator= +
+
executor, executor::operator= +
+
generic::basic_endpoint, generic::basic_endpoint::operator= +
+
io_context::basic_executor_type, io_context::basic_executor_type::operator= +
+
ip::address, ip::address::operator= +
+
ip::address_v4, ip::address_v4::operator= +
+
ip::address_v6, ip::address_v6::operator= +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::operator= +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::operator= +
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::operator= +
+
ip::basic_address_range< + address_v6 >, ip::basic_address_range< + address_v6 >::operator= +
+
ip::basic_endpoint, ip::basic_endpoint::operator= +
+
ip::basic_resolver, ip::basic_resolver::operator= +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::operator= +
+
ip::basic_resolver_results, ip::basic_resolver_results::operator= +
+
ip::network_v4, ip::network_v4::operator= +
+
ip::network_v6, ip::network_v6::operator= +
+
local::basic_endpoint, local::basic_endpoint::operator= +
+
posix::basic_descriptor, posix::basic_descriptor::operator= +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::operator= +
+
ssl::context, ssl::context::operator= +
+
strand, strand::operator= +
+
system_error, system_error::operator= +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::operator= +
+
windows::basic_object_handle, windows::basic_object_handle::operator= +
+
windows::basic_overlapped_handle, windows::basic_overlapped_handle::operator= +
+
windows::basic_random_access_handle, windows::basic_random_access_handle::operator= +
+
windows::basic_stream_handle, windows::basic_stream_handle::operator= +
+
+
operator==
+
+
basic_system_executor, basic_system_executor::operator== +
+
buffers_iterator, buffers_iterator::operator== +
+
error_category, error_category::operator== +
+
error_code, error_code::operator== +
+
execution::any_executor, execution::any_executor::operator== +
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::operator== +
+
execution::blocking_t, execution::blocking_t::operator== +
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::operator== +
+
execution::mapping_t, execution::mapping_t::operator== +
+
execution::outstanding_work_t, execution::outstanding_work_t::operator== +
+
execution::relationship_t, execution::relationship_t::operator== +
+
executor, executor::operator== +
+
generic::basic_endpoint, generic::basic_endpoint::operator== +
+
generic::datagram_protocol, generic::datagram_protocol::operator== +
+
generic::raw_protocol, generic::raw_protocol::operator== +
+
generic::seq_packet_protocol, generic::seq_packet_protocol::operator== +
+
generic::stream_protocol, generic::stream_protocol::operator== +
+
io_context::basic_executor_type, io_context::basic_executor_type::operator== +
+
io_context::strand, io_context::strand::operator== +
+
ip::address, ip::address::operator== +
+
ip::address_v4, ip::address_v4::operator== +
+
ip::address_v6, ip::address_v6::operator== +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::operator== +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::operator== +
+
ip::basic_endpoint, ip::basic_endpoint::operator== +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::operator== +
+
ip::basic_resolver_results, ip::basic_resolver_results::operator== +
+
ip::icmp, ip::icmp::operator== +
+
ip::network_v4, ip::network_v4::operator== +
+
ip::network_v6, ip::network_v6::operator== +
+
ip::tcp, ip::tcp::operator== +
+
ip::udp, ip::udp::operator== +
+
local::basic_endpoint, local::basic_endpoint::operator== +
+
strand, strand::operator== +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::operator== +
+
+
operator>
+
+
buffers_iterator, buffers_iterator::operator> +
+
generic::basic_endpoint, generic::basic_endpoint::operator> +
+
ip::address, ip::address::operator> +
+
ip::address_v4, ip::address_v4::operator> +
+
ip::address_v6, ip::address_v6::operator> +
+
ip::basic_endpoint, ip::basic_endpoint::operator> +
+
local::basic_endpoint, local::basic_endpoint::operator> +
+
+
operator>=
+
+
buffers_iterator, buffers_iterator::operator>= +
+
generic::basic_endpoint, generic::basic_endpoint::operator>= +
+
ip::address, ip::address::operator>= +
+
ip::address_v4, ip::address_v4::operator>= +
+
ip::address_v6, ip::address_v6::operator>= +
+
ip::basic_endpoint, ip::basic_endpoint::operator>= +
+
local::basic_endpoint, local::basic_endpoint::operator>= +
+
+
operator[]
+
+
basic_yield_context, basic_yield_context::operator[] +
+
buffers_iterator, buffers_iterator::operator[] +
+
use_future_t, use_future_t::operator[] +
+
+
options
+
+
ssl::context, ssl::context::options +
+
ssl::context_base, ssl::context_base::options +
+
+
other
+
+
basic_datagram_socket::rebind_executor, basic_datagram_socket::rebind_executor::other +
+
basic_deadline_timer::rebind_executor, basic_deadline_timer::rebind_executor::other +
+
basic_raw_socket::rebind_executor, basic_raw_socket::rebind_executor::other +
+
basic_seq_packet_socket::rebind_executor, basic_seq_packet_socket::rebind_executor::other +
+
basic_serial_port::rebind_executor, basic_serial_port::rebind_executor::other +
+
basic_signal_set::rebind_executor, basic_signal_set::rebind_executor::other +
+
basic_socket::rebind_executor, basic_socket::rebind_executor::other +
+
basic_socket_acceptor::rebind_executor, basic_socket_acceptor::rebind_executor::other +
+
basic_stream_socket::rebind_executor, basic_stream_socket::rebind_executor::other +
+
basic_waitable_timer::rebind_executor, basic_waitable_timer::rebind_executor::other +
+
execution::mapping_t, execution::mapping_t::other +
+
ip::basic_resolver::rebind_executor, ip::basic_resolver::rebind_executor::other +
+
posix::basic_descriptor::rebind_executor, posix::basic_descriptor::rebind_executor::other +
+
posix::basic_stream_descriptor::rebind_executor, posix::basic_stream_descriptor::rebind_executor::other +
+
windows::basic_object_handle::rebind_executor, windows::basic_object_handle::rebind_executor::other +
+
windows::basic_overlapped_handle::rebind_executor, windows::basic_overlapped_handle::rebind_executor::other +
+
windows::basic_random_access_handle::rebind_executor, windows::basic_random_access_handle::rebind_executor::other +
+
windows::basic_stream_handle::rebind_executor, windows::basic_stream_handle::rebind_executor::other +
+
+
other_t
+
execution::mapping_t::other_t, execution::mapping_t::other_t::other_t +
+
outstanding_work_t
+
execution::outstanding_work_t, execution::outstanding_work_t::outstanding_work_t +
+
out_of_band_inline
+
+
basic_datagram_socket, basic_datagram_socket::out_of_band_inline +
+
basic_raw_socket, basic_raw_socket::out_of_band_inline +
+
basic_seq_packet_socket, basic_seq_packet_socket::out_of_band_inline +
+
basic_socket, basic_socket::out_of_band_inline +
+
basic_socket_acceptor, basic_socket_acceptor::out_of_band_inline +
+
basic_stream_socket, basic_stream_socket::out_of_band_inline +
+
socket_base, socket_base::out_of_band_inline +
+
+
overflow
+
+
basic_socket_streambuf, basic_socket_streambuf::overflow +
+
basic_streambuf, basic_streambuf::overflow +
+
+
overlapped_ptr
+
windows::overlapped_ptr, windows::overlapped_ptr::overlapped_ptr +
+
owns_work
+
executor_work_guard, executor_work_guard::owns_work +
+
+
+
+

P

+
+
parallel
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::parallel +
+
parallel_t
+
execution::bulk_guarantee_t::parallel_t, execution::bulk_guarantee_t::parallel_t::parallel_t +
+
parity
+
serial_port_base::parity, serial_port_base::parity::parity +
+
passive
+
+
ip::basic_resolver, ip::basic_resolver::passive +
+
ip::basic_resolver_query, ip::basic_resolver_query::passive +
+
ip::resolver_base, ip::resolver_base::passive +
+
ip::resolver_query_base, ip::resolver_query_base::passive +
+
+
password_purpose
+
+
ssl::context, ssl::context::password_purpose +
+
ssl::context_base, ssl::context_base::password_purpose +
+
+
path
+
local::basic_endpoint, local::basic_endpoint::path +
+
peek
+
+
buffered_read_stream, buffered_read_stream::peek +
+
buffered_stream, buffered_stream::peek +
+
buffered_write_stream, buffered_write_stream::peek +
+
+
pem
+
+
ssl::context, ssl::context::file_format +
+
ssl::context_base, ssl::context_base::file_format +
+
+
placeholders::bytes_transferred, placeholders::bytes_transferred +
+
placeholders::endpoint, placeholders::endpoint +
+
placeholders::error, placeholders::error +
+
placeholders::iterator, placeholders::iterator +
+
placeholders::results, placeholders::results +
+
placeholders::signal_number, placeholders::signal_number +
+
pointer
+
+
buffers_iterator, buffers_iterator::pointer +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::pointer +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::pointer +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::pointer +
+
ip::basic_resolver_results, ip::basic_resolver_results::pointer +
+
+
poll
+
io_context, io_context::poll +
+
poll_one
+
io_context, io_context::poll_one +
+
polymorphic_query_result_type
+
+
execution::blocking_adaptation_t, execution::blocking_adaptation_t::polymorphic_query_result_type +
+
execution::blocking_adaptation_t::allowed_t, execution::blocking_adaptation_t::allowed_t::polymorphic_query_result_type +
+
execution::blocking_adaptation_t::disallowed_t, execution::blocking_adaptation_t::disallowed_t::polymorphic_query_result_type +
+
execution::blocking_t, execution::blocking_t::polymorphic_query_result_type +
+
execution::blocking_t::always_t, execution::blocking_t::always_t::polymorphic_query_result_type +
+
execution::blocking_t::never_t, execution::blocking_t::never_t::polymorphic_query_result_type +
+
execution::blocking_t::possibly_t, execution::blocking_t::possibly_t::polymorphic_query_result_type +
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::polymorphic_query_result_type +
+
execution::bulk_guarantee_t::parallel_t, execution::bulk_guarantee_t::parallel_t::polymorphic_query_result_type +
+
execution::bulk_guarantee_t::sequenced_t, execution::bulk_guarantee_t::sequenced_t::polymorphic_query_result_type +
+
execution::bulk_guarantee_t::unsequenced_t, execution::bulk_guarantee_t::unsequenced_t::polymorphic_query_result_type +
+
execution::context_as_t, execution::context_as_t::polymorphic_query_result_type +
+
execution::context_t, execution::context_t::polymorphic_query_result_type +
+
execution::mapping_t, execution::mapping_t::polymorphic_query_result_type +
+
execution::mapping_t::new_thread_t, execution::mapping_t::new_thread_t::polymorphic_query_result_type +
+
execution::mapping_t::other_t, execution::mapping_t::other_t::polymorphic_query_result_type +
+
execution::mapping_t::thread_t, execution::mapping_t::thread_t::polymorphic_query_result_type +
+
execution::occupancy_t, execution::occupancy_t::polymorphic_query_result_type +
+
execution::outstanding_work_t, execution::outstanding_work_t::polymorphic_query_result_type +
+
execution::outstanding_work_t::tracked_t, execution::outstanding_work_t::tracked_t::polymorphic_query_result_type +
+
execution::outstanding_work_t::untracked_t, execution::outstanding_work_t::untracked_t::polymorphic_query_result_type +
+
execution::prefer_only, execution::prefer_only::polymorphic_query_result_type +
+
execution::relationship_t, execution::relationship_t::polymorphic_query_result_type +
+
execution::relationship_t::continuation_t, execution::relationship_t::continuation_t::polymorphic_query_result_type +
+
execution::relationship_t::fork_t, execution::relationship_t::fork_t::polymorphic_query_result_type +
+
+
port
+
ip::basic_endpoint, ip::basic_endpoint::port +
+
posix::descriptor, posix::descriptor +
+
posix::stream_descriptor, posix::stream_descriptor +
+
possibly
+
execution::blocking_t, execution::blocking_t::possibly +
+
possibly_t
+
execution::blocking_t::possibly_t, execution::blocking_t::possibly_t::possibly_t +
+
post, post +
+
+
basic_system_executor, basic_system_executor::post +
+
executor, executor::post +
+
io_context, io_context::post +
+
io_context::basic_executor_type, io_context::basic_executor_type::post +
+
io_context::strand, io_context::strand::post +
+
strand, strand::post +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::post +
+
+
prefer, prefer +
+
+
execution::any_executor, execution::any_executor::prefer +
+
strand, strand::prefer +
+
+
prefix_length
+
+
ip::network_v4, ip::network_v4::prefix_length +
+
ip::network_v6, ip::network_v6::prefix_length +
+
+
prepare
+
+
basic_streambuf, basic_streambuf::prepare +
+
basic_streambuf_ref, basic_streambuf_ref::prepare +
+
dynamic_string_buffer, dynamic_string_buffer::prepare +
+
dynamic_vector_buffer, dynamic_vector_buffer::prepare +
+
+
protocol
+
+
generic::basic_endpoint, generic::basic_endpoint::protocol +
+
generic::datagram_protocol, generic::datagram_protocol::protocol +
+
generic::raw_protocol, generic::raw_protocol::protocol +
+
generic::seq_packet_protocol, generic::seq_packet_protocol::protocol +
+
generic::stream_protocol, generic::stream_protocol::protocol +
+
ip::basic_endpoint, ip::basic_endpoint::protocol +
+
ip::icmp, ip::icmp::protocol +
+
ip::tcp, ip::tcp::protocol +
+
ip::udp, ip::udp::protocol +
+
local::basic_endpoint, local::basic_endpoint::protocol +
+
local::datagram_protocol, local::datagram_protocol::protocol +
+
local::stream_protocol, local::stream_protocol::protocol +
+
+
protocol_type
+
+
basic_datagram_socket, basic_datagram_socket::protocol_type +
+
basic_raw_socket, basic_raw_socket::protocol_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::protocol_type +
+
basic_socket, basic_socket::protocol_type +
+
basic_socket_acceptor, basic_socket_acceptor::protocol_type +
+
basic_socket_iostream, basic_socket_iostream::protocol_type +
+
basic_socket_streambuf, basic_socket_streambuf::protocol_type +
+
basic_stream_socket, basic_stream_socket::protocol_type +
+
generic::basic_endpoint, generic::basic_endpoint::protocol_type +
+
ip::basic_endpoint, ip::basic_endpoint::protocol_type +
+
ip::basic_resolver, ip::basic_resolver::protocol_type +
+
ip::basic_resolver_entry, ip::basic_resolver_entry::protocol_type +
+
ip::basic_resolver_query, ip::basic_resolver_query::protocol_type +
+
ip::basic_resolver_results, ip::basic_resolver_results::protocol_type +
+
local::basic_endpoint, local::basic_endpoint::protocol_type +
+
+
puberror
+
basic_socket_streambuf, basic_socket_streambuf::puberror +
+
+
+
+

Q

+
+
query, query +
+
+
basic_system_executor, basic_system_executor::query, basic_system_executor::query +
+
execution::any_executor, execution::any_executor::query +
+
io_context::basic_executor_type, io_context::basic_executor_type::query, io_context::basic_executor_type::query +
+
ip::basic_resolver, ip::basic_resolver::query +
+
strand, strand::query +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::query, thread_pool::basic_executor_type::query +
+
+
+
+
+

R

+
+
raw_protocol
+
generic::raw_protocol, generic::raw_protocol::raw_protocol +
+
rdbuf
+
basic_socket_iostream, basic_socket_iostream::rdbuf +
+
read, read +
+
read_at, read_at +
+
read_some
+
+
basic_serial_port, basic_serial_port::read_some +
+
basic_stream_socket, basic_stream_socket::read_some +
+
buffered_read_stream, buffered_read_stream::read_some +
+
buffered_stream, buffered_stream::read_some +
+
buffered_write_stream, buffered_write_stream::read_some +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::read_some +
+
ssl::stream, ssl::stream::read_some +
+
windows::basic_stream_handle, windows::basic_stream_handle::read_some +
+
+
read_some_at
+
windows::basic_random_access_handle, windows::basic_random_access_handle::read_some_at +
+
read_until, read_until +
+
rebind
+
use_future_t, use_future_t::rebind +
+
receive
+
+
basic_datagram_socket, basic_datagram_socket::receive +
+
basic_raw_socket, basic_raw_socket::receive +
+
basic_seq_packet_socket, basic_seq_packet_socket::receive +
+
basic_stream_socket, basic_stream_socket::receive +
+
+
receiver_invocation_error
+
execution::receiver_invocation_error, execution::receiver_invocation_error::receiver_invocation_error +
+
receive_buffer_size
+
+
basic_datagram_socket, basic_datagram_socket::receive_buffer_size +
+
basic_raw_socket, basic_raw_socket::receive_buffer_size +
+
basic_seq_packet_socket, basic_seq_packet_socket::receive_buffer_size +
+
basic_socket, basic_socket::receive_buffer_size +
+
basic_socket_acceptor, basic_socket_acceptor::receive_buffer_size +
+
basic_stream_socket, basic_stream_socket::receive_buffer_size +
+
socket_base, socket_base::receive_buffer_size +
+
+
receive_from
+
+
basic_datagram_socket, basic_datagram_socket::receive_from +
+
basic_raw_socket, basic_raw_socket::receive_from +
+
+
receive_low_watermark
+
+
basic_datagram_socket, basic_datagram_socket::receive_low_watermark +
+
basic_raw_socket, basic_raw_socket::receive_low_watermark +
+
basic_seq_packet_socket, basic_seq_packet_socket::receive_low_watermark +
+
basic_socket, basic_socket::receive_low_watermark +
+
basic_socket_acceptor, basic_socket_acceptor::receive_low_watermark +
+
basic_stream_socket, basic_stream_socket::receive_low_watermark +
+
socket_base, socket_base::receive_low_watermark +
+
+
redirect_error, redirect_error +
+
redirect_error_t
+
redirect_error_t, redirect_error_t::redirect_error_t +
+
reference
+
+
buffers_iterator, buffers_iterator::reference +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::reference +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::reference +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::reference +
+
ip::basic_resolver_results, ip::basic_resolver_results::reference +
+
+
relationship_t
+
execution::relationship_t, execution::relationship_t::relationship_t +
+
release
+
+
basic_datagram_socket, basic_datagram_socket::release +
+
basic_raw_socket, basic_raw_socket::release +
+
basic_seq_packet_socket, basic_seq_packet_socket::release +
+
basic_socket, basic_socket::release +
+
basic_socket_acceptor, basic_socket_acceptor::release +
+
basic_stream_socket, basic_stream_socket::release +
+
posix::basic_descriptor, posix::basic_descriptor::release +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::release +
+
windows::overlapped_ptr, windows::overlapped_ptr::release +
+
+
remote_endpoint
+
+
basic_datagram_socket, basic_datagram_socket::remote_endpoint +
+
basic_raw_socket, basic_raw_socket::remote_endpoint +
+
basic_seq_packet_socket, basic_seq_packet_socket::remote_endpoint +
+
basic_socket, basic_socket::remote_endpoint +
+
basic_stream_socket, basic_stream_socket::remote_endpoint +
+
+
remove
+
basic_signal_set, basic_signal_set::remove +
+
require, require +
+
+
basic_system_executor, basic_system_executor::require +
+
execution::any_executor, execution::any_executor::require +
+
io_context::basic_executor_type, io_context::basic_executor_type::require +
+
strand, strand::require +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::require +
+
+
require_concept, require_concept +
+
reserve
+
basic_streambuf, basic_streambuf::reserve +
+
reset
+
+
executor_work_guard, executor_work_guard::reset +
+
io_context, io_context::reset +
+
windows::overlapped_ptr, windows::overlapped_ptr::reset +
+
+
resize
+
+
generic::basic_endpoint, generic::basic_endpoint::resize +
+
ip::basic_endpoint, ip::basic_endpoint::resize +
+
local::basic_endpoint, local::basic_endpoint::resize +
+
+
resolve
+
ip::basic_resolver, ip::basic_resolver::resolve +
+
resolver
+
+
ip::icmp, ip::icmp::resolver +
+
ip::tcp, ip::tcp::resolver +
+
ip::udp, ip::udp::resolver +
+
+
resolver_errc::try_again, resolver_errc::try_again +
+
restart
+
io_context, io_context::restart +
+
result
+
async_completion, async_completion::result +
+
results_type
+
ip::basic_resolver, ip::basic_resolver::results_type +
+
result_type
+
+
executor_binder, executor_binder::result_type +
+
ssl::host_name_verification, ssl::host_name_verification::result_type +
+
ssl::rfc2818_verification, ssl::rfc2818_verification::result_type +
+
+
return_type
+
+
async_result, async_result::return_type +
+
async_result< + std::packaged_task< Result(Args...)>, Signature >, async_result< + std::packaged_task< Result(Args...)>, Signature >::return_type +
+
+
reuse_address
+
+
basic_datagram_socket, basic_datagram_socket::reuse_address +
+
basic_raw_socket, basic_raw_socket::reuse_address +
+
basic_seq_packet_socket, basic_seq_packet_socket::reuse_address +
+
basic_socket, basic_socket::reuse_address +
+
basic_socket_acceptor, basic_socket_acceptor::reuse_address +
+
basic_stream_socket, basic_stream_socket::reuse_address +
+
socket_base, socket_base::reuse_address +
+
+
rfc2818_verification
+
ssl::rfc2818_verification, ssl::rfc2818_verification::rfc2818_verification +
+
run
+
io_context, io_context::run +
+
running_in_this_thread
+
+
io_context::basic_executor_type, io_context::basic_executor_type::running_in_this_thread +
+
io_context::strand, io_context::strand::running_in_this_thread +
+
strand, strand::running_in_this_thread +
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::running_in_this_thread +
+
+
run_for
+
io_context, io_context::run_for +
+
run_one
+
io_context, io_context::run_one +
+
run_one_for
+
io_context, io_context::run_one_for +
+
run_one_until
+
io_context, io_context::run_one_until +
+
run_until
+
io_context, io_context::run_until +
+
+
+
+

S

+
+
schedule
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::schedule +
+
scheduler
+
thread_pool, thread_pool::scheduler +
+
scheduler_type
+
thread_pool, thread_pool::scheduler_type +
+
scope_id
+
ip::address_v6, ip::address_v6::scope_id +
+
second_argument_type
+
executor_binder, executor_binder::second_argument_type +
+
send
+
+
basic_datagram_socket, basic_datagram_socket::send +
+
basic_raw_socket, basic_raw_socket::send +
+
basic_seq_packet_socket, basic_seq_packet_socket::send +
+
basic_stream_socket, basic_stream_socket::send +
+
+
sender_type
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::sender_type +
+
send_break
+
basic_serial_port, basic_serial_port::send_break +
+
send_buffer_size
+
+
basic_datagram_socket, basic_datagram_socket::send_buffer_size +
+
basic_raw_socket, basic_raw_socket::send_buffer_size +
+
basic_seq_packet_socket, basic_seq_packet_socket::send_buffer_size +
+
basic_socket, basic_socket::send_buffer_size +
+
basic_socket_acceptor, basic_socket_acceptor::send_buffer_size +
+
basic_stream_socket, basic_stream_socket::send_buffer_size +
+
socket_base, socket_base::send_buffer_size +
+
+
send_low_watermark
+
+
basic_datagram_socket, basic_datagram_socket::send_low_watermark +
+
basic_raw_socket, basic_raw_socket::send_low_watermark +
+
basic_seq_packet_socket, basic_seq_packet_socket::send_low_watermark +
+
basic_socket, basic_socket::send_low_watermark +
+
basic_socket_acceptor, basic_socket_acceptor::send_low_watermark +
+
basic_stream_socket, basic_stream_socket::send_low_watermark +
+
socket_base, socket_base::send_low_watermark +
+
+
send_to
+
+
basic_datagram_socket, basic_datagram_socket::send_to +
+
basic_raw_socket, basic_raw_socket::send_to +
+
+
sequenced
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::sequenced +
+
sequenced_t
+
execution::bulk_guarantee_t::sequenced_t, execution::bulk_guarantee_t::sequenced_t::sequenced_t +
+
seq_packet_protocol
+
generic::seq_packet_protocol, generic::seq_packet_protocol::seq_packet_protocol +
+
serial_port, serial_port +
+
server
+
+
ssl::stream, ssl::stream::handshake_type +
+
ssl::stream_base, ssl::stream_base::handshake_type +
+
+
service
+
+
execution_context::service, execution_context::service::service +
+
io_context::service, io_context::service::service +
+
+
service_already_exists
+
service_already_exists, service_already_exists::service_already_exists +
+
service_name
+
+
ip::basic_resolver_entry, ip::basic_resolver_entry::service_name +
+
ip::basic_resolver_query, ip::basic_resolver_query::service_name +
+
+
service_not_found
+
error::addrinfo_errors, error::addrinfo_errors +
+
service_type
+
basic_io_object, basic_io_object::service_type +
+
setbuf
+
basic_socket_streambuf, basic_socket_streambuf::setbuf +
+
set_default_verify_paths
+
ssl::context, ssl::context::set_default_verify_paths +
+
set_option
+
+
basic_datagram_socket, basic_datagram_socket::set_option +
+
basic_raw_socket, basic_raw_socket::set_option +
+
basic_seq_packet_socket, basic_seq_packet_socket::set_option +
+
basic_serial_port, basic_serial_port::set_option +
+
basic_socket, basic_socket::set_option +
+
basic_socket_acceptor, basic_socket_acceptor::set_option +
+
basic_stream_socket, basic_stream_socket::set_option +
+
+
set_options
+
ssl::context, ssl::context::set_options +
+
set_password_callback
+
ssl::context, ssl::context::set_password_callback +
+
set_verify_callback
+
+
ssl::context, ssl::context::set_verify_callback +
+
ssl::stream, ssl::stream::set_verify_callback +
+
+
set_verify_depth
+
+
ssl::context, ssl::context::set_verify_depth +
+
ssl::stream, ssl::stream::set_verify_depth +
+
+
set_verify_mode
+
+
ssl::context, ssl::context::set_verify_mode +
+
ssl::stream, ssl::stream::set_verify_mode +
+
+
shape_type
+
thread_pool::basic_executor_type, thread_pool::basic_executor_type::shape_type +
+
shrink
+
+
dynamic_string_buffer, dynamic_string_buffer::shrink +
+
dynamic_vector_buffer, dynamic_vector_buffer::shrink +
+
+
shutdown
+
+
basic_datagram_socket, basic_datagram_socket::shutdown +
+
basic_raw_socket, basic_raw_socket::shutdown +
+
basic_seq_packet_socket, basic_seq_packet_socket::shutdown +
+
basic_socket, basic_socket::shutdown +
+
basic_stream_socket, basic_stream_socket::shutdown +
+
execution_context, execution_context::shutdown +
+
execution_context::service, execution_context::service::shutdown +
+
io_context, io_context::shutdown +
+
ssl::stream, ssl::stream::shutdown +
+
system_context, system_context::shutdown +
+
thread_pool, thread_pool::shutdown +
+
+
shutdown_both
+
+
basic_datagram_socket, basic_datagram_socket::shutdown_type +
+
basic_raw_socket, basic_raw_socket::shutdown_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::shutdown_type +
+
basic_socket, basic_socket::shutdown_type +
+
basic_socket_acceptor, basic_socket_acceptor::shutdown_type +
+
basic_stream_socket, basic_stream_socket::shutdown_type +
+
socket_base, socket_base::shutdown_type +
+
+
shutdown_receive
+
+
basic_datagram_socket, basic_datagram_socket::shutdown_type +
+
basic_raw_socket, basic_raw_socket::shutdown_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::shutdown_type +
+
basic_socket, basic_socket::shutdown_type +
+
basic_socket_acceptor, basic_socket_acceptor::shutdown_type +
+
basic_stream_socket, basic_stream_socket::shutdown_type +
+
socket_base, socket_base::shutdown_type +
+
+
shutdown_send
+
+
basic_datagram_socket, basic_datagram_socket::shutdown_type +
+
basic_raw_socket, basic_raw_socket::shutdown_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::shutdown_type +
+
basic_socket, basic_socket::shutdown_type +
+
basic_socket_acceptor, basic_socket_acceptor::shutdown_type +
+
basic_stream_socket, basic_stream_socket::shutdown_type +
+
socket_base, socket_base::shutdown_type +
+
+
shutdown_type
+
+
basic_datagram_socket, basic_datagram_socket::shutdown_type +
+
basic_raw_socket, basic_raw_socket::shutdown_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::shutdown_type +
+
basic_socket, basic_socket::shutdown_type +
+
basic_socket_acceptor, basic_socket_acceptor::shutdown_type +
+
basic_stream_socket, basic_stream_socket::shutdown_type +
+
socket_base, socket_base::shutdown_type +
+
+
shut_down
+
error::basic_errors, error::basic_errors +
+
signal_set, signal_set +
+
single_dh_use
+
+
ssl::context, ssl::context::single_dh_use +
+
ssl::context_base, ssl::context_base::single_dh_use +
+
+
size
+
+
basic_streambuf, basic_streambuf::size +
+
basic_streambuf_ref, basic_streambuf_ref::size +
+
const_buffer, const_buffer::size +
+
const_buffers_1, const_buffers_1::size +
+
dynamic_string_buffer, dynamic_string_buffer::size +
+
dynamic_vector_buffer, dynamic_vector_buffer::size +
+
generic::basic_endpoint, generic::basic_endpoint::size +
+
ip::basic_address_range< + address_v4 >, ip::basic_address_range< + address_v4 >::size +
+
ip::basic_endpoint, ip::basic_endpoint::size +
+
ip::basic_resolver_results, ip::basic_resolver_results::size +
+
local::basic_endpoint, local::basic_endpoint::size +
+
mutable_buffer, mutable_buffer::size +
+
mutable_buffers_1, mutable_buffers_1::size +
+
+
size_type
+
ip::basic_resolver_results, ip::basic_resolver_results::size_type +
+
socket
+
+
basic_socket_iostream, basic_socket_iostream::socket +
+
basic_socket_streambuf, basic_socket_streambuf::socket +
+
generic::datagram_protocol, generic::datagram_protocol::socket +
+
generic::raw_protocol, generic::raw_protocol::socket +
+
generic::seq_packet_protocol, generic::seq_packet_protocol::socket +
+
generic::stream_protocol, generic::stream_protocol::socket +
+
ip::icmp, ip::icmp::socket +
+
ip::tcp, ip::tcp::socket +
+
ip::udp, ip::udp::socket +
+
local::datagram_protocol, local::datagram_protocol::socket +
+
local::stream_protocol, local::stream_protocol::socket +
+
+
socket_type_not_supported
+
error::addrinfo_errors, error::addrinfo_errors +
+
software
+
serial_port_base::flow_control, serial_port_base::flow_control::type +
+
spawn, spawn +
+
ssl
+
ssl::stream::impl_struct, ssl::stream::impl_struct::ssl +
+
ssl::error::get_stream_category, ssl::error::get_stream_category +
+
ssl::error::make_error_code, ssl::error::make_error_code +
+
ssl::error::stream_category, ssl::error::stream_category +
+
ssl::error::stream_errors, ssl::error::stream_errors +
+
ssl::verify_client_once, ssl::verify_client_once +
+
ssl::verify_fail_if_no_peer_cert, ssl::verify_fail_if_no_peer_cert +
+
ssl::verify_mode, ssl::verify_mode +
+
ssl::verify_none, ssl::verify_none +
+
ssl::verify_peer, ssl::verify_peer +
+
sslv2
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv23
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv23_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv23_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv2_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv2_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv3
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv3_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
sslv3_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
static_thread_pool, static_thread_pool +
+
steady_timer, steady_timer +
+
stop
+
+
io_context, io_context::stop +
+
system_context, system_context::stop +
+
thread_pool, thread_pool::stop +
+
+
stopped
+
+
io_context, io_context::stopped +
+
system_context, system_context::stopped +
+
+
stop_bits
+
serial_port_base::stop_bits, serial_port_base::stop_bits::stop_bits +
+
store
+
+
serial_port_base::baud_rate, serial_port_base::baud_rate::store +
+
serial_port_base::character_size, serial_port_base::character_size::store +
+
serial_port_base::flow_control, serial_port_base::flow_control::store +
+
serial_port_base::parity, serial_port_base::parity::store +
+
serial_port_base::stop_bits, serial_port_base::stop_bits::store +
+
+
strand
+
+
io_context::strand, io_context::strand::strand +
+
strand, strand::strand +
+
+
stream
+
ssl::stream, ssl::stream::stream +
+
streambuf, streambuf +
+
stream_protocol
+
generic::stream_protocol, generic::stream_protocol::stream_protocol +
+
stream_truncated
+
ssl::error::stream_errors, ssl::error::stream_errors +
+
subtract
+
time_traits< + boost::posix_time::ptime >, time_traits< + boost::posix_time::ptime >::subtract +
+
swap
+
+
execution::any_executor, execution::any_executor::swap +
+
ip::basic_resolver_results, ip::basic_resolver_results::swap +
+
+
sync
+
basic_socket_streambuf, basic_socket_streambuf::sync +
+
system_category, system_category +
+
system_error
+
system_error, system_error::system_error +
+
system_executor, system_executor +
+
system_timer, system_timer +
+
+
+
+

T

+
+
target
+
+
execution::any_executor, execution::any_executor::target +
+
executor, executor::target +
+
+
target_type
+
+
execution::any_executor, execution::any_executor::target_type +
+
executor, executor::target_type +
+
executor_binder, executor_binder::target_type +
+
+
this_coro::executor, this_coro::executor +
+
thread
+
+
execution::mapping_t, execution::mapping_t::thread +
+
thread, thread::thread +
+
+
thread_pool
+
thread_pool, thread_pool::thread_pool +
+
thread_t
+
execution::mapping_t::thread_t, execution::mapping_t::thread_t::thread_t +
+
timed_out
+
error::basic_errors, error::basic_errors +
+
time_point
+
+
basic_socket_iostream, basic_socket_iostream::time_point +
+
basic_socket_streambuf, basic_socket_streambuf::time_point +
+
basic_waitable_timer, basic_waitable_timer::time_point +
+
+
time_type
+
+
basic_deadline_timer, basic_deadline_timer::time_type +
+
basic_socket_iostream, basic_socket_iostream::time_type +
+
basic_socket_streambuf, basic_socket_streambuf::time_type +
+
time_traits< + boost::posix_time::ptime >, time_traits< + boost::posix_time::ptime >::time_type +
+
+
tls
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv1
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv11
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv11_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv11_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv12
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv12_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv12_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv13
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv13_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv13_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv1_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tlsv1_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tls_client
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
tls_server
+
+
ssl::context, ssl::context::method +
+
ssl::context_base, ssl::context_base::method +
+
+
token_
+
redirect_error_t, redirect_error_t::token_ +
+
to_bytes
+
+
ip::address_v4, ip::address_v4::to_bytes +
+
ip::address_v6, ip::address_v6::to_bytes +
+
+
to_posix_duration
+
time_traits< + boost::posix_time::ptime >, time_traits< + boost::posix_time::ptime >::to_posix_duration +
+
to_string
+
+
ip::address, ip::address::to_string +
+
ip::address_v4, ip::address_v4::to_string +
+
ip::address_v6, ip::address_v6::to_string +
+
ip::network_v4, ip::network_v4::to_string +
+
ip::network_v6, ip::network_v6::to_string +
+
+
to_uint
+
ip::address_v4, ip::address_v4::to_uint +
+
to_ulong
+
ip::address_v4, ip::address_v4::to_ulong +
+
to_v4
+
+
ip::address, ip::address::to_v4 +
+
ip::address_v6, ip::address_v6::to_v4 +
+
+
to_v6
+
ip::address, ip::address::to_v6 +
+
to_wait_duration
+
wait_traits, wait_traits::to_wait_duration +
+
tracked
+
execution::outstanding_work_t, execution::outstanding_work_t::tracked +
+
tracked_t
+
execution::outstanding_work_t::tracked_t, execution::outstanding_work_t::tracked_t::tracked_t +
+
traits_type
+
+
basic_deadline_timer, basic_deadline_timer::traits_type +
+
basic_waitable_timer, basic_waitable_timer::traits_type +
+
+
transfer_all, transfer_all +
+
transfer_at_least, transfer_at_least +
+
transfer_exactly, transfer_exactly +
+
try_again
+
error::basic_errors, error::basic_errors +
+
two
+
serial_port_base::stop_bits, serial_port_base::stop_bits::type +
+
type
+
+
associated_allocator, associated_allocator::type +
+
associated_executor, associated_executor::type +
+
default_completion_token, default_completion_token::type +
+
execution::connect_result, execution::connect_result::type +
+
execution::executor_index, execution::executor_index::type +
+
execution::executor_shape, execution::executor_shape::type +
+
generic::datagram_protocol, generic::datagram_protocol::type +
+
generic::raw_protocol, generic::raw_protocol::type +
+
generic::seq_packet_protocol, generic::seq_packet_protocol::type +
+
generic::stream_protocol, generic::stream_protocol::type +
+
ip::icmp, ip::icmp::type +
+
ip::tcp, ip::tcp::type +
+
ip::udp, ip::udp::type +
+
local::datagram_protocol, local::datagram_protocol::type +
+
local::stream_protocol, local::stream_protocol::type +
+
prefer_result, prefer_result::type +
+
query_result, query_result::type +
+
require_concept_result, require_concept_result::type +
+
require_result, require_result::type +
+
serial_port_base::flow_control, serial_port_base::flow_control::type +
+
serial_port_base::parity, serial_port_base::parity::type +
+
serial_port_base::stop_bits, serial_port_base::stop_bits::type +
+
+
+
+
+

U

+
+
uint_type
+
ip::address_v4, ip::address_v4::uint_type +
+
underflow
+
+
basic_socket_streambuf, basic_socket_streambuf::underflow +
+
basic_streambuf, basic_streambuf::underflow +
+
+
unexpected_result
+
ssl::error::stream_errors, ssl::error::stream_errors +
+
unsequenced
+
execution::bulk_guarantee_t, execution::bulk_guarantee_t::unsequenced +
+
unsequenced_t
+
execution::bulk_guarantee_t::unsequenced_t, execution::bulk_guarantee_t::unsequenced_t::unsequenced_t +
+
unspecified_bool_true
+
+
error_code, error_code::unspecified_bool_true +
+
executor, executor::unspecified_bool_true +
+
+
unspecified_bool_type
+
+
error_code, error_code::unspecified_bool_type +
+
executor, executor::unspecified_bool_type +
+
+
unspecified_system_error
+
ssl::error::stream_errors, ssl::error::stream_errors +
+
untracked
+
execution::outstanding_work_t, execution::outstanding_work_t::untracked +
+
untracked_t
+
execution::outstanding_work_t::untracked_t, execution::outstanding_work_t::untracked_t::untracked_t +
+
use_awaitable, use_awaitable +
+
use_awaitable_t
+
use_awaitable_t, use_awaitable_t::use_awaitable_t +
+
use_certificate
+
ssl::context, ssl::context::use_certificate +
+
use_certificate_chain
+
ssl::context, ssl::context::use_certificate_chain +
+
use_certificate_chain_file
+
ssl::context, ssl::context::use_certificate_chain_file +
+
use_certificate_file
+
ssl::context, ssl::context::use_certificate_file +
+
use_future, use_future +
+
use_future_t
+
use_future_t, use_future_t::use_future_t +
+
use_private_key
+
ssl::context, ssl::context::use_private_key +
+
use_private_key_file
+
ssl::context, ssl::context::use_private_key_file +
+
use_rsa_private_key
+
ssl::context, ssl::context::use_rsa_private_key +
+
use_rsa_private_key_file
+
ssl::context, ssl::context::use_rsa_private_key_file +
+
use_service
+
+
execution_context, execution_context::use_service +
+
io_context, io_context::use_service +
+
system_context, system_context::use_service +
+
thread_pool, thread_pool::use_service +
+
+
use_tmp_dh
+
ssl::context, ssl::context::use_tmp_dh +
+
use_tmp_dh_file
+
ssl::context, ssl::context::use_tmp_dh_file +
+
+
+
+

V

+
+
v4
+
+
ip::icmp, ip::icmp::v4 +
+
ip::tcp, ip::tcp::v4 +
+
ip::udp, ip::udp::v4 +
+
+
v4_compatible
+
ip::address_v6, ip::address_v6::v4_compatible +
+
v4_mapped
+
+
ip::address_v6, ip::address_v6::v4_mapped +
+
ip::basic_resolver, ip::basic_resolver::v4_mapped +
+
ip::basic_resolver_query, ip::basic_resolver_query::v4_mapped +
+
ip::resolver_base, ip::resolver_base::v4_mapped +
+
ip::resolver_query_base, ip::resolver_query_base::v4_mapped +
+
ip::v4_mapped_t, ip::v4_mapped_t +
+
+
v6
+
+
ip::icmp, ip::icmp::v6 +
+
ip::tcp, ip::tcp::v6 +
+
ip::udp, ip::udp::v6 +
+
+
valid
+
awaitable, awaitable::valid +
+
value
+
+
error_code, error_code::value +
+
execution::allocator_t, execution::allocator_t::value +
+
execution::blocking_adaptation_t::allowed_t, execution::blocking_adaptation_t::allowed_t::value +
+
execution::blocking_adaptation_t::disallowed_t, execution::blocking_adaptation_t::disallowed_t::value +
+
execution::blocking_t::always_t, execution::blocking_t::always_t::value +
+
execution::blocking_t::never_t, execution::blocking_t::never_t::value +
+
execution::blocking_t::possibly_t, execution::blocking_t::possibly_t::value +
+
execution::bulk_guarantee_t::parallel_t, execution::bulk_guarantee_t::parallel_t::value +
+
execution::bulk_guarantee_t::sequenced_t, execution::bulk_guarantee_t::sequenced_t::value +
+
execution::bulk_guarantee_t::unsequenced_t, execution::bulk_guarantee_t::unsequenced_t::value +
+
execution::mapping_t::new_thread_t, execution::mapping_t::new_thread_t::value +
+
execution::mapping_t::other_t, execution::mapping_t::other_t::value +
+
execution::mapping_t::thread_t, execution::mapping_t::thread_t::value +
+
execution::outstanding_work_t::tracked_t, execution::outstanding_work_t::tracked_t::value +
+
execution::outstanding_work_t::untracked_t, execution::outstanding_work_t::untracked_t::value +
+
execution::relationship_t::continuation_t, execution::relationship_t::continuation_t::value +
+
execution::relationship_t::fork_t, execution::relationship_t::fork_t::value +
+
is_endpoint_sequence, is_endpoint_sequence::value +
+
is_match_condition, is_match_condition::value +
+
is_read_buffered, is_read_buffered::value +
+
is_write_buffered, is_write_buffered::value +
+
serial_port_base::baud_rate, serial_port_base::baud_rate::value +
+
serial_port_base::character_size, serial_port_base::character_size::value +
+
serial_port_base::flow_control, serial_port_base::flow_control::value +
+
serial_port_base::parity, serial_port_base::parity::value +
+
serial_port_base::stop_bits, serial_port_base::stop_bits::value +
+
+
values_
+
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::values_ +
+
ip::basic_resolver_results, ip::basic_resolver_results::values_ +
+
+
value_type
+
+
awaitable, awaitable::value_type +
+
buffers_iterator, buffers_iterator::value_type +
+
const_buffers_1, const_buffers_1::value_type +
+
ip::basic_address_iterator< + address_v4 >, ip::basic_address_iterator< + address_v4 >::value_type +
+
ip::basic_address_iterator< + address_v6 >, ip::basic_address_iterator< + address_v6 >::value_type +
+
ip::basic_resolver_iterator, ip::basic_resolver_iterator::value_type +
+
ip::basic_resolver_results, ip::basic_resolver_results::value_type +
+
mutable_buffers_1, mutable_buffers_1::value_type +
+
null_buffers, null_buffers::value_type +
+
+
verify_context
+
ssl::verify_context, ssl::verify_context::verify_context +
+
+
+
+

W

+
+
wait
+
+
basic_datagram_socket, basic_datagram_socket::wait +
+
basic_deadline_timer, basic_deadline_timer::wait +
+
basic_raw_socket, basic_raw_socket::wait +
+
basic_seq_packet_socket, basic_seq_packet_socket::wait +
+
basic_socket, basic_socket::wait +
+
basic_socket_acceptor, basic_socket_acceptor::wait +
+
basic_stream_socket, basic_stream_socket::wait +
+
basic_waitable_timer, basic_waitable_timer::wait +
+
posix::basic_descriptor, posix::basic_descriptor::wait +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::wait +
+
thread_pool, thread_pool::wait +
+
windows::basic_object_handle, windows::basic_object_handle::wait +
+
+
wait_error
+
+
basic_datagram_socket, basic_datagram_socket::wait_type +
+
basic_raw_socket, basic_raw_socket::wait_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::wait_type +
+
basic_socket, basic_socket::wait_type +
+
basic_socket_acceptor, basic_socket_acceptor::wait_type +
+
basic_stream_socket, basic_stream_socket::wait_type +
+
posix::basic_descriptor, posix::basic_descriptor::wait_type +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::wait_type +
+
posix::descriptor_base, posix::descriptor_base::wait_type +
+
socket_base, socket_base::wait_type +
+
+
wait_read
+
+
basic_datagram_socket, basic_datagram_socket::wait_type +
+
basic_raw_socket, basic_raw_socket::wait_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::wait_type +
+
basic_socket, basic_socket::wait_type +
+
basic_socket_acceptor, basic_socket_acceptor::wait_type +
+
basic_stream_socket, basic_stream_socket::wait_type +
+
posix::basic_descriptor, posix::basic_descriptor::wait_type +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::wait_type +
+
posix::descriptor_base, posix::descriptor_base::wait_type +
+
socket_base, socket_base::wait_type +
+
+
wait_type
+
+
basic_datagram_socket, basic_datagram_socket::wait_type +
+
basic_raw_socket, basic_raw_socket::wait_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::wait_type +
+
basic_socket, basic_socket::wait_type +
+
basic_socket_acceptor, basic_socket_acceptor::wait_type +
+
basic_stream_socket, basic_stream_socket::wait_type +
+
posix::basic_descriptor, posix::basic_descriptor::wait_type +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::wait_type +
+
posix::descriptor_base, posix::descriptor_base::wait_type +
+
socket_base, socket_base::wait_type +
+
+
wait_write
+
+
basic_datagram_socket, basic_datagram_socket::wait_type +
+
basic_raw_socket, basic_raw_socket::wait_type +
+
basic_seq_packet_socket, basic_seq_packet_socket::wait_type +
+
basic_socket, basic_socket::wait_type +
+
basic_socket_acceptor, basic_socket_acceptor::wait_type +
+
basic_stream_socket, basic_stream_socket::wait_type +
+
posix::basic_descriptor, posix::basic_descriptor::wait_type +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::wait_type +
+
posix::descriptor_base, posix::descriptor_base::wait_type +
+
socket_base, socket_base::wait_type +
+
+
what
+
+
bad_executor, bad_executor::what +
+
execution::bad_executor, execution::bad_executor::what +
+
ip::bad_address_cast, ip::bad_address_cast::what +
+
multiple_exceptions, multiple_exceptions::what +
+
system_error, system_error::what +
+
+
windows::object_handle, windows::object_handle +
+
windows::overlapped_handle, windows::overlapped_handle +
+
windows::random_access_handle, windows::random_access_handle +
+
windows::stream_handle, windows::stream_handle +
+
work
+
io_context::work, io_context::work::work +
+
would_block
+
error::basic_errors, error::basic_errors +
+
wrap
+
+
io_context, io_context::wrap +
+
io_context::strand, io_context::strand::wrap +
+
+
write, write +
+
write_at, write_at +
+
write_some
+
+
basic_serial_port, basic_serial_port::write_some +
+
basic_stream_socket, basic_stream_socket::write_some +
+
buffered_read_stream, buffered_read_stream::write_some +
+
buffered_stream, buffered_stream::write_some +
+
buffered_write_stream, buffered_write_stream::write_some +
+
posix::basic_stream_descriptor, posix::basic_stream_descriptor::write_some +
+
ssl::stream, ssl::stream::write_some +
+
windows::basic_stream_handle, windows::basic_stream_handle::write_some +
+
+
write_some_at
+
windows::basic_random_access_handle, windows::basic_random_access_handle::write_some_at +
+
+
+
+

Y

+
yield_context, yield_context +
+
+
+
+
+ + + +
+
+
+PrevUpHome +
+ + diff --git a/include/asio/doc/asio/net_ts.html b/include/asio/doc/asio/net_ts.html new file mode 100644 index 0000000..395720b --- /dev/null +++ b/include/asio/doc/asio/net_ts.html @@ -0,0 +1,1240 @@ + + + +Networking TS compatibility + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio now provides the interfaces and functionality specified by the "C++ + Extensions for Networking" Technical Specification. In addition to access + via the usual Asio header files, this functionality may be accessed through + special headers that correspond to the header files defined in the TS. These + are listed in the table below: +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Networking TS header +

+
+

+ Asio header +

+
+

+ #include <buffer> +

+
+

+ #include <asio/ts/buffer.hpp> +

+
+

+ #include <executor> +

+
+

+ #include <asio/ts/executor.hpp> +

+
+

+ #include <internet> +

+
+

+ #include <asio/ts/internet.hpp> +

+
+

+ #include <io_context> +

+
+

+ #include <asio/ts/io_context.hpp> +

+
+

+ #include <net> +

+
+

+ #include <asio/ts/net.hpp> +

+
+

+ #include <netfwd> +

+
+

+ #include <asio/ts/netfwd.hpp> +

+
+

+ #include <socket> +

+
+

+ #include <asio/ts/socket.hpp> +

+
+

+ #include <timer> +

+
+

+ #include <asio/ts/timer.hpp> +

+
+

+ In some cases the new Networking TS compatible interfaces supersede older Asio + facilities. In these cases the older interfaces have been deprecated. The table + below shows the new Networking TS interfaces and the facilities they replace: +

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ New interface +

+
+

+ Old interface +

+
+

+ Notes +

+
+

+ io_context +

+
+

+ io_service +

+
+

+ The name io_service is retained as a typedef. +

+
+

+ dispatch +

+
+

+ io_service::dispatch +

+
+

+ The dispatch free function can be used to submit functions + to any Executor or + ExecutionContext. +

+
+

+ post +

+
+

+ io_service::post +

+
+

+ The post free function can be used to submit functions + to any Executor or + ExecutionContext. +

+
+

+ defer +

+
+

+ io_service::post + when the asio_handler_is_continuation + hook returns true +

+
+

+ The defer free function can be used to submit functions + to any Executor or + ExecutionContext. +

+
+

+ io_context::poll +

+
+

+ io_service::poll + overload that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ io_context::poll_one +

+
+

+ io_service::poll_one + overload that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ io_context::run +

+
+

+ io_service::run + overload that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ io_context::run_one +

+
+

+ io_service::run_one + overload that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ io_context::run_for, + io_context::run_until, + io_context::run_one_for, + and io_context::run_one_until +

+
+ +

+ These functions add the ability to run an io_context + for a limited time. +

+
+

+ io_context::restart +

+
+

+ io_service::reset +

+
+
+

+ io_context + constructor concurrency_hint parameter is type int +

+
+

+ io_context + constructor concurrency_hint parameter is type std::size_t +

+
+

+ The old constructor has not been retained as a deprecated overload. +

+
+

+ execution_context, + execution_context::service, + and execution_context::id +

+
+

+ io_service, + io_service::service, + and io_service::id +

+
+

+ The service-related functionality has been moved to the execution_context + base class. This may also be used as a base for creating custom execution + contexts. +

+
+

+ make_service +

+
+

+ add_service +

+
+
+

+ strand +

+
+

+ io_service::strand +

+
+

+ This template works with any valid executor, and is itself a valid + executor. +

+
+

+ executor_work_guard + and make_work_guard +

+
+

+ io_service::work +

+
+

+ Work tracking is now covered by the Executor + requirements. These templates work with any valid executor. +

+
+

+ executor_binder + and bind_executor +

+
+

+ io_service::wrap + and io_service::strand::wrap +

+
+

+ These templates work with any valid executor. +

+
+

+ async_result + with CompletionToken and Signature template + parameters +

+
+

+ handler_type and single parameter async_result +

+
+

+ The async_result trait is now the single point of customisation + for asynchronous operation completion handlers and return type. +

+
+

+ associated_executor + and get_associated_executor +

+
+

+ asio_handler_invoke +

+
+

+ The handler invocation hook has been replaced by the new Executor + requirements and the associated executor traits. +

+
+

+ associated_allocator + and get_associated_allocator +

+
+

+ asio_handler_allocate + and asio_handler_deallocate +

+
+

+ The handler allocation hooks have been replaced by the standard Allocator + requirements and the associated allocator traits. +

+
+

+ const_buffer::data + and mutable_buffer::data +

+
+

+ buffer_cast +

+
+
+

+ const_buffer::size + and mutable_buffer::size +

+
+

+ buffer_size + for single buffers +

+
+

+ buffer_size is not deprecated for single buffers as + const_buffer and mutable_buffer now satisfy + the buffer sequence requirements +

+
+

+ const_buffer +

+
+

+ const_buffers_1 +

+
+

+ The ConstBufferSequence + requirements have been modified such that const_buffer + now satisfies them. +

+
+

+ mutable_buffer +

+
+

+ mutable_buffers_1 +

+
+

+ The MutableBufferSequence + requirements have been modified such that mutable_buffer + now satisfies them. +

+
+

+ basic_socket::get_executor + (and corresponding member for I/O objects such as timers, serial + ports, etc.) +

+
+

+ basic_io_object::get_io_service +

+
+

+ Use get_executor().context() to obtain the associated + io_context. +

+
+

+ socket_base::max_listen_connections +

+
+

+ socket_base::max_connections +

+
+
+

+ socket_base::wait_type, + basic_socket::wait, + basic_socket::async_wait, + basic_socket_acceptor::wait, + and basic_socket_acceptor::async_wait +

+
+

+ null_buffers +

+
+

+ Operations for reactive I/O. +

+
+

+ basic_socket_acceptor::accept + returns a socket +

+
+

+ basic_socket_acceptor::accept + takes a socket by reference +

+
+

+ Uses move support so requires C++11 or later. To accept a connection + into a socket object on a different io_context, pass + the destination context to accept. +

+
+

+ basic_socket_acceptor::async_accept + passes socket to handler +

+
+

+ basic_socket_acceptor::async_accept + takes a socket by reference +

+
+

+ Uses move support so requires C++11 or later. To accept a connection + into a socket object on a different io_context, pass + the destination context to async_accept. +

+
+

+ connect + overloads that take a range +

+
+

+ connect + overloads that take a single iterator +

+
+

+ The ip::basic_resolver::resolve + function now returns a range. When the resolve function's + result is passed directly to connect, the range overload + will be selected. +

+
+

+ async_connect + overloads that take a range +

+
+

+ async_connect + overloads that take a single iterator +

+
+

+ The ip::basic_resolver::resolve + function now returns a range. When the resolve function's + result is passed directly to async_connect, the range + overload will be selected. +

+
+

+ basic_socket_streambuf::duration +

+
+

+ basic_socket_streambuf::duration_type +

+
+
+

+ basic_socket_streambuf::time_point +

+
+

+ basic_socket_streambuf::time_type +

+
+
+

+ basic_socket_streambuf::expiry +

+
+

+ basic_socket_streambuf::expires_at + and basic_socket_streambuf::expires_from_now + getters +

+
+
+

+ basic_socket_streambuf::expires_after +

+
+

+ basic_socket_streambuf::expires_from_now + setter +

+
+
+

+ basic_socket_streambuf::error +

+
+

+ basic_socket_streambuf::puberror +

+
+
+

+ basic_socket_iostream::duration +

+
+

+ basic_socket_iostream::duration_type +

+
+
+

+ basic_socket_iostream::time_point +

+
+

+ basic_socket_iostream::time_type +

+
+
+

+ basic_socket_iostream::expiry +

+
+

+ basic_socket_iostream::expires_at + and basic_socket_iostream::expires_from_now + getters +

+
+
+

+ basic_socket_iostream::expires_after +

+
+

+ basic_socket_iostream::expires_from_now + setter +

+
+
+

+ basic_waitable_timer::cancel +

+
+

+ basic_waitable_timer::cancel + overload that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ basic_waitable_timer::cancel_one +

+
+

+ basic_waitable_timer::cancel_one + overload that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ basic_waitable_timer::expires_at + setter +

+
+

+ basic_waitable_timer::expires_at + setter that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ basic_waitable_timer::expiry +

+
+

+ basic_waitable_timer::expires_at + and basic_waitable_timer::expires_from_now + getters +

+
+
+

+ basic_waitable_timer::expires_after +

+
+

+ basic_waitable_timer::expires_from_now + setter +

+
+
+

+ ip::make_address +

+
+

+ ip::address::from_string +

+
+
+

+ ip::make_address_v4 +

+
+

+ ip::address_v4::from_string + and ip::address_v6::to_v4 +

+
+
+

+ ip::make_address_v6 +

+
+

+ ip::address_v6::from_string + and ip::address_v6::v4_mapped +

+
+
+

+ ip::address::to_string +

+
+

+ ip::address::to_string + that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ ip::address_v4::to_string +

+
+

+ ip::address_v4::to_string + that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ ip::address_v6::to_string +

+
+

+ ip::address_v6::to_string + that takes error_code& +

+
+

+ The error_code overload is not required. +

+
+

+ No replacement +

+
+

+ ip::address_v6::is_v4_compatible + and ip::address_v6::v4_compatible +

+
+
+

+ ip::network_v4 +

+
+

+ ip::address_v4::broadcast, + ip::address_v4::is_class_a, + ip::address_v4::is_class_b, + ip::address_v4::is_class_c, + and ip::address_v4::netmask +

+
+

+ The network_v4 class adds the ability to manipulate + IPv4 network addresses using CIDR notation. +

+
+

+ ip::network_v6 +

+
+ +

+ The network_v6 class adds the ability to manipulate + IPv6 network addresses using CIDR notation. +

+
+

+ ip::address_v4_iterator + and ip::address_v4_range +

+
+ +

+ The ip::address_v4_iterator and address_v4_range + classes add the ability to iterate over all, or a subset of, IPv4 + addresses. +

+
+

+ ip::address_v6_iterator + and ip::address_v6_range +

+
+ +

+ The ip::address_v6_iterator and address_v6_range + classes add the ability to iterate over all, or a subset of, IPv6 + addresses. +

+
+

+ ip::basic_resolver::results_type +

+
+

+ ip::basic_resolver::iterator +

+
+

+ Resolvers now produce ranges rather than single iterators. +

+
+

+ ip::basic_resolver::resolve + overloads taking hostname and service as arguments +

+
+

+ ip::basic_resolver::resolve + overloads taking a ip::basic_resolver::query +

+
+
+

+ ip::basic_resolver::resolve + returns a range +

+
+

+ ip::basic_resolver::resolve + returns a single iterator +

+
+
+

+ ip::basic_resolver::async_resolve + overloads taking hostname and service as arguments +

+
+

+ ip::basic_resolver::async_resolve + overloads taking a ip::basic_resolver::query +

+
+
+

+ ip::basic_resolver::async_resolve + calls the handler with a range +

+
+

+ ip::basic_resolver::async_resolve + calls the handler with a single iterator +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview.html b/include/asio/doc/asio/overview.html new file mode 100644 index 0000000..57ae59c --- /dev/null +++ b/include/asio/doc/asio/overview.html @@ -0,0 +1,155 @@ + + + +Overview + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core.html b/include/asio/doc/asio/overview/core.html new file mode 100644 index 0000000..4e9c620 --- /dev/null +++ b/include/asio/doc/asio/overview/core.html @@ -0,0 +1,84 @@ + + + +Core Concepts and Functionality + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/allocation.html b/include/asio/doc/asio/overview/core/allocation.html new file mode 100644 index 0000000..e8f4b6d --- /dev/null +++ b/include/asio/doc/asio/overview/core/allocation.html @@ -0,0 +1,136 @@ + + + +Custom Memory Allocation + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Many asynchronous operations need to allocate an object to store state + associated with the operation. For example, a Win32 implementation needs + OVERLAPPED-derived objects + to pass to Win32 API functions. +

+

+ Furthermore, programs typically contain easily identifiable chains of asynchronous + operations. A half duplex protocol implementation (e.g. an HTTP server) + would have a single chain of operations per client (receives followed by + sends). A full duplex protocol implementation would have two chains executing + in parallel. Programs should be able to leverage this knowledge to reuse + memory for all asynchronous operations in a chain. +

+

+ Given a copy of a user-defined Handler + object h, if the implementation + needs to allocate memory associated with that handler it will obtain an + allocator using the get_associated_allocator + function. For example: +

+
asio::associated_allocator_t<Handler> a = asio::get_associated_allocator(h);
+
+

+ The associated allocator must satisfy the standard Allocator requirements. +

+

+ By default, handlers use the standard allocator (which is implemented in + terms of ::operator + new() + and ::operator + delete()). + The allocator may be customised for a particular handler type by specifying + a nested type allocator_type + and member function get_allocator(): +

+
class my_handler
+{
+public:
+  // Custom implementation of Allocator type requirements.
+  typedef my_allocator allocator_type;
+
+  // Return a custom allocator implementation.
+  allocator_type get_allocator() const noexcept
+  {
+    return my_allocator();
+  }
+
+  void operator()() { ... }
+};
+
+

+ In more complex cases, the associated_allocator + template may be partially specialised directly: +

+
namespace asio {
+
+  template <typename Allocator>
+  struct associated_allocator<my_handler, Allocator>
+  {
+    // Custom implementation of Allocator type requirements.
+    typedef my_allocator type;
+
+    // Return a custom allocator implementation.
+    static type get(const my_handler&,
+        const Allocator& a = Allocator()) noexcept
+    {
+      return my_allocator();
+    }
+  };
+
+} // namespace asio
+
+

+ The implementation guarantees that the deallocation will occur before the + associated handler is invoked, which means the memory is ready to be reused + for any new asynchronous operations started by the handler. +

+

+ The custom memory allocation functions may be called from any user-created + thread that is calling a library function. The implementation guarantees + that, for the asynchronous operations included the library, the implementation + will not make concurrent calls to the memory allocation functions for that + handler. The implementation will insert appropriate memory barriers to + ensure correct memory visibility should allocation functions need to be + called from different threads. +

+
+ + See + Also +
+

+ associated_allocator, + get_associated_allocator, + custom memory allocation + example (C++03), custom + memory allocation example (C++11). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/async.html b/include/asio/doc/asio/overview/core/async.html new file mode 100644 index 0000000..6825ebf --- /dev/null +++ b/include/asio/doc/asio/overview/core/async.html @@ -0,0 +1,280 @@ + + + +The Proactor Design Pattern: Concurrency Without Threads + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The Asio library offers side-by-side support for synchronous and asynchronous + operations. The asynchronous support is based on the Proactor design pattern + [POSA2]. The + advantages and disadvantages of this approach, when compared to a synchronous-only + or Reactor approach, are outlined below. +

+
+ + Proactor + and Asio +
+

+ Let us examine how the Proactor design pattern is implemented in Asio, + without reference to platform-specific details. +

+

+ proactor +

+

+ Proactor design pattern (adapted from [POSA2]) +

+

+ — Asynchronous Operation +

+

+ Defines an operation that is executed asynchronously, such as an asynchronous + read or write on a socket. +

+

+ — Asynchronous Operation Processor +

+

+ Executes asynchronous operations and queues events on a completion event + queue when operations complete. From a high-level point of view, internal + services like reactive_socket_service + are asynchronous operation processors. +

+

+ — Completion Event Queue +

+

+ Buffers completion events until they are dequeued by an asynchronous + event demultiplexer. +

+

+ — Completion Handler +

+

+ Processes the result of an asynchronous operation. These are function + objects, often created using boost::bind. +

+

+ — Asynchronous Event Demultiplexer +

+

+ Blocks waiting for events to occur on the completion event queue, and + returns a completed event to its caller. +

+

+ — Proactor +

+

+ Calls the asynchronous event demultiplexer to dequeue events, and dispatches + the completion handler (i.e. invokes the function object) associated + with the event. This abstraction is represented by the io_context class. +

+

+ — Initiator +

+

+ Application-specific code that starts asynchronous operations. The initiator + interacts with an asynchronous operation processor via a high-level interface + such as basic_stream_socket, + which in turn delegates to a service like reactive_socket_service. +

+
+ + Implementation + Using Reactor +
+

+ On many platforms, Asio implements the Proactor design pattern in terms + of a Reactor, such as select, + epoll or kqueue. This implementation approach + corresponds to the Proactor design pattern as follows: +

+

+ — Asynchronous Operation Processor +

+

+ A reactor implemented using select, + epoll or kqueue. When the reactor indicates + that the resource is ready to perform the operation, the processor executes + the asynchronous operation and enqueues the associated completion handler + on the completion event queue. +

+

+ — Completion Event Queue +

+

+ A linked list of completion handlers (i.e. function objects). +

+

+ — Asynchronous Event Demultiplexer +

+

+ This is implemented by waiting on an event or condition variable until + a completion handler is available in the completion event queue. +

+
+ + Implementation + Using Windows Overlapped I/O +
+

+ On Windows NT, 2000 and XP, Asio takes advantage of overlapped I/O to provide + an efficient implementation of the Proactor design pattern. This implementation + approach corresponds to the Proactor design pattern as follows: +

+

+ — Asynchronous Operation Processor +

+

+ This is implemented by the operating system. Operations are initiated + by calling an overlapped function such as AcceptEx. +

+

+ — Completion Event Queue +

+

+ This is implemented by the operating system, and is associated with an + I/O completion port. There is one I/O completion port for each io_context instance. +

+

+ — Asynchronous Event Demultiplexer +

+

+ Called by Asio to dequeue events and their associated completion handlers. +

+
+ + Advantages +
+

+ — Portability. +

+

+ Many operating systems offer a native asynchronous I/O API (such as overlapped + I/O on Windows) as the preferred option for developing + high performance network applications. The library may be implemented + in terms of native asynchronous I/O. However, if native support is not + available, the library may also be implemented using synchronous event + demultiplexors that typify the Reactor pattern, such as POSIX + select(). +

+

+ — Decoupling threading from concurrency. +

+

+ Long-duration operations are performed asynchronously by the implementation + on behalf of the application. Consequently applications do not need to + spawn many threads in order to increase concurrency. +

+

+ — Performance and scalability. +

+

+ Implementation strategies such as thread-per-connection (which a synchronous-only + approach would require) can degrade system performance, due to increased + context switching, synchronisation and data movement among CPUs. With + asynchronous operations it is possible to avoid the cost of context switching + by minimising the number of operating system threads — typically a limited + resource — and only activating the logical threads of control that have + events to process. +

+

+ — Simplified application synchronisation. +

+

+ Asynchronous operation completion handlers can be written as though they + exist in a single-threaded environment, and so application logic can + be developed with little or no concern for synchronisation issues. +

+

+ — Function composition. +

+

+ Function composition refers to the implementation of functions to provide + a higher-level operation, such as sending a message in a particular format. + Each function is implemented in terms of multiple calls to lower-level + read or write operations. +

+

+ For example, consider a protocol where each message consists of a fixed-length + header followed by a variable length body, where the length of the body + is specified in the header. A hypothetical read_message operation could + be implemented using two lower-level reads, the first to receive the + header and, once the length is known, the second to receive the body. +

+

+ To compose functions in an asynchronous model, asynchronous operations + can be chained together. That is, a completion handler for one operation + can initiate the next. Starting the first call in the chain can be encapsulated + so that the caller need not be aware that the higher-level operation + is implemented as a chain of asynchronous operations. +

+

+ The ability to compose new operations in this way simplifies the development + of higher levels of abstraction above a networking library, such as functions + to support a specific protocol. +

+
+ + Disadvantages +
+

+ — Program complexity. +

+

+ It is more difficult to develop applications using asynchronous mechanisms + due to the separation in time and space between operation initiation + and completion. Applications may also be harder to debug due to the inverted + flow of control. +

+

+ — Memory usage. +

+

+ Buffer space must be committed for the duration of a read or write operation, + which may continue indefinitely, and a separate buffer is required for + each concurrent operation. The Reactor pattern, on the other hand, does + not require buffer space until a socket is ready for reading or writing. +

+
+ + References +
+

+ [POSA2] D. Schmidt et al, Pattern Oriented Software Architecture, + Volume 2. Wiley, 2000. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/basics.html b/include/asio/doc/asio/overview/core/basics.html new file mode 100644 index 0000000..13d06c5 --- /dev/null +++ b/include/asio/doc/asio/overview/core/basics.html @@ -0,0 +1,172 @@ + + + +Basic Asio Anatomy + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio may be used to perform both synchronous and asynchronous operations + on I/O objects such as sockets. Before using Asio it may be useful to get + a conceptual picture of the various parts of Asio, your program, and how + they work together. +

+

+ As an introductory example, let's consider what happens when you perform + a connect operation on a socket. We shall start by examining synchronous + operations. +

+

+ sync_op +

+

+ Your program will have at least one I/O execution context, such as an asio::io_context object, asio::thread_pool + object, or asio::system_context. This I/O + execution context represents your program's + link to the operating system's I/O services. +

+
asio::io_context io_context;
+
+

+ To perform I/O operations your program + will need an I/O object such as a TCP + socket: +

+
asio::ip::tcp::socket socket(io_context);
+
+

+ When a synchronous connect operation is performed, the following sequence + of events occurs: +

+

+ 1. Your program initiates the connect + operation by calling the I/O object: +

+
socket.connect(server_endpoint);
+
+

+ 2. The I/O object forwards the request + to the I/O execution context. +

+

+ 3. The I/O execution context calls on + the operating system to perform the connect + operation. +

+

+ 4. The operating system returns the result + of the operation to the I/O execution context. +

+

+ 5. The I/O execution context translates + any error resulting from the operation into an object of type asio::error_code. An error_code + may be compared with specific values, or tested as a boolean (where a + false result means that no + error occurred). The result is then forwarded back up to the I/O object. +

+

+ 6. The I/O object throws an exception + of type asio::system_error if the operation failed. + If the code to initiate the operation had instead been written as: +

+
asio::error_code ec;
+socket.connect(server_endpoint, ec);
+
+

+ then the error_code variable + ec would be set to the + result of the operation, and no exception would be thrown. +

+

+ When an asynchronous operation is used, a different sequence of events + occurs. +

+

+ async_op1 +

+

+ 1. Your program initiates the connect + operation by calling the I/O object: +

+
socket.async_connect(server_endpoint, your_completion_handler);
+
+

+ where your_completion_handler + is a function or function object with the signature: +

+
void your_completion_handler(const asio::error_code& ec);
+
+

+ The exact signature required depends on the asynchronous operation being + performed. The reference documentation indicates the appropriate form for + each operation. +

+

+ 2. The I/O object forwards the request + to the I/O execution context. +

+

+ 3. The I/O execution context signals to + the operating system that it should start + an asynchronous connect. +

+

+ Time passes. (In the synchronous case this wait would have been contained + entirely within the duration of the connect operation.) +

+

+ async_op2 +

+

+ 4. The operating system indicates that + the connect operation has completed by placing the result on a queue, ready + to be picked up by the I/O execution context. +

+

+ 5. When using an io_context + as the I/O execution context, your program must make a call to io_context::run() (or to one of the similar io_context member functions) in order + for the result to be retrieved. A call to io_context::run() blocks while there are unfinished asynchronous + operations, so you would typically call it as soon as you have started + your first asynchronous operation. +

+

+ 6. While inside the call to io_context::run(), the I/O execution + context dequeues the result of the operation, translates it + into an error_code, and + then passes it to your completion handler. +

+

+ This is a simplified picture of how Asio operates. You will want to delve + further into the documentation if your needs are more advanced, such as + extending Asio to perform other types of asynchronous operations. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/buffers.html b/include/asio/doc/asio/overview/core/buffers.html new file mode 100644 index 0000000..0418eb7 --- /dev/null +++ b/include/asio/doc/asio/overview/core/buffers.html @@ -0,0 +1,235 @@ + + + +Buffers + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Fundamentally, I/O involves the transfer of data to and from contiguous + regions of memory, called buffers. These buffers can be simply expressed + as a tuple consisting of a pointer and a size in bytes. However, to allow + the development of efficient network applications, Asio includes support + for scatter-gather operations. These operations involve one or more buffers: +

+
    +
  • + A scatter-read receives data into multiple buffers. +
  • +
  • + A gather-write transmits multiple buffers. +
  • +
+

+ Therefore we require an abstraction to represent a collection of buffers. + The approach used in Asio is to define a type (actually two types) to represent + a single buffer. These can be stored in a container, which may be passed + to the scatter-gather operations. +

+

+ In addition to specifying buffers as a pointer and size in bytes, Asio + makes a distinction between modifiable memory (called mutable) and non-modifiable + memory (where the latter is created from the storage for a const-qualified + variable). These two types could therefore be defined as follows: +

+
typedef std::pair<void*, std::size_t> mutable_buffer;
+typedef std::pair<const void*, std::size_t> const_buffer;
+
+

+ Here, a mutable_buffer would be convertible to a const_buffer, but conversion + in the opposite direction is not valid. +

+

+ However, Asio does not use the above definitions as-is, but instead defines + two classes: mutable_buffer + and const_buffer. The goal + of these is to provide an opaque representation of contiguous memory, where: +

+
    +
  • + Types behave as std::pair would in conversions. That is, a mutable_buffer is convertible to + a const_buffer, but + the opposite conversion is disallowed. +
  • +
  • + There is protection against buffer overruns. Given a buffer instance, + a user can only create another buffer representing the same range of + memory or a sub-range of it. To provide further safety, the library + also includes mechanisms for automatically determining the size of + a buffer from an array, boost::array + or std::vector of POD elements, or from a + std::string. +
  • +
  • + The underlying memory is explicitly accessed using the data() + member function. In general an application should never need to do + this, but it is required by the library implementation to pass the + raw memory to the underlying operating system functions. +
  • +
+

+ Finally, multiple buffers can be passed to scatter-gather operations (such + as read() or write()) + by putting the buffer objects into a container. The MutableBufferSequence + and ConstBufferSequence + concepts have been defined so that containers such as std::vector, + std::list, std::array + or boost::array can be used. +

+
+ + Streambuf + for Integration with Iostreams +
+

+ The class asio::basic_streambuf is derived from std::basic_streambuf to associate the input + sequence and output sequence with one or more objects of some character + array type, whose elements store arbitrary values. These character array + objects are internal to the streambuf object, but direct access to the + array elements is provided to permit them to be used with I/O operations, + such as the send or receive operations of a socket: +

+
    +
  • + The input sequence of the streambuf is accessible via the data() + member function. The return type of this function meets the ConstBufferSequence requirements. +
  • +
  • + The output sequence of the streambuf is accessible via the prepare() + member function. The return type of this function meets the MutableBufferSequence requirements. +
  • +
  • + Data is transferred from the front of the output sequence to the back + of the input sequence by calling the commit() + member function. +
  • +
  • + Data is removed from the front of the input sequence by calling the + consume() + member function. +
  • +
+

+ The streambuf constructor accepts a size_t + argument specifying the maximum of the sum of the sizes of the input sequence + and output sequence. Any operation that would, if successful, grow the + internal data beyond this limit will throw a std::length_error + exception. +

+
+ + Bytewise + Traversal of Buffer Sequences +
+

+ The buffers_iterator<> + class template allows buffer sequences (i.e. types meeting MutableBufferSequence or ConstBufferSequence requirements) to + be traversed as though they were a contiguous sequence of bytes. Helper + functions called buffers_begin() and buffers_end() are also provided, where + the buffers_iterator<> template parameter is automatically deduced. +

+

+ As an example, to read a single line from a socket and into a std::string, you may write: +

+
asio::streambuf sb;
+...
+std::size_t n = asio::read_until(sock, sb, '\n');
+asio::streambuf::const_buffers_type bufs = sb.data();
+std::string line(
+    asio::buffers_begin(bufs),
+    asio::buffers_begin(bufs) + n);
+
+
+ + Buffer + Debugging +
+

+ Some standard library implementations, such as the one that ships with + Microsoft Visual C++ 8.0 and later, provide a feature called iterator debugging. + What this means is that the validity of iterators is checked at runtime. + If a program tries to use an iterator that has been invalidated, an assertion + will be triggered. For example: +

+
std::vector<int> v(1)
+std::vector<int>::iterator i = v.begin();
+v.clear(); // invalidates iterators
+*i = 0; // assertion!
+
+

+ Asio takes advantage of this feature to add buffer debugging. Consider + the following code: +

+
void dont_do_this()
+{
+ std::string msg = "Hello, world!";
+ asio::async_write(sock, asio::buffer(msg), my_handler);
+}
+
+

+ When you call an asynchronous read or write you need to ensure that the + buffers for the operation are valid until the completion handler is called. + In the above example, the buffer is the std::string + variable msg. This variable + is on the stack, and so it goes out of scope before the asynchronous operation + completes. If you're lucky then the application will crash, but random + failures are more likely. +

+

+ When buffer debugging is enabled, Asio stores an iterator into the string + until the asynchronous operation completes, and then dereferences it to + check its validity. In the above example you would observe an assertion + failure just before Asio tries to call the completion handler. +

+

+ This feature is automatically made available for Microsoft Visual Studio + 8.0 or later and for GCC when _GLIBCXX_DEBUG + is defined. There is a performance cost to this checking, so buffer debugging + is only enabled in debug builds. For other compilers it may be enabled + by defining ASIO_ENABLE_BUFFER_DEBUGGING. + It can also be explicitly disabled by defining ASIO_DISABLE_BUFFER_DEBUGGING. +

+
+ + See + Also +
+

+ buffer, buffers_begin, + buffers_end, buffers_iterator, + const_buffer, const_buffers_1, mutable_buffer, mutable_buffers_1, + streambuf, ConstBufferSequence, + MutableBufferSequence, + buffers example (C++03), + buffers example (c++11). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/concurrency_hint.html b/include/asio/doc/asio/overview/core/concurrency_hint.html new file mode 100644 index 0000000..276929c --- /dev/null +++ b/include/asio/doc/asio/overview/core/concurrency_hint.html @@ -0,0 +1,168 @@ + + + +Concurrency Hints + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The io_context constructor allows + programs to specify a concurrency hint. This is a suggestion to the io_context implementation as to the number + of active threads that should be used for running completion handlers. +

+

+ When the Windows I/O completion port backend is in use, this value is passed + to CreateIoCompletionPort. +

+

+ When a reactor-based backend is used, the implementation recognises the + following special concurrency hint values: +

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Value +

+
+

+ Description +

+
+

+ 1 +

+
+

+ The implementation assumes that the io_context + will be run from a single thread, and applies several optimisations + based on this assumption. +

+

+ For example, when a handler is posted from within another handler, + the new handler is added to a fast thread-local queue (with the + consequence that the new handler is held back until the currently + executing handler finishes). +

+
+

+ ASIO_CONCURRENCY_HINT_UNSAFE +

+
+

+ This special concurrency hint disables locking in both the scheduler + and reactor I/O. This hint has the following restrictions: +

+

+ — Care must be taken to ensure that all operations on the io_context and any of its associated + I/O objects (such as sockets and timers) occur in only one thread + at a time. +

+

+ — Asynchronous resolve operations fail with operation_not_supported. +

+

+ — If a signal_set + is used with the io_context, + signal_set objects + cannot be used with any other io_context in the program. +

+
+

+ ASIO_CONCURRENCY_HINT_UNSAFE_IO +

+
+

+ This special concurrency hint disables locking in the reactor + I/O. This hint has the following restrictions: +

+

+ — Care must be taken to ensure that run functions on the io_context, and all operations + on the context's associated I/O objects (such as sockets and + timers), occur in only one thread at a time. +

+
+

+ ASIO_CONCURRENCY_HINT_SAFE +

+
+

+ The default. The io_context + provides full thread safety, and distinct I/O objects may be + used from any thread. +

+
+

+ The concurrency hint used by default-constructed io_context + objects can be overridden at compile time by defining the ASIO_CONCURRENCY_HINT_DEFAULT + macro. For example, specifying +

+
-DASIO_CONCURRENCY_HINT_DEFAULT=1
+
+

+ on the compiler command line means that a concurrency hint of 1 + is used for all default-constructed io_context objects in + the program. Similarly, the concurrency hint used by io_context + objects constructed with 1 can be overridden by defining + ASIO_CONCURRENCY_HINT_1. For example, passing +

+
-DASIO_CONCURRENCY_HINT_1=ASIO_CONCURRENCY_HINT_UNSAFE
+
+

+ to the compiler will disable thread safety for all of these objects. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/coroutine.html b/include/asio/doc/asio/overview/core/coroutine.html new file mode 100644 index 0000000..d43b7d8 --- /dev/null +++ b/include/asio/doc/asio/overview/core/coroutine.html @@ -0,0 +1,84 @@ + + + +Stackless Coroutines + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The coroutine + class provides support for stackless coroutines. Stackless coroutines enable + programs to implement asynchronous logic in a synchronous manner, with + minimal overhead, as shown in the following example: +

+
struct session : asio::coroutine
+{
+  boost::shared_ptr<tcp::socket> socket_;
+  boost::shared_ptr<std::vector<char> > buffer_;
+
+  session(boost::shared_ptr<tcp::socket> socket)
+    : socket_(socket),
+      buffer_(new std::vector<char>(1024))
+  {
+  }
+
+  void operator()(asio::error_code ec = asio::error_code(), std::size_t n = 0)
+  {
+    if (!ec) reenter (this)
+    {
+      for (;;)
+      {
+        yield socket_->async_read_some(asio::buffer(*buffer_), *this);
+        yield asio::async_write(*socket_, asio::buffer(*buffer_, n), *this);
+      }
+    }
+  }
+};
+
+

+ The coroutine class is used in conjunction with the pseudo-keywords + reenter, yield and fork. These are + preprocessor macros, and are implemented in terms of a switch + statement using a technique similar to Duff's Device. The coroutine + class's documentation provides a complete description of these pseudo-keywords. +

+
+ + See + Also +
+

+ coroutine, HTTP + Server 4 example, Stackful + Coroutines. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/coroutines_ts.html b/include/asio/doc/asio/overview/core/coroutines_ts.html new file mode 100644 index 0000000..39b375a --- /dev/null +++ b/include/asio/doc/asio/overview/core/coroutines_ts.html @@ -0,0 +1,132 @@ + + + +Coroutines TS Support + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Support for the Coroutines TS is provided via the awaitable + class template, the use_awaitable + completion token, and the co_spawn() + function. These facilities allow programs to implement asynchronous logic + in a synchronous manner, in conjunction with the co_await + keyword, as shown in the following example: +

+
asio::co_spawn(executor, echo(std::move(socket)), asio::detached);
+
+// ...
+
+asio::awaitable<void> echo(tcp::socket socket)
+{
+  try
+  {
+    char data[1024];
+    for (;;)
+    {
+      std::size_t n = co_await socket.async_read_some(asio::buffer(data), asio::use_awaitable);
+      co_await async_write(socket, asio::buffer(data, n), asio::use_awaitable);
+    }
+  }
+  catch (std::exception& e)
+  {
+    std::printf("echo Exception: %s\n", e.what());
+  }
+}
+
+

+ The first argument to co_spawn() is an executor + that determines the context in which the coroutine is permitted to execute. + For example, a server's per-client object may consist of multiple coroutines; + they should all run on the same strand so that no explicit + synchronisation is required. +

+

+ The second argument is an awaitable<R>, + that is the result of the coroutine's entry point function, and in the + above example is the result of the call to echo. (Alternatively, + this argument can be a function object that returns the awaitable<R>.) + The template parameter R is the type of return value produced + by the coroutine. In the above example, the coroutine returns void. +

+

+ The third argument is a completion token, and this is used by co_spawn() + to produce a completion handler with signature void(std::exception_ptr, + R). This completion handler is invoked with the result of the coroutine + once it has finished. In the above example we pass a completion token type, + asio::detached, + which is used to explicitly ignore the result of an asynchronous operation. +

+

+ In this example the body of the coroutine is implemented in the echo + function. When the use_awaitable completion token is passed + to an asynchronous operation, the operation's initiating function returns + an awaitable that may be used with the co_await + keyword: +

+
std::size_t n = co_await socket.async_read_some(asio::buffer(data), asio::use_awaitable);
+
+

+ Where an asynchronous operation's handler signature has the form: +

+
void handler(asio::error_code ec, result_type result);
+
+

+ the resulting type of the co_await expression is result_type. + In the async_read_some example above, this is size_t. + If the asynchronous operation fails, the error_code is converted + into a system_error exception and thrown. +

+

+ Where a handler signature has the form: +

+
void handler(asio::error_code ec);
+
+

+ the co_await expression produces a void result. + As above, an error is passed back to the coroutine as a system_error + exception. +

+
+ + See + Also +
+

+ co_spawn, detached, + redirect_error, awaitable, use_awaitable_t, + use_awaitable, this_coro::executor, + Coroutines + TS examples, Stackful Coroutines, + Stackless Coroutines. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/handler_tracking.html b/include/asio/doc/asio/overview/core/handler_tracking.html new file mode 100644 index 0000000..aa483d9 --- /dev/null +++ b/include/asio/doc/asio/overview/core/handler_tracking.html @@ -0,0 +1,490 @@ + + + +Handler Tracking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ To aid in debugging asynchronous programs, Asio provides support for handler + tracking. When enabled by defining ASIO_ENABLE_HANDLER_TRACKING, + Asio writes debugging output to the standard error stream. The output records + asynchronous operations and the relationships between their handlers. +

+

+ This feature is useful when debugging and you need to know how your asynchronous + operations are chained together, or what the pending asynchronous operations + are. As an illustration, here is the output when you run the HTTP Server + example, handle a single request, then shut down via Ctrl+C: +

+
@asio|1589424178.741850|0*1|signal_set@0x7ffee977d878.async_wait
+@asio|1589424178.742593|0*2|socket@0x7ffee977d8a8.async_accept
+@asio|1589424178.742619|.2|non_blocking_accept,ec=asio.system:11
+@asio|1589424178.742625|0|resolver@0x7ffee977d760.cancel
+@asio|1589424195.830382|.2|non_blocking_accept,ec=system:0
+@asio|1589424195.830413|>2|ec=system:0
+@asio|1589424195.830473|2*3|socket@0x7fa71d808230.async_receive
+@asio|1589424195.830496|.3|non_blocking_recv,ec=system:0,bytes_transferred=151
+@asio|1589424195.830503|2*4|socket@0x7ffee977d8a8.async_accept
+@asio|1589424195.830507|.4|non_blocking_accept,ec=asio.system:11
+@asio|1589424195.830510|<2|
+@asio|1589424195.830529|>3|ec=system:0,bytes_transferred=151
+@asio|1589424195.831143|3^5|in 'async_write' (./../../../include/asio/impl/write.hpp:330)
+@asio|1589424195.831143|3*5|socket@0x7fa71d808230.async_send
+@asio|1589424195.831186|.5|non_blocking_send,ec=system:0,bytes_transferred=1090
+@asio|1589424195.831194|<3|
+@asio|1589424195.831218|>5|ec=system:0,bytes_transferred=1090
+@asio|1589424195.831263|5|socket@0x7fa71d808230.close
+@asio|1589424195.831298|<5|
+@asio|1589424199.793770|>1|ec=system:0,signal_number=2
+@asio|1589424199.793781|1|socket@0x7ffee977d8a8.close
+@asio|1589424199.793809|<1|
+@asio|1589424199.793840|>4|ec=asio.system:125
+@asio|1589424199.793854|<4|
+@asio|1589424199.793883|0|signal_set@0x7ffee977d878.cancel
+
+

+ Each line is of the form: +

+
<tag>|<timestamp>|<action>|<description>
+
+

+ The <tag> is always @asio, and is used + to identify and extract the handler tracking messages from the program + output. +

+

+ The <timestamp> is seconds and microseconds from 1 Jan + 1970 UTC. +

+

+ The <action> takes one of the following forms: +

+
+

+
+
>n
+

+ The program entered the handler number n. The <description> + shows the arguments to the handler. +

+
<n
+

+ The program left handler number n. +

+
!n
+

+ The program left handler number n due to an exception. +

+
~n
+

+ The handler number n was destroyed without having been + invoked. This is usually the case for any unfinished asynchronous + operations when the io_context is destroyed. +

+
n^m
+

+ The handler number n is about to create a new asynchronous + operation with completion handler number m. The <description> + contains source location information to help identify where in the + program the asynchronous operation is being started. +

+
n*m
+

+ The handler number n created a new asynchronous operation + with completion handler number m. The <description> + shows what asynchronous operation was started. +

+
n
+

+ The handler number n performed some other operation. + The <description> shows what function was called. + Currently only close() and cancel() operations + are logged, as these may affect the state of pending asynchronous + operations. +

+
.n
+

+ The implementation performed a system call as part of the asynchronous + operation for which handler number n is the completion + handler. The <description> shows what function + was called and its results. These tracking events are only emitted + when using a reactor-based implementation. +

+
+
+

+ Where the <description> shows a synchronous or asynchronous + operation, the format is <object-type>@<pointer>.<operation>. + For handler entry, it shows a comma-separated list of arguments and their + values. +

+

+ As shown above, Each handler is assigned a numeric identifier. Where the + handler tracking output shows a handler number of 0, it means that the + action was performed outside of any handler. +

+
+ + Adding + Location Information +
+

+ Programs may augment the handler tracking output's location information + by using the macro ASIO_HANDLER_LOCATION + in the source code. For example: +

+
#define HANDLER_LOCATION \
+  ASIO_HANDLER_LOCATION((__FILE__, __LINE__, __func__))
+
+// ...
+
+void do_read()
+{
+  HANDLER_LOCATION;
+
+  auto self(shared_from_this());
+  socket_.async_read_some(asio::buffer(data_, max_length),
+      [this, self](std::error_code ec, std::size_t length)
+      {
+        HANDLER_LOCATION;
+
+        if (!ec)
+        {
+          do_write(length);
+        }
+      });
+}
+
+

+ With the additional location information available, the handler tracking + output may include a call stack of source locations: +

+
@asio|1589423304.861944|>7|ec=system:0,bytes_transferred=5
+@asio|1589423304.861952|7^8|in 'async_write' (./../../../include/asio/impl/write.hpp:330)
+@asio|1589423304.861952|7^8|called from 'do_write' (handler_tracking/async_tcp_echo_server.cpp:62)
+@asio|1589423304.861952|7^8|called from 'operator()' (handler_tracking/async_tcp_echo_server.cpp:51)
+@asio|1589423304.861952|7*8|socket@0x7ff61c008230.async_send
+@asio|1589423304.861975|.8|non_blocking_send,ec=system:0,bytes_transferred=5
+@asio|1589423304.861980|<7|
+
+

+ Furthermore, if std::source_location or std::experimental::source_location + are available, the use_awaitable_t + token (when default-constructed or used as a default completion token) + will also cause handler tracking to output a source location for each newly + created asynchronous operation. A use_awaitable_t object may + also be explicitly constructed with location information. +

+
+ + Visual + Representations +
+

+ The handler tracking output may be post-processed using the included handlerviz.pl + tool to create a visual representation of the handlers (requires the GraphViz + tool dot). +

+
+ + Custom Tracking +
+

+ Handling tracking may be customised by defining the ASIO_CUSTOM_HANDLER_TRACKING + macro to the name of a header file (enclosed in "" + or <>). This header + file must implement the following preprocessor macros: +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Macro +

+
+

+ Description +

+
+

+ ASIO_INHERIT_TRACKED_HANDLER +

+
+

+ Specifies a base class for classes that implement asynchronous + operations. When used, the macro immediately follows the class + name, so it must have the form : + public my_class. +

+
+

+ ASIO_ALSO_INHERIT_TRACKED_HANDLER +

+
+

+ Specifies a base class for classes that implement asynchronous + operations. When used, the macro follows other base classes, + so it must have the form , + public my_class. +

+
+

+ ASIO_HANDLER_TRACKING_INIT(args) +

+
+

+ An expression that is used to initialise the tracking mechanism. +

+
+

+ ASIO_HANDLER_LOCATION(args) +

+
+

+ A variable declaration that is used to define a source code location. + args is a parenthesised + function argument list containing the file name, line number, + and function name. +

+
+

+ ASIO_HANDLER_CREATION(args) +

+
+

+ An expression that is called on creation of an asynchronous operation. + args is a parenthesised + function argument list containing the owning execution context, + the tracked handler, the name of the object type, a pointer to + the object, the object's native handle, and the operation name. +

+
+

+ ASIO_HANDLER_COMPLETION(args) +

+
+

+ An expression that is called on completion of an asynchronous + operation. args + is a parenthesised function argument list containing the tracked + handler. +

+
+

+ ASIO_HANDLER_INVOCATION_BEGIN(args) +

+
+

+ An expression that is called immediately before a completion + handler is invoked. args + is a parenthesised function argument list containing the arguments + to the completion handler. +

+
+

+ ASIO_HANDLER_INVOCATION_END +

+
+

+ An expression that is called immediately after a completion handler + is invoked. +

+
+

+ ASIO_HANDLER_OPERATION(args) +

+
+

+ An expression that is called when some synchronous object operation + is called (such as close() or cancel()). args + is a parenthesised function argument list containing the owning + execution context, the name of the object type, a pointer to + the object, the object's native handle, and the operation name. +

+
+

+ ASIO_HANDLER_REACTOR_REGISTRATION(args) +

+
+

+ An expression that is called when an object is registered with + the reactor. args + is a parenthesised function argument list containing the owning + execution context, the object's native handle, and a unique registration + key. +

+
+

+ ASIO_HANDLER_REACTOR_DEREGISTRATION(args) +

+
+

+ An expression that is called when an object is deregistered from + the reactor. args + is a parenthesised function argument list containing the owning + execution context, the object's native handle, and a unique registration + key. +

+
+

+ ASIO_HANDLER_REACTOR_READ_EVENT +

+
+

+ A bitmask constant used to identify reactor read readiness events. +

+
+

+ ASIO_HANDLER_REACTOR_WRITE_EVENT +

+
+

+ A bitmask constant used to identify reactor write readiness events. +

+
+

+ ASIO_HANDLER_REACTOR_ERROR_EVENT +

+
+

+ A bitmask constant used to identify reactor error readiness events. +

+
+

+ ASIO_HANDLER_REACTOR_EVENTS(args) +

+
+

+ An expression that is called when an object registered with the + reactor becomes ready. args + is a parenthesised function argument list containing the owning + execution context, the unique registration key, and a bitmask + of the ready events. +

+
+

+ ASIO_HANDLER_REACTOR_OPERATION(args) +

+
+

+ An expression that is called when the implementation performs + a system call as part of a reactor-based asynchronous operation. + args is a parenthesised + function argument list containing the tracked handler, the operation + name, the error code produced by the operation, and (optionally) + the number of bytes transferred. +

+
+
+ + See + Also +
+

+ Handler tracking + examples. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/line_based.html b/include/asio/doc/asio/overview/core/line_based.html new file mode 100644 index 0000000..ea9e913 --- /dev/null +++ b/include/asio/doc/asio/overview/core/line_based.html @@ -0,0 +1,158 @@ + + + +Line-Based Operations + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Many commonly-used internet protocols are line-based, which means that + they have protocol elements that are delimited by the character sequence + "\r\n". Examples + include HTTP, SMTP and FTP. To more easily permit the implementation of + line-based protocols, as well as other protocols that use delimiters, Asio + includes the functions read_until() and async_read_until(). +

+

+ The following example illustrates the use of async_read_until() in an HTTP server, to receive the first + line of an HTTP request from a client: +

+
class http_connection
+{
+  ...
+
+  void start()
+  {
+    asio::async_read_until(socket_, data_, "\r\n",
+        boost::bind(&http_connection::handle_request_line, this, _1));
+  }
+
+  void handle_request_line(asio::error_code ec)
+  {
+    if (!ec)
+    {
+      std::string method, uri, version;
+      char sp1, sp2, cr, lf;
+      std::istream is(&data_);
+      is.unsetf(std::ios_base::skipws);
+      is >> method >> sp1 >> uri >> sp2 >> version >> cr >> lf;
+      ...
+    }
+  }
+
+  ...
+
+  asio::ip::tcp::socket socket_;
+  asio::streambuf data_;
+};
+
+

+ The streambuf data member + serves as a place to store the data that has been read from the socket + before it is searched for the delimiter. It is important to remember that + there may be additional data after the delimiter. + This surplus data should be left in the streambuf + so that it may be inspected by a subsequent call to read_until() or async_read_until(). +

+

+ The delimiters may be specified as a single char, + a std::string or a boost::regex. + The read_until() + and async_read_until() + functions also include overloads that accept a user-defined function object + called a match condition. For example, to read data into a streambuf until + whitespace is encountered: +

+
typedef asio::buffers_iterator<
+    asio::streambuf::const_buffers_type> iterator;
+
+std::pair<iterator, bool>
+match_whitespace(iterator begin, iterator end)
+{
+  iterator i = begin;
+  while (i != end)
+    if (std::isspace(*i++))
+      return std::make_pair(i, true);
+  return std::make_pair(i, false);
+}
+...
+asio::streambuf b;
+asio::read_until(s, b, match_whitespace);
+
+

+ To read data into a streambuf until a matching character is found: +

+
class match_char
+{
+public:
+  explicit match_char(char c) : c_(c) {}
+
+  template <typename Iterator>
+  std::pair<Iterator, bool> operator()(
+      Iterator begin, Iterator end) const
+  {
+    Iterator i = begin;
+    while (i != end)
+      if (c_ == *i++)
+        return std::make_pair(i, true);
+    return std::make_pair(i, false);
+  }
+
+private:
+  char c_;
+};
+
+namespace asio {
+  template <> struct is_match_condition<match_char>
+    : public boost::true_type {};
+} // namespace asio
+...
+asio::streambuf b;
+asio::read_until(s, b, match_char('a'));
+
+

+ The is_match_condition<> type trait automatically evaluates + to true for functions, and for function objects with a nested result_type typedef. For other types + the trait must be explicitly specialised, as shown above. +

+
+ + See + Also +
+

+ async_read_until(), + is_match_condition, + read_until(), streambuf, + HTTP client example. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/reactor.html b/include/asio/doc/asio/overview/core/reactor.html new file mode 100644 index 0000000..5c4477f --- /dev/null +++ b/include/asio/doc/asio/overview/core/reactor.html @@ -0,0 +1,79 @@ + + + +Reactor-Style Operations + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sometimes a program must be integrated with a third-party library that + wants to perform the I/O operations itself. To facilitate this, Asio includes + synchronous and asynchronous operations that may be used to wait for a + socket to become ready to read, ready to write, or to have a pending error + condition. +

+

+ As an example, to perform a non-blocking read something like the following + may be used: +

+
ip::tcp::socket socket(my_io_context);
+...
+socket.non_blocking(true);
+...
+socket.async_wait(ip::tcp::socket::wait_read, read_handler);
+...
+void read_handler(asio::error_code ec)
+{
+  if (!ec)
+  {
+    std::vector<char> buf(socket.available());
+    socket.read_some(buffer(buf));
+  }
+}
+
+

+ These operations are supported for sockets on all platforms, and for the + POSIX stream-oriented descriptor classes. +

+
+ + See + Also +
+

+ basic_socket::wait(), + basic_socket::async_wait(), + basic_socket::non_blocking(), + basic_socket::native_non_blocking(), + nonblocking example. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/spawn.html b/include/asio/doc/asio/overview/core/spawn.html new file mode 100644 index 0000000..fc8b926 --- /dev/null +++ b/include/asio/doc/asio/overview/core/spawn.html @@ -0,0 +1,146 @@ + + + +Stackful Coroutines + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The spawn() function + is a high-level wrapper for running stackful coroutines. It is based on + the Boost.Coroutine library. The spawn() function enables + programs to implement asynchronous logic in a synchronous manner, as shown + in the following example: +

+
asio::spawn(my_strand, do_echo);
+
+// ...
+
+void do_echo(asio::yield_context yield)
+{
+  try
+  {
+    char data[128];
+    for (;;)
+    {
+      std::size_t length =
+        my_socket.async_read_some(
+          asio::buffer(data), yield);
+
+      asio::async_write(my_socket,
+          asio::buffer(data, length), yield);
+    }
+  }
+  catch (std::exception& e)
+  {
+    // ...
+  }
+}
+
+

+ The first argument to spawn() may be a strand, + io_context, + or completion handler. + This argument determines the context in which the coroutine is permitted + to execute. For example, a server's per-client object may consist of multiple + coroutines; they should all run on the same strand so that + no explicit synchronisation is required. +

+

+ The second argument is a function object with signature: +

+
void coroutine(asio::yield_context yield);
+
+

+ that specifies the code to be run as part of the coroutine. The parameter + yield may be passed to an asynchronous operation in place + of the completion handler, as in: +

+
std::size_t length =
+  my_socket.async_read_some(
+    asio::buffer(data), yield);
+
+

+ This starts the asynchronous operation and suspends the coroutine. The + coroutine will be resumed automatically when the asynchronous operation + completes. +

+

+ Where an asynchronous operation's handler signature has the form: +

+
void handler(asio::error_code ec, result_type result);
+
+

+ the initiating function returns the result_type. In the async_read_some + example above, this is size_t. If the asynchronous operation + fails, the error_code is converted into a system_error + exception and thrown. +

+

+ Where a handler signature has the form: +

+
void handler(asio::error_code ec);
+
+

+ the initiating function returns void. As above, an error is + passed back to the coroutine as a system_error exception. +

+

+ To collect the error_code from an operation, rather than have + it throw an exception, associate the output variable with the yield_context + as follows: +

+
asio::error_code ec;
+std::size_t length =
+  my_socket.async_read_some(
+    asio::buffer(data), yield[ec]);
+
+

+ Note: if spawn() is used + with a custom completion handler of type Handler, the function + object signature is actually: +

+
void coroutine(asio::basic_yield_context<Handler> yield);
+
+
+ + See + Also +
+

+ spawn, yield_context, + basic_yield_context, + Spawn example (C++03), + Spawn example (C++11), + Stackless Coroutines. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/strands.html b/include/asio/doc/asio/overview/core/strands.html new file mode 100644 index 0000000..8e1b31a --- /dev/null +++ b/include/asio/doc/asio/overview/core/strands.html @@ -0,0 +1,161 @@ + + + +Strands: Use Threads Without Explicit Locking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A strand is defined as a strictly sequential invocation of event handlers + (i.e. no concurrent invocation). Use of strands allows execution of code + in a multithreaded program without the need for explicit locking (e.g. + using mutexes). +

+

+ Strands may be either implicit or explicit, as illustrated by the following + alternative approaches: +

+
    +
  • + Calling io_context::run() from only one thread means all event handlers + execute in an implicit strand, due to the io_context's guarantee that + handlers are only invoked from inside run(). +
  • +
  • + Where there is a single chain of asynchronous operations associated + with a connection (e.g. in a half duplex protocol implementation like + HTTP) there is no possibility of concurrent execution of the handlers. + This is an implicit strand. +
  • +
  • + An explicit strand is an instance of strand<> or io_context::strand. + All event handler function objects need to be bound to the strand using + asio::bind_executor() + or otherwise posted/dispatched through the strand object. +
  • +
+

+ In the case of composed asynchronous operations, such as async_read() + or async_read_until(), + if a completion handler goes through a strand, then all intermediate handlers + should also go through the same strand. This is needed to ensure thread + safe access for any objects that are shared between the caller and the + composed operation (in the case of async_read() it's the socket, which the caller can + close() + to cancel the operation). +

+

+ To achieve this, all asynchronous operations obtain the handler's associated + executor by using the get_associated_executor + function. For example: +

+
asio::associated_executor_t<Handler> a = asio::get_associated_executor(h);
+
+

+ The associated executor must satisfy the Executor requirements. It will + be used by the asynchronous operation to submit both intermediate and final + handlers for execution. +

+

+ The executor may be customised for a particular handler type by specifying + a nested type executor_type + and member function get_executor(): +

+
class my_handler
+{
+public:
+  // Custom implementation of Executor type requirements.
+  typedef my_executor executor_type;
+
+  // Return a custom executor implementation.
+  executor_type get_executor() const noexcept
+  {
+    return my_executor();
+  }
+
+  void operator()() { ... }
+};
+
+

+ In more complex cases, the associated_executor + template may be partially specialised directly: +

+
struct my_handler
+{
+  void operator()() { ... }
+};
+
+namespace asio {
+
+  template <class Executor>
+  struct associated_executor<my_handler, Executor>
+  {
+    // Custom implementation of Executor type requirements.
+    typedef my_executor type;
+
+    // Return a custom executor implementation.
+    static type get(const my_handler&,
+        const Executor& = Executor()) noexcept
+    {
+      return my_executor();
+    }
+  };
+
+} // namespace asio
+
+

+ The asio::bind_executor() + function is a helper to bind a specific executor object, such as a strand, + to a completion handler. This binding automatically associates an executor + as shown above. For example, to bind a strand to a completion handler we + would simply write: +

+
my_socket.async_read_some(my_buffer,
+    asio::bind_executor(my_strand,
+      [](error_code ec, size_t length)
+      {
+        // ...
+      }));
+
+
+ + See + Also +
+

+ associated_executor, + get_associated_executor, + bind_executor, strand, io_context::strand, + tutorial Timer.5, HTTP server 3 example. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/streams.html b/include/asio/doc/asio/overview/core/streams.html new file mode 100644 index 0000000..bf2ce0a --- /dev/null +++ b/include/asio/doc/asio/overview/core/streams.html @@ -0,0 +1,121 @@ + + + +Streams, Short Reads and Short Writes + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Many I/O objects in Asio are stream-oriented. This means that: +

+
    +
  • + There are no message boundaries. The data being transferred is a continuous + sequence of bytes. +
  • +
  • + Read or write operations may transfer fewer bytes than requested. This + is referred to as a short read or short write. +
  • +
+

+ Objects that provide stream-oriented I/O model one or more of the following + type requirements: +

+
    +
  • + SyncReadStream, where + synchronous read operations are performed using a member function called + read_some(). +
  • +
  • + AsyncReadStream, where + asynchronous read operations are performed using a member function + called async_read_some(). +
  • +
  • + SyncWriteStream, where + synchronous write operations are performed using a member function + called write_some(). +
  • +
  • + AsyncWriteStream, where + asynchronous write operations are performed using a member function + called async_write_some(). +
  • +
+

+ Examples of stream-oriented I/O objects include ip::tcp::socket, + ssl::stream<>, + posix::stream_descriptor, windows::stream_handle, + etc. +

+

+ Programs typically want to transfer an exact number of bytes. When a short + read or short write occurs the program must restart the operation, and + continue to do so until the required number of bytes has been transferred. + Asio provides generic functions that do this automatically: read(), + async_read(), + write() + and async_write(). +

+
+ + Why + EOF is an Error +
+
    +
  • + The end of a stream can cause read, + async_read, read_until or async_read_until + functions to violate their contract. E.g. a read of N bytes may finish + early due to EOF. +
  • +
  • + An EOF error may be used to distinguish the end of a stream from a + successful read of size 0. +
  • +
+
+ + See + Also +
+

+ async_read(), async_write(), + read(), write(), + AsyncReadStream, + AsyncWriteStream, + SyncReadStream, SyncWriteStream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/core/threads.html b/include/asio/doc/asio/overview/core/threads.html new file mode 100644 index 0000000..4745baa --- /dev/null +++ b/include/asio/doc/asio/overview/core/threads.html @@ -0,0 +1,124 @@ + + + +Threads and Asio + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ + Thread + Safety +
+

+ In general, it is safe to make concurrent use of distinct objects, but + unsafe to make concurrent use of a single object. However, types such as + io_context provide a stronger + guarantee that it is safe to use a single object concurrently. +

+
+ + Thread + Pools +
+

+ Multiple threads may call io_context::run() to set up a pool of threads from which + completion handlers may be invoked. This approach may also be used with + post() + as a means to perform arbitrary computational tasks across a thread pool. +

+

+ Note that all threads that have joined an io_context's + pool are considered equivalent, and the io_context + may distribute work across them in an arbitrary fashion. +

+
+ + Internal + Threads +
+

+ The implementation of this library for a particular platform may make use + of one or more internal threads to emulate asynchronicity. As far as possible, + these threads must be invisible to the library user. In particular, the + threads: +

+
    +
  • + must not call the user's code directly; and +
  • +
  • + must block all signals. +
  • +
+

+ This approach is complemented by the following guarantee: +

+
  • + Asynchronous completion handlers will only be called from threads that + are currently calling io_context::run(). +
+

+ Consequently, it is the library user's responsibility to create and manage + all threads to which the notifications will be delivered. +

+

+ The reasons for this approach include: +

+
    +
  • + By only calling io_context::run() from a single thread, the user's + code can avoid the development complexity associated with synchronisation. + For example, a library user can implement scalable servers that are + single-threaded (from the user's point of view). +
  • +
  • + A library user may need to perform initialisation in a thread shortly + after the thread starts and before any other application code is executed. + For example, users of Microsoft's COM must call CoInitializeEx + before any other COM operations can be called from that thread. +
  • +
  • + The library interface is decoupled from interfaces for thread creation + and management, and permits implementations on platforms where threads + are not available. +
  • +
+
+ + See + Also +
+

+ io_context, post. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011.html b/include/asio/doc/asio/overview/cpp2011.html new file mode 100644 index 0000000..543a07d --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011.html @@ -0,0 +1,65 @@ + + + +C++ 2011 Support + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/array.html b/include/asio/doc/asio/overview/cpp2011/array.html new file mode 100644 index 0000000..307eea9 --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/array.html @@ -0,0 +1,63 @@ + + + +Array Container + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Where the standard library provides std::array<>, Asio: +

+
+

+ Support for std::array<> is automatically enabled for + g++ 4.3 and later, when the -std=c++0x + or -std=gnu++0x compiler options are used, as well as + for Microsoft Visual C++ 10. It may be disabled by defining ASIO_DISABLE_STD_ARRAY, + or explicitly enabled for other compilers by defining ASIO_HAS_STD_ARRAY. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/atomic.html b/include/asio/doc/asio/overview/cpp2011/atomic.html new file mode 100644 index 0000000..6c53355 --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/atomic.html @@ -0,0 +1,48 @@ + + + +Atomics + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio's implementation can use std::atomic<> in preference + to boost::detail::atomic_count. +

+

+ Support for the standard atomic integer template is automatically enabled + for g++ 4.5 and later, when the -std=c++0x + or -std=gnu++0x compiler options are used. It may be + disabled by defining ASIO_DISABLE_STD_ATOMIC, or explicitly + enabled for other compilers by defining ASIO_HAS_STD_ATOMIC. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/chrono.html b/include/asio/doc/asio/overview/cpp2011/chrono.html new file mode 100644 index 0000000..9108977 --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/chrono.html @@ -0,0 +1,59 @@ + + + +Chrono + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+Chrono +

+

+ Asio provides timers based on the std::chrono facilities via + the basic_waitable_timer + class template. The typedefs system_timer, + steady_timer and high_resolution_timer + utilise the standard clocks system_clock, steady_clock + and high_resolution_clock respectively. +

+

+ Support for the std::chrono facilities is automatically enabled + for g++ 4.6 and later, when the -std=c++0x + or -std=gnu++0x compiler options are used. (Note that, + for g++, the draft-standard monotonic_clock + is used in place of steady_clock.) Support may be disabled + by defining ASIO_DISABLE_STD_CHRONO, or explicitly enabled + for other compilers by defining ASIO_HAS_STD_CHRONO. +

+

+ When standard chrono is unavailable, Asio will otherwise use + the Boost.Chrono library. The basic_waitable_timer + class template may be used with either. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/futures.html b/include/asio/doc/asio/overview/cpp2011/futures.html new file mode 100644 index 0000000..c3b219c --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/futures.html @@ -0,0 +1,75 @@ + + + +Futures + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The asio::use_future special value provides first-class support + for returning a C++11 std::future from an asynchronous operation's + initiating function. +

+

+ To use asio::use_future, pass it to an asynchronous operation + instead of a normal completion handler. For example: +

+
std::future<std::size_t> length =
+  my_socket.async_read_some(my_buffer, asio::use_future);
+
+

+ Where a handler signature has the form: +

+
void handler(asio::error_code ec, result_type result);
+
+

+ the initiating function returns a std::future templated on + result_type. In the above example, this is std::size_t. + If the asynchronous operation fails, the error_code is converted + into a system_error exception and passed back to the caller + through the future. +

+

+ Where a handler signature has the form: +

+
void handler(asio::error_code ec);
+
+

+ the initiating function returns std::future<void>. As + above, an error is passed back in the future as a system_error + exception. +

+

+ use_future, use_future_t, + Futures example (C++11). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/move_handlers.html b/include/asio/doc/asio/overview/cpp2011/move_handlers.html new file mode 100644 index 0000000..42868fb --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/move_handlers.html @@ -0,0 +1,81 @@ + + + +Movable Handlers + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ With C++11 and later, user-defined completion handlers are only required + to be move constructible, and are not required to be copy constructible. +

+

+ When move support is enabled, asynchronous that are documented as follows: +

+
template <typename Handler>
+void async_XYZ(..., Handler handler);
+
+

+ are actually declared as: +

+
template <typename Handler>
+void async_XYZ(..., Handler&& handler);
+
+

+ The handler argument is perfectly forwarded and the move construction occurs + within the body of async_XYZ(). This ensures that all other + function arguments are evaluated prior to the move. This is critical when + the other arguments to async_XYZ() are members of the handler. + For example: +

+
struct my_operation
+{
+  unique_ptr<tcp::socket> socket;
+  unique_ptr<vector<char>> buffer;
+  ...
+  void operator(error_code ec, size_t length)
+  {
+    ...
+    socket->async_read_some(asio::buffer(*buffer), std::move(*this));
+    ...
+  }
+};
+
+

+ Move support is automatically enabled for g++ 4.5 and + later, when the -std=c++0x or -std=gnu++0x + compiler options are used. It may be disabled by defining ASIO_DISABLE_MOVE, + or explicitly enabled for other compilers by defining ASIO_HAS_MOVE. + Note that these macros also affect the availability of movable + I/O objects. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/move_objects.html b/include/asio/doc/asio/overview/cpp2011/move_objects.html new file mode 100644 index 0000000..f8e0185 --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/move_objects.html @@ -0,0 +1,102 @@ + + + +Movable I/O Objects + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ When move support is available (via rvalue references), Asio allows move + construction and assignment of sockets, serial ports, POSIX descriptors + and Windows handles. +

+

+ Move support allows you to write code like: +

+
tcp::socket make_socket(io_context& i)
+{
+  tcp::socket s(i);
+  ...
+  std::move(s);
+}
+
+

+ or: +

+
class connection : public enable_shared_from_this<connection>
+{
+private:
+  tcp::socket socket_;
+  ...
+public:
+  connection(tcp::socket&& s) : socket_(std::move(s)) {}
+  ...
+};
+
+...
+
+class server
+{
+private:
+  tcp::acceptor acceptor_;
+  ...
+  void handle_accept(error_code ec, tcp::socket socket)
+  {
+    if (!ec)
+      std::make_shared<connection>(std::move(socket))->go();
+    acceptor_.async_accept(...);
+  }
+  ...
+};
+
+

+ as well as: +

+
std::vector<tcp::socket> sockets;
+sockets.push_back(tcp::socket(...));
+
+

+ A word of warning: There is nothing stopping you from moving these objects + while there are pending asynchronous operations, but it is unlikely to + be a good idea to do so. In particular, composed operations like async_read() store a reference + to the stream object. Moving during the composed operation means that the + composed operation may attempt to access a moved-from object. +

+

+ Move support is automatically enabled for g++ 4.5 and + later, when the -std=c++0x or -std=gnu++0x + compiler options are used. It may be disabled by defining ASIO_DISABLE_MOVE, + or explicitly enabled for other compilers by defining ASIO_HAS_MOVE. + Note that these macros also affect the availability of movable + handlers. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/shared_ptr.html b/include/asio/doc/asio/overview/cpp2011/shared_ptr.html new file mode 100644 index 0000000..8fa2a92 --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/shared_ptr.html @@ -0,0 +1,48 @@ + + + +Shared Pointers + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio's implementation can use std::shared_ptr<> and + std::weak_ptr<> in preference to the Boost equivalents. +

+

+ Support for the standard smart pointers is automatically enabled for g++ + 4.3 and later, when the -std=c++0x or -std=gnu++0x + compiler options are used, as well as for Microsoft Visual C++ 10. It may + be disabled by defining ASIO_DISABLE_STD_SHARED_PTR, or explicitly + enabled for other compilers by defining ASIO_HAS_STD_SHARED_PTR. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/system_error.html b/include/asio/doc/asio/overview/cpp2011/system_error.html new file mode 100644 index 0000000..8f8d2fa --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/system_error.html @@ -0,0 +1,50 @@ + + + +System Errors and Error Codes + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ When available, Asio can use the std::error_code and std::system_error + classes for reporting errors. In this case, the names asio::error_code + and asio::system_error will be typedefs for these standard + classes. +

+

+ System error support is automatically enabled for g++ + 4.6 and later, when the -std=c++0x or -std=gnu++0x + compiler options are used. It may be disabled by defining ASIO_DISABLE_STD_SYSTEM_ERROR, + or explicitly enabled for other compilers by defining ASIO_HAS_STD_SYSTEM_ERROR. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/cpp2011/variadic.html b/include/asio/doc/asio/overview/cpp2011/variadic.html new file mode 100644 index 0000000..9d4e053 --- /dev/null +++ b/include/asio/doc/asio/overview/cpp2011/variadic.html @@ -0,0 +1,49 @@ + + + +Variadic Templates + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ When supported by a compiler, Asio can use variadic templates to implement + the basic_socket_streambuf::connect() + and basic_socket_iostream::connect() + functions. +

+

+ Support for variadic templates is automatically enabled for g++ + 4.3 and later, when the -std=c++0x or -std=gnu++0x + compiler options are used. It may be disabled by defining ASIO_DISABLE_VARIADIC_TEMPLATES, + or explicitly enabled for other compilers by defining ASIO_HAS_VARIADIC_TEMPLATES. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/implementation.html b/include/asio/doc/asio/overview/implementation.html new file mode 100644 index 0000000..a16cb6a --- /dev/null +++ b/include/asio/doc/asio/overview/implementation.html @@ -0,0 +1,491 @@ + + + +Platform-Specific Implementation Notes + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This section lists platform-specific implementation details, such as the + default demultiplexing mechanism, the number of threads created internally, + and when threads are created. +

+
+ + Linux + Kernel 2.4 +
+

+ Demultiplexing mechanism: +

+
  • + Uses select for demultiplexing. This means that the number + of file descriptors in the process cannot be permitted to exceed FD_SETSIZE. +
+

+ Threads: +

+
    +
  • + Demultiplexing using select is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + Linux + Kernel 2.6 +
+

+ Demultiplexing mechanism: +

+
  • + Uses epoll for demultiplexing. +
+

+ Threads: +

+
    +
  • + Demultiplexing using epoll is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + Solaris +
+

+ Demultiplexing mechanism: +

+
  • + Uses /dev/poll for demultiplexing. +
+

+ Threads: +

+
    +
  • + Demultiplexing using /dev/poll is performed in one + of the threads that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + QNX + Neutrino +
+

+ Demultiplexing mechanism: +

+
  • + Uses select for demultiplexing. This means that the number + of file descriptors in the process cannot be permitted to exceed FD_SETSIZE. +
+

+ Threads: +

+
    +
  • + Demultiplexing using select is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + Mac + OS X +
+

+ Demultiplexing mechanism: +

+
  • + Uses kqueue for demultiplexing. +
+

+ Threads: +

+
    +
  • + Demultiplexing using kqueue is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + FreeBSD +
+

+ Demultiplexing mechanism: +

+
  • + Uses kqueue for demultiplexing. +
+

+ Threads: +

+
    +
  • + Demultiplexing using kqueue is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + AIX +
+

+ Demultiplexing mechanism: +

+
  • + Uses select for demultiplexing. This means that the number + of file descriptors in the process cannot be permitted to exceed FD_SETSIZE. +
+

+ Threads: +

+
    +
  • + Demultiplexing using select is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + HP-UX +
+

+ Demultiplexing mechanism: +

+
  • + Uses select for demultiplexing. This means that the number + of file descriptors in the process cannot be permitted to exceed FD_SETSIZE. +
+

+ Threads: +

+
    +
  • + Demultiplexing using select is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + Tru64 +
+

+ Demultiplexing mechanism: +

+
  • + Uses select for demultiplexing. This means that the number + of file descriptors in the process cannot be permitted to exceed FD_SETSIZE. +
+

+ Threads: +

+
    +
  • + Demultiplexing using select is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + At most min(64,IOV_MAX) buffers may be transferred in a + single operation. +
+
+ + Windows + 95, 98 and Me +
+

+ Demultiplexing mechanism: +

+
  • + Uses select for demultiplexing. +
+

+ Threads: +

+
    +
  • + Demultiplexing using select is performed in one of the threads + that calls io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
  • + For sockets, at most 16 buffers may be transferred in a single operation. +
+
+ + Windows + NT, 2000, XP, 2003, Vista, 7 and 8 +
+

+ Demultiplexing mechanism: +

+
    +
  • + Uses overlapped I/O and I/O completion ports for all asynchronous socket + operations except for asynchronous connect. +
  • +
  • + Uses select for emulating asynchronous connect. +
  • +
+

+ Threads: +

+
    +
  • + Demultiplexing using I/O completion ports is performed in all threads + that call io_context::run(), io_context::run_one(), + io_context::poll() or io_context::poll_one(). +
  • +
  • + An additional thread per io_context is used to trigger timers. + This thread is created on construction of the first basic_deadline_timer + or basic_waitable_timer objects. +
  • +
  • + An additional thread per io_context is used for the select + demultiplexing. This thread is created on the first call to async_connect(). +
  • +
  • + An additional thread per io_context is used to emulate asynchronous + host resolution. This thread is created on the first call to either + ip::tcp::resolver::async_resolve() or ip::udp::resolver::async_resolve(). +
  • +
+

+ Scatter-Gather: +

+
    +
  • + For sockets, at most 64 buffers may be transferred in a single operation. +
  • +
  • + For stream-oriented handles, only one buffer may be transferred in a + single operation. +
  • +
+
+ + Windows + Runtime +
+

+ Asio provides limited support for the Windows Runtime. It requires that the + language extensions be enabled. Due to the restricted facilities exposed + by the Windows Runtime API, the support comes with the following caveats: +

+
    +
  • + The core facilities such as the io_context, strand, + buffers, composed operations, timers, etc., should all work as normal. +
  • +
  • + For sockets, only client-side TCP is supported. +
  • +
  • + Explicit binding of a client-side TCP socket is not supported. +
  • +
  • + The cancel() function is not supported for sockets. Asynchronous + operations may only be cancelled by closing the socket. +
  • +
  • + Operations that use null_buffers are not supported. +
  • +
  • + Only tcp::no_delay and socket_base::keep_alive + options are supported. +
  • +
  • + Resolvers do not support service names, only numbers. I.e. you must use + "80" rather than "http". +
  • +
  • + Most resolver query flags have no effect. +
  • +
+

+ Demultiplexing mechanism: +

+
  • + Uses the Windows::Networking::Sockets::StreamSocket class + to implement asynchronous TCP socket operations. +
+

+ Threads: +

+
    +
  • + Event completions are delivered to the Windows thread pool and posted + to the io_context for the handler to be executed. +
  • +
  • + An additional thread per io_context is used to trigger timers. + This thread is created on construction of the first timer objects. +
  • +
+

+ Scatter-Gather: +

+
  • + For sockets, at most one buffer may be transferred in a single operation. +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/networking.html b/include/asio/doc/asio/overview/networking.html new file mode 100644 index 0000000..32c517d --- /dev/null +++ b/include/asio/doc/asio/overview/networking.html @@ -0,0 +1,53 @@ + + + +Networking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/networking/bsd_sockets.html b/include/asio/doc/asio/overview/networking/bsd_sockets.html new file mode 100644 index 0000000..2977e73 --- /dev/null +++ b/include/asio/doc/asio/overview/networking/bsd_sockets.html @@ -0,0 +1,546 @@ + + + +The BSD Socket API and Asio + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The Asio library includes a low-level socket interface based on the BSD + socket API, which is widely implemented and supported by extensive literature. + It is also used as the basis for networking APIs in other languages, like + Java. This low-level interface is designed to support the development of + efficient and scalable applications. For example, it permits programmers + to exert finer control over the number of system calls, avoid redundant + data copying, minimise the use of resources like threads, and so on. +

+

+ Unsafe and error prone aspects of the BSD socket API are not included. + For example, the use of int to represent all sockets lacks + type safety. The socket representation in Asio uses a distinct type for + each protocol, e.g. for TCP one would use ip::tcp::socket, + and for UDP one uses ip::udp::socket. +

+

+ The following table shows the mapping between the BSD socket API and Asio: +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ BSD Socket API Elements +

+
+

+ Equivalents in Asio +

+
+

+ socket descriptor - int (POSIX) or SOCKET + (Windows) +

+
+

+ For TCP: ip::tcp::socket, + ip::tcp::acceptor +

+

+ For UDP: ip::udp::socket +

+

+ basic_socket, + basic_stream_socket, + basic_datagram_socket, + basic_raw_socket +

+
+

+ in_addr, in6_addr +

+
+

+ ip::address, + ip::address_v4, + ip::address_v6 +

+
+

+ sockaddr_in, sockaddr_in6 +

+
+

+ For TCP: ip::tcp::endpoint +

+

+ For UDP: ip::udp::endpoint +

+

+ ip::basic_endpoint +

+
+

+ accept() +

+
+

+ For TCP: ip::tcp::acceptor::accept() +

+

+ basic_socket_acceptor::accept() +

+
+

+ bind() +

+
+

+ For TCP: ip::tcp::acceptor::bind(), + ip::tcp::socket::bind() +

+

+ For UDP: ip::udp::socket::bind() +

+

+ basic_socket::bind() +

+
+

+ close() +

+
+

+ For TCP: ip::tcp::acceptor::close(), + ip::tcp::socket::close() +

+

+ For UDP: ip::udp::socket::close() +

+

+ basic_socket::close() +

+
+

+ connect() +

+
+

+ For TCP: ip::tcp::socket::connect() +

+

+ For UDP: ip::udp::socket::connect() +

+

+ basic_socket::connect() +

+
+

+ getaddrinfo(), gethostbyaddr(), gethostbyname(), + getnameinfo(), getservbyname(), getservbyport() +

+
+

+ For TCP: ip::tcp::resolver::resolve(), + ip::tcp::resolver::async_resolve() +

+

+ For UDP: ip::udp::resolver::resolve(), + ip::udp::resolver::async_resolve() +

+

+ ip::basic_resolver::resolve(), + ip::basic_resolver::async_resolve() +

+
+

+ gethostname() +

+
+

+ ip::host_name() +

+
+

+ getpeername() +

+
+

+ For TCP: ip::tcp::socket::remote_endpoint() +

+

+ For UDP: ip::udp::socket::remote_endpoint() +

+

+ basic_socket::remote_endpoint() +

+
+

+ getsockname() +

+
+

+ For TCP: ip::tcp::acceptor::local_endpoint(), + ip::tcp::socket::local_endpoint() +

+

+ For UDP: ip::udp::socket::local_endpoint() +

+

+ basic_socket::local_endpoint() +

+
+

+ getsockopt() +

+
+

+ For TCP: ip::tcp::acceptor::get_option(), + ip::tcp::socket::get_option() +

+

+ For UDP: ip::udp::socket::get_option() +

+

+ basic_socket::get_option() +

+
+

+ inet_addr(), inet_aton(), inet_pton() +

+
+

+ ip::address::from_string(), + ip::address_v4::from_string(), + ip_address_v6::from_string() +

+
+

+ inet_ntoa(), inet_ntop() +

+
+

+ ip::address::to_string(), + ip::address_v4::to_string(), + ip_address_v6::to_string() +

+
+

+ ioctl() +

+
+

+ For TCP: ip::tcp::socket::io_control() +

+

+ For UDP: ip::udp::socket::io_control() +

+

+ basic_socket::io_control() +

+
+

+ listen() +

+
+

+ For TCP: ip::tcp::acceptor::listen() +

+

+ basic_socket_acceptor::listen() +

+
+

+ poll(), select(), pselect() +

+
+

+ io_context::run(), + io_context::run_one(), + io_context::poll(), + io_context::poll_one() +

+

+ Note: in conjunction with asynchronous operations. +

+
+

+ readv(), recv(), read() +

+
+

+ For TCP: ip::tcp::socket::read_some(), + ip::tcp::socket::async_read_some(), + ip::tcp::socket::receive(), + ip::tcp::socket::async_receive() +

+

+ For UDP: ip::udp::socket::receive(), + ip::udp::socket::async_receive() +

+

+ basic_stream_socket::read_some(), + basic_stream_socket::async_read_some(), + basic_stream_socket::receive(), + basic_stream_socket::async_receive(), + basic_datagram_socket::receive(), + basic_datagram_socket::async_receive() +

+
+

+ recvfrom() +

+
+

+ For UDP: ip::udp::socket::receive_from(), + ip::udp::socket::async_receive_from() +

+

+ basic_datagram_socket::receive_from(), + basic_datagram_socket::async_receive_from() +

+
+

+ send(), write(), writev() +

+
+

+ For TCP: ip::tcp::socket::write_some(), + ip::tcp::socket::async_write_some(), + ip::tcp::socket::send(), + ip::tcp::socket::async_send() +

+

+ For UDP: ip::udp::socket::send(), + ip::udp::socket::async_send() +

+

+ basic_stream_socket::write_some(), + basic_stream_socket::async_write_some(), + basic_stream_socket::send(), + basic_stream_socket::async_send(), + basic_datagram_socket::send(), + basic_datagram_socket::async_send() +

+
+

+ sendto() +

+
+

+ For UDP: ip::udp::socket::send_to(), + ip::udp::socket::async_send_to() +

+

+ basic_datagram_socket::send_to(), + basic_datagram_socket::async_send_to() +

+
+

+ setsockopt() +

+
+

+ For TCP: ip::tcp::acceptor::set_option(), + ip::tcp::socket::set_option() +

+

+ For UDP: ip::udp::socket::set_option() +

+

+ basic_socket::set_option() +

+
+

+ shutdown() +

+
+

+ For TCP: ip::tcp::socket::shutdown() +

+

+ For UDP: ip::udp::socket::shutdown() +

+

+ basic_socket::shutdown() +

+
+

+ sockatmark() +

+
+

+ For TCP: ip::tcp::socket::at_mark() +

+

+ basic_socket::at_mark() +

+
+

+ socket() +

+
+

+ For TCP: ip::tcp::acceptor::open(), + ip::tcp::socket::open() +

+

+ For UDP: ip::udp::socket::open() +

+

+ basic_socket::open() +

+
+

+ socketpair() +

+
+

+ local::connect_pair() +

+

+ Note: POSIX operating systems only. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/networking/iostreams.html b/include/asio/doc/asio/overview/networking/iostreams.html new file mode 100644 index 0000000..647e58d --- /dev/null +++ b/include/asio/doc/asio/overview/networking/iostreams.html @@ -0,0 +1,112 @@ + + + +Socket Iostreams + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio includes classes that implement iostreams on top of sockets. These + hide away the complexities associated with endpoint resolution, protocol + independence, etc. To create a connection one might simply write: +

+
ip::tcp::iostream stream("www.boost.org", "http");
+if (!stream)
+{
+  // Can't connect.
+}
+
+

+ The iostream class can also be used in conjunction with an acceptor to + create simple servers. For example: +

+
io_context ioc;
+
+ip::tcp::endpoint endpoint(tcp::v4(), 80);
+ip::tcp::acceptor acceptor(ios, endpoint);
+
+for (;;)
+{
+  ip::tcp::iostream stream;
+  acceptor.accept(stream.socket());
+  ...
+}
+
+

+ Timeouts may be set by calling expires_at() or expires_from_now() + to establish a deadline. Any socket operations that occur past the deadline + will put the iostream into a "bad" state. +

+

+ For example, a simple client program like this: +

+
ip::tcp::iostream stream;
+stream.expires_from_now(boost::posix_time::seconds(60));
+stream.connect("www.boost.org", "http");
+stream << "GET /LICENSE_1_0.txt HTTP/1.0\r\n";
+stream << "Host: www.boost.org\r\n";
+stream << "Accept: */*\r\n";
+stream << "Connection: close\r\n\r\n";
+stream.flush();
+std::cout << stream.rdbuf();
+
+

+ will fail if all the socket operations combined take longer than 60 seconds. +

+

+ If an error does occur, the iostream's error() member function + may be used to retrieve the error code from the most recent system call: +

+
if (!stream)
+{
+  std::cout << "Error: " << stream.error().message() << "\n";
+}
+
+
+ + See + Also +
+

+ ip::tcp::iostream, + basic_socket_iostream, + iostreams examples. +

+
+ + Notes +
+

+ These iostream templates only support char, not wchar_t, + and do not perform any code conversion. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/networking/other_protocols.html b/include/asio/doc/asio/overview/networking/other_protocols.html new file mode 100644 index 0000000..ec159f0 --- /dev/null +++ b/include/asio/doc/asio/overview/networking/other_protocols.html @@ -0,0 +1,152 @@ + + + +Support for Other Protocols + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Support for other socket protocols (such as Bluetooth or IRCOMM sockets) + can be added by implementing the protocol + type requirements. However, in many cases these protocols may also + be used with Asio's generic protocol support. For this, Asio provides the + following four classes: +

+ +

+ These classes implement the protocol + type requirements, but allow the user to specify the address family + (e.g. AF_INET) and protocol type (e.g. IPPROTO_TCP) + at runtime. For example: +

+
asio::generic::stream_protocol::socket my_socket(my_io_context);
+my_socket.open(asio::generic::stream_protocol(AF_INET, IPPROTO_TCP));
+...
+
+

+ An endpoint class template, asio::generic::basic_endpoint, + is included to support these protocol classes. This endpoint can hold any + other endpoint type, provided its native representation fits into a sockaddr_storage + object. This class will also convert from other types that implement the + endpoint type requirements: +

+
asio::ip::tcp::endpoint my_endpoint1 = ...;
+asio::generic::stream_protocol::endpoint my_endpoint2(my_endpoint1);
+
+

+ The conversion is implicit, so as to support the following use cases: +

+
asio::generic::stream_protocol::socket my_socket(my_io_context);
+asio::ip::tcp::endpoint my_endpoint = ...;
+my_socket.connect(my_endpoint);
+
+
+ + C++11 + Move Construction +
+

+ When using C++11, it is possible to perform move construction from a socket + (or acceptor) object to convert to the more generic protocol's socket (or + acceptor) type. If the protocol conversion is valid: +

+
Protocol1 p1 = ...;
+Protocol2 p2(p1);
+
+

+ then the corresponding socket conversion is allowed: +

+
Protocol1::socket my_socket1(my_io_context);
+...
+Protocol2::socket my_socket2(std::move(my_socket1));
+
+

+ For example, one possible conversion is from a TCP socket to a generic + stream-oriented socket: +

+
asio::ip::tcp::socket my_socket1(my_io_context);
+...
+asio::generic::stream_protocol::socket my_socket2(std::move(my_socket1));
+
+

+ These conversions are also available for move-assignment. +

+

+ These conversions are not limited to the above generic protocol classes. + User-defined protocols may take advantage of this feature by similarly + ensuring the conversion from Protocol1 to Protocol2 + is valid, as above. +

+
+ + Accepting + Generic Sockets +
+

+ As a convenience, a socket acceptor's accept() and async_accept() + functions can directly accept into a different protocol's socket type, + provided the corresponding protocol conversion is valid. For example, the + following is supported because the protocol asio::ip::tcp + is convertible to asio::generic::stream_protocol: +

+
asio::ip::tcp::acceptor my_acceptor(my_io_context);
+...
+asio::generic::stream_protocol::socket my_socket(my_io_context);
+my_acceptor.accept(my_socket);
+
+
+ + See + Also +
+

+ generic::datagram_protocol, + generic::raw_protocol, + generic::seq_packet_protocol, + generic::stream_protocol, + protocol type requirements. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/networking/protocols.html b/include/asio/doc/asio/overview/networking/protocols.html new file mode 100644 index 0000000..3c3f240 --- /dev/null +++ b/include/asio/doc/asio/overview/networking/protocols.html @@ -0,0 +1,204 @@ + + + +TCP, UDP and ICMP + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio provides off-the-shelf support for the internet protocols TCP, UDP + and ICMP. +

+
+ + TCP + Clients +
+

+ Hostname resolution is performed using a resolver, where host and service + names are looked up and converted into one or more endpoints: +

+
ip::tcp::resolver resolver(my_io_context);
+ip::tcp::resolver::query query("www.boost.org", "http");
+ip::tcp::resolver::iterator iter = resolver.resolve(query);
+ip::tcp::resolver::iterator end; // End marker.
+while (iter != end)
+{
+  ip::tcp::endpoint endpoint = *iter++;
+  std::cout << endpoint << std::endl;
+}
+
+

+ The list of endpoints obtained above could contain both IPv4 and IPv6 endpoints, + so a program should try each of them until it finds one that works. This + keeps the client program independent of a specific IP version. +

+

+ To simplify the development of protocol-independent programs, TCP clients + may establish connections using the free functions connect() + and async_connect(). + These operations try each endpoint in a list until the socket is successfully + connected. For example, a single call: +

+
ip::tcp::socket socket(my_io_context);
+asio::connect(socket, resolver.resolve(query));
+
+

+ will synchronously try all endpoints until one is successfully connected. + Similarly, an asynchronous connect may be performed by writing: +

+
asio::async_connect(socket_, iter,
+    boost::bind(&client::handle_connect, this,
+      asio::placeholders::error));
+
+// ...
+
+void handle_connect(const error_code& error)
+{
+  if (!error)
+  {
+    // Start read or write operations.
+  }
+  else
+  {
+    // Handle error.
+  }
+}
+
+

+ When a specific endpoint is available, a socket can be created and connected: +

+
ip::tcp::socket socket(my_io_context);
+socket.connect(endpoint);
+
+

+ Data may be read from or written to a connected TCP socket using the receive(), + async_receive(), + send() or + async_send() + member functions. However, as these could result in short + writes or reads, an application will typically use the following + operations instead: read(), + async_read(), write() + and async_write(). +

+
+ + TCP + Servers +
+

+ A program uses an acceptor to accept incoming TCP connections: +

+
ip::tcp::acceptor acceptor(my_io_context, my_endpoint);
+...
+ip::tcp::socket socket(my_io_context);
+acceptor.accept(socket);
+
+

+ After a socket has been successfully accepted, it may be read from or written + to as illustrated for TCP clients above. +

+
+ + UDP +
+

+ UDP hostname resolution is also performed using a resolver: +

+
ip::udp::resolver resolver(my_io_context);
+ip::udp::resolver::query query("localhost", "daytime");
+ip::udp::resolver::iterator iter = resolver.resolve(query);
+...
+
+

+ A UDP socket is typically bound to a local endpoint. The following code + will create an IP version 4 UDP socket and bind it to the "any" + address on port 12345: +

+
ip::udp::endpoint endpoint(ip::udp::v4(), 12345);
+ip::udp::socket socket(my_io_context, endpoint);
+
+

+ Data may be read from or written to an unconnected UDP socket using the + receive_from(), + async_receive_from(), + send_to() + or async_send_to() + member functions. For a connected UDP socket, use the receive(), + async_receive(), + send() + or async_send() + member functions. +

+
+ + ICMP +
+

+ As with TCP and UDP, ICMP hostname resolution is performed using a resolver: +

+
ip::icmp::resolver resolver(my_io_context);
+ip::icmp::resolver::query query("localhost", "");
+ip::icmp::resolver::iterator iter = resolver.resolve(query);
+...
+
+

+ An ICMP socket may be bound to a local endpoint. The following code will + create an IP version 6 ICMP socket and bind it to the "any" address: +

+
ip::icmp::endpoint endpoint(ip::icmp::v6(), 0);
+ip::icmp::socket socket(my_io_context, endpoint);
+
+

+ The port number is not used for ICMP. +

+

+ Data may be read from or written to an unconnected ICMP socket using the + receive_from(), + async_receive_from(), + send_to() + or async_send_to() + member functions. +

+
+ + See + Also +
+

+ ip::tcp, ip::udp, + ip::icmp, daytime + protocol tutorials, ICMP + ping example. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/posix.html b/include/asio/doc/asio/overview/posix.html new file mode 100644 index 0000000..f41206c --- /dev/null +++ b/include/asio/doc/asio/overview/posix.html @@ -0,0 +1,47 @@ + + + +POSIX-Specific Functionality + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/posix/fork.html b/include/asio/doc/asio/overview/posix/fork.html new file mode 100644 index 0000000..3855593 --- /dev/null +++ b/include/asio/doc/asio/overview/posix/fork.html @@ -0,0 +1,77 @@ + + + +Fork + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+Fork +

+

+ Asio supports programs that utilise the fork() system call. + Provided the program calls io_context.notify_fork() at the + appropriate times, Asio will recreate any internal file descriptors (such + as the "self-pipe trick" descriptor used for waking up a reactor). + The notification is usually performed as follows: +

+
io_context_.notify_fork(asio::io_context::fork_prepare);
+if (fork() == 0)
+{
+  io_context_.notify_fork(asio::io_context::fork_child);
+  ...
+}
+else
+{
+  io_context_.notify_fork(asio::io_context::fork_parent);
+  ...
+}
+
+

+ User-defined services can also be made fork-aware by overriding the io_context::service::notify_fork() + virtual function. +

+

+ Note that any file descriptors accessible via Asio's public API (e.g. the + descriptors underlying basic_socket<>, posix::stream_descriptor, + etc.) are not altered during a fork. It is the program's responsibility + to manage these as required. +

+
+ + See + Also +
+

+ io_context::notify_fork(), + io_context::fork_event, + io_context::service::notify_fork(), + Fork examples. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/posix/local.html b/include/asio/doc/asio/overview/posix/local.html new file mode 100644 index 0000000..3bc83e1 --- /dev/null +++ b/include/asio/doc/asio/overview/posix/local.html @@ -0,0 +1,104 @@ + + + +UNIX Domain Sockets + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio provides basic support for UNIX domain sockets (also known as local + sockets). The simplest use involves creating a pair of connected sockets. + The following code: +

+
local::stream_protocol::socket socket1(my_io_context);
+local::stream_protocol::socket socket2(my_io_context);
+local::connect_pair(socket1, socket2);
+
+

+ will create a pair of stream-oriented sockets. To do the same for datagram-oriented + sockets, use: +

+
local::datagram_protocol::socket socket1(my_io_context);
+local::datagram_protocol::socket socket2(my_io_context);
+local::connect_pair(socket1, socket2);
+
+

+ A UNIX domain socket server may be created by binding an acceptor to an + endpoint, in much the same way as one does for a TCP server: +

+
::unlink("/tmp/foobar"); // Remove previous binding.
+local::stream_protocol::endpoint ep("/tmp/foobar");
+local::stream_protocol::acceptor acceptor(my_io_context, ep);
+local::stream_protocol::socket socket(my_io_context);
+acceptor.accept(socket);
+
+

+ A client that connects to this server might look like: +

+
local::stream_protocol::endpoint ep("/tmp/foobar");
+local::stream_protocol::socket socket(my_io_context);
+socket.connect(ep);
+
+

+ Transmission of file descriptors or credentials across UNIX domain sockets + is not directly supported within Asio, but may be achieved by accessing + the socket's underlying descriptor using the native_handle() + member function. +

+
+ + See + Also +
+

+ local::connect_pair, + local::datagram_protocol, + local::datagram_protocol::endpoint, + local::datagram_protocol::socket, + local::stream_protocol, + local::stream_protocol::acceptor, + local::stream_protocol::endpoint, + local::stream_protocol::iostream, + local::stream_protocol::socket, + UNIX domain + sockets examples. +

+
+ + Notes +
+

+ UNIX domain sockets are only available at compile time if supported by + the target operating system. A program may test for the macro ASIO_HAS_LOCAL_SOCKETS + to determine whether they are supported. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/posix/stream_descriptor.html b/include/asio/doc/asio/overview/posix/stream_descriptor.html new file mode 100644 index 0000000..36fcd67 --- /dev/null +++ b/include/asio/doc/asio/overview/posix/stream_descriptor.html @@ -0,0 +1,86 @@ + + + +Stream-Oriented File Descriptors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio includes classes added to permit synchronous and asynchronous read + and write operations to be performed on POSIX file descriptors, such as + pipes, standard input and output, and various devices. +

+

+ These classes also provide limited support for regular files. This support + assumes that the underlying read and write operations provided by the operating + system never fail with EAGAIN or EWOULDBLOCK. + (This assumption normally holds for buffered file I/O.) Synchronous and + asynchronous read and write operations on file descriptors will succeed + but the I/O will always be performed immediately. Wait operations, and + operations involving asio::null_buffers, are not portably + supported. +

+

+ For example, to perform read and write operations on standard input and + output, the following objects may be created: +

+
posix::stream_descriptor in(my_io_context, ::dup(STDIN_FILENO));
+posix::stream_descriptor out(my_io_context, ::dup(STDOUT_FILENO));
+
+

+ These are then used as synchronous or asynchronous read and write streams. + This means the objects can be used with any of the read(), + async_read(), write(), + async_write(), read_until() or async_read_until() + free functions. +

+
+ + See + Also +
+

+ posix::stream_descriptor, + Chat example (C++03), + Chat example (C++11). +

+
+ + Notes +
+

+ POSIX stream descriptors are only available at compile time if supported + by the target operating system. A program may test for the macro ASIO_HAS_POSIX_STREAM_DESCRIPTOR + to determine whether they are supported. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/rationale.html b/include/asio/doc/asio/overview/rationale.html new file mode 100644 index 0000000..35aab1a --- /dev/null +++ b/include/asio/doc/asio/overview/rationale.html @@ -0,0 +1,97 @@ + + + +Rationale + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Most programs interact with the outside world in some way, whether it be + via a file, a network, a serial cable, or the console. Sometimes, as is the + case with networking, individual I/O operations can take a long time to complete. + This poses particular challenges to application development. +

+

+ Asio provides the tools to manage these long running operations, without + requiring programs to use concurrency models based on threads and explicit + locking. +

+

+ The Asio library is intended for programmers using C++ for systems programming, + where access to operating system functionality such as networking is often + required. In particular, Asio addresses the following goals: +

+
    +
  • + Portability. The library should support + a range of commonly used operating systems, and provide consistent behaviour + across these operating systems. +
  • +
  • + Scalability. The library should facilitate + the development of network applications that scale to thousands of concurrent + connections. The library implementation for each operating system should + use the mechanism that best enables this scalability. +
  • +
  • + Efficiency. The library should support + techniques such as scatter-gather I/O, and allow programs to minimise + data copying. +
  • +
  • + Model concepts from established APIs, such as BSD + sockets. The BSD socket API is widely implemented and understood, + and is covered in much literature. Other programming languages often + use a similar interface for networking APIs. As far as is reasonable, + Asio should leverage existing practice. +
  • +
  • + Ease of use. The library should provide + a lower entry barrier for new users by taking a toolkit, rather than + framework, approach. That is, it should try to minimise the up-front + investment in time to just learning a few basic rules and guidelines. + After that, a library user should only need to understand the specific + functions that are being used. +
  • +
  • + Basis for further abstraction. The library + should permit the development of other libraries that provide higher + levels of abstraction. For example, implementations of commonly used + protocols such as HTTP. +
  • +
+

+ Although Asio started life focused primarily on networking, its concepts + of asynchronous I/O have been extended to include other operating system + resources such as serial ports, file descriptors, and so on. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/serial_ports.html b/include/asio/doc/asio/overview/serial_ports.html new file mode 100644 index 0000000..872d650 --- /dev/null +++ b/include/asio/doc/asio/overview/serial_ports.html @@ -0,0 +1,83 @@ + + + +Serial Ports + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio includes classes for creating and manipulating serial ports in a portable + manner. For example, a serial port may be opened using: +

+
serial_port port(my_io_context, name);
+
+

+ where name is something like "COM1" on Windows, and + "/dev/ttyS0" on POSIX platforms. +

+

+ Once opened, the serial port may be used as a stream. + This means the objects can be used with any of the read(), + async_read(), write(), + async_write(), read_until() + or async_read_until() + free functions. +

+

+ The serial port implementation also includes option classes for configuring + the port's baud rate, flow control type, parity, stop bits and character + size. +

+
+ + See + Also +
+

+ serial_port, serial_port_base, + serial_port_base::baud_rate, + serial_port_base::flow_control, + serial_port_base::parity, + serial_port_base::stop_bits, + serial_port_base::character_size. +

+
+ + Notes +
+

+ Serial ports are available on all POSIX platforms. For Windows, serial ports + are only available at compile time when the I/O completion port backend is + used (which is the default). A program may test for the macro ASIO_HAS_SERIAL_PORT + to determine whether they are supported. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/signals.html b/include/asio/doc/asio/overview/signals.html new file mode 100644 index 0000000..edf641c --- /dev/null +++ b/include/asio/doc/asio/overview/signals.html @@ -0,0 +1,76 @@ + + + +Signal Handling + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio supports signal handling using a class called signal_set. + Programs may add one or more signals to the set, and then perform an async_wait() + operation. The specified handler will be called when one of the signals occurs. + The same signal number may be registered with multiple signal_set + objects, however the signal number must be used only with Asio. +

+
void handler(
+    const asio::error_code& error,
+    int signal_number)
+{
+  if (!error)
+  {
+    // A signal occurred.
+  }
+}
+
+...
+
+// Construct a signal set registered for process termination.
+asio::signal_set signals(io_context, SIGINT, SIGTERM);
+
+// Start an asynchronous wait for one of the signals to occur.
+signals.async_wait(handler);
+
+

+ Signal handling also works on Windows, as the Microsoft Visual C++ runtime + library maps console events like Ctrl+C to the equivalent signal. +

+
+ + See + Also +
+

+ signal_set, HTTP + server example (C++03), HTTP + server example (C++11). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/ssl.html b/include/asio/doc/asio/overview/ssl.html new file mode 100644 index 0000000..a3ac848 --- /dev/null +++ b/include/asio/doc/asio/overview/ssl.html @@ -0,0 +1,189 @@ + + + +SSL + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+SSL +

+

+ Asio contains classes and class templates for basic SSL support. These classes + allow encrypted communication to be layered on top of an existing stream, + such as a TCP socket. +

+

+ Before creating an encrypted stream, an application must construct an SSL + context object. This object is used to set SSL options such as verification + mode, certificate files, and so on. As an illustration, client-side initialisation + may look something like: +

+
ssl::context ctx(ssl::context::sslv23);
+ctx.set_verify_mode(ssl::verify_peer);
+ctx.load_verify_file("ca.pem");
+
+

+ To use SSL with a TCP socket, one may write: +

+
ssl::stream<ip::tcp::socket> ssl_sock(my_io_context, ctx);
+
+

+ To perform socket-specific operations, such as establishing an outbound connection + or accepting an incoming one, the underlying socket must first be obtained + using the ssl::stream template's lowest_layer() + member function: +

+
ip::tcp::socket::lowest_layer_type& sock = ssl_sock.lowest_layer();
+sock.connect(my_endpoint);
+
+

+ In some use cases the underlying stream object will need to have a longer + lifetime than the SSL stream, in which case the template parameter should + be a reference to the stream type: +

+
ip::tcp::socket sock(my_io_context);
+ssl::stream<ip::tcp::socket&> ssl_sock(sock, ctx);
+
+

+ SSL handshaking must be performed prior to transmitting or receiving data + over an encrypted connection. This is accomplished using the ssl::stream + template's handshake() + or async_handshake() + member functions. +

+

+ Once connected, SSL stream objects are used as synchronous or asynchronous + read and write streams. This means the objects can be used with any of the + read(), async_read(), + write(), async_write(), + read_until() or async_read_until() + free functions. +

+
+ + Certificate + Verification +
+

+ Asio provides various methods for configuring the way SSL certificates are + verified: +

+ +

+ To simplify use cases where certificates are verified according to the rules + in RFC 6125 (identity verification in the context of Transport Layer Security), + Asio provides a reusable verification callback as a function object: +

+ +

+ The following example shows verification of a remote host's certificate according + to the rules used by HTTPS: +

+
using asio::ip::tcp;
+namespace ssl = asio::ssl;
+typedef ssl::stream<tcp::socket> ssl_socket;
+
+// Create a context that uses the default paths for
+// finding CA certificates.
+ssl::context ctx(ssl::context::sslv23);
+ctx.set_default_verify_paths();
+
+// Open a socket and connect it to the remote host.
+asio::io_context io_context;
+ssl_socket sock(io_context, ctx);
+tcp::resolver resolver(io_context);
+tcp::resolver::query query("host.name", "https");
+asio::connect(sock.lowest_layer(), resolver.resolve(query));
+sock.lowest_layer().set_option(tcp::no_delay(true));
+
+// Perform SSL handshake and verify the remote host's
+// certificate.
+sock.set_verify_mode(ssl::verify_peer);
+sock.set_verify_callback(ssl::host_name_verification("host.name"));
+sock.handshake(ssl_socket::client);
+
+// ... read and write as normal ...
+
+
+ + SSL + and Threads +
+

+ SSL stream objects perform no locking of their own. Therefore, it is essential + that all asynchronous SSL operations are performed in an implicit or explicit + strand. Note that this + means that no synchronisation is required (and so no locking overhead is + incurred) in single threaded programs. +

+
+ + See + Also +
+

+ ssl::context, ssl::host_name_verification, + ssl::stream, SSL + example (C++03), SSL + example (C++11). +

+
+ + Notes +
+

+ OpenSSL is required to make use + of Asio's SSL support. When an application needs to use OpenSSL functionality + that is not wrapped by Asio, the underlying OpenSSL types may be obtained + by calling ssl::context::native_handle() + or ssl::stream::native_handle(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/timers.html b/include/asio/doc/asio/overview/timers.html new file mode 100644 index 0000000..6d92cc5 --- /dev/null +++ b/include/asio/doc/asio/overview/timers.html @@ -0,0 +1,87 @@ + + + +Timers + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+Timers +

+

+ Long running I/O operations will often have a deadline by which they must + have completed. These deadlines may be expressed as absolute times, but are + often calculated relative to the current time. +

+

+ As a simple example, to perform a synchronous wait operation on a timer using + a relative time one may write: +

+
io_context i;
+...
+deadline_timer t(i);
+t.expires_from_now(boost::posix_time::seconds(5));
+t.wait();
+
+

+ More commonly, a program will perform an asynchronous wait operation on a + timer: +

+
void handler(asio::error_code ec) { ... }
+...
+io_context i;
+...
+deadline_timer t(i);
+t.expires_from_now(boost::posix_time::milliseconds(400));
+t.async_wait(handler);
+...
+i.run();
+
+

+ The deadline associated with a timer may also be obtained as a relative time: +

+
boost::posix_time::time_duration time_until_expiry
+  = t.expires_from_now();
+
+

+ or as an absolute time to allow composition of timers: +

+
deadline_timer t2(i);
+t2.expires_at(t.expires_at() + boost::posix_time::seconds(30));
+
+
+ + See + Also +
+

+ basic_deadline_timer, + deadline_timer, timer tutorials. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/windows.html b/include/asio/doc/asio/overview/windows.html new file mode 100644 index 0000000..5ffee40 --- /dev/null +++ b/include/asio/doc/asio/overview/windows.html @@ -0,0 +1,47 @@ + + + +Windows-Specific Functionality + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/windows/object_handle.html b/include/asio/doc/asio/overview/windows/object_handle.html new file mode 100644 index 0000000..f035c38 --- /dev/null +++ b/include/asio/doc/asio/overview/windows/object_handle.html @@ -0,0 +1,95 @@ + + + +Object HANDLEs + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio provides Windows-specific classes that permit asynchronous wait operations + to be performed on HANDLEs to kernel objects of the following types: +

+
    +
  • + Change notification +
  • +
  • + Console input +
  • +
  • + Event +
  • +
  • + Memory resource notification +
  • +
  • + Process +
  • +
  • + Semaphore +
  • +
  • + Thread +
  • +
  • + Waitable timer +
  • +
+

+ For example, to perform asynchronous operations on an event, the following + object may be created: +

+
HANDLE handle = ::CreateEvent(...);
+windows::object_handle file(my_io_context, handle);
+
+

+ The wait() and async_wait() member functions + may then be used to wait until the kernel object is signalled. +

+
+ + See + Also +
+

+ windows::object_handle. +

+
+ + Notes +
+

+ Windows object HANDLEs are only available at compile time + when targeting Windows. Programs may test for the macro ASIO_HAS_WINDOWS_OBJECT_HANDLE + to determine whether they are supported. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/windows/random_access_handle.html b/include/asio/doc/asio/overview/windows/random_access_handle.html new file mode 100644 index 0000000..5d1355c --- /dev/null +++ b/include/asio/doc/asio/overview/windows/random_access_handle.html @@ -0,0 +1,76 @@ + + + +Random-Access HANDLEs + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio provides Windows-specific classes that permit asynchronous read and + write operations to be performed on HANDLEs that refer to regular files. +

+

+ For example, to perform asynchronous operations on a file the following + object may be created: +

+
HANDLE handle = ::CreateFile(...);
+windows::random_access_handle file(my_io_context, handle);
+
+

+ Data may be read from or written to the handle using one of the read_some_at(), + async_read_some_at(), write_some_at() or async_write_some_at() + member functions. However, like the equivalent functions (read_some(), + etc.) on streams, these functions are only required to transfer one or + more bytes in a single operation. Therefore free functions called read_at(), async_read_at(), + write_at() and async_write_at() + have been created to repeatedly call the corresponding *_some_at() function until all data has + been transferred. +

+
+ + See Also +
+

+ windows::random_access_handle. +

+
+ + Notes +
+

+ Windows random-access HANDLEs are only available at compile + time when targeting Windows and only when the I/O completion port backend + is used (which is the default). A program may test for the macro ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE + to determine whether they are supported. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/overview/windows/stream_handle.html b/include/asio/doc/asio/overview/windows/stream_handle.html new file mode 100644 index 0000000..be154b9 --- /dev/null +++ b/include/asio/doc/asio/overview/windows/stream_handle.html @@ -0,0 +1,79 @@ + + + +Stream-Oriented HANDLEs + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio contains classes to allow asynchronous read and write operations to + be performed on Windows HANDLEs, such as named pipes. +

+

+ For example, to perform asynchronous operations on a named pipe, the following + object may be created: +

+
HANDLE handle = ::CreateFile(...);
+windows::stream_handle pipe(my_io_context, handle);
+
+

+ These are then used as synchronous or asynchronous read and write streams. + This means the objects can be used with any of the read(), + async_read(), write(), + async_write(), read_until() or async_read_until() + free functions. +

+

+ The kernel object referred to by the HANDLE must support use + with I/O completion ports (which means that named pipes are supported, + but anonymous pipes and console streams are not). +

+
+ + See + Also +
+

+ windows::stream_handle. +

+
+ + Notes +
+

+ Windows stream HANDLEs are only available at compile time + when targeting Windows and only when the I/O completion port backend is + used (which is the default). A program may test for the macro ASIO_HAS_WINDOWS_STREAM_HANDLE + to determine whether they are supported. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference.html b/include/asio/doc/asio/reference.html new file mode 100644 index 0000000..906451b --- /dev/null +++ b/include/asio/doc/asio/reference.html @@ -0,0 +1,788 @@ + + + +Reference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ ++++++ + + + + + + + + + + +
+

+Properties

+
+

+Execution

+
+

+Customisation Points

+ + + + + +
prefer
query
require
require_concept
+

+Traits

+ + + + + + + + + + + + + +
can_prefer
can_query
can_require
can_require_concept
is_nothrow_prefer
is_nothrow_query
is_nothrow_require
is_nothrow_require_concept
prefer_result
query_result
require_result
require_concept_result
+
+

+Class Templates

+
execution::any_executor
+

+Classes

+ + + + +
execution::bad_executor
execution::invocable_archetype
execution::receiver_invocation_error
+

+Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
execution::allocator_t
execution::blocking_t
execution::blocking_t::possibly_t
execution::blocking_t::always_t
execution::blocking_t::never_t
execution::blocking_adaptation_t
execution::blocking_adaptation_t::disallowed_t
execution::blocking_adaptation_t::allowed_t
execution::bulk_guarantee_t
execution::bulk_guarantee_t::unsequenced_t
execution::bulk_guarantee_t::sequenced_t
execution::bulk_guarantee_t::parallel_t
execution::context_t
execution::context_as_t
execution::mapping_t
execution::mapping_t::thread_t
execution::mapping_t::new_thread_t
execution::mapping_t::other_t
execution::occupancy_t
execution::outstanding_work_t
execution::outstanding_work_t::untracked_t
execution::outstanding_work_t::tracked_t
execution::prefer_only
execution::relationship_t
execution::relationship_t::fork_t
execution::relationship_t::continuation_t
+
+

+Customisation Points

+ + + + + + + + + + +
execution::bulk_execute
execution::connect
execution::execute
execution::schedule
execution::set_done
execution::set_error
execution::set_value
execution::start
execution::submit
+

+Property Objects

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
execution::allocator
execution::blocking
execution::blocking.possibly
execution::blocking.always
execution::blocking.never
execution::blocking_adaptation
execution::blocking_adaptation.disallowed
execution::blocking_adaptation.allowed
execution::bulk_guarantee
execution::bulk_guarantee.unsequenced
execution::bulk_guarantee.sequenced
execution::bulk_guarantee.parallel
execution::context
execution::context_as
execution::mapping
execution::mapping.thread
execution::mapping.new_thread
execution::mapping.other
execution::occupancy
execution::outstanding_work
execution::outstanding_work.untracked
execution::outstanding_work.tracked
execution::relationship
execution::relationship.fork
execution::relationship.continuation
+
+

+Type Traits

+ + + + + + + + + + + + + + + + + + + + +
execution::can_bulk_execute
execution::can_connect
execution::can_execute
execution::can_schedule
execution::can_set_done
execution::can_set_error
execution::can_set_value
execution::can_start
execution::can_submit
execution::connect_result
execution::is_executor
execution::is_executor_of
execution::is_nothrow_receiver_of
execution::is_receiver
execution::is_receiver_of
execution::is_sender
execution::is_sender_to
execution::is_typed_sender
execution::sender_traits
+

+Concepts

+ + + + + + + + + + +
executor
executor_of
operation_state
receiver
receiver_of
scheduler
sender
sender_to
typed_sender
+
+ ++++++ + + + + + + + +
+

+Core

+
+

+Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
any_io_executor
bad_executor
coroutine
detached_t
error_code
execution_context
execution_context::id
execution_context::service
executor
executor_arg_t
invalid_service_owner
io_context
io_context::executor_type
io_context::service
io_context::strand
+io_context::work (deprecated)
multiple_exceptions
service_already_exists
static_thread_pool
system_context
system_error
system_executor
this_coro::executor_t
thread
thread_pool
thread_pool::executor_type
yield_context
+
+

+Free Functions

+ + + + + + + + + + + + + + + + + + + + + +
add_service
+asio_handler_allocate (deprecated)
+asio_handler_deallocate (deprecated)
+asio_handler_invoke (deprecated)
asio_handler_is_continuation
async_compose
async_initiate
bind_executor
co_spawn
dispatch
defer
get_associated_allocator
get_associated_executor
has_service
make_strand
make_work_guard
post
redirect_error
spawn
use_service
+
+

+Class Templates

+ + + + + + + + + + + + + + +
async_completion
awaitable
basic_io_object
basic_system_executor
basic_yield_context
executor_binder
executor_work_guard
io_context::basic_executor_type
redirect_error_t
strand
thread_pool::basic_executor_type
use_awaitable_t
use_future_t
+

+Special Values

+ + + + + + +
detached
executor_arg
this_coro::executor
use_future
use_awaitable
+

+Boost.Bind Placeholders

+ + + + + + + +
placeholders::bytes_transferred
placeholders::endpoint
placeholders::error
placeholders::iterator
placeholders::results
placeholders::signal_number
+
+

+Error Codes

+ + + + + +
error::basic_errors
error::netdb_errors
error::addrinfo_errors
error::misc_errors
+

+Type Traits

+ + + + + + + +
associated_allocator
associated_executor
async_result
default_completion_token
is_executor
uses_executor
+

+Type Requirements

+ + + + + + + +
Asynchronous operations
CompletionHandler
ExecutionContext
Executor
Handler
Service
+
+ ++++++ + + + + + + + +
+

+Buffers and Buffer-Oriented Operations

+
+

+Classes

+ + + + + + + +
const_buffer
mutable_buffer
+const_buffers_1 (deprecated)
+mutable_buffers_1 (deprecated)
+null_buffers (deprecated)
streambuf
+

+Class Templates

+ + + + + + + + +
basic_streambuf
buffered_read_stream
buffered_stream
buffered_write_stream
buffers_iterator
dynamic_string_buffer
dynamic_vector_buffer
+
+

+Free Functions

+ + + + + + + + + + + + + + + + + + + + + + + +
async_read
async_read_at
async_read_until
async_write
async_write_at
buffer
+buffer_cast (deprecated)
buffer_copy
buffer_size
buffer_sequence_begin
buffer_sequence_end
buffers_begin
buffers_end
dynamic_buffer
read
read_at
read_until
transfer_all
transfer_at_least
transfer_exactly
write
write_at
+
+

+Type Traits

+ + + + + + + + + +
is_const_buffer_sequence
is_dynamic_buffer
is_dynamic_buffer_v1
is_dynamic_buffer_v2
is_match_condition
is_mutable_buffer_sequence
is_read_buffered
is_write_buffered
+
+

+Type Requirements

+ + + + + + + + + + + + + + + + + + +
Read and write operations
AsyncRandomAccessReadDevice
AsyncRandomAccessWriteDevice
AsyncReadStream
AsyncWriteStream
CompletionCondition
ConstBufferSequence
DynamicBuffer
DynamicBuffer_v1
DynamicBuffer_v2
MutableBufferSequence
ReadHandler
SyncRandomAccessReadDevice
SyncRandomAccessWriteDevice
SyncReadStream
SyncWriteStream
WriteHandler
+
+ ++++++ + + + + + + + +
+

+Networking

+
+

+Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
generic::datagram_protocol
generic::datagram_protocol::endpoint
generic::datagram_protocol::socket
generic::raw_protocol
generic::raw_protocol::endpoint
generic::raw_protocol::socket
generic::seq_packet_protocol
generic::seq_packet_protocol::endpoint
generic::seq_packet_protocol::socket
generic::stream_protocol
generic::stream_protocol::endpoint
generic::stream_protocol::iostream
generic::stream_protocol::socket
ip::address
ip::address_v4
ip::address_v4_iterator
ip::address_v4_range
ip::address_v6
ip::address_v6_iterator
ip::address_v6_range
ip::bad_address_cast
ip::icmp
ip::icmp::endpoint
ip::icmp::resolver
ip::icmp::socket
ip::network_v4
ip::network_v6
ip::resolver_base
ip::resolver_query_base
ip::tcp
ip::tcp::acceptor
ip::tcp::endpoint
ip::tcp::iostream
ip::tcp::resolver
ip::tcp::socket
ip::udp
ip::udp::endpoint
ip::udp::resolver
ip::udp::socket
ip::v4_mapped_t
socket_base
+
+

+Free Functions

+ + + + + + + + + +
async_connect
connect
ip::host_name
ip::make_address
ip::make_address_v4
ip::make_address_v6
ip::make_network_v4
ip::make_network_v6
+

+Class Templates

+ + + + + + + + + + + + + + + + +
basic_datagram_socket
basic_raw_socket
basic_seq_packet_socket
basic_socket
basic_socket_acceptor
basic_socket_iostream
basic_socket_streambuf
basic_stream_socket
generic::basic_endpoint
ip::basic_endpoint
ip::basic_resolver
ip::basic_resolver_entry
ip::basic_resolver_iterator
ip::basic_resolver_results
ip::basic_resolver_query
+
+

+Socket Options

+ + + + + + + + + + + + + + + + + + + + +
ip::multicast::enable_loopback
ip::multicast::hops
ip::multicast::join_group
ip::multicast::leave_group
ip::multicast::outbound_interface
ip::tcp::no_delay
ip::unicast::hops
ip::v6_only
socket_base::broadcast
socket_base::debug
socket_base::do_not_route
socket_base::enable_connection_aborted
socket_base::keep_alive
socket_base::linger
socket_base::receive_buffer_size
socket_base::receive_low_watermark
socket_base::reuse_address
socket_base::send_buffer_size
socket_base::send_low_watermark
+
+

+I/O Control Commands

+
socket_base::bytes_readable
+

+Type Requirements

+ + + + + + + + + + + + + + + + + + +
Synchronous socket operations
Asynchronous socket operations
AcceptableProtocol
AcceptHandler
ConnectCondition
ConnectHandler
Endpoint
EndpointSequence
GettableSocketOption
InternetProtocol
IoControlCommand
IteratorConnectHandler
MoveAcceptHandler
Protocol
RangeConnectHandler
ResolveHandler
SettableSocketOption
+
+ ++++++ + + + + + + + + + + + + +
+

+Timers

+
+

+SSL

+
+

+Serial Ports

+
+

+Signal Handling

+
+

+Classes

+ + + + + +
deadline_timer
high_resolution_timer
steady_timer
system_timer
+

+Class Templates

+ + + + + +
basic_deadline_timer
basic_waitable_timer
time_traits
wait_traits
+

+Type Requirements

+ + + + +
TimeTraits
WaitHandler
WaitTraits
+
+

+Classes

+ + + + + + + +
ssl::context
ssl::context_base
ssl::host_name_verification
+ssl::rfc2818_verification (deprecated)
ssl::stream_base
ssl::verify_context
+

+Class Templates

+
ssl::stream
+

+Error Codes

+
ssl::error::stream_errors
+

+Type Requirements

+ + + + +
BufferedHandshakeHandler
HandshakeHandler
ShutdownHandler
+
+

+Classes

+ + + +
serial_port
serial_port_base
+

+Class templates

+
basic_serial_port
+

+Serial Port Options

+ + + + + + +
serial_port_base::baud_rate
serial_port_base::flow_control
serial_port_base::parity
serial_port_base::stop_bits
serial_port_base::character_size
+

+Type Requirements

+ + + +
GettableSerialPortOption
SettableSerialPortOption
+
+

+Classes

+
signal_set
+

+Class Templates

+
basic_signal_set
+

+Type Requirements

+
SignalHandler
+
+ +++++ + + + + + + + + + +
+

+POSIX-specific

+
+

+Windows-specific

+
+

+Classes

+ + + + + + + + + + + + +
local::stream_protocol
local::stream_protocol::acceptor
local::stream_protocol::endpoint
local::stream_protocol::iostream
local::stream_protocol::socket
local::datagram_protocol
local::datagram_protocol::endpoint
local::datagram_protocol::socket
posix::descriptor
posix::descriptor_base
posix::stream_descriptor
+
+

+Free Functions

+
local::connect_pair
+

+Class Templates

+ + + + +
local::basic_endpoint
posix::basic_descriptor
posix::basic_stream_descriptor
+
+

+Classes

+ + + + + + +
windows::object_handle
windows::overlapped_handle
windows::overlapped_ptr
windows::random_access_handle
windows::stream_handle
+

+Class Templates

+ + + + + +
windows::basic_object_handle
windows::basic_overlapped_handle
windows::basic_random_access_handle
windows::basic_stream_handle
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/AcceptHandler.html b/include/asio/doc/asio/reference/AcceptHandler.html new file mode 100644 index 0000000..9547ba9 --- /dev/null +++ b/include/asio/doc/asio/reference/AcceptHandler.html @@ -0,0 +1,105 @@ + + + +Accept handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An accept handler must meet the requirements for a handler. + A value h of an accept handler class should work correctly in + the expression h(ec), where ec is an lvalue of + type const error_code. +

+
+ + Examples +
+

+ A free function as an accept handler: +

+
void accept_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+
+

+ An accept handler function object: +

+
struct accept_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as an accept handler: +

+
acceptor.async_accept(...,
+    [](const asio::error_code& ec)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to an accept handler using std::bind(): +

+
void my_class::accept_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+acceptor.async_accept(...,
+    std::bind(&my_class::accept_handler,
+      this, std::placeholders::_1));
+
+

+ A non-static class member function adapted to an accept handler using boost::bind(): +

+
void my_class::accept_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+acceptor.async_accept(...,
+    boost::bind(&my_class::accept_handler,
+      this, asio::placeholders::error));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/AcceptableProtocol.html b/include/asio/doc/asio/reference/AcceptableProtocol.html new file mode 100644 index 0000000..2080efe --- /dev/null +++ b/include/asio/doc/asio/reference/AcceptableProtocol.html @@ -0,0 +1,88 @@ + + + +Acceptable protocol requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the AcceptableProtocol requirements + if it satisfies the requirements of Protocol + as well as the additional requirements listed below. +

+
+

Table 1. AcceptableProtocol requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ X::socket +

+
+

+ A type that satisfies the requirements of Destructible + (C++Std [destructible]) and MoveConstructible (C++Std + [moveconstructible]), and that is publicly and unambiguously derived + from basic_socket<X>. +

+
+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/AsyncRandomAccessReadDevice.html b/include/asio/doc/asio/reference/AsyncRandomAccessReadDevice.html new file mode 100644 index 0000000..0036146 --- /dev/null +++ b/include/asio/doc/asio/reference/AsyncRandomAccessReadDevice.html @@ -0,0 +1,128 @@ + + + +Buffer-oriented asynchronous random-access read device requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In the table below, a denotes an asynchronous random access + read device object, o denotes an offset of type boost::uint64_t, + mb denotes an object satisfying mutable + buffer sequence requirements, and h denotes an object + satisfying read handler + requirements. +

+
+

Table 2. Buffer-oriented asynchronous random-access read device requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.get_executor() +

+
+

+ A type satisfying the Executor + requirements. +

+
+

+ Returns the associated I/O executor. +

+
+

+ a.async_read_some_at(o, mb, h); +

+
+

+ void +

+
+

+ Initiates an asynchronous operation to read one or more bytes of + data from the device a at the offset o. + The operation is performed via the io_service object + a.get_io_service() and behaves according to asynchronous operation + requirements.

The mutable buffer sequence mb + specifies memory where the data should be placed. The async_read_some_at + operation shall always fill a buffer in the sequence completely + before proceeding to the next.

The implementation + shall maintain one or more copies of mb until such + time as the read operation no longer requires access to the memory + specified by the buffers in the sequence. The program must ensure + the memory is valid until:

— the last copy of mb + is destroyed, or

— the handler for the asynchronous + read operation is invoked,

whichever comes first.
+
If the total size of all buffers in the sequence mb + is 0, the asynchronous read operation shall complete + immediately and pass 0 as the argument to the handler + that specifies the number of bytes read. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/AsyncRandomAccessWriteDevice.html b/include/asio/doc/asio/reference/AsyncRandomAccessWriteDevice.html new file mode 100644 index 0000000..7888797 --- /dev/null +++ b/include/asio/doc/asio/reference/AsyncRandomAccessWriteDevice.html @@ -0,0 +1,129 @@ + + + +Buffer-oriented asynchronous random-access write device requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In the table below, a denotes an asynchronous write stream object, + o denotes an offset of type boost::uint64_t, cb + denotes an object satisfying constant + buffer sequence requirements, and h denotes an object + satisfying write handler + requirements. +

+
+

Table 3. Buffer-oriented asynchronous random-access write device requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.get_executor() +

+
+

+ A type satisfying the Executor + requirements. +

+
+

+ Returns the associated I/O executor. +

+
+

+ a.async_write_some_at(o, cb, h); +

+
+

+ void +

+
+

+ Initiates an asynchronous operation to write one or more bytes + of data to the device a at offset o. + The operation is performed via the io_service object + a.get_io_service() and behaves according to asynchronous operation + requirements.

The constant buffer sequence cb + specifies memory where the data to be written is located. The + async_write_some_at operation shall always write a + buffer in the sequence completely before proceeding to the next.
+
The implementation shall maintain one or more copies of + cb until such time as the write operation no longer + requires access to the memory specified by the buffers in the sequence. + The program must ensure the memory is valid until:

+ — the last copy of cb is destroyed, or

+ — the handler for the asynchronous write operation is invoked,
+
whichever comes first.

If the total size of + all buffers in the sequence cb is 0, + the asynchronous write operation shall complete immediately and + pass 0 as the argument to the handler that specifies + the number of bytes written. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/AsyncReadStream.html b/include/asio/doc/asio/reference/AsyncReadStream.html new file mode 100644 index 0000000..b267b7b --- /dev/null +++ b/include/asio/doc/asio/reference/AsyncReadStream.html @@ -0,0 +1,129 @@ + + + +Buffer-oriented asynchronous read stream requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the AsyncReadStream requirements + if it satisfies the requirements listed below. +

+

+ In the table below, a denotes a value of type X, + mb denotes a (possibly const) value satisfying the MutableBufferSequence + requirements, and t is a completion token. +

+
+

Table 4. AsyncReadStream requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.get_executor() +

+
+

+ A type satisfying the Executor + requirements. +

+
+

+ Returns the associated I/O executor. +

+
+

+ a.async_read_some(mb,t) +

+
+

+ The return type is determined according to the requirements for + an asynchronous + operation. +

+
+

+ Meets the requirements for a read + operation and an asynchronous + operation with completion signature void(error_code + ec, size_t n).

If buffer_size(mb) > + 0, initiates an asynchronous operation to read one or more + bytes of data from the stream a into the buffer sequence + mb. If successful, ec is set such that + !ec is true, and n is the + number of bytes read. If an error occurred, ec is + set such that !!ec is true, and n + is 0. If all data has been read from the stream, and the stream + performed an orderly shutdown, ec is stream_errc::eof + and n is 0.

If buffer_size(mb) + == 0, the operation completes immediately. ec + is set such that !ec is true, and n + is 0. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/AsyncWriteStream.html b/include/asio/doc/asio/reference/AsyncWriteStream.html new file mode 100644 index 0000000..218032b --- /dev/null +++ b/include/asio/doc/asio/reference/AsyncWriteStream.html @@ -0,0 +1,126 @@ + + + +Buffer-oriented asynchronous write stream requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the AsyncWriteStream requirements + if it satisfies the requirements listed below. +

+

+ In the table below, a denotes a value of type X, + cb denotes a (possibly const) value satisfying the ConstBufferSequence + requirements, and t is a completion token. +

+
+

Table 5. AsyncWriteStream requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.get_executor() +

+
+

+ A type satisfying the Executor + requirements. +

+
+

+ Returns the associated I/O executor. +

+
+

+ a.async_write_some(cb,t) +

+
+

+ The return type is determined according to the requirements for + an asynchronous + operation. +

+
+

+ Meets the requirements for a write + operation and an asynchronous + operation with completion signature void(error_code + ec, size_t n).

If buffer_size(cb) > + 0, initiates an asynchronous operation to write one or more + bytes of data to the stream a from the buffer sequence + cb. If successful, ec is set such that + !ec is true, and n is the + number of bytes written. If an error occurred, ec + is set such that !!ec is true, and n + is 0.

If buffer_size(cb) == 0, the operation + completes immediately. ec is set such that !ec + is true, and n is 0. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/BufferedHandshakeHandler.html b/include/asio/doc/asio/reference/BufferedHandshakeHandler.html new file mode 100644 index 0000000..7687fad --- /dev/null +++ b/include/asio/doc/asio/reference/BufferedHandshakeHandler.html @@ -0,0 +1,90 @@ + + + +Buffered handshake handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A buffered handshake handler must meet the requirements for a handler. + A value h of a buffered handshake handler class should work + correctly in the expression h(ec, s), where ec + is an lvalue of type const error_code and s is + an lvalue of type const size_t. +

+
+ + Examples +
+

+ A free function as a buffered handshake handler: +

+
void handshake_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+
+

+ A buffered handshake handler function object: +

+
struct handshake_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec,
+      std::size_t bytes_transferred)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A non-static class member function adapted to a buffered handshake handler + using boost::bind(): +

+
void my_class::handshake_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+...
+socket.async_handshake(...,
+    boost::bind(&my_class::handshake_handler,
+      this, asio::placeholders::error,
+      asio::placeholders::bytes_transferred));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/CompletionCondition.html b/include/asio/doc/asio/reference/CompletionCondition.html new file mode 100644 index 0000000..8ba18e3 --- /dev/null +++ b/include/asio/doc/asio/reference/CompletionCondition.html @@ -0,0 +1,106 @@ + + + +Completion condition requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A completion condition is a function object that is + used with the algorithms read, + async_read, + write, and async_write to determine + when the algorithm has completed transferring data. +

+

+ A type X meets the CompletionCondition requirements + if it satisfies the requirements of Destructible (C++Std [destructible]) + and MoveConstructible (C++Std [moveconstructible]), as well + as the additional requirements listed below. +

+

+ In the table below, x denotes a value of type X, + ec denotes a (possibly const) value of type error_code, + and n denotes a (possibly const) value of type size_t. +

+
+

Table 6. CompletionCondition requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ x(ec, n) +

+
+

+ size_t +

+
+

+ Let n be the total number of bytes transferred by + the read or write algorithm so far.

Returns the maximum + number of bytes to be transferred on the next read_some, + async_read_some, write_some, or async_write_some + operation performed by the algorithm. Returns 0 to + indicate that the algorithm is complete. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/CompletionHandler.html b/include/asio/doc/asio/reference/CompletionHandler.html new file mode 100644 index 0000000..27f4e88 --- /dev/null +++ b/include/asio/doc/asio/reference/CompletionHandler.html @@ -0,0 +1,99 @@ + + + +Completion handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A completion handler must meet the requirements for a handler. + A value h of a completion handler class should work correctly + in the expression h(). +

+
+ + Examples +
+

+ A free function as a completion handler: +

+
void completion_handler()
+{
+  ...
+}
+
+

+ A completion handler function object: +

+
struct completion_handler
+{
+  ...
+  void operator()()
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a completion handler: +

+
my_io_service.post(
+    []()
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a completion handler using + std::bind(): +

+
void my_class::completion_handler()
+{
+  ...
+}
+...
+my_io_service.post(std::bind(&my_class::completion_handler, this));
+
+

+ A non-static class member function adapted to a completion handler using + boost::bind(): +

+
void my_class::completion_handler()
+{
+  ...
+}
+...
+my_io_service.post(boost::bind(&my_class::completion_handler, this));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ConnectCondition.html b/include/asio/doc/asio/reference/ConnectCondition.html new file mode 100644 index 0000000..5228391 --- /dev/null +++ b/include/asio/doc/asio/reference/ConnectCondition.html @@ -0,0 +1,99 @@ + + + +Connect condition requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the ConnectCondition requirements + if it satisfies the requirements of Destructible (C++Std [destructible]) + and CopyConstructible (C++Std [copyconstructible]), as well + as the additional requirements listed below. +

+

+ In the table below, x denotes a value of type X, + ec denotes a (possibly const) value of type error_code, + and ep denotes a (possibly const) value of some type satisfying + the endpoint requirements. +

+
+

Table 7. ConnectCondition requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ x(ec, ep) +

+
+

+ bool +

+
+

+ Returns true to indicate that the connect + or async_connect algorithm should attempt a connection + to the endpoint ep. Otherwise, returns false + to indicate that the algorithm should not attempt connection to + the endpoint ep, and should instead skip to the next + endpoint in the sequence. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ConnectHandler.html b/include/asio/doc/asio/reference/ConnectHandler.html new file mode 100644 index 0000000..9eaa065 --- /dev/null +++ b/include/asio/doc/asio/reference/ConnectHandler.html @@ -0,0 +1,105 @@ + + + +Connect handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A connect handler must meet the requirements for a handler. + A value h of a connect handler class should work correctly in + the expression h(ec), where ec is an lvalue of + type const error_code. +

+
+ + Examples +
+

+ A free function as a connect handler: +

+
void connect_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+
+

+ A connect handler function object: +

+
struct connect_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a connect handler: +

+
socket.async_connect(...,
+    [](const asio::error_code& ec)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a connect handler using std::bind(): +

+
void my_class::connect_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+socket.async_connect(...,
+    std::bind(&my_class::connect_handler,
+      this, std::placeholders::_1));
+
+

+ A non-static class member function adapted to a connect handler using boost::bind(): +

+
void my_class::connect_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+socket.async_connect(...,
+    boost::bind(&my_class::connect_handler,
+      this, asio::placeholders::error));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ConstBufferSequence.html b/include/asio/doc/asio/reference/ConstBufferSequence.html new file mode 100644 index 0000000..de1debf --- /dev/null +++ b/include/asio/doc/asio/reference/ConstBufferSequence.html @@ -0,0 +1,130 @@ + + + +Constant buffer sequence requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A constant buffer sequence represents a set of memory + regions that may be used as input to an operation, such as the send + operation of a socket. +

+

+ A type X meets the ConstBufferSequence requirements + if it satisfies the requirements of Destructible (C++Std [destructible]) + and CopyConstructible (C++Std [copyconstructible]), as well + as the additional requirements listed below. +

+

+ In the table below, x denotes a (possibly const) value of type + X, and u denotes an identifier. +

+
+

Table 8. ConstBufferSequence requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ asio::buffer_sequence_begin(x)
asio::buffer_sequence_end(x) +

+
+

+ An iterator type meeting the requirements for bidirectional iterators + (C++Std [bidirectional.iterators]) whose value type is convertible + to const_buffer. +

+
+
+

+

+
X u(x);
+
+

+

+
+ +

+ post:
+

+
equal(
+  asio::buffer_sequence_begin(x),
+  asio::buffer_sequence_end(x),
+  asio::buffer_sequence_begin(u),
+  asio::buffer_sequence_end(u),
+  [](const const_buffer& b1,
+     const const_buffer& b2)
+   {
+     return b1.data() == b2.data()
+         && b1.size() == b2.size();
+   })
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/DynamicBuffer.html b/include/asio/doc/asio/reference/DynamicBuffer.html new file mode 100644 index 0000000..32eba3a --- /dev/null +++ b/include/asio/doc/asio/reference/DynamicBuffer.html @@ -0,0 +1,50 @@ + + + +Dynamic buffer requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/DynamicBuffer_v1.html b/include/asio/doc/asio/reference/DynamicBuffer_v1.html new file mode 100644 index 0000000..b02ea91 --- /dev/null +++ b/include/asio/doc/asio/reference/DynamicBuffer_v1.html @@ -0,0 +1,258 @@ + + + +Dynamic buffer requirements (version 1) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A dynamic buffer encapsulates memory storage that may be automatically resized + as required, where the memory is divided into an input sequence followed + by an output sequence. These memory regions are internal to the dynamic buffer + sequence, but direct access to the elements is provided to permit them to + be efficiently used with I/O operations, such as the send or + receive operations of a socket. Data written to the output sequence + of a dynamic buffer sequence object is appended to the input sequence of + the same object. +

+

+ A dynamic buffer type X shall satisfy the requirements of MoveConstructible + (C++ Std, [moveconstructible]) types in addition to those listed below. +

+

+ In the table below, X denotes a dynamic buffer class, x + denotes a value of type X&, x1 denotes values + of type const X&, and n denotes a value of + type size_t, and u denotes an identifier. +

+
+

Table 9. DynamicBuffer_v1 requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ X::const_buffers_type +

+
+

+ type meeting ConstBufferSequence + requirements. +

+
+

+ This type represents the memory associated with the input sequence. +

+
+

+ X::mutable_buffers_type +

+
+

+ type meeting MutableBufferSequence + requirements. +

+
+

+ This type represents the memory associated with the output sequence. +

+
+

+ x1.size() +

+
+

+ size_t +

+
+

+ Returns the size, in bytes, of the input sequence. +

+
+

+ x1.max_size() +

+
+

+ size_t +

+
+

+ Returns the permitted maximum of the sum of the sizes of the input + sequence and output sequence. +

+
+

+ x1.capacity() +

+
+

+ size_t +

+
+

+ Returns the maximum sum of the sizes of the input sequence and + output sequence that the dynamic buffer can hold without requiring + reallocation. +

+
+

+ x1.data() +

+
+

+ X::const_buffers_type +

+
+

+ Returns a constant buffer sequence u that represents + the memory associated with the input sequence, and where buffer_size(u) + == size(). +

+
+

+ x.prepare(n) +

+
+

+ X::mutable_buffers_type +

+
+

+ Requires: size() + n <= max_size().

+ Returns a mutable buffer sequence u representing the + output sequence, and where buffer_size(u) == n. The + dynamic buffer reallocates memory as required. All constant or + mutable buffer sequences previously obtained using data() + or prepare() are invalidated.

Throws: + length_error if size() + n > max_size(). +

+
+

+ x.commit(n) +

+
+ +

+ Appends n bytes from the start of the output sequence + to the end of the input sequence. The remainder of the output sequence + is discarded. If n is greater than the size of the + output sequence, the entire output sequence is appended to the + input sequence. All constant or mutable buffer sequences previously + obtained using data() or prepare() are + invalidated. +

+
+

+ x.consume(n) +

+
+ +

+ Removes n bytes from beginning of the input sequence. + If n is greater than the size of the input sequence, + the entire input sequence is removed. All constant or mutable buffer + sequences previously obtained using data() or prepare() + are invalidated. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/DynamicBuffer_v2.html b/include/asio/doc/asio/reference/DynamicBuffer_v2.html new file mode 100644 index 0000000..34be6ce --- /dev/null +++ b/include/asio/doc/asio/reference/DynamicBuffer_v2.html @@ -0,0 +1,265 @@ + + + +Dynamic buffer requirements (version 2) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A dynamic buffer encapsulates memory storage that may be automatically resized + as required. +

+

+ A dynamic buffer type X shall satisfy the requirements of CopyConstructible + (C++ Std, [copyconstructible]) types in addition to those listed below. +

+

+ In the table below, X denotes a dynamic buffer class, x + denotes a value of type X&, x1 denotes values + of type const X&, pos and n denote + values of type size_t, and u denotes an identifier. +

+
+

Table 10. DynamicBuffer_v2 requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ X::const_buffers_type +

+
+

+ type meeting ConstBufferSequence + requirements. +

+
+

+ This type represents the underlying memory as a sequence of @c + const_buffer objects. +

+
+

+ X::mutable_buffers_type +

+
+

+ type meeting MutableBufferSequence + requirements. +

+
+

+ This type represents the underlying memory as a sequence of @c + mutable_buffer objects. +

+
+

+ x1.size() +

+
+

+ size_t +

+
+

+ Returns the size, in bytes, of the underlying memory. +

+
+

+ x1.max_size() +

+
+

+ size_t +

+
+

+ Returns the permitted maximum size of the underlying memory. +

+
+

+ x1.capacity() +

+
+

+ size_t +

+
+

+ Returns the maximum size to which the underlying memory can grow + without requiring reallocation. +

+
+

+ x1.data(pos, n) +

+
+

+ X::const_buffers_type +

+
+

+ Returns a constant buffer sequence u that represents + the underlying memory beginning at offset pos, and + where buffer_size(u) <= n. +

+
+

+ x.data(pos, n) +

+
+

+ X::mutable_buffers_type +

+
+

+ Returns a mutable buffer sequence u that represents + the underlying memory beginning at offset pos, and + where buffer_size(u) <= n. +

+
+

+ x.grow(n) +

+
+ +

+ Requires: size() + n <= max_size().

+ Extends the underlying memory to accommodate n additional + bytes at the end. The dynamic buffer reallocates memory as required. + All constant or mutable buffer sequences previously obtained using + data() are invalidated.

Throws: length_error + if size() + n > max_size(). +

+
+

+ x.shrink(n) +

+
+ +

+ Removes n bytes from the end of the underlying memory. + If n is greater than the size of the underlying memory, + the entire underlying memory is emptied. All constant or mutable + buffer sequences previously obtained using data() + are invalidated. +

+
+

+ x.consume(n) +

+
+ +

+ Removes n bytes from the beginning of the underlying + memory. If n is greater than the size of the underlying + memory, the entire underlying memory is emptied. All constant or + mutable buffer sequences previously obtained using data() + are invalidated. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Endpoint.html b/include/asio/doc/asio/reference/Endpoint.html new file mode 100644 index 0000000..ab294b9 --- /dev/null +++ b/include/asio/doc/asio/reference/Endpoint.html @@ -0,0 +1,256 @@ + + + +Endpoint requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the Endpoint requirements if it + satisfies the requirements of Destructible (C++Std [destructible]), + DefaultConstructible (C++Std [defaultconstructible]), CopyConstructible + (C++Std [copyconstructible]), and CopyAssignable (C++Std [copyassignable]), + as well as the additional requirements listed below. +

+

+ The default constructor and move operations of the type X shall + not exit via an exception. +

+

+ In the table below, a denotes a (possibly const) value of type + X, and u denotes an identifier. +

+
+

Table 11. Endpoint requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ X::protocol_type +

+
+

+ type meeting Protocol + requirements +

+
+
+

+ a.protocol() +

+
+

+ protocol_type +

+
+
+
+

+ In the table below, a denotes a (possibly const) value of type + X, b denotes a value of type X, and + s denotes a (possibly const) value of a type that is convertible + to size_t and denotes a size in bytes. +

+
+

Table 12. Endpoint requirements for extensible implementations

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ a.data() +

+
+

+ const void* +

+
+

+ Returns a pointer suitable for passing as the address + argument to functions such as POSIX connect(), + or as the dest_addr argument to functions + such as POSIX sendto(). + The implementation shall perform a static_cast on + the pointer to convert it to const sockaddr*. +

+
+

+ b.data() +

+
+

+ void* +

+
+

+ Returns a pointer suitable for passing as the address + argument to functions such as POSIX accept(), + getpeername(), + getsockname() + and recvfrom(). + The implementation shall perform a static_cast on + the pointer to convert it to sockaddr*. +

+
+

+ a.size() +

+
+

+ size_t +

+
+

+ Returns a value suitable for passing as the address_len + argument to functions such as POSIX connect(), + or as the dest_len argument to functions such + as POSIX sendto(), + after appropriate integer conversion has been performed. +

+
+

+ b.resize(s) +

+
+ +

+ pre: s >= 0
post: a.size() == s
+ Passed the value contained in the address_len + argument to functions such as POSIX accept(), + getpeername(), + getsockname() + and recvfrom(), + after successful completion of the function. Permitted to throw + an exception if the protocol associated with the endpoint object + a does not support the specified size. +

+
+

+ a.capacity() +

+
+

+ size_t +

+
+

+ Returns a value suitable for passing as the address_len + argument to functions such as POSIX accept(), + getpeername(), + getsockname() + and recvfrom(), + after appropriate integer conversion has been performed. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/EndpointSequence.html b/include/asio/doc/asio/reference/EndpointSequence.html new file mode 100644 index 0000000..3845ebb --- /dev/null +++ b/include/asio/doc/asio/reference/EndpointSequence.html @@ -0,0 +1,94 @@ + + + +Endpoint sequence requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the EndpointSequence requirements + if it satisfies the requirements of Destructible (C++Std [destructible]) + and CopyConstructible (C++Std [copyconstructible]), as well + as the additional requirements listed below. +

+

+ In the table below, x denotes a (possibly const) value of type + X. +

+
+

Table 13. EndpointSequence requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ x.begin()
x.end() +

+
+

+ A type meeting the requirements for forward iterators (C++Std [forward.iterators]) + whose value type is convertible to a type satisfying the Endpoint + requirements. +

+
+

+ [x.begin(),x.end()) is a valid range. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ExecutionContext.html b/include/asio/doc/asio/reference/ExecutionContext.html new file mode 100644 index 0000000..653c9ff --- /dev/null +++ b/include/asio/doc/asio/reference/ExecutionContext.html @@ -0,0 +1,123 @@ + + + +Execution context requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the ExecutionContext requirements + if it is publicly and unambiguously derived from execution_context, + and satisfies the additional requirements listed below. +

+

+ In the table below, x denotes a value of type X. +

+
+

Table 14. ExecutionContext requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ X::executor_type +

+
+

+ type meeting Executor + requirements +

+
+
+

+ x.~X() +

+
+ +

+ Destroys all unexecuted function objects that were submitted via + an executor object that is associated with the execution context. +

+
+

+ x.get_executor() +

+
+

+ X::executor_type +

+
+

+ Returns an executor object that is associated with the execution + context. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Executor1.html b/include/asio/doc/asio/reference/Executor1.html new file mode 100644 index 0000000..775fe69 --- /dev/null +++ b/include/asio/doc/asio/reference/Executor1.html @@ -0,0 +1,404 @@ + + + +Executor requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ + Standard + executors +
+

+ Let executor-of-impl be the exposition-only concept +

+
template<class E, class F>
+  concept executor-of-impl =
+    invocable<decay_t<F>&> &&
+    constructible_from<decay_t<F>, F> &&
+    move_constructible<decay_t<F>> &&
+    copy_constructible<E> &&
+    is_nothrow_copy_constructible_v<E> &&
+    equality_comparable<E> /* nothrow */ &&
+    requires(const E& e, F&& f) {
+      execution::execute(e, (F&&)f);
+    };
+
+

+ Then the executor and executor_of concepts are + defined as follows: +

+
template<class E>
+  concept executor =
+    executor-of-impl<E, execution::invocable_archetype>;
+
+template<class E, class F>
+  concept executor_of =
+    executor<E> &&
+    executor-of-impl<E, F>;
+
+

+ Neither an executor's equality comparison nor swap operation + shall exit via an exception. +

+

+ None of an executor type's copy constructor, destructor, equality comparison, + swap function, execute function, or associated + query functions shall introduce data races as a result of concurrent + invocations of those functions from different threads. +

+

+ For any two (possibly const) values x1 and x2 of + some executor type X, x1 == x2 shall return true + only if asio::query(x1,p) == asio::query(x2,p) for every property + p where both asio::query(x1,p) and asio::query(x2,p) + are well-formed and result in a non-void type that is equality_comparable + (C++Std [equalitycomparable]). [Note: The above requirements + imply that x1 == x2 returns true if x1 + and x2 can be interchanged with identical effects. An executor + may conceptually contain additional properties which are not exposed by a + named property type that can be observed via asio::query; in + this case, it is up to the concrete executor implementation to decide if + these properties affect equality. Returning false does not necessarily + imply that the effects are not identical. —end note] +

+

+ An executor type's destructor shall not block pending completion of the submitted + function objects. [Note: The ability to wait for completion + of submitted function objects may be provided by the associated execution + context. —end note] +

+

+ In addition to the above requirements, types E and F + model executor_of only if they satisfy the requirements of the + Table below. +

+

+ Let: +

+
    +
  • + e denotes a (possibly const) executor object of type E, +
  • +
  • + cf denotes the function object DECAY_COPY(std::forward<F>(f)) +
  • +
  • + f denotes a function of type F&& invocable + as cf() and where decay_t<F> models + move_constructible. +
  • +
+

+ The expression execution::execute(e, f): +

+
    +
  • + Evaluates DECAY_COPY(std::forward<F>(f)) on the calling + thread to create cf that will be invoked at most once by + an execution agent. +
  • +
  • + May block pending completion of this invocation. Synchronizes with [intro.multithread] + the invocation of f. +
  • +
  • + Shall not propagate any exception thrown by the function object or any + other function submitted to the executor. +
  • +
+

+ [Note: The treatment of exceptions thrown by one-way + submitted functions is implementation-defined. The forward progress guarantee + of the associated execution agent(s) is implementation-defined. —end + note] +

+
+ + Networking + TS-style executors +
+

+ The library describes a standard set of requirements for executors. + A type meeting the Executor requirements embodies a set of rules + for determining how submitted function objects are to be executed. +

+

+ A type X meets the Executor requirements if it + satisfies the requirements of CopyConstructible (C++Std [copyconstructible]) + and Destructible (C++Std [destructible]), as well as the additional + requirements listed below. +

+

+ No constructor, comparison operator, copy operation, move operation, swap + operation, or member functions context, on_work_started, + and on_work_finished on these types shall exit via an exception. +

+

+ The executor copy constructor, comparison operators, and other member functions + defined in these requirements shall not introduce data races as a result + of concurrent calls to those functions from different threads. +

+

+ Let ctx be the execution context returned by the executor's + context() member function. An executor becomes invalid + when the first call to ctx.shutdown() returns. The effect of + calling on_work_started, on_work_finished, dispatch, + post, or defer on an invalid executor is undefined. + [Note: The copy constructor, comparison operators, and + context() member function continue to remain valid until ctx + is destroyed. —end note] +

+

+ In the table below, x1 and x2 denote (possibly + const) values of type X, mx1 denotes an xvalue + of type X, f denotes a MoveConstructible + (C++Std [moveconstructible]) function object callable with zero arguments, + a denotes a (possibly const) value of type A meeting + the Allocator requirements (C++Std [allocator.requirements]), + and u denotes an identifier. +

+
+

Table 15. Executor requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ X u(x1); +

+
+ +

+ Shall not exit via an exception.

post: u == + x1 and std::addressof(u.context()) == std::addressof(x1.context()). +

+
+

+ X u(mx1); +

+
+ +

+ Shall not exit via an exception.

post: u + equals the prior value of mx1 and std::addressof(u.context()) + equals the prior value of std::addressof(mx1.context()). +

+
+

+ x1 == x2 +

+
+

+ bool +

+
+

+ Returns true only if x1 and x2 + can be interchanged with identical effects in any of the expressions + defined in these type requirements. [Note: + Returning false does not necessarily imply that the + effects are not identical. —end note]
+
operator== shall be reflexive, symmetric, and + transitive, and shall not exit via an exception. +

+
+

+ x1 != x2 +

+
+

+ bool +

+
+

+ Same as !(x1 == x2). +

+
+

+ x1.context() +

+
+

+ execution_context&, or E& where + E is a type that satifisfies the ExecutionContext + requirements. +

+
+

+ Shall not exit via an exception.

The comparison operators + and member functions defined in these requirements shall not alter + the reference returned by this function. +

+
+

+ x1.on_work_started() +

+
+ +

+ Shall not exit via an exception. +

+
+

+ x1.on_work_finished() +

+
+ +

+ Shall not exit via an exception.

Precondition: A preceding + call x2.on_work_started() where x1 == x2. +

+
+

+ x1.dispatch(std::move(f),a) +

+
+ +

+ Effects: Creates an object f1 initialized with DECAY_COPY(forward<Func>(f)) + (C++Std [thread.decaycopy]) in the current thread of execution + . Calls f1() at most once. The executor may block + forward progress of the caller until f1() finishes + execution.

Executor implementations should use the + supplied allocator to allocate any memory required to store the + function object. Prior to invoking the function object, the executor + shall deallocate any memory allocated. [Note: + Executors defined in this Technical Specification always use the + supplied allocator unless otherwise specified. —end note] +

Synchronization: The invocation of dispatch + synchronizes with (C++Std [intro.multithread]) the invocation of + f1. +

+
+

+ x1.post(std::move(f),a)
x1.defer(std::move(f),a) +

+
+ +

+ Effects: Creates an object f1 initialized with DECAY_COPY(forward<Func>(f)) + in the current thread of execution. Calls f1() at + most once. The executor shall not block forward progress of the + caller pending completion of f1().

Executor + implementations should use the supplied allocator to allocate any + memory required to store the function object. Prior to invoking + the function object, the executor shall deallocate any memory allocated. + [Note: Executors defined in this Technical + Specification always use the supplied allocator unless otherwise + specified. —end note]

Synchronization: + The invocation of post or defer synchronizes + with (C++Std [intro.multithread]) the invocation of f1.
+
[Note: Although the requirements placed + on defer are identical to post, the use + of post conveys a preference that the caller does + not block the first step of f1's + progress, whereas defer conveys a preference that + the caller does block the first step of f1. + One use of defer is to convey the intention of the + caller that f1 is a continuation of the current + call context. The executor may use this information to optimize + or otherwise adjust the way in which f1 is invoked. + —end note] +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/GettableSerialPortOption.html b/include/asio/doc/asio/reference/GettableSerialPortOption.html new file mode 100644 index 0000000..37fdd8f --- /dev/null +++ b/include/asio/doc/asio/reference/GettableSerialPortOption.html @@ -0,0 +1,95 @@ + + + +Gettable serial port option requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In the table below, X denotes a serial port option class, a + denotes a value of X, ec denotes a value of type + error_code, and s denotes a value of implementation-defined + type storage (where storage + is the type DCB on Windows and termios on POSIX + platforms), and u denotes an identifier. +

+
+

Table 16. GettableSerialPortOption requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ const storage& + u = s;
a.load(u, ec); +

+
+

+ error_code +

+
+

+ Retrieves the value of the serial port option from the storage.
+
If successful, sets ec such that !ec + is true. If an error occurred, sets ec such that + !!ec is true. Returns ec. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/GettableSocketOption.html b/include/asio/doc/asio/reference/GettableSocketOption.html new file mode 100644 index 0000000..288c4e6 --- /dev/null +++ b/include/asio/doc/asio/reference/GettableSocketOption.html @@ -0,0 +1,175 @@ + + + +Gettable socket option requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the GettableSocketOption requirements + if it satisfies the requirements listed below. +

+

+ In the table below, a denotes a (possibly const) value of type + X, b denotes a value of type X, p + denotes a (possibly const) value that meets the Protocol + requirements, and s denotes a (possibly const) value of a type + that is convertible to size_t and denotes a size in bytes. +

+
+

Table 17. GettableSocketOption requirements for extensible implementations

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ a.level(p) +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the level + argument to POSIX getsockopt() + (or equivalent). +

+
+

+ a.name(p) +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the option_name + argument to POSIX getsockopt() + (or equivalent). +

+
+

+ b.data(p) +

+
+

+ void* +

+
+

+ Returns a pointer suitable for passing as the option_value + argument to POSIX getsockopt() + (or equivalent). +

+
+

+ a.size(p) +

+
+

+ size_t +

+
+

+ Returns a value suitable for passing as the option_len + argument to POSIX getsockopt() + (or equivalent), after appropriate integer conversion has been + performed. +

+
+

+ b.resize(p,s) +

+
+ +

+ post: b.size(p) == s.
Passed the value contained + in the option_len argument to POSIX + getsockopt() + (or equivalent) after successful completion of the function. Permitted + to throw an exception if the socket option object b + does not support the specified size. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Handler.html b/include/asio/doc/asio/reference/Handler.html new file mode 100644 index 0000000..1019fd0 --- /dev/null +++ b/include/asio/doc/asio/reference/Handler.html @@ -0,0 +1,150 @@ + + + +Handlers + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A handler must meet the requirements of MoveConstructible types + (C++Std [moveconstructible]). +

+

+ In the table below, X denotes a handler class, h + denotes a value of X, p denotes a pointer to a + block of allocated memory of type void*, s denotes + the size for a block of allocated memory, and f denotes a function + object taking no arguments. +

+
+

Table 18. Handler requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+

+
using asio::asio_handler_allocate;
+asio_handler_allocate(s, &h);
+
+

+

+
+

+ void* +

+
+

+ Returns a pointer to a block of memory of size s. + The pointer must satisfy the same alignment requirements as a pointer + returned by ::operator new(). Throws bad_alloc + on failure.

The asio_handler_allocate() + function is located using argument-dependent lookup. The function + asio::asio_handler_allocate() serves as a default + if no user-supplied function is available. +

+
+

+

+
using asio::asio_handler_deallocate;
+asio_handler_deallocate(p, s, &h);
+
+

+

+
+ +

+ Frees a block of memory associated with a pointer p, + of at least size s, that was previously allocated + using asio_handler_allocate().

The asio_handler_deallocate() + function is located using argument-dependent lookup. The function + asio::asio_handler_deallocate() serves as a default + if no user-supplied function is available. +

+
+

+

+
using asio::asio_handler_invoke;
+asio_handler_invoke(f, &h);
+
+

+

+
+ +

+ Causes the function object f to be executed as if + by calling f().

The asio_handler_invoke() + function is located using argument-dependent lookup. The function + asio::asio_handler_invoke() serves as a default if + no user-supplied function is available. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/HandshakeHandler.html b/include/asio/doc/asio/reference/HandshakeHandler.html new file mode 100644 index 0000000..0901560 --- /dev/null +++ b/include/asio/doc/asio/reference/HandshakeHandler.html @@ -0,0 +1,108 @@ + + + +SSL handshake handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A handshake handler must meet the requirements for a handler. + A value h of a handshake handler class should work correctly + in the expression h(ec), where ec is an lvalue + of type const error_code. +

+
+ + Examples +
+

+ A free function as a handshake handler: +

+
void handshake_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+
+

+ A handshake handler function object: +

+
struct handshake_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a handshake handler: +

+
ssl_stream.async_handshake(...,
+    [](const asio::error_code& ec)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a handshake handler using + std::bind(): +

+
void my_class::handshake_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+ssl_stream.async_handshake(...,
+    std::bind(&my_class::handshake_handler,
+      this, std::placeholders::_1));
+
+

+ A non-static class member function adapted to a handshake handler using + boost::bind(): +

+
void my_class::handshake_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+ssl_stream.async_handshake(...,
+    boost::bind(&my_class::handshake_handler,
+      this, asio::placeholders::error));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/InternetProtocol.html b/include/asio/doc/asio/reference/InternetProtocol.html new file mode 100644 index 0000000..46e9e13 --- /dev/null +++ b/include/asio/doc/asio/reference/InternetProtocol.html @@ -0,0 +1,163 @@ + + + +Internet protocol requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the InternetProtocol requirements + if it satisfies the requirements of AcceptableProtocol, + as well as the additional requirements listed below. +

+

+ In the table below, a denotes a (possibly const) value of type + X, and b denotes a (possibly const) value of type + X. +

+
+

Table 19. InternetProtocol requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ X::resolver +

+
+

+ ip::basic_resolver<X> +

+
+

+ The type of a resolver for the protocol. +

+
+

+ X::v4() +

+
+

+ X +

+
+

+ Returns an object representing the IP version 4 protocol. +

+
+

+ X::v6() +

+
+

+ X +

+
+

+ Returns an object representing the IP version 6 protocol. +

+
+

+ a == b +

+
+

+ convertible to bool +

+
+

+ Returns true if a and b + represent the same IP protocol version, otherwise false. +

+
+

+ a != b +

+
+

+ convertible to bool +

+
+

+ Returns !(a == b). +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/IoControlCommand.html b/include/asio/doc/asio/reference/IoControlCommand.html new file mode 100644 index 0000000..a1a2971 --- /dev/null +++ b/include/asio/doc/asio/reference/IoControlCommand.html @@ -0,0 +1,109 @@ + + + +I/O control command requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the IoControlCommand requirements + if it satisfies the requirements listed below. +

+

+ In the table below, a denotes a (possibly const) value of type + X, and b denotes a value of type X. +

+
+

Table 20. IoControlCommand requirements for extensible implementations

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ a.name() +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the request + argument to POSIX ioctl() + (or equivalent). +

+
+

+ b.data() +

+
+

+ void* +

+
+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/IoObjectService.html b/include/asio/doc/asio/reference/IoObjectService.html new file mode 100644 index 0000000..a382a4f --- /dev/null +++ b/include/asio/doc/asio/reference/IoObjectService.html @@ -0,0 +1,170 @@ + + + +I/O object service requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An I/O object service must meet the requirements for a service, + as well as the requirements listed below. +

+

+ In the table below, X denotes an I/O object service class, + a and ao denote values of type X, + b and c denote values of type X::implementation_type, + and u denotes an identifier. +

+
+

Table 21. IoObjectService requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ X::implementation_type +

+
+ +
+

+ X::implementation_type u; +

+
+ +

+ note: X::implementation_type has a public default + constructor and destructor. +

+
+

+

+
a.construct(b);
+
+

+

+
+ +
+

+

+
a.destroy(b);
+
+

+

+
+ +

+ note: destroy() will only be called on a value that + has previously been initialised with construct() or + move_construct(). +

+
+

+

+
a.move_construct(b, c);
+
+

+

+
+ +

+ note: only required for I/O objects that support movability. +

+
+

+

+
a.move_assign(b, ao, c);
+
+

+

+
+ +

+ note: only required for I/O objects that support movability. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/IteratorConnectHandler.html b/include/asio/doc/asio/reference/IteratorConnectHandler.html new file mode 100644 index 0000000..247bea5 --- /dev/null +++ b/include/asio/doc/asio/reference/IteratorConnectHandler.html @@ -0,0 +1,118 @@ + + + +Iterator connect handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An iterator connect handler must meet the requirements for a handler. + A value h of an iterator connect handler class should work correctly + in the expression h(ec, i), where ec is an lvalue + of type const error_code and i is an lvalue of + the type Iterator used in the corresponding connect() + or async_connect()` function. +

+
+ + Examples +
+

+ A free function as an iterator connect handler: +

+
void connect_handler(
+    const asio::error_code& ec,
+    asio::ip::tcp::resolver::iterator iterator)
+{
+  ...
+}
+
+

+ An iterator connect handler function object: +

+
struct connect_handler
+{
+  ...
+  template <typename Iterator>
+  void operator()(
+      const asio::error_code& ec,
+      Iterator iterator)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as an iterator connect handler: +

+
asio::async_connect(...,
+    [](const asio::error_code& ec,
+      asio::ip::tcp::resolver::iterator iterator)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to an iterator connect handler + using std::bind(): +

+
void my_class::connect_handler(
+    const asio::error_code& ec,
+    asio::ip::tcp::resolver::iterator iterator)
+{
+  ...
+}
+...
+asio::async_connect(...,
+    std::bind(&my_class::connect_handler,
+      this, std::placeholders::_1,
+      std::placeholders::_2));
+
+

+ A non-static class member function adapted to an iterator connect handler + using boost::bind(): +

+
void my_class::connect_handler(
+    const asio::error_code& ec,
+    asio::ip::tcp::resolver::iterator iterator)
+{
+  ...
+}
+...
+asio::async_connect(...,
+    boost::bind(&my_class::connect_handler,
+      this, asio::placeholders::error,
+      asio::placeholders::iterator));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/LegacyCompletionHandler.html b/include/asio/doc/asio/reference/LegacyCompletionHandler.html new file mode 100644 index 0000000..8b1b0fc --- /dev/null +++ b/include/asio/doc/asio/reference/LegacyCompletionHandler.html @@ -0,0 +1,100 @@ + + + +Legacy completion handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A legacy completion handler must meet the requirements for a handler. + A legacy completion handler must meet the requirements of CopyConstructible + types (C++Std [copyconstructible]). A value h of a completion + handler class should work correctly in the expression h(). +

+
+ + Examples +
+

+ A free function as a completion handler: +

+
void completion_handler()
+{
+  ...
+}
+
+

+ A completion handler function object: +

+
struct completion_handler
+{
+  ...
+  void operator()()
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a completion handler: +

+
my_io_service.post(
+    []()
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a completion handler using + std::bind(): +

+
void my_class::completion_handler()
+{
+  ...
+}
+...
+my_io_service.post(std::bind(&my_class::completion_handler, this));
+
+

+ A non-static class member function adapted to a completion handler using + boost::bind(): +

+
void my_class::completion_handler()
+{
+  ...
+}
+...
+my_io_service.post(boost::bind(&my_class::completion_handler, this));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/MoveAcceptHandler.html b/include/asio/doc/asio/reference/MoveAcceptHandler.html new file mode 100644 index 0000000..2fe0b92 --- /dev/null +++ b/include/asio/doc/asio/reference/MoveAcceptHandler.html @@ -0,0 +1,97 @@ + + + +Move accept handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A move accept handler must meet the requirements for a handler. + A value h of a move accept handler class should work correctly + in the expression h(ec, s), where ec is an lvalue + of type const error_code and s is an lvalue of + the nested type Protocol::socket for the type Protocol + of the socket class template. +

+
+ + Examples +
+

+ A free function as a move accept handler: +

+
void accept_handler(
+    const asio::error_code& ec, asio::ip::tcp::socket s)
+{
+  ...
+}
+
+

+ A move accept handler function object: +

+
struct accept_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec, asio::ip::tcp::socket s)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a move accept handler: +

+
acceptor.async_accept(...,
+    [](const asio::error_code& ec, asio::ip::tcp::socket s)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a move accept handler using + std::bind(): +

+
void my_class::accept_handler(
+    const asio::error_code& ec, asio::ip::tcp::socket socket)
+{
+  ...
+}
+...
+asio::async_accept(...,
+    std::bind(&my_class::accept_handler,
+      this, std::placeholders::_1,
+      std::placeholders::_2));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/MutableBufferSequence.html b/include/asio/doc/asio/reference/MutableBufferSequence.html new file mode 100644 index 0000000..3e50a42 --- /dev/null +++ b/include/asio/doc/asio/reference/MutableBufferSequence.html @@ -0,0 +1,130 @@ + + + +Mutable buffer sequence requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A mutable buffer sequence represents a set of memory + regions that may be used to receive the output of an operation, such as the + receive operation of a socket. +

+

+ A type X meets the MutableBufferSequence requirements + if it satisfies the requirements of Destructible (C++Std [destructible]) + and CopyConstructible (C++Std [copyconstructible]), as well + as the additional requirements listed below. +

+

+ In the table below, x denotes a (possibly const) value of type + X, and u denotes an identifier. +

+
+

Table 22. MutableBufferSequence requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ asio::buffer_sequence_begin(x)
asio::buffer_sequence_end(x) +

+
+

+ An iterator type meeting the requirements for bidirectional iterators + (C++Std [bidirectional.iterators]) whose value type is convertible + to mutable_buffer. +

+
+
+

+

+
X u(x);
+
+

+

+
+ +

+ post:
+

+
equal(
+  asio::buffer_sequence_begin(x),
+  asio::buffer_sequence_end(x),
+  asio::buffer_sequence_begin(u),
+  asio::buffer_sequence_end(u),
+  [](const mutable_buffer& b1,
+     const mutable_buffer& b2)
+   {
+     return b1.data() == b2.data()
+         && b1.size() == b2.size();
+   })
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/OperationState.html b/include/asio/doc/asio/reference/OperationState.html new file mode 100644 index 0000000..ac40624 --- /dev/null +++ b/include/asio/doc/asio/reference/OperationState.html @@ -0,0 +1,66 @@ + + + +Operation state concept + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
template<class O>
+  concept operation_state =
+    destructible<O> &&
+    is_object_v<O> &&
+    requires (O& o) {
+      { execution::start(o) } noexcept;
+    };
+
+

+ An object whose type satisfies operation_state represents the + state of an asynchronous operation. It is the result of calling execution::connect + with a sender and a receiver. +

+

+ execution::start may be called on an operation_state + object at most once. Once execution::start has been invoked, + the caller shall ensure that the start of a non-exceptional invocation of + one of the receiver's completion-signalling operations strongly happens before + [intro.multithread] the call to the operation_state destructor. +

+

+ The start of the invocation of execution::start shall strongly + happen before [intro.multithread] the invocation of one of the three receiver + operations. +

+

+ execution::start may or may not block pending the successful + transfer of execution to one of the three receiver operations. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ProtoAllocator.html b/include/asio/doc/asio/reference/ProtoAllocator.html new file mode 100644 index 0000000..18d354e --- /dev/null +++ b/include/asio/doc/asio/reference/ProtoAllocator.html @@ -0,0 +1,48 @@ + + + +Proto-allocator requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type A meets the proto-allocator requirements if A + is CopyConstructible (C++Std [copyconstructible]), Destructible + (C++Std [destructible]), and allocator_traits<A>::rebind_alloc<U> + meets the allocator requirements (C++Std [allocator.requirements]), where + U is an object type. [Note: For example, + std::allocator<void> meets the proto-allocator requirements + but not the allocator requirements. —end note] No constructor, + comparison operator, copy operation, move operation, or swap operation on + these types shall exit via an exception. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Protocol.html b/include/asio/doc/asio/reference/Protocol.html new file mode 100644 index 0000000..4bee788 --- /dev/null +++ b/include/asio/doc/asio/reference/Protocol.html @@ -0,0 +1,180 @@ + + + +Protocol requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the Protocol requirements if it + satisfies the requirements of Destructible (C++Std [destructible]), + CopyConstructible (C++Std [copyconstructible]), and CopyAssignable + (C++Std [copyassignable]), as well as the additional requirements listed + below. +

+

+ No copy or move operation of the type X shall exit via an exception. +

+
+

Table 23. Protocol requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ X::endpoint +

+
+

+ type meeting endpoint + requirements +

+
+
+
+

+ In the table below, a denotes a (possibly const) value of type + X. +

+
+

Table 24. Protocol requirements for extensible implementations

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ a.family() +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the domain + argument to POSIX socket() + (or equivalent). +

+
+

+ a.type() +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the type + argument to POSIX socket() + (or equivalent). +

+
+

+ a.protocol() +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the protocol + argument to POSIX socket() + (or equivalent). +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/RangeConnectHandler.html b/include/asio/doc/asio/reference/RangeConnectHandler.html new file mode 100644 index 0000000..bb2c139 --- /dev/null +++ b/include/asio/doc/asio/reference/RangeConnectHandler.html @@ -0,0 +1,118 @@ + + + +Range connect handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A range connect handler must meet the requirements for a handler. + A value h of a range connect handler class should work correctly + in the expression h(ec, ep), where ec is an lvalue + of type const error_code and ep is an lvalue of + the type Protocol::endpoint for the Protocol type + in the corresponding connect() or async_connect()` function. +

+
+ + Examples +
+

+ A free function as a range connect handler: +

+
void connect_handler(
+    const asio::error_code& ec,
+    const asio::ip::tcp::endpoint& endpoint)
+{
+  ...
+}
+
+

+ A range connect handler function object: +

+
struct connect_handler
+{
+  ...
+  template <typename Range>
+  void operator()(
+      const asio::error_code& ec,
+      const asio::ip::tcp::endpoint& endpoint)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a range connect handler: +

+
asio::async_connect(...,
+    [](const asio::error_code& ec,
+      const asio::ip::tcp::endpoint& endpoint)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a range connect handler using + std::bind(): +

+
void my_class::connect_handler(
+    const asio::error_code& ec,
+    const asio::ip::tcp::endpoint& endpoint)
+{
+  ...
+}
+...
+asio::async_connect(...,
+    std::bind(&my_class::connect_handler,
+      this, std::placeholders::_1,
+      std::placeholders::_2));
+
+

+ A non-static class member function adapted to a range connect handler using + boost::bind(): +

+
void my_class::connect_handler(
+    const asio::error_code& ec,
+    const asio::ip::tcp::endpoint& endpoint)
+{
+  ...
+}
+...
+asio::async_connect(...,
+    boost::bind(&my_class::connect_handler,
+      this, asio::placeholders::error,
+      asio::placeholders::endpoint));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ReadHandler.html b/include/asio/doc/asio/reference/ReadHandler.html new file mode 100644 index 0000000..8b29af9 --- /dev/null +++ b/include/asio/doc/asio/reference/ReadHandler.html @@ -0,0 +1,113 @@ + + + +Read handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A read handler must meet the requirements for a handler. + A value h of a read handler class should work correctly in the + expression h(ec, s), where ec is an lvalue of type + const error_code and s is an lvalue of type const + size_t. +

+
+ + Examples +
+

+ A free function as a read handler: +

+
void read_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+
+

+ A read handler function object: +

+
struct read_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec,
+      std::size_t bytes_transferred)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a read handler: +

+
socket.async_read(...
+    [](const asio::error_code& ec,
+      std::size_t bytes_transferred)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a read handler using std::bind(): +

+
void my_class::read_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+...
+socket.async_read(...,
+    std::bind(&my_class::read_handler,
+      this, std::placeholders::_1,
+      std::placeholders::_2));
+
+

+ A non-static class member function adapted to a read handler using boost::bind(): +

+
void my_class::read_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+...
+socket.async_read(...,
+    boost::bind(&my_class::read_handler,
+      this, asio::placeholders::error,
+      asio::placeholders::bytes_transferred));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Receiver.html b/include/asio/doc/asio/reference/Receiver.html new file mode 100644 index 0000000..6aa256b --- /dev/null +++ b/include/asio/doc/asio/reference/Receiver.html @@ -0,0 +1,88 @@ + + + +Receiver concepts + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A receiver represents the continuation of an asynchronous operation. An asynchronous + operation may complete with a (possibly empty) set of values, an error, or + it may be cancelled. A receiver has three principal operations corresponding + to the three ways an asynchronous operation may complete: set_value, + set_error, and set_done. These are collectively + known as a receiver’s completion-signal operations. +

+
template<class T, class E = exception_ptr>
+concept receiver =
+  move_constructible<remove_cvref_t<T>> &&
+  constructible_from<remove_cvref_t<T>, T> &&
+  requires(remove_cvref_t<T>&& t, E&& e) {
+    { execution::set_done(std::move(t)) } noexcept;
+    { execution::set_error(std::move(t), (E&&) e) } noexcept;
+  };
+
+template<class T, class... An>
+concept receiver_of =
+  receiver<T> &&
+  requires(remove_cvref_t<T>&& t, An&&... an) {
+    execution::set_value(std::move(t), (An&&) an...);
+  };
+
+

+ The receiver’s completion-signal operations have semantic requirements + that are collectively known as the receiver contract, + described below: +

+
    +
  • + None of a receiver’s completion-signal operations shall be invoked + before execution::start has been called on the operation + state object that was returned by execution::connect to + connect that receiver to a sender. +
  • +
  • + Once execution::start has been called on the operation state + object, exactly one of the receiver’s completion-signal operations + shall complete non-exceptionally before the receiver is destroyed. +
  • +
  • + If execution::set_value exits with an exception, it is still + valid to call execution::set_error or execution::set_done + on the receiver. +
  • +
+

+ Once one of a receiver’s completion-signal operations has completed non-exceptionally, + the receiver contract has been satisfied. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ResolveHandler.html b/include/asio/doc/asio/reference/ResolveHandler.html new file mode 100644 index 0000000..3e8aaf5 --- /dev/null +++ b/include/asio/doc/asio/reference/ResolveHandler.html @@ -0,0 +1,115 @@ + + + +Resolve handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A resolve handler must meet the requirements for a handler. + A value h of a resolve handler class should work correctly in + the expression h(ec, r), where ec is an lvalue + of type const error_code and r is an lvalue of + type const ip::basic_resolver_results<InternetProtocol>. + InternetProtocol is the template parameter of the ip::basic_resolver<> + which is used to initiate the asynchronous operation. +

+
+ + Examples +
+

+ A free function as a resolve handler: +

+
void resolve_handler(
+    const asio::error_code& ec,
+    asio::ip::tcp::resolver::results_type results)
+{
+  ...
+}
+
+

+ A resolve handler function object: +

+
struct resolve_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec,
+      asio::ip::tcp::resolver::results_type results)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a resolve handler: +

+
resolver.async_resolve(...,
+    [](const asio::error_code& ec,
+      asio::ip::tcp::resolver::results_type results)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a resolve handler using std::bind(): +

+
void my_class::resolve_handler(
+    const asio::error_code& ec,
+    asio::ip::tcp::resolver::results_type results)
+{
+  ...
+}
+...
+resolver.async_resolve(...,
+    std::bind(&my_class::resolve_handler,
+      this, std::placeholders::_1,
+      std::placeholders::_2));
+
+

+ A non-static class member function adapted to a resolve handler using boost::bind(): +

+
void my_class::resolve_handler(
+    const asio::error_code& ec,
+    asio::ip::tcp::resolver::results_type results)
+{
+  ...
+}
+...
+resolver.async_resolve(...,
+    boost::bind(&my_class::resolve_handler,
+      this, asio::placeholders::error,
+      asio::placeholders::results));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Scheduler.html b/include/asio/doc/asio/reference/Scheduler.html new file mode 100644 index 0000000..772d3bb --- /dev/null +++ b/include/asio/doc/asio/reference/Scheduler.html @@ -0,0 +1,178 @@ + + + +Scheduler concept + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
template<class S>
+  concept scheduler =
+    copy_constructible<remove_cvref_t<S>> &&
+    equality_comparable<remove_cvref_t<S>> &&
+    requires(E&& e) {
+      execution::schedule((E&&)e);
+    };
+
+

+ None of a scheduler's copy constructor, destructor, equality comparison, + or swap operation shall exit via an exception. +

+

+ None of these operations, nor a scheduler type's schedule function, + or associated query functions shall introduce data races as a result of concurrent + invocations of those functions from different threads. +

+

+ For any two (possibly const) values x1 and x2 of + some scheduler type X, x1 == x2 shall return true + only if asio::query(x1, p) == asio::query(x2, p) for every property + p where both asio::query(x1, p) and asio::query(x2, + p) are well-formed and result in a non-void type that is EqualityComparable + (C++Std [equalitycomparable]). [Note: The above requirements + imply that x1 == x2 returns true if x1 + and x2 can be interchanged with identical effects. A scheduler + may conceptually contain additional properties which are not exposed by a + named property type that can be observed via asio::query; in + this case, it is up to the concrete scheduler implementation to decide if + these properties affect equality. Returning false does not necessarily + imply that the effects are not identical. —end note] +

+

+ A scheduler type's destructor shall not block pending completion of any receivers + submitted to the sender objects returned from schedule. [Note: + The ability to wait for completion of submitted function objects may be provided + by the execution context that produced the scheduler. —end note] +

+

+ In addition to the above requirements, type S models scheduler + only if it satisfies the requirements in the Table below. +

+

+ In the Table below, +

+
    +
  • + s denotes a (possibly const) scheduler object of type S, +
  • +
  • + N denotes a type that models sender, and +
  • +
  • + n denotes a sender object of type N +
  • +
+
+

Table 25. Scheduler requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ operation semantics +

+
+

+ execution::schedule(s) +

+
+

+ N +

+
+

+ Evaluates execution::schedule(s) on the calling thread + to create N. +

+
+
+

+ execution::start(o), where o is the result of a + call to execution::connect(N, r) for some receiver object r, + is required to eagerly submit r for execution on an execution + agent that s creates for it. Let rc be r + or an object created by copy or move construction from r. The + semantic constraints on the sender N returned from + a scheduler s's schedule function are as follows: +

+
    +
  • + If rc's set_error function is called in response + to a submission error, scheduling error, or other internal error, let + E be an expression that refers to that error if set_error(rc, + E) is well-formed; otherwise, let E be an exception_ptr + that refers to that error. [Note: E could be the result + of calling current_exception or make_exception_ptr.] + The scheduler calls set_error(rc, E) on an unspecified weakly-parallel + execution agent ([Note: An invocation of set_error on a + receiver is required to be noexcept]), and +
  • +
  • + If rc's set_error function is called in response + to an exception that propagates out of the invocation of set_value + on rc, let E be make_exception_ptr(receiver_invocation_error{}) + invoked from within a catch clause that has caught the exception. The + executor calls set_error(rc, E) on an unspecified weakly-parallel + execution agent, and +
  • +
  • + A call to set_done(rc) is made on an unspecified weakly-parallel + execution agent ([Note: An invocation of a receiver's set_done + function is required to be noexcept]). +
  • +
+

+ [Note: The senders returned from a scheduler's schedule + function have wide discretion when deciding which of the three receiver functions + to call upon submission. —end note] +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Sender.html b/include/asio/doc/asio/reference/Sender.html new file mode 100644 index 0000000..bd95d3b --- /dev/null +++ b/include/asio/doc/asio/reference/Sender.html @@ -0,0 +1,98 @@ + + + +Sender concepts + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ + sender + and sender_to +
+
template<class S>
+  concept sender =
+    move_constructible<remove_cvref_t<S>> &&
+    !requires {
+      typename sender_traits<remove_cvref_t<S>>::__unspecialized; // exposition only
+    };
+
+template<class S, class R>
+  concept sender_to =
+    sender<S> &&
+    receiver<R> &&
+    requires (S&& s, R&& r) {
+      execution::connect((S&&) s, (R&&) r);
+    };
+
+

+ None of these operations shall introduce data races as a result of concurrent + invocations of those functions from different threads. +

+

+ A sender type's destructor shall not block pending completion of the submitted + function objects. +

+

+ [Note: The ability to wait for completion of submitted + function objects may be provided by the associated execution context. —end + note] +

+
+ + typed_sender +
+

+ A sender is typed if it declares what types + it sends through a receiver's channels. The typed_sender concept + is defined as: +

+
template<template<template<class...> class Tuple, template<class...> class Variant> class>
+  struct has-value-types; // exposition only
+
+template<template<class...> class Variant>
+  struct has-error-types; // exposition only
+
+template<class S>
+  concept has-sender-types = // exposition only
+    requires {
+      typename has-value-types<S::template value_types>;
+      typename has-error-types<S::template error_types>;
+      typename bool_constant<S::sends_done>;
+    };
+
+template<class S>
+  concept typed_sender =
+    sender<S> &&
+    has-sender-types<sender_traits<remove_cvref_t<S>>>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/Service.html b/include/asio/doc/asio/reference/Service.html new file mode 100644 index 0000000..cc8733f --- /dev/null +++ b/include/asio/doc/asio/reference/Service.html @@ -0,0 +1,74 @@ + + + +Service requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A class is a service if it is publicly and unambiguously + derived from execution_context::service, or if it is publicly + and unambiguously derived from another service. For a service S, + S::key_type shall be valid and denote a type (C++Std [temp.deduct]), + is_base_of_v<typename S::key_type, S> shall be true, + and S shall satisfy the Destructible requirements + (C++Std [destructible]). +

+

+ The first parameter of all service constructors shall be an lvalue reference + to execution_context. This parameter denotes the execution_context + object that represents a set of services, of which the service object will + be a member. [Note: These constructors may be called + by the make_service function. —end note] +

+

+ A service shall provide an explicit constructor with a single parameter of + lvalue reference to execution_context. [Note: + This constructor may be called by the use_service function. + —end note] +

+
class my_service : public execution_context::service
+{
+public:
+  typedef my_service key_type;
+  explicit my_service(execution_context& ctx);
+  my_service(execution_context& ctx, int some_value);
+private:
+  virtual void shutdown() noexcept override;
+  ...
+};
+
+

+ A service's shutdown member function shall destroy all copies + of user-defined function objects that are held by the service. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/SettableSerialPortOption.html b/include/asio/doc/asio/reference/SettableSerialPortOption.html new file mode 100644 index 0000000..922b6ef --- /dev/null +++ b/include/asio/doc/asio/reference/SettableSerialPortOption.html @@ -0,0 +1,94 @@ + + + +Settable serial port option requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In the table below, X denotes a serial port option class, a + denotes a value of X, ec denotes a value of type + error_code, and s denotes a value of implementation-defined + type storage (where storage + is the type DCB on Windows and termios on POSIX + platforms), and u denotes an identifier. +

+
+

Table 26. SettableSerialPortOption requirements

+
+++++ + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ const X& u = a;
u.store(s, ec); +

+
+

+ error_code +

+
+

+ Saves the value of the serial port option to the storage.
+
If successful, sets ec such that !ec + is true. If an error occurred, sets ec such that + !!ec is true. Returns ec. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/SettableSocketOption.html b/include/asio/doc/asio/reference/SettableSocketOption.html new file mode 100644 index 0000000..5ae7538 --- /dev/null +++ b/include/asio/doc/asio/reference/SettableSocketOption.html @@ -0,0 +1,155 @@ + + + +Settable socket option requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the SettableSocketOption requirements + if it satisfies the requirements listed below. +

+

+ In the table below, a denotes a (possibly const) value of type + X, p denotes a (possibly const) value that meets + the Protocol + requirements, and u denotes an identifier. +

+
+

Table 27. SettableSocketOption requirements for extensible implementations

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ type +

+
+

+ assertion/note
pre/post-conditions +

+
+

+ a.level(p) +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the level + argument to POSIX setsockopt() + (or equivalent). +

+
+

+ a.name(p) +

+
+

+ int +

+
+

+ Returns a value suitable for passing as the option_name + argument to POSIX setsockopt() + (or equivalent). +

+
+

+ a.data(p) +

+
+

+ const void* +

+
+

+ Returns a pointer suitable for passing as the option_value + argument to POSIX setsockopt() + (or equivalent). +

+
+

+ a.size(p) +

+
+

+ size_t +

+
+

+ Returns a value suitable for passing as the option_len + argument to POSIX setsockopt() + (or equivalent), after appropriate integer conversion has been + performed. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ShutdownHandler.html b/include/asio/doc/asio/reference/ShutdownHandler.html new file mode 100644 index 0000000..4fa9109 --- /dev/null +++ b/include/asio/doc/asio/reference/ShutdownHandler.html @@ -0,0 +1,106 @@ + + + +SSL shutdown handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A shutdown handler must meet the requirements for a handler. + A value h of a shutdown handler class should work correctly + in the expression h(ec), where ec is an lvalue + of type const error_code. +

+
+ + Examples +
+

+ A free function as a shutdown handler: +

+
void shutdown_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+
+

+ A shutdown handler function object: +

+
struct shutdown_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a shutdown handler: +

+
ssl_stream.async_shutdown(...,
+    [](const asio::error_code& ec)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a shutdown handler using std::bind(): +

+
void my_class::shutdown_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+ssl_stream.async_shutdown(
+    std::bind(&my_class::shutdown_handler,
+      this, std::placeholders::_1));
+
+

+ A non-static class member function adapted to a shutdown handler using boost::bind(): +

+
void my_class::shutdown_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+ssl_stream.async_shutdown(
+    boost::bind(&my_class::shutdown_handler,
+      this, asio::placeholders::error));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/SignalHandler.html b/include/asio/doc/asio/reference/SignalHandler.html new file mode 100644 index 0000000..057ab79 --- /dev/null +++ b/include/asio/doc/asio/reference/SignalHandler.html @@ -0,0 +1,113 @@ + + + +Signal handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A signal handler must meet the requirements for a handler. + A value h of a signal handler class should work correctly in + the expression h(ec, n), where ec is an lvalue + of type const error_code and n is an lvalue of + type const int. +

+
+ + Examples +
+

+ A free function as a signal handler: +

+
void signal_handler(
+    const asio::error_code& ec,
+    int signal_number)
+{
+  ...
+}
+
+

+ A signal handler function object: +

+
struct signal_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec,
+      int signal_number)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a signal handler: +

+
my_signal_set.async_wait(
+    [](const asio::error_code& ec,
+      int signal_number)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a signal handler using std::bind(): +

+
void my_class::signal_handler(
+    const asio::error_code& ec,
+    int signal_number)
+{
+  ...
+}
+...
+my_signal_set.async_wait(
+    std::bind(&my_class::signal_handler,
+      this, std::placeholders::_1,
+      std::placeholders::_2));
+
+

+ A non-static class member function adapted to a signal handler using boost::bind(): +

+
void my_class::signal_handler(
+    const asio::error_code& ec,
+    int signal_number)
+{
+  ...
+}
+...
+my_signal_set.async_wait(
+    boost::bind(&my_class::signal_handler,
+      this, asio::placeholders::error,
+      asio::placeholders::signal_number));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/SyncRandomAccessReadDevice.html b/include/asio/doc/asio/reference/SyncRandomAccessReadDevice.html new file mode 100644 index 0000000..a6f9d82 --- /dev/null +++ b/include/asio/doc/asio/reference/SyncRandomAccessReadDevice.html @@ -0,0 +1,126 @@ + + + +Buffer-oriented synchronous random-access read device requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In the table below, a denotes a synchronous random-access read + device object, o denotes an offset of type boost::uint64_t, + mb denotes an object satisfying mutable + buffer sequence requirements, and ec denotes an object + of type error_code. +

+
+

Table 28. Buffer-oriented synchronous random-access read device requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.read_some_at(o, mb); +

+
+

+ size_t +

+
+

+ Equivalent to: +

+
error_code ec;
+size_t s = a.read_some_at(o, mb, ec);
+if (ec) throw system_error(ec);
+return s;
+
+

+

+
+

+ a.read_some_at(o, mb, ec); +

+
+

+ size_t +

+
+

+ Reads one or more bytes of data from the device a + at offset o.

The mutable buffer sequence + mb specifies memory where the data should be placed. + The read_some_at operation shall always fill a buffer + in the sequence completely before proceeding to the next.
+
If successful, returns the number of bytes read and sets + ec such that !ec is true. If an error + occurred, returns 0 and sets ec such + that !!ec is true.

If the total size + of all buffers in the sequence mb is 0, + the function shall return 0 immediately. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/SyncRandomAccessWriteDevice.html b/include/asio/doc/asio/reference/SyncRandomAccessWriteDevice.html new file mode 100644 index 0000000..5b290fd --- /dev/null +++ b/include/asio/doc/asio/reference/SyncRandomAccessWriteDevice.html @@ -0,0 +1,126 @@ + + + +Buffer-oriented synchronous random-access write device requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In the table below, a denotes a synchronous random-access write + device object, o denotes an offset of type boost::uint64_t, + cb denotes an object satisfying constant + buffer sequence requirements, and ec denotes an object + of type error_code. +

+
+

Table 29. Buffer-oriented synchronous random-access write device requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.write_some_at(o, cb); +

+
+

+ size_t +

+
+

+ Equivalent to: +

+
error_code ec;
+size_t s = a.write_some(o, cb, ec);
+if (ec) throw system_error(ec);
+return s;
+
+

+

+
+

+ a.write_some_at(o, cb, ec); +

+
+

+ size_t +

+
+

+ Writes one or more bytes of data to the device a at + offset o.

The constant buffer sequence + cb specifies memory where the data to be written is + located. The write_some_at operation shall always + write a buffer in the sequence completely before proceeding to + the next.

If successful, returns the number of bytes + written and sets ec such that !ec is + true. If an error occurred, returns 0 and sets ec + such that !!ec is true.

If the total + size of all buffers in the sequence cb is 0, + the function shall return 0 immediately. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/SyncReadStream.html b/include/asio/doc/asio/reference/SyncReadStream.html new file mode 100644 index 0000000..6f4f42f --- /dev/null +++ b/include/asio/doc/asio/reference/SyncReadStream.html @@ -0,0 +1,103 @@ + + + +Buffer-oriented synchronous read stream requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the SyncReadStream requirements + if it satisfies the requirements listed below. +

+

+ In the table below, a denotes a value of type X, + mb denotes a (possibly const) value satisfying the MutableBufferSequence + requirements, and ec denotes an object of type error_code. +

+
+

Table 30. SyncReadStream requirements

+
+++++ + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.read_some(mb)
a.read_some(mb,ec) +

+
+

+ size_t +

+
+

+ Meets the requirements for a read + operation.

If buffer_size(mb) > 0, + reads one or more bytes of data from the stream a + into the buffer sequence mb. If successful, sets + ec such that !ec is true, + and returns the number of bytes read. If an error occurred, sets + ec such that !!ec is true, + and returns 0. If all data has been read from the stream, and the + stream performed an orderly shutdown, sets ec to + stream_errc::eof and returns 0.

If buffer_size(mb) + == 0, the operation shall not block. Sets ec + such that !ec is true, and returns 0. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/SyncWriteStream.html b/include/asio/doc/asio/reference/SyncWriteStream.html new file mode 100644 index 0000000..6c73eb0 --- /dev/null +++ b/include/asio/doc/asio/reference/SyncWriteStream.html @@ -0,0 +1,101 @@ + + + +Buffer-oriented synchronous write stream requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type X meets the SyncWriteStream requirements + if it satisfies the requirements listed below. +

+

+ In the table below, a denotes a value of type X, + cb denotes a (possibly const) value satisfying the ConstBufferSequence + requirements, and ec denotes an object of type error_code. +

+
+

Table 31. SyncWriteStream requirements

+
+++++ + + + + + + + + + + +
+

+ operation +

+
+

+ type +

+
+

+ semantics, pre/post-conditions +

+
+

+ a.write_some(cb)
a.write_some(cb,ec) +

+
+

+ size_t +

+
+

+ Meets the requirements for a write + operation.

If buffer_size(cb) > 0, + writes one or more bytes of data to the stream a from + the buffer sequence cb. If successful, sets ec + such that !ec is true, and returns the + number of bytes written. If an error occurred, sets ec + such that !!ec is true, and returns 0.
+
If buffer_size(cb) == 0, the operation shall + not block. Sets ec such that !ec is + true, and returns 0. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/TimeTraits.html b/include/asio/doc/asio/reference/TimeTraits.html new file mode 100644 index 0000000..a15842d --- /dev/null +++ b/include/asio/doc/asio/reference/TimeTraits.html @@ -0,0 +1,198 @@ + + + +Time traits requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In the table below, X denotes a time traits class for time type + Time, t, t1, and t2 denote + values of type Time, and d denotes a value of type + X::duration_type. +

+
+

Table 32. TimeTraits requirements

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ X::time_type +

+
+

+ Time +

+
+

+ Represents an absolute time. Must support default construction, + and meet the requirements for CopyConstructible and + Assignable. +

+
+

+ X::duration_type +

+
+ +

+ Represents the difference between two absolute times. Must support + default construction, and meet the requirements for CopyConstructible + and Assignable. A duration can be positive, negative, + or zero. +

+
+

+ X::now(); +

+
+

+ time_type +

+
+

+ Returns the current time. +

+
+

+ X::add(t, d); +

+
+

+ time_type +

+
+

+ Returns a new absolute time resulting from adding the duration + d to the absolute time t. +

+
+

+ X::subtract(t1, t2); +

+
+

+ duration_type +

+
+

+ Returns the duration resulting from subtracting t2 + from t1. +

+
+

+ X::less_than(t1, t2); +

+
+

+ bool +

+
+

+ Returns whether t1 is to be treated as less than + t2. +

+
+

+ X::to_posix_duration(d); +

+
+

+ date_time::time_duration_type +

+
+

+ Returns the date_time::time_duration_type value that + most closely represents the duration d. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/WaitHandler.html b/include/asio/doc/asio/reference/WaitHandler.html new file mode 100644 index 0000000..4a312cc --- /dev/null +++ b/include/asio/doc/asio/reference/WaitHandler.html @@ -0,0 +1,105 @@ + + + +Wait handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A wait handler must meet the requirements for a handler. + A value h of a wait handler class should work correctly in the + expression h(ec), where ec is an lvalue of type + const error_code. +

+
+ + Examples +
+

+ A free function as a wait handler: +

+
void wait_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+
+

+ A wait handler function object: +

+
struct wait_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a wait handler: +

+
socket.async_wait(...,
+    [](const asio::error_code& ec)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a wait handler using std::bind(): +

+
void my_class::wait_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+socket.async_wait(...,
+    std::bind(&my_class::wait_handler,
+      this, std::placeholders::_1));
+
+

+ A non-static class member function adapted to a wait handler using boost::bind(): +

+
void my_class::wait_handler(
+    const asio::error_code& ec)
+{
+  ...
+}
+...
+socket.async_wait(...,
+    boost::bind(&my_class::wait_handler,
+      this, asio::placeholders::error));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/WaitTraits.html b/include/asio/doc/asio/reference/WaitTraits.html new file mode 100644 index 0000000..160c7b5 --- /dev/null +++ b/include/asio/doc/asio/reference/WaitTraits.html @@ -0,0 +1,130 @@ + + + +Wait traits requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The basic_waitable_timer template uses wait traits to allow + programs to customize wait and async_wait behavior. + [Note: Possible uses of wait traits include:
— To + enable timers based on non-realtime clocks.
— Determining how quickly + wallclock-based timers respond to system time changes.
— Correcting for + errors or rounding timeouts to boundaries.
— Preventing duration overflow. + That is, a program may set a timer's expiry e to be Clock::max() + (meaning never reached) or Clock::min() (meaning always in the + past). As a result, computing the duration until timer expiry as e + - Clock::now() may cause overflow. —end note] +

+

+ For a type Clock meeting the Clock requirements + (C++Std [time.clock.req]), a type X meets the WaitTraits + requirements if it satisfies the requirements listed below. +

+

+ In the table below, t denotes a (possibly const) value of type + Clock::time_point; and d denotes a (possibly const) + value of type Clock::duration. +

+
+

Table 33. WaitTraits requirements

+
+++++ + + + + + + + + + + + + + + + + + +
+

+ expression +

+
+

+ return type +

+
+

+ assertion/note
pre/post-condition +

+
+

+ X::to_wait_duration(d) +

+
+

+ Clock::duration +

+
+

+ Returns a Clock::duration value to be used in a wait + or async_wait operation. [Note: + The return value is typically representative of the duration d. + —end note] +

+
+

+ X::to_wait_duration(t) +

+
+

+ Clock::duration +

+
+

+ Returns a Clock::duration value to be used in a wait + or async_wait operation. [Note: + The return value is typically representative of the duration from + Clock::now() until the time point t. + —end note] +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/WriteHandler.html b/include/asio/doc/asio/reference/WriteHandler.html new file mode 100644 index 0000000..6a27dbd --- /dev/null +++ b/include/asio/doc/asio/reference/WriteHandler.html @@ -0,0 +1,113 @@ + + + +Write handler requirements + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A write handler must meet the requirements for a handler. + A value h of a write handler class should work correctly in + the expression h(ec, s), where ec is an lvalue + of type const error_code and s is an lvalue of + type const size_t. +

+
+ + Examples +
+

+ A free function as a write handler: +

+
void write_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+
+

+ A write handler function object: +

+
struct write_handler
+{
+  ...
+  void operator()(
+      const asio::error_code& ec,
+      std::size_t bytes_transferred)
+  {
+    ...
+  }
+  ...
+};
+
+

+ A lambda as a write handler: +

+
socket.async_write(...
+    [](const asio::error_code& ec,
+      std::size_t bytes_transferred)
+    {
+      ...
+    });
+
+

+ A non-static class member function adapted to a write handler using std::bind(): +

+
void my_class::write_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+...
+socket.async_write(...,
+    std::bind(&my_class::write_handler,
+      this, std::placeholders::_1,
+      std::placeholders::_2));
+
+

+ A non-static class member function adapted to a write handler using boost::bind(): +

+
void my_class::write_handler(
+    const asio::error_code& ec,
+    std::size_t bytes_transferred)
+{
+  ...
+}
+...
+socket.async_write(...,
+    boost::bind(&my_class::write_handler,
+      this, asio::placeholders::error,
+      asio::placeholders::bytes_transferred));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/any_io_executor.html b/include/asio/doc/asio/reference/any_io_executor.html new file mode 100644 index 0000000..3df997e --- /dev/null +++ b/include/asio/doc/asio/reference/any_io_executor.html @@ -0,0 +1,294 @@ + + + +any_io_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Polymorphic executor type for + use with I/O objects. +

+
typedef execution::any_executor<...> any_io_executor;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ any_executor [constructor] +

+
+

+ Default constructor.
—
Construct in an empty state. + Equivalent effects to default constructor.
—
Copy constructor. +
—
Move constructor.
—
Construct to point + to the same target as another any_executor.
—
Construct + a polymorphic wrapper for the specified executor. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ execute +

+
+

+ Execute the function on the target executor. +

+
+

+ operator bool +

+
+

+ Determine whether the wrapper has a target executor. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator.
+ —
Assignment operator that sets the polymorphic wrapper to + the empty state.
—
Assignment operator to create a + polymorphic wrapper for the specified executor. +

+
+

+ prefer +

+
+

+ Obtain a polymorphic wrapper with the specified property. +

+
+

+ query +

+
+

+ Obtain the value associated with the specified property. +

+
+

+ require +

+
+

+ Obtain a polymorphic wrapper with the specified property. +

+
+

+ swap +

+
+

+ Swap targets with another polymorphic wrapper. +

+
+

+ target +

+
+

+ Get a pointer to the target executor. +

+
+

+ target_type +

+
+

+ Get the type of the target executor. +

+
+

+ ~any_executor [destructor] +

+
+

+ Destructor. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Inequality operator. +

+
+

+ operator== +

+
+

+ Equality operator. +

+
+

+ The any_io_executor type is a polymorphic executor that supports + the set of properties required by I/O objects. It is defined as the execution::any_executor + class template parameterised as follows: +

+
execution::any_executor<
+  execution::context_as_t<execution_context&>,
+  execution::blocking_t::never_t,
+  execution::prefer_only<execution::blocking_t::possibly_t>,
+  execution::prefer_only<execution::outstanding_work_t::tracked_t>,
+  execution::prefer_only<execution::outstanding_work_t::untracked_t>,
+  execution::prefer_only<execution::relationship_t::fork_t>,
+  execution::prefer_only<execution::relationship_t::continuation_t>
+>
+
+
+ + Requirements +
+

+ Header: asio/any_io_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asio_handler_allocate.html b/include/asio/doc/asio/reference/asio_handler_allocate.html new file mode 100644 index 0000000..3369e11 --- /dev/null +++ b/include/asio/doc/asio/reference/asio_handler_allocate.html @@ -0,0 +1,96 @@ + + + +asio_handler_allocate + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use + the associated_allocator + trait.) Default allocation function for handlers. +

+
asio_handler_allocate_is_deprecated asio_handler_allocate(
+    std::size_t size,
+    ... );
+
+

+ Asynchronous operations may need to allocate temporary objects. Since asynchronous + operations have a handler function object, these temporary objects can be + said to be associated with the handler. +

+

+ Implement asio_handler_allocate and asio_handler_deallocate for your own + handlers to provide custom allocation for these temporary objects. +

+

+ The default implementation of these allocation hooks uses operator + new and operator delete. +

+
+ + Remarks +
+

+ All temporary objects associated with a handler will be deallocated before + the upcall to the handler is performed. This allows the same memory to be + reused for a subsequent asynchronous operation initiated by the handler. +

+
+ + Example +
+
class my_handler;
+
+void* asio_handler_allocate(std::size_t size, my_handler* context)
+{
+  return ::operator new(size);
+}
+
+void asio_handler_deallocate(void* pointer, std::size_t size,
+    my_handler* context)
+{
+  ::operator delete(pointer);
+}
+
+
+ + Requirements +
+

+ Header: asio/handler_alloc_hook.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asio_handler_deallocate.html b/include/asio/doc/asio/reference/asio_handler_deallocate.html new file mode 100644 index 0000000..37018d8 --- /dev/null +++ b/include/asio/doc/asio/reference/asio_handler_deallocate.html @@ -0,0 +1,65 @@ + + + +asio_handler_deallocate + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default deallocation + function for handlers. +

+
asio_handler_deallocate_is_deprecated asio_handler_deallocate(
+    void * pointer,
+    std::size_t size,
+    ... );
+
+

+ Implement asio_handler_allocate and asio_handler_deallocate for your own + handlers to provide custom allocation for the associated temporary objects. +

+

+ The default implementation of these allocation hooks uses operator + new and operator delete. +

+
+ + Requirements +
+

+ Header: asio/handler_alloc_hook.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asio_handler_invoke.html b/include/asio/doc/asio/reference/asio_handler_invoke.html new file mode 100644 index 0000000..4a20c8b --- /dev/null +++ b/include/asio/doc/asio/reference/asio_handler_invoke.html @@ -0,0 +1,116 @@ + + + +asio_handler_invoke + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use the + associated_executor + trait.) Default invoke function for handlers. +

+

+ Default handler invocation hook used for non-const function objects. +

+
template<
+    typename Function>
+asio_handler_invoke_is_deprecated asio_handler_invoke(
+    Function & function,
+    ... );
+  » more...
+
+

+ Default handler invocation hook used for const function objects. +

+
template<
+    typename Function>
+asio_handler_invoke_is_deprecated asio_handler_invoke(
+    const Function & function,
+    ... );
+  » more...
+
+

+ Completion handlers for asynchronous operations are invoked by the io_context associated + with the corresponding object (e.g. a socket or deadline_timer). Certain + guarantees are made on when the handler may be invoked, in particular that + a handler can only be invoked from a thread that is currently calling run() + on the corresponding io_context + object. Handlers may subsequently be invoked through other objects (such + as io_context::strand + objects) that provide additional guarantees. +

+

+ When asynchronous operations are composed from other asynchronous operations, + all intermediate handlers should be invoked using the same method as the + final handler. This is required to ensure that user-defined objects are not + accessed in a way that may violate the guarantees. This hooking function + ensures that the invoked method used for the final handler is accessible + at each intermediate step. +

+

+ Implement asio_handler_invoke for your own handlers to specify a custom invocation + strategy. +

+

+ This default implementation invokes the function object like so: +

+
function();
+
+

+ If necessary, the default implementation makes a copy of the function object + so that the non-const operator() can be used. +

+
+ + Example +
+
class my_handler;
+
+template <typename Function>
+void asio_handler_invoke(Function function, my_handler* context)
+{
+  context->strand_.dispatch(function);
+}
+
+
+ + Requirements +
+

+ Header: asio/handler_invoke_hook.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asio_handler_invoke/overload1.html b/include/asio/doc/asio/reference/asio_handler_invoke/overload1.html new file mode 100644 index 0000000..307ec20 --- /dev/null +++ b/include/asio/doc/asio/reference/asio_handler_invoke/overload1.html @@ -0,0 +1,47 @@ + + + +asio_handler_invoke (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default handler invocation hook used for non-const function objects. +

+
template<
+    typename Function>
+asio_handler_invoke_is_deprecated asio_handler_invoke(
+    Function & function,
+    ... );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asio_handler_invoke/overload2.html b/include/asio/doc/asio/reference/asio_handler_invoke/overload2.html new file mode 100644 index 0000000..b88e96e --- /dev/null +++ b/include/asio/doc/asio/reference/asio_handler_invoke/overload2.html @@ -0,0 +1,47 @@ + + + +asio_handler_invoke (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default handler invocation hook used for const function objects. +

+
template<
+    typename Function>
+asio_handler_invoke_is_deprecated asio_handler_invoke(
+    const Function & function,
+    ... );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asio_handler_is_continuation.html b/include/asio/doc/asio/reference/asio_handler_is_continuation.html new file mode 100644 index 0000000..f9b47d1 --- /dev/null +++ b/include/asio/doc/asio/reference/asio_handler_is_continuation.html @@ -0,0 +1,78 @@ + + + +asio_handler_is_continuation + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + continuation function for handlers. +

+
bool asio_handler_is_continuation(
+    ... );
+
+

+ Asynchronous operations may represent a continuation of the asynchronous + control flow associated with the current handler. The implementation can + use this knowledge to optimise scheduling of the handler. +

+

+ Implement asio_handler_is_continuation for your own handlers to indicate + when a handler represents a continuation. +

+

+ The default implementation of the continuation hook returns false. +

+
+ + Example +
+
class my_handler;
+
+bool asio_handler_is_continuation(my_handler* context)
+{
+  return true;
+}
+
+
+ + Requirements +
+

+ Header: asio/handler_continuation_hook.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/associated_allocator.html b/include/asio/doc/asio/reference/associated_allocator.html new file mode 100644 index 0000000..93a7e9f --- /dev/null +++ b/include/asio/doc/asio/reference/associated_allocator.html @@ -0,0 +1,149 @@ + + + +associated_allocator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Traits type used to obtain the allocator associated with an object. +

+
template<
+    typename T,
+    typename Allocator = std::allocator<void>>
+struct associated_allocator
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ If T has a nested type allocator_type, T::allocator_type. Otherwise + Allocator. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ get [static] +

+
+

+ If T has a nested type allocator_type, returns t.get_allocator(). + Otherwise returns a. +

+
+

+ A program may specialise this traits type if the T template + parameter in the specialisation is a user-defined type. The template parameter + Allocator shall be a type meeting the Allocator requirements. +

+

+ Specialisations shall meet the following requirements, where t + is a const reference to an object of type T, and a + is an object of type Allocator. +

+
    +
  • + Provide a nested typedef type that identifies a type meeting + the Allocator requirements. +
  • +
  • + Provide a noexcept static member function named get, callable + as get(t) and with return type type. +
  • +
  • + Provide a noexcept static member function named get, callable + as get(t,a) and with return type type. +
  • +
+
+ + Requirements +
+

+ Header: asio/associated_allocator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/associated_allocator/get.html b/include/asio/doc/asio/reference/associated_allocator/get.html new file mode 100644 index 0000000..a143423 --- /dev/null +++ b/include/asio/doc/asio/reference/associated_allocator/get.html @@ -0,0 +1,47 @@ + + + +associated_allocator::get + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +If T + has a nested type allocator_type, returns t.get_allocator(). + Otherwise returns a. +

+
static type get(
+    const T & t,
+    const Allocator & a = Allocator());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/associated_allocator/type.html b/include/asio/doc/asio/reference/associated_allocator/type.html new file mode 100644 index 0000000..cb2ac44 --- /dev/null +++ b/include/asio/doc/asio/reference/associated_allocator/type.html @@ -0,0 +1,55 @@ + + + +associated_allocator::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +If T + has a nested type allocator_type, T::allocator_type. + Otherwise Allocator. +

+
typedef see_below type;
+
+
+ + Requirements +
+

+ Header: asio/associated_allocator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/associated_executor.html b/include/asio/doc/asio/reference/associated_executor.html new file mode 100644 index 0000000..2b5af88 --- /dev/null +++ b/include/asio/doc/asio/reference/associated_executor.html @@ -0,0 +1,150 @@ + + + +associated_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Traits type used to obtain the executor associated with an object. +

+
template<
+    typename T,
+    typename Executor = system_executor>
+struct associated_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ If T has a nested type executor_type, T::executor_type. Otherwise + Executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ get [static] +

+
+

+ If T has a nested type executor_type, returns t.get_executor(). + Otherwise returns ex. +

+
+

+ A program may specialise this traits type if the T template + parameter in the specialisation is a user-defined type. The template parameter + Executor shall be a type meeting the Executor requirements. +

+

+ Specialisations shall meet the following requirements, where t + is a const reference to an object of type T, and e + is an object of type Executor. +

+
    +
  • + Provide a nested typedef type that identifies a type meeting + the Executor requirements. +
  • +
  • + Provide a noexcept static member function named get, callable + as get(t) and with return type type. +
  • +
  • + Provide a noexcept static member function named get, callable + as get(t,e) and with return type type. +
  • +
+
+ + Requirements +
+

+ Header: asio/associated_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/associated_executor/get.html b/include/asio/doc/asio/reference/associated_executor/get.html new file mode 100644 index 0000000..cf305b2 --- /dev/null +++ b/include/asio/doc/asio/reference/associated_executor/get.html @@ -0,0 +1,47 @@ + + + +associated_executor::get + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +If T + has a nested type executor_type, returns t.get_executor(). + Otherwise returns ex. +

+
static type get(
+    const T & t,
+    const Executor & ex = Executor());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/associated_executor/type.html b/include/asio/doc/asio/reference/associated_executor/type.html new file mode 100644 index 0000000..ddbe0e5 --- /dev/null +++ b/include/asio/doc/asio/reference/associated_executor/type.html @@ -0,0 +1,55 @@ + + + +associated_executor::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +If T + has a nested type executor_type, T::executor_type. + Otherwise Executor. +

+
typedef see_below type;
+
+
+ + Requirements +
+

+ Header: asio/associated_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_completion.html b/include/asio/doc/asio/reference/async_completion.html new file mode 100644 index 0000000..b250492 --- /dev/null +++ b/include/asio/doc/asio/reference/async_completion.html @@ -0,0 +1,175 @@ + + + +async_completion + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Helper template to deduce the handler type from a CompletionToken, capture + a local copy of the handler, and then create an async_result + for the handler. +

+
template<
+    typename CompletionToken,
+    typename Signature>
+struct async_completion
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ completion_handler_type +

+
+

+ The real handler type to be used for the asynchronous operation. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_completion [constructor] +

+
+

+ Constructor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ completion_handler +

+
+

+ A copy of, or reference to, a real handler object. +

+
+

+ result +

+
+

+ The result of the asynchronous operation's initiating function. +

+
+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_completion/async_completion.html b/include/asio/doc/asio/reference/async_completion/async_completion.html new file mode 100644 index 0000000..68461d6 --- /dev/null +++ b/include/asio/doc/asio/reference/async_completion/async_completion.html @@ -0,0 +1,48 @@ + + + +async_completion::async_completion + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
async_completion(
+    CompletionToken & token);
+
+

+ The constructor creates the concrete completion handler and makes the link + between the handler and the asynchronous result. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_completion/completion_handler.html b/include/asio/doc/asio/reference/async_completion/completion_handler.html new file mode 100644 index 0000000..2ddfc10 --- /dev/null +++ b/include/asio/doc/asio/reference/async_completion/completion_handler.html @@ -0,0 +1,44 @@ + + + +async_completion::completion_handler + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + copy of, or reference to, a real handler object. +

+
conditional< is_same< CompletionToken, completion_handler_type >::value, completion_handler_type &, completion_handler_type >::type completion_handler;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_completion/completion_handler_type.html b/include/asio/doc/asio/reference/async_completion/completion_handler_type.html new file mode 100644 index 0000000..baf43ed --- /dev/null +++ b/include/asio/doc/asio/reference/async_completion/completion_handler_type.html @@ -0,0 +1,189 @@ + + + +async_completion::completion_handler_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + real handler type to be used for the asynchronous operation. +

+
typedef asio::async_result< typename decay< CompletionToken >::type, Signature >::completion_handler_type completion_handler_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ completion_handler_type +

+
+

+ The concrete completion handler type for the specific signature. +

+
+

+ return_type +

+
+

+ The return type of the initiating function. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_result [constructor] +

+
+

+ Construct an async result from a given handler. +

+
+

+ get +

+
+

+ Obtain the value to be returned from the initiating function. +

+
+

+ initiate [static] +

+
+

+ Initiate the asynchronous operation that will produce the result, + and obtain the value to be returned from the initiating function. +

+
+

+ The async_result + traits class is used for determining: +

+
    +
  • + the concrete completion handler type to be called at the end of the + asynchronous operation; +
  • +
  • + the initiating function return type; and +
  • +
  • + how the return value of the initiating function is obtained. +
  • +
+

+ The trait allows the handler and return types to be determined at the point + where the specific completion handler signature is known. +

+

+ This template may be specialised for user-defined completion token types. + The primary template assumes that the CompletionToken is the completion + handler. +

+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_completion/result.html b/include/asio/doc/asio/reference/async_completion/result.html new file mode 100644 index 0000000..68e83d0 --- /dev/null +++ b/include/asio/doc/asio/reference/async_completion/result.html @@ -0,0 +1,44 @@ + + + +async_completion::result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The result + of the asynchronous operation's initiating function. +

+
async_result< typename decay< CompletionToken >::type, Signature > result;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_compose.html b/include/asio/doc/asio/reference/async_compose.html new file mode 100644 index 0000000..f70dbaf --- /dev/null +++ b/include/asio/doc/asio/reference/async_compose.html @@ -0,0 +1,150 @@ + + + +async_compose + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Launch an asynchronous operation + with a stateful implementation. +

+
template<
+    typename CompletionToken,
+    typename Signature,
+    typename Implementation,
+    typename... IoObjectsOrExecutors>
+DEDUCED async_compose(
+    Implementation && implementation,
+    CompletionToken & token,
+    IoObjectsOrExecutors &&... io_objects_or_executors);
+
+

+ The async_compose function simplifies the implementation of composed asynchronous + operations automatically wrapping a stateful function object with a conforming + intermediate completion handler. +

+
+ + Parameters +
+
+

+
+
implementation
+

+ A function object that contains the implementation of the composed + asynchronous operation. The first argument to the function object is + a non-const reference to the enclosing intermediate completion handler. + The remaining arguments are any arguments that originate from the completion + handlers of any asynchronous operations performed by the implementation. +

+
token
+

+ The completion token. +

+
io_objects_or_executors
+

+ Zero or more I/O objects or I/O executors for which outstanding work + must be maintained. +

+
+
+
+ + Example: +
+
struct async_echo_implementation
+{
+  tcp::socket& socket_;
+  asio::mutable_buffer buffer_;
+  enum { starting, reading, writing } state_;
+
+  template <typename Self>
+  void operator()(Self& self,
+      asio::error_code error = {},
+      std::size_t n = 0)
+  {
+    switch (state_)
+    {
+    case starting:
+      state_ = reading;
+      socket_.async_read_some(
+          buffer_, std::move(self));
+      break;
+    case reading:
+      if (error)
+      {
+        self.complete(error, 0);
+      }
+      else
+      {
+        state_ = writing;
+        asio::async_write(socket_, buffer_,
+            asio::transfer_exactly(n),
+            std::move(self));
+      }
+      break;
+    case writing:
+      self.complete(error, n);
+      break;
+    }
+  }
+};
+
+template <typename CompletionToken>
+auto async_echo(tcp::socket& socket,
+    asio::mutable_buffer buffer,
+    CompletionToken&& token) ->
+  typename asio::async_result<
+    typename std::decay<CompletionToken>::type,
+      void(asio::error_code, std::size_t)>::return_type
+{
+  return asio::async_compose<CompletionToken,
+    void(asio::error_code, std::size_t)>(
+      async_echo_implementation{socket, buffer,
+        async_echo_implementation::starting},
+      token, socket);
+}
+
+
+ + Requirements +
+

+ Header: asio/compose.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_connect.html b/include/asio/doc/asio/reference/async_connect.html new file mode 100644 index 0000000..6834ab2 --- /dev/null +++ b/include/asio/doc/asio/reference/async_connect.html @@ -0,0 +1,151 @@ + + + +async_connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The async_connect function + is a composed asynchronous operation that establishes a socket connection + by trying each endpoint in a sequence. +

+

+ Asynchronously establishes a socket connection by trying each endpoint in + a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename RangeConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    RangeConnectHandler && handler = DEFAULT,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+  » more...
+
+

+ (Deprecated: Use range overload.) Asynchronously establishes a socket connection + by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    IteratorConnectHandler && handler = DEFAULT,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+  » more...
+
+

+ Asynchronously establishes a socket connection by trying each endpoint in + a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    IteratorConnectHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename ConnectCondition,
+    typename RangeConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    ConnectCondition connect_condition,
+    RangeConnectHandler && handler = DEFAULT,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+  » more...
+
+

+ (Deprecated: Use range overload.) Asynchronously establishes a socket connection + by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    ConnectCondition connect_condition,
+    IteratorConnectHandler && handler = DEFAULT,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+  » more...
+
+

+ Asynchronously establishes a socket connection by trying each endpoint in + a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    ConnectCondition connect_condition,
+    IteratorConnectHandler && handler = DEFAULT);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/connect.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_connect/overload1.html b/include/asio/doc/asio/reference/async_connect/overload1.html new file mode 100644 index 0000000..d5e370f --- /dev/null +++ b/include/asio/doc/asio/reference/async_connect/overload1.html @@ -0,0 +1,135 @@ + + + +async_connect (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously establishes a socket connection by trying each endpoint + in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename RangeConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    RangeConnectHandler && handler = DEFAULT,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's async_connect + member function, once for each endpoint in the sequence, until a connection + is successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
endpoints
+

+ A sequence of endpoints. +

+
handler
+
+

+ The handler to be called when the connect operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation. if the sequence is empty, set to
+  // asio::error::not_found. Otherwise, contains the
+  // error from the last connection attempt.
+  const asio::error_code& error,
+
+  // On success, the successfully connected endpoint.
+  // Otherwise, a default-constructed endpoint.
+  const typename Protocol::endpoint& endpoint
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::socket s(my_context);
+
+// ...
+
+r.async_resolve(q, resolve_handler);
+
+// ...
+
+void resolve_handler(
+    const asio::error_code& ec,
+    tcp::resolver::results_type results)
+{
+  if (!ec)
+  {
+    asio::async_connect(s, results, connect_handler);
+  }
+}
+
+// ...
+
+void connect_handler(
+    const asio::error_code& ec,
+    const tcp::endpoint& endpoint)
+{
+  // ...
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_connect/overload2.html b/include/asio/doc/asio/reference/async_connect/overload2.html new file mode 100644 index 0000000..08721b7 --- /dev/null +++ b/include/asio/doc/asio/reference/async_connect/overload2.html @@ -0,0 +1,111 @@ + + + +async_connect (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use range overload.) Asynchronously establishes a socket connection + by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    IteratorConnectHandler && handler = DEFAULT,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's async_connect + member function, once for each endpoint in the sequence, until a connection + is successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
handler
+
+

+ The handler to be called when the connect operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation. if the sequence is empty, set to
+  // asio::error::not_found. Otherwise, contains the
+  // error from the last connection attempt.
+  const asio::error_code& error,
+
+  // On success, an iterator denoting the successfully
+  // connected endpoint. Otherwise, the end iterator.
+  Iterator iterator
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ This overload assumes that a default constructed object of type Iterator + represents the end of the sequence. This is a valid assumption for iterator + types such as asio::ip::tcp::resolver::iterator. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_connect/overload3.html b/include/asio/doc/asio/reference/async_connect/overload3.html new file mode 100644 index 0000000..96ed448 --- /dev/null +++ b/include/asio/doc/asio/reference/async_connect/overload3.html @@ -0,0 +1,125 @@ + + + +async_connect (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously establishes a socket connection by trying each endpoint + in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    IteratorConnectHandler && handler = DEFAULT);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's async_connect + member function, once for each endpoint in the sequence, until a connection + is successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
end
+

+ An iterator pointing to the end of a sequence of endpoints. +

+
handler
+
+

+ The handler to be called when the connect operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation. if the sequence is empty, set to
+  // asio::error::not_found. Otherwise, contains the
+  // error from the last connection attempt.
+  const asio::error_code& error,
+
+  // On success, an iterator denoting the successfully
+  // connected endpoint. Otherwise, the end iterator.
+  Iterator iterator
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
std::vector<tcp::endpoint> endpoints = ...;
+tcp::socket s(my_context);
+asio::async_connect(s,
+    endpoints.begin(), endpoints.end(),
+    connect_handler);
+
+// ...
+
+void connect_handler(
+    const asio::error_code& ec,
+    std::vector<tcp::endpoint>::iterator i)
+{
+  // ...
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_connect/overload4.html b/include/asio/doc/asio/reference/async_connect/overload4.html new file mode 100644 index 0000000..bc1b2a8 --- /dev/null +++ b/include/asio/doc/asio/reference/async_connect/overload4.html @@ -0,0 +1,184 @@ + + + +async_connect (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously establishes a socket connection by trying each endpoint + in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename ConnectCondition,
+    typename RangeConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    ConnectCondition connect_condition,
+    RangeConnectHandler && handler = DEFAULT,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's async_connect + member function, once for each endpoint in the sequence, until a connection + is successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
endpoints
+

+ A sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
handler
+
+

+ The handler to be called when the connect operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation. if the sequence is empty, set to
+  // asio::error::not_found. Otherwise, contains the
+  // error from the last connection attempt.
+  const asio::error_code& error,
+
+  // On success, an iterator denoting the successfully
+  // connected endpoint. Otherwise, the end iterator.
+  Iterator iterator
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ The following connect condition function object can be used to output information + about the individual connection attempts: +

+
struct my_connect_condition
+{
+  bool operator()(
+      const asio::error_code& ec,
+      const::tcp::endpoint& next)
+  {
+    if (ec) std::cout << "Error: " << ec.message() << std::endl;
+    std::cout << "Trying: " << next << std::endl;
+    return true;
+  }
+};
+
+

+ It would be used with the asio::connect function as follows: +

+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::socket s(my_context);
+
+// ...
+
+r.async_resolve(q, resolve_handler);
+
+// ...
+
+void resolve_handler(
+    const asio::error_code& ec,
+    tcp::resolver::results_type results)
+{
+  if (!ec)
+  {
+    asio::async_connect(s, results,
+        my_connect_condition(),
+        connect_handler);
+  }
+}
+
+// ...
+
+void connect_handler(
+    const asio::error_code& ec,
+    const tcp::endpoint& endpoint)
+{
+  if (ec)
+  {
+    // An error occurred.
+  }
+  else
+  {
+    std::cout << "Connected to: " << endpoint << std::endl;
+  }
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_connect/overload5.html b/include/asio/doc/asio/reference/async_connect/overload5.html new file mode 100644 index 0000000..d8c8ce3 --- /dev/null +++ b/include/asio/doc/asio/reference/async_connect/overload5.html @@ -0,0 +1,132 @@ + + + +async_connect (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use range overload.) Asynchronously establishes a socket connection + by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    ConnectCondition connect_condition,
+    IteratorConnectHandler && handler = DEFAULT,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's async_connect + member function, once for each endpoint in the sequence, until a connection + is successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
handler
+
+

+ The handler to be called when the connect operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation. if the sequence is empty, set to
+  // asio::error::not_found. Otherwise, contains the
+  // error from the last connection attempt.
+  const asio::error_code& error,
+
+  // On success, an iterator denoting the successfully
+  // connected endpoint. Otherwise, the end iterator.
+  Iterator iterator
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ This overload assumes that a default constructed object of type Iterator + represents the end of the sequence. This is a valid assumption for iterator + types such as asio::ip::tcp::resolver::iterator. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_connect/overload6.html b/include/asio/doc/asio/reference/async_connect/overload6.html new file mode 100644 index 0000000..4a0eb73 --- /dev/null +++ b/include/asio/doc/asio/reference/async_connect/overload6.html @@ -0,0 +1,189 @@ + + + +async_connect (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously establishes a socket connection by trying each endpoint + in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition,
+    typename IteratorConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    ConnectCondition connect_condition,
+    IteratorConnectHandler && handler = DEFAULT);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's async_connect + member function, once for each endpoint in the sequence, until a connection + is successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
end
+

+ An iterator pointing to the end of a sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
handler
+
+

+ The handler to be called when the connect operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation. if the sequence is empty, set to
+  // asio::error::not_found. Otherwise, contains the
+  // error from the last connection attempt.
+  const asio::error_code& error,
+
+  // On success, an iterator denoting the successfully
+  // connected endpoint. Otherwise, the end iterator.
+  Iterator iterator
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ The following connect condition function object can be used to output information + about the individual connection attempts: +

+
struct my_connect_condition
+{
+  bool operator()(
+      const asio::error_code& ec,
+      const::tcp::endpoint& next)
+  {
+    if (ec) std::cout << "Error: " << ec.message() << std::endl;
+    std::cout << "Trying: " << next << std::endl;
+    return true;
+  }
+};
+
+

+ It would be used with the asio::connect function as follows: +

+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::socket s(my_context);
+
+// ...
+
+r.async_resolve(q, resolve_handler);
+
+// ...
+
+void resolve_handler(
+    const asio::error_code& ec,
+    tcp::resolver::iterator i)
+{
+  if (!ec)
+  {
+    tcp::resolver::iterator end;
+    asio::async_connect(s, i, end,
+        my_connect_condition(),
+        connect_handler);
+  }
+}
+
+// ...
+
+void connect_handler(
+    const asio::error_code& ec,
+    tcp::resolver::iterator i)
+{
+  if (ec)
+  {
+    // An error occurred.
+  }
+  else
+  {
+    std::cout << "Connected to: " << i->endpoint() << std::endl;
+  }
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_initiate.html b/include/asio/doc/asio/reference/async_initiate.html new file mode 100644 index 0000000..9504be5 --- /dev/null +++ b/include/asio/doc/asio/reference/async_initiate.html @@ -0,0 +1,60 @@ + + + +async_initiate + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
template<
+    typename CompletionToken,
+    completion_signature Signature,
+    typename Initiation,
+    typename... Args>
+DEDUCED async_initiate(
+    Initiation && initiation,
+    CompletionToken & ,
+    Args &&... args);
+
+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read.html b/include/asio/doc/asio/reference/async_read.html new file mode 100644 index 0000000..7c960bf --- /dev/null +++ b/include/asio/doc/asio/reference/async_read.html @@ -0,0 +1,150 @@ + + + +async_read + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The async_read function is + a composed asynchronous operation that reads a certain amount of data from + a stream before completion. +

+

+ Start an asynchronous operation to read a certain amount of data from a stream. +

+
template<
+    typename AsyncReadStream,
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename MutableBufferSequence,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/read.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload1.html b/include/asio/doc/asio/reference/async_read/overload1.html new file mode 100644 index 0000000..592ab7c --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload1.html @@ -0,0 +1,148 @@ + + + +async_read (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + The program must ensure that the stream performs no other read operations + (such as async_read, the stream's async_read_some function, or any other + composed operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the stream. Although the buffers object may be copied as necessary, + ownership of the underlying memory blocks is retained by the caller, + which must guarantee that they remain valid until the handler is + called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::async_read(s, asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::async_read(
+    s, buffers,
+    asio::transfer_all(),
+    handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload2.html b/include/asio/doc/asio/reference/async_read/overload2.html new file mode 100644 index 0000000..eea9073 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload2.html @@ -0,0 +1,154 @@ + + + +async_read (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename MutableBufferSequence,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the stream. Although the buffers object may be copied as necessary, + ownership of the underlying memory blocks is retained by the caller, + which must guarantee that they remain valid until the handler is + called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's async_read_some function. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::async_read(s,
+    asio::buffer(data, size),
+    asio::transfer_at_least(32),
+    handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload3.html b/include/asio/doc/asio/reference/async_read/overload3.html new file mode 100644 index 0000000..2e6f57e --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload3.html @@ -0,0 +1,131 @@ + + + +async_read (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + The program must ensure that the stream performs no other read operations + (such as async_read, the stream's async_read_some function, or any other + composed operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::async_read(
+    s, buffers,
+    asio::transfer_all(),
+    handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload4.html b/include/asio/doc/asio/reference/async_read/overload4.html new file mode 100644 index 0000000..0847056 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload4.html @@ -0,0 +1,141 @@ + + + +async_read (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + The program must ensure that the stream performs no other read operations + (such as async_read, the stream's async_read_some function, or any other + composed operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's async_read_some function. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload5.html b/include/asio/doc/asio/reference/async_read/overload5.html new file mode 100644 index 0000000..2bba057 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload5.html @@ -0,0 +1,129 @@ + + + +async_read (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + The program must ensure that the stream performs no other read operations + (such as async_read, the stream's async_read_some function, or any other + composed operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
b
+

+ A basic_streambuf + object into which the data will be read. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::async_read(
+    s, b,
+    asio::transfer_all(),
+    handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload6.html b/include/asio/doc/asio/reference/async_read/overload6.html new file mode 100644 index 0000000..420d9cc --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload6.html @@ -0,0 +1,139 @@ + + + +async_read (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + The program must ensure that the stream performs no other read operations + (such as async_read, the stream's async_read_some function, or any other + composed operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
b
+

+ A basic_streambuf + object into which the data will be read. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's async_read_some function. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload7.html b/include/asio/doc/asio/reference/async_read/overload7.html new file mode 100644 index 0000000..ab72b7b --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload7.html @@ -0,0 +1,131 @@ + + + +async_read (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + The program must ensure that the stream performs no other read operations + (such as async_read, the stream's async_read_some function, or any other + composed operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::async_read(
+    s, buffers,
+    asio::transfer_all(),
+    handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read/overload8.html b/include/asio/doc/asio/reference/async_read/overload8.html new file mode 100644 index 0000000..3c657e7 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read/overload8.html @@ -0,0 +1,141 @@ + + + +async_read (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data from a + stream. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + The program must ensure that the stream performs no other read operations + (such as async_read, the stream's async_read_some function, or any other + composed operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's async_read_some function. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes copied into the
+                                          // buffers. If an error occurred,
+                                          // this will be the  number of
+                                          // bytes successfully transferred
+                                          // prior to the error.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_at.html b/include/asio/doc/asio/reference/async_read_at.html new file mode 100644 index 0000000..1006216 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_at.html @@ -0,0 +1,105 @@ + + + +async_read_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The async_read_at function + is a composed asynchronous operation that reads a certain amount of data + at the specified offset. +

+

+ Start an asynchronous operation to read a certain amount of data at the specified + offset. +

+
template<
+    typename AsyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename AsyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename AsyncRandomAccessReadDevice,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename AsyncRandomAccessReadDevice,
+    typename Allocator,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/read_at.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_at/overload1.html b/include/asio/doc/asio/reference/async_read_at/overload1.html new file mode 100644 index 0000000..0ff8b50 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_at/overload1.html @@ -0,0 +1,149 @@ + + + +async_read_at (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a random access device at the specified offset. The function + call always returns immediately. The asynchronous operation will continue + until one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + async_read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the AsyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the device. Although the buffers object may be copied as necessary, + ownership of the underlying memory blocks is retained by the caller, + which must guarantee that they remain valid until the handler is + called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes copied into the buffers. If an error
+  // occurred, this will be the number of bytes successfully
+  // transferred prior to the error.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::async_read_at(d, 42, asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::async_read_at(
+    d, 42, buffers,
+    asio::transfer_all(),
+    handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_at/overload2.html b/include/asio/doc/asio/reference/async_read_at/overload2.html new file mode 100644 index 0000000..751a9ba --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_at/overload2.html @@ -0,0 +1,158 @@ + + + +async_read_at (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a random access device at the specified offset. The function + call always returns immediately. The asynchronous operation will continue + until one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the AsyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the device. Although the buffers object may be copied as necessary, + ownership of the underlying memory blocks is retained by the caller, + which must guarantee that they remain valid until the handler is + called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_read_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the device's async_read_some_at function. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes copied into the buffers. If an error
+  // occurred, this will be the number of bytes successfully
+  // transferred prior to the error.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::async_read_at(d, 42,
+    asio::buffer(data, size),
+    asio::transfer_at_least(32),
+    handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_at/overload3.html b/include/asio/doc/asio/reference/async_read_at/overload3.html new file mode 100644 index 0000000..8ef2300 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_at/overload3.html @@ -0,0 +1,126 @@ + + + +async_read_at (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessReadDevice,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a random access device at the specified offset. The function + call always returns immediately. The asynchronous operation will continue + until one of the following conditions is true: +

+
  • + An error occurred. +
+

+ This operation is implemented in terms of zero or more calls to the device's + async_read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the AsyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
b
+

+ A basic_streambuf + object into which the data will be read. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes copied into the buffers. If an error
+  // occurred, this will be the number of bytes successfully
+  // transferred prior to the error.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::async_read_at(
+    d, 42, b,
+    asio::transfer_all(),
+    handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_at/overload4.html b/include/asio/doc/asio/reference/async_read_at/overload4.html new file mode 100644 index 0000000..47fa568 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_at/overload4.html @@ -0,0 +1,136 @@ + + + +async_read_at (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessReadDevice,
+    typename Allocator,
+    typename CompletionCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_at(
+    AsyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read a certain number of bytes + of data from a random access device at the specified offset. The function + call always returns immediately. The asynchronous operation will continue + until one of the following conditions is true: +

+
  • + The completion_condition function object returns 0. +
+

+ This operation is implemented in terms of zero or more calls to the device's + async_read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the AsyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
b
+

+ A basic_streambuf + object into which the data will be read. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_read_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the device's async_read_some_at function. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes copied into the buffers. If an error
+  // occurred, this will be the number of bytes successfully
+  // transferred prior to the error.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until.html b/include/asio/doc/asio/reference/async_read_until.html new file mode 100644 index 0000000..230cd48 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until.html @@ -0,0 +1,234 @@ + + + +async_read_until + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The async_read_until + function is a composed asynchronous operation that reads data into a dynamic + buffer sequence, or into a streambuf, until it contains a delimiter, matches + a regular expression, or a function object indicates a match. +

+

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until it contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    char delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    string_view delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until some part of its data matches a regular expression. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    const boost::regex & expr,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until a function object indicates a match. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename MatchCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    MatchCondition match_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to read data into a streambuf until it contains + a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    char delim,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    string_view delim,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+

+ Start an asynchronous operation to read data into a streambuf until some + part of its data matches a regular expression. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    const boost::regex & expr,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+

+ Start an asynchronous operation to read data into a streambuf until a function + object indicates a match. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename MatchCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    MatchCondition match_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_match_condition< MatchCondition >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until it contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    char delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    string_view delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until some part of its data matches a regular expression. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    const boost::regex & expr,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until a function object indicates a match. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename MatchCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    MatchCondition match_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/read_until.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload1.html b/include/asio/doc/asio/reference/async_read_until/overload1.html new file mode 100644 index 0000000..726fe69 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload1.html @@ -0,0 +1,181 @@ + + + +async_read_until (1 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until it contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    char delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until the dynamic buffer sequence's get area contains the + specified delimiter. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the dynamic buffer sequence's get area already contains the delimiter, + this asynchronous operation completes immediately. The program must ensure + that the stream performs no other read operations (such as async_read, + async_read_until, the stream's async_read_some function, or any other composed + operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
delim
+

+ The delimiter character. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer sequence's
+  // get area up to and including the delimiter.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent async_read_until + operation to examine. +

+
+ + Example +
+

+ To asynchronously read data into a std::string until a newline + is encountered: +

+
std::string data;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::string line = data.substr(0, n);
+    data.erase(0, n);
+    ...
+  }
+}
+...
+asio::async_read_until(s, data, '\n', handler);
+
+

+ After the async_read_until operation completes successfully, + the buffer data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer data as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload10.html b/include/asio/doc/asio/reference/async_read_until/overload10.html new file mode 100644 index 0000000..1d06d00 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload10.html @@ -0,0 +1,181 @@ + + + +async_read_until (10 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until it contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    string_view delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until the dynamic buffer sequence's get area contains the + specified delimiter. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the dynamic buffer sequence's get area already contains the delimiter, + this asynchronous operation completes immediately. The program must ensure + that the stream performs no other read operations (such as async_read, + async_read_until, the stream's async_read_some function, or any other composed + operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
delim
+

+ The delimiter string. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer sequence's
+  // get area up to and including the delimiter.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent async_read_until + operation to examine. +

+
+ + Example +
+

+ To asynchronously read data into a std::string until a CR-LF + sequence is encountered: +

+
std::string data;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::string line = data.substr(0, n);
+    data.erase(0, n);
+    ...
+  }
+}
+...
+asio::async_read_until(s, data, "\r\n", handler);
+
+

+ After the async_read_until operation completes successfully, + the string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + string data as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload11.html b/include/asio/doc/asio/reference/async_read_until/overload11.html new file mode 100644 index 0000000..be06366 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload11.html @@ -0,0 +1,185 @@ + + + +async_read_until (11 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until some part of its data matches a regular expression. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    const boost::regex & expr,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until the dynamic buffer sequence's get area contains some + data that matches a regular expression. The function call always returns + immediately. The asynchronous operation will continue until one of the + following conditions is true: +

+
    +
  • + A substring of the dynamic buffer sequence's get area matches the regular + expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the dynamic buffer sequence's get area already contains data that matches + the regular expression, this asynchronous operation completes immediately. + The program must ensure that the stream performs no other read operations + (such as async_read, async_read_until, the stream's async_read_some function, + or any other composed operations that perform reads) until this operation + completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
expr
+

+ The regular expression. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer
+  // sequence's get area up to and including the
+  // substring that matches the regular expression.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond that which matched the regular expression. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent async_read_until operation to examine. +

+
+ + Example +
+

+ To asynchronously read data into a std::string until a CR-LF + sequence is encountered: +

+
std::string data;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::string line = data.substr(0, n);
+    data.erase(0, n);
+    ...
+  }
+}
+...
+asio::async_read_until(s, data,
+    boost::regex("\r\n"), handler);
+
+

+ After the async_read_until operation completes successfully, + the string data contains the data which matched the regular + expression: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the match, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + string data as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload12.html b/include/asio/doc/asio/reference/async_read_until/overload12.html new file mode 100644 index 0000000..e1c451d --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload12.html @@ -0,0 +1,224 @@ + + + +async_read_until (12 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until a function object indicates a match. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename MatchCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    MatchCondition match_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until a user-defined match condition function object, when + applied to the data contained in the dynamic buffer sequence, indicates + a successful match. The function call always returns immediately. The asynchronous + operation will continue until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the match condition function object already indicates a match, this + asynchronous operation completes immediately. The program must ensure that + the stream performs no other read operations (such as async_read, async_read_until, + the stream's async_read_some function, or any other composed operations + that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<typename DynamicBuffer_v2::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer sequence's
+  // get area that have been fully consumed by the match
+  // function. O if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond that which matched the function object. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent async_read_until operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + Examples +
+

+ To asynchronously read data into a std::string until whitespace + is encountered: +

+
typedef asio::buffers_iterator<
+    asio::const_buffers_1> iterator;
+
+std::pair<iterator, bool>
+match_whitespace(iterator begin, iterator end)
+{
+  iterator i = begin;
+  while (i != end)
+    if (std::isspace(*i++))
+      return std::make_pair(i, true);
+  return std::make_pair(i, false);
+}
+...
+void handler(const asio::error_code& e, std::size_t size);
+...
+std::string data;
+asio::async_read_until(s, data, match_whitespace, handler);
+
+

+ To asynchronously read data into a std::string until a matching + character is found: +

+
class match_char
+{
+public:
+  explicit match_char(char c) : c_(c) {}
+
+  template <typename Iterator>
+  std::pair<Iterator, bool> operator()(
+      Iterator begin, Iterator end) const
+  {
+    Iterator i = begin;
+    while (i != end)
+      if (c_ == *i++)
+        return std::make_pair(i, true);
+    return std::make_pair(i, false);
+  }
+
+private:
+  char c_;
+};
+
+namespace asio {
+  template <> struct is_match_condition<match_char>
+    : public boost::true_type {};
+} // namespace asio
+...
+void handler(const asio::error_code& e, std::size_t size);
+...
+std::string data;
+asio::async_read_until(s, data, match_char('a'), handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload2.html b/include/asio/doc/asio/reference/async_read_until/overload2.html new file mode 100644 index 0000000..4267cd8 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload2.html @@ -0,0 +1,181 @@ + + + +async_read_until (2 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until it contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    string_view delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until the dynamic buffer sequence's get area contains the + specified delimiter. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the dynamic buffer sequence's get area already contains the delimiter, + this asynchronous operation completes immediately. The program must ensure + that the stream performs no other read operations (such as async_read, + async_read_until, the stream's async_read_some function, or any other composed + operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
delim
+

+ The delimiter string. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer sequence's
+  // get area up to and including the delimiter.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent async_read_until + operation to examine. +

+
+ + Example +
+

+ To asynchronously read data into a std::string until a CR-LF + sequence is encountered: +

+
std::string data;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::string line = data.substr(0, n);
+    data.erase(0, n);
+    ...
+  }
+}
+...
+asio::async_read_until(s, data, "\r\n", handler);
+
+

+ After the async_read_until operation completes successfully, + the string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + string data as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload3.html b/include/asio/doc/asio/reference/async_read_until/overload3.html new file mode 100644 index 0000000..3f8fb85 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload3.html @@ -0,0 +1,185 @@ + + + +async_read_until (3 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until some part of its data matches a regular expression. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    const boost::regex & expr,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until the dynamic buffer sequence's get area contains some + data that matches a regular expression. The function call always returns + immediately. The asynchronous operation will continue until one of the + following conditions is true: +

+
    +
  • + A substring of the dynamic buffer sequence's get area matches the regular + expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the dynamic buffer sequence's get area already contains data that matches + the regular expression, this asynchronous operation completes immediately. + The program must ensure that the stream performs no other read operations + (such as async_read, async_read_until, the stream's async_read_some function, + or any other composed operations that perform reads) until this operation + completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
expr
+

+ The regular expression. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer
+  // sequence's get area up to and including the
+  // substring that matches the regular expression.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond that which matched the regular expression. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent async_read_until operation to examine. +

+
+ + Example +
+

+ To asynchronously read data into a std::string until a CR-LF + sequence is encountered: +

+
std::string data;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::string line = data.substr(0, n);
+    data.erase(0, n);
+    ...
+  }
+}
+...
+asio::async_read_until(s, data,
+    boost::regex("\r\n"), handler);
+
+

+ After the async_read_until operation completes successfully, + the string data contains the data which matched the regular + expression: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the match, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + string data as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload4.html b/include/asio/doc/asio/reference/async_read_until/overload4.html new file mode 100644 index 0000000..551f8f7 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload4.html @@ -0,0 +1,224 @@ + + + +async_read_until (4 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until a function object indicates a match. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v1,
+    typename MatchCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    MatchCondition match_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until a user-defined match condition function object, when + applied to the data contained in the dynamic buffer sequence, indicates + a successful match. The function call always returns immediately. The asynchronous + operation will continue until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the match condition function object already indicates a match, this + asynchronous operation completes immediately. The program must ensure that + the stream performs no other read operations (such as async_read, async_read_until, + the stream's async_read_some function, or any other composed operations + that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<typename DynamicBuffer_v1::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer sequence's
+  // get area that have been fully consumed by the match
+  // function. O if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond that which matched the function object. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent async_read_until operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + Examples +
+

+ To asynchronously read data into a std::string until whitespace + is encountered: +

+
typedef asio::buffers_iterator<
+    asio::const_buffers_1> iterator;
+
+std::pair<iterator, bool>
+match_whitespace(iterator begin, iterator end)
+{
+  iterator i = begin;
+  while (i != end)
+    if (std::isspace(*i++))
+      return std::make_pair(i, true);
+  return std::make_pair(i, false);
+}
+...
+void handler(const asio::error_code& e, std::size_t size);
+...
+std::string data;
+asio::async_read_until(s, data, match_whitespace, handler);
+
+

+ To asynchronously read data into a std::string until a matching + character is found: +

+
class match_char
+{
+public:
+  explicit match_char(char c) : c_(c) {}
+
+  template <typename Iterator>
+  std::pair<Iterator, bool> operator()(
+      Iterator begin, Iterator end) const
+  {
+    Iterator i = begin;
+    while (i != end)
+      if (c_ == *i++)
+        return std::make_pair(i, true);
+    return std::make_pair(i, false);
+  }
+
+private:
+  char c_;
+};
+
+namespace asio {
+  template <> struct is_match_condition<match_char>
+    : public boost::true_type {};
+} // namespace asio
+...
+void handler(const asio::error_code& e, std::size_t size);
+...
+std::string data;
+asio::async_read_until(s, data, match_char('a'), handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload5.html b/include/asio/doc/asio/reference/async_read_until/overload5.html new file mode 100644 index 0000000..d407e0f --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload5.html @@ -0,0 +1,177 @@ + + + +async_read_until (5 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a streambuf until it + contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    char delim,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data into the specified streambuf + until the streambuf's get area contains the specified delimiter. The function + call always returns immediately. The asynchronous operation will continue + until one of the following conditions is true: +

+
    +
  • + The get area of the streambuf contains the specified delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the streambuf's get area already contains the delimiter, this asynchronous + operation completes immediately. The program must ensure that the stream + performs no other read operations (such as async_read, async_read_until, + the stream's async_read_some function, or any other composed operations + that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. Ownership of + the streambuf is retained by the caller, which must guarantee that + it remains valid until the handler is called. +

+
delim
+

+ The delimiter character. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the streambuf's get
+  // area up to and including the delimiter.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the streambuf may contain + additional data beyond the delimiter. An application will typically leave + that data in the streambuf for a subsequent async_read_until operation + to examine. +

+
+ + Example +
+

+ To asynchronously read data into a streambuf until a newline is encountered: +

+
asio::streambuf b;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::istream is(&b);
+    std::string line;
+    std::getline(is, line);
+    ...
+  }
+}
+...
+asio::async_read_until(s, b, '\n', handler);
+
+

+ After the async_read_until operation completes successfully, + the buffer b contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
+
+

+ The call to std::getline then extracts the data up to and + including the newline (which is discarded), so that the string line + contains: +

+
{ 'a', 'b', ..., 'c' }
+
+

+ The remaining data is left in the buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload6.html b/include/asio/doc/asio/reference/async_read_until/overload6.html new file mode 100644 index 0000000..d1d41f0 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload6.html @@ -0,0 +1,177 @@ + + + +async_read_until (6 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a streambuf until it + contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    string_view delim,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data into the specified streambuf + until the streambuf's get area contains the specified delimiter. The function + call always returns immediately. The asynchronous operation will continue + until one of the following conditions is true: +

+
    +
  • + The get area of the streambuf contains the specified delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the streambuf's get area already contains the delimiter, this asynchronous + operation completes immediately. The program must ensure that the stream + performs no other read operations (such as async_read, async_read_until, + the stream's async_read_some function, or any other composed operations + that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. Ownership of + the streambuf is retained by the caller, which must guarantee that + it remains valid until the handler is called. +

+
delim
+

+ The delimiter string. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the streambuf's get
+  // area up to and including the delimiter.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the streambuf may contain + additional data beyond the delimiter. An application will typically leave + that data in the streambuf for a subsequent async_read_until operation + to examine. +

+
+ + Example +
+

+ To asynchronously read data into a streambuf until a newline is encountered: +

+
asio::streambuf b;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::istream is(&b);
+    std::string line;
+    std::getline(is, line);
+    ...
+  }
+}
+...
+asio::async_read_until(s, b, "\r\n", handler);
+
+

+ After the async_read_until operation completes successfully, + the buffer b contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to std::getline then extracts the data up to and + including the newline (which is discarded), so that the string line + contains: +

+
{ 'a', 'b', ..., 'c', '\r' }
+
+

+ The remaining data is left in the buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload7.html b/include/asio/doc/asio/reference/async_read_until/overload7.html new file mode 100644 index 0000000..30302a2 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload7.html @@ -0,0 +1,180 @@ + + + +async_read_until (7 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a streambuf until some + part of its data matches a regular expression. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    const boost::regex & expr,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data into the specified streambuf + until the streambuf's get area contains some data that matches a regular + expression. The function call always returns immediately. The asynchronous + operation will continue until one of the following conditions is true: +

+
    +
  • + A substring of the streambuf's get area matches the regular expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the streambuf's get area already contains data that matches the regular + expression, this asynchronous operation completes immediately. The program + must ensure that the stream performs no other read operations (such as + async_read, async_read_until, the stream's async_read_some function, or + any other composed operations that perform reads) until this operation + completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. Ownership of + the streambuf is retained by the caller, which must guarantee that + it remains valid until the handler is called. +

+
expr
+

+ The regular expression. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the streambuf's get
+  // area up to and including the substring
+  // that matches the regular. expression.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the streambuf may contain + additional data beyond that which matched the regular expression. An application + will typically leave that data in the streambuf for a subsequent async_read_until + operation to examine. +

+
+ + Example +
+

+ To asynchronously read data into a streambuf until a CR-LF sequence is + encountered: +

+
asio::streambuf b;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::istream is(&b);
+    std::string line;
+    std::getline(is, line);
+    ...
+  }
+}
+...
+asio::async_read_until(s, b, boost::regex("\r\n"), handler);
+
+

+ After the async_read_until operation completes successfully, + the buffer b contains the data which matched the regular expression: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to std::getline then extracts the data up to and + including the newline (which is discarded), so that the string line + contains: +

+
{ 'a', 'b', ..., 'c', '\r' }
+
+

+ The remaining data is left in the buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload8.html b/include/asio/doc/asio/reference/async_read_until/overload8.html new file mode 100644 index 0000000..c9e0308 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload8.html @@ -0,0 +1,220 @@ + + + +async_read_until (8 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a streambuf until a function + object indicates a match. +

+
template<
+    typename AsyncReadStream,
+    typename Allocator,
+    typename MatchCondition,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    MatchCondition match_condition,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_match_condition< MatchCondition >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified streambuf + until a user-defined match condition function object, when applied to the + data contained in the streambuf, indicates a successful match. The function + call always returns immediately. The asynchronous operation will continue + until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the match condition function object already indicates a match, this + asynchronous operation completes immediately. The program must ensure that + the stream performs no other read operations (such as async_read, async_read_until, + the stream's async_read_some function, or any other composed operations + that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the streambuf's get
+  // area that have been fully consumed by the
+  // match function. O if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the streambuf may contain + additional data beyond that which matched the function object. An application + will typically leave that data in the streambuf for a subsequent async_read_until + operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + Examples +
+

+ To asynchronously read data into a streambuf until whitespace is encountered: +

+
typedef asio::buffers_iterator<
+    asio::streambuf::const_buffers_type> iterator;
+
+std::pair<iterator, bool>
+match_whitespace(iterator begin, iterator end)
+{
+  iterator i = begin;
+  while (i != end)
+    if (std::isspace(*i++))
+      return std::make_pair(i, true);
+  return std::make_pair(i, false);
+}
+...
+void handler(const asio::error_code& e, std::size_t size);
+...
+asio::streambuf b;
+asio::async_read_until(s, b, match_whitespace, handler);
+
+

+ To asynchronously read data into a streambuf until a matching character + is found: +

+
class match_char
+{
+public:
+  explicit match_char(char c) : c_(c) {}
+
+  template <typename Iterator>
+  std::pair<Iterator, bool> operator()(
+      Iterator begin, Iterator end) const
+  {
+    Iterator i = begin;
+    while (i != end)
+      if (c_ == *i++)
+        return std::make_pair(i, true);
+    return std::make_pair(i, false);
+  }
+
+private:
+  char c_;
+};
+
+namespace asio {
+  template <> struct is_match_condition<match_char>
+    : public boost::true_type {};
+} // namespace asio
+...
+void handler(const asio::error_code& e, std::size_t size);
+...
+asio::streambuf b;
+asio::async_read_until(s, b, match_char('a'), handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_read_until/overload9.html b/include/asio/doc/asio/reference/async_read_until/overload9.html new file mode 100644 index 0000000..2c0a701 --- /dev/null +++ b/include/asio/doc/asio/reference/async_read_until/overload9.html @@ -0,0 +1,181 @@ + + + +async_read_until (9 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to read data into a dynamic buffer sequence + until it contains a specified delimiter. +

+
template<
+    typename AsyncReadStream,
+    typename DynamicBuffer_v2,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_until(
+    AsyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    char delim,
+    ReadHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously read data into the specified dynamic + buffer sequence until the dynamic buffer sequence's get area contains the + specified delimiter. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_read_some function, and is known as a composed operation. + If the dynamic buffer sequence's get area already contains the delimiter, + this asynchronous operation completes immediately. The program must ensure + that the stream performs no other read operations (such as async_read, + async_read_until, the stream's async_read_some function, or any other composed + operations that perform reads) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the AsyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
delim
+

+ The delimiter character. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // The number of bytes in the dynamic buffer sequence's
+  // get area up to and including the delimiter.
+  // 0 if an error occurred.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ After a successful async_read_until operation, the dynamic buffer sequence + may contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent async_read_until + operation to examine. +

+
+ + Example +
+

+ To asynchronously read data into a std::string until a newline + is encountered: +

+
std::string data;
+...
+void handler(const asio::error_code& e, std::size_t size)
+{
+  if (!e)
+  {
+    std::string line = data.substr(0, n);
+    data.erase(0, n);
+    ...
+  }
+}
+...
+asio::async_read_until(s, data, '\n', handler);
+
+

+ After the async_read_until operation completes successfully, + the buffer data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer data as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + async_read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result.html b/include/asio/doc/asio/reference/async_result.html new file mode 100644 index 0000000..1c6fccb --- /dev/null +++ b/include/asio/doc/asio/reference/async_result.html @@ -0,0 +1,189 @@ + + + +async_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An interface for customising the behaviour of an initiating function. +

+
template<
+    typename CompletionToken,
+    typename Signature>
+class async_result
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ completion_handler_type +

+
+

+ The concrete completion handler type for the specific signature. +

+
+

+ return_type +

+
+

+ The return type of the initiating function. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_result [constructor] +

+
+

+ Construct an async result from a given handler. +

+
+

+ get +

+
+

+ Obtain the value to be returned from the initiating function. +

+
+

+ initiate [static] +

+
+

+ Initiate the asynchronous operation that will produce the result, + and obtain the value to be returned from the initiating function. +

+
+

+ The async_result + traits class is used for determining: +

+
    +
  • + the concrete completion handler type to be called at the end of the asynchronous + operation; +
  • +
  • + the initiating function return type; and +
  • +
  • + how the return value of the initiating function is obtained. +
  • +
+

+ The trait allows the handler and return types to be determined at the point + where the specific completion handler signature is known. +

+

+ This template may be specialised for user-defined completion token types. + The primary template assumes that the CompletionToken is the completion handler. +

+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result/async_result.html b/include/asio/doc/asio/reference/async_result/async_result.html new file mode 100644 index 0000000..9ae3325 --- /dev/null +++ b/include/asio/doc/asio/reference/async_result/async_result.html @@ -0,0 +1,51 @@ + + + +async_result::async_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an async result from a given handler. +

+
async_result(
+    completion_handler_type & h);
+
+

+ When using a specalised async_result, + the constructor has an opportunity to initialise some state associated + with the completion handler, which is then returned from the initiating + function. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result/completion_handler_type.html b/include/asio/doc/asio/reference/async_result/completion_handler_type.html new file mode 100644 index 0000000..217a2ae --- /dev/null +++ b/include/asio/doc/asio/reference/async_result/completion_handler_type.html @@ -0,0 +1,54 @@ + + + +async_result::completion_handler_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + concrete completion handler type for the specific signature. +

+
typedef CompletionToken completion_handler_type;
+
+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result/get.html b/include/asio/doc/asio/reference/async_result/get.html new file mode 100644 index 0000000..1cf53b1 --- /dev/null +++ b/include/asio/doc/asio/reference/async_result/get.html @@ -0,0 +1,44 @@ + + + +async_result::get + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the value to be returned + from the initiating function. +

+
return_type get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result/initiate.html b/include/asio/doc/asio/reference/async_result/initiate.html new file mode 100644 index 0000000..2eeed28 --- /dev/null +++ b/include/asio/doc/asio/reference/async_result/initiate.html @@ -0,0 +1,52 @@ + + + +async_result::initiate + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Initiate the asynchronous + operation that will produce the result, and obtain the value to be returned + from the initiating function. +

+
template<
+    typename Initiation,
+    typename RawCompletionToken,
+    typename... Args>
+static return_type initiate(
+    Initiation && initiation,
+    RawCompletionToken && token,
+    Args &&... args);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result/return_type.html b/include/asio/doc/asio/reference/async_result/return_type.html new file mode 100644 index 0000000..77bc06f --- /dev/null +++ b/include/asio/doc/asio/reference/async_result/return_type.html @@ -0,0 +1,54 @@ + + + +async_result::return_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The return + type of the initiating function. +

+
typedef void return_type;
+
+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_.html b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_.html new file mode 100644 index 0000000..167503a --- /dev/null +++ b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_.html @@ -0,0 +1,155 @@ + + + +async_result< std::packaged_task< Result(Args...)>, Signature > + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Partial specialisation of async_result for std::packaged_task. +

+
template<
+    typename Result,
+    typename... Args,
+    typename Signature>
+class async_result< std::packaged_task< Result(Args...)>, Signature >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ completion_handler_type +

+
+

+ The packaged task is the concrete completion handler type. +

+
+

+ return_type +

+
+

+ The return type of the initiating function is the future obtained + from the packaged task. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_result +

+
+

+ The constructor extracts the future from the packaged task. +

+
+

+ get +

+
+

+ Returns the packaged task's future. +

+
+
+ + Requirements +
+

+ Header: asio/packaged_task.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/async_result.html b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/async_result.html new file mode 100644 index 0000000..52bb65a --- /dev/null +++ b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/async_result.html @@ -0,0 +1,46 @@ + + + +async_result< std::packaged_task< Result(Args...)>, Signature >::async_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The constructor + extracts the future from the packaged task. +

+
async_result(
+    completion_handler_type & h);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/completion_handler_type.html b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/completion_handler_type.html new file mode 100644 index 0000000..2727fdf --- /dev/null +++ b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/completion_handler_type.html @@ -0,0 +1,55 @@ + + + +async_result< std::packaged_task< Result(Args...)>, Signature >::completion_handler_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The packaged + task is the concrete completion handler type. +

+
typedef std::packaged_task< Result(Args...)> completion_handler_type;
+
+
+ + Requirements +
+

+ Header: asio/packaged_task.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/get.html b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/get.html new file mode 100644 index 0000000..65dece1 --- /dev/null +++ b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/get.html @@ -0,0 +1,45 @@ + + + +async_result< std::packaged_task< Result(Args...)>, Signature >::get + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Returns the packaged + task's future. +

+
return_type get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/return_type.html b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/return_type.html new file mode 100644 index 0000000..0ade5d6 --- /dev/null +++ b/include/asio/doc/asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/return_type.html @@ -0,0 +1,55 @@ + + + +async_result< std::packaged_task< Result(Args...)>, Signature >::return_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The return type + of the initiating function is the future obtained from the packaged task. +

+
typedef std::future< Result > return_type;
+
+
+ + Requirements +
+

+ Header: asio/packaged_task.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write.html b/include/asio/doc/asio/reference/async_write.html new file mode 100644 index 0000000..afd1c2d --- /dev/null +++ b/include/asio/doc/asio/reference/async_write.html @@ -0,0 +1,171 @@ + + + +async_write + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The async_write function + is a composed asynchronous operation that writes a certain amount of data + to a stream before completion. +

+

+ Start an asynchronous operation to write all of the supplied data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to write a certain amount of data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename ConstBufferSequence,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to write all of the supplied data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    WriteHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to write a certain amount of data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to write all of the supplied data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename Allocator,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+

+ Start an asynchronous operation to write a certain amount of data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename Allocator,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    WriteHandler && handler);
+  » more...
+
+

+ Start an asynchronous operation to write all of the supplied data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    WriteHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+

+ Start an asynchronous operation to write a certain amount of data to a stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/write.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload1.html b/include/asio/doc/asio/reference/async_write/overload1.html new file mode 100644 index 0000000..0c886e8 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload1.html @@ -0,0 +1,133 @@ + + + +async_write (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write all of the supplied data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
buffers
+

+ One or more buffers containing the data to be written. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::async_write(s, asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload2.html b/include/asio/doc/asio/reference/async_write/overload2.html new file mode 100644 index 0000000..434b064 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload2.html @@ -0,0 +1,158 @@ + + + +async_write (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write a certain amount of data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename ConstBufferSequence,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
buffers
+

+ One or more buffers containing the data to be written. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's async_write_some function. +

+
+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::async_write(s,
+    asio::buffer(data, size),
+    asio::transfer_at_least(32),
+    handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload3.html b/include/asio/doc/asio/reference/async_write/overload3.html new file mode 100644 index 0000000..584ede4 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload3.html @@ -0,0 +1,118 @@ + + + +async_write (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write all of the supplied data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    WriteHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. Successfully written + data is automatically consumed from the buffers. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload4.html b/include/asio/doc/asio/reference/async_write/overload4.html new file mode 100644 index 0000000..d98b6d2 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload4.html @@ -0,0 +1,140 @@ + + + +async_write (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write a certain amount of data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. Successfully written + data is automatically consumed from the buffers. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's async_write_some function. +

+
+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload5.html b/include/asio/doc/asio/reference/async_write/overload5.html new file mode 100644 index 0000000..d9fdbe0 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload5.html @@ -0,0 +1,117 @@ + + + +async_write (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write all of the supplied data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename Allocator,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
b
+

+ A basic_streambuf + object from which data will be written. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload6.html b/include/asio/doc/asio/reference/async_write/overload6.html new file mode 100644 index 0000000..06db16d --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload6.html @@ -0,0 +1,139 @@ + + + +async_write (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write a certain amount of data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename Allocator,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    WriteHandler && handler);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
b
+

+ A basic_streambuf + object from which data will be written. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's async_write_some function. +

+
+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload7.html b/include/asio/doc/asio/reference/async_write/overload7.html new file mode 100644 index 0000000..6d54bf0 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload7.html @@ -0,0 +1,118 @@ + + + +async_write (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write all of the supplied data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    WriteHandler && handler = DEFAULT,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. Successfully written + data is automatically consumed from the buffers. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write/overload8.html b/include/asio/doc/asio/reference/async_write/overload8.html new file mode 100644 index 0000000..0fcc8ef --- /dev/null +++ b/include/asio/doc/asio/reference/async_write/overload8.html @@ -0,0 +1,140 @@ + + + +async_write (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write a certain amount of data to a + stream. +

+
template<
+    typename AsyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition,
+    typename WriteHandler>
+DEDUCED async_write(
+    AsyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a stream. The function call always returns immediately. The + asynchronous operation will continue until one of the following conditions + is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + async_write_some function, and is known as a composed operation. + The program must ensure that the stream performs no other write operations + (such as async_write, the stream's async_write_some function, or any other + composed operations that perform writes) until this operation completes. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the AsyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. Successfully written + data is automatically consumed from the buffers. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's async_write_some function. +

+
+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+
+  std::size_t bytes_transferred           // Number of bytes written from the
+                                          // buffers. If an error occurred,
+                                          // this will be less than the sum
+                                          // of the buffer sizes.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write_at.html b/include/asio/doc/asio/reference/async_write_at.html new file mode 100644 index 0000000..7f6af03 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write_at.html @@ -0,0 +1,117 @@ + + + +async_write_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The async_write_at + function is a composed asynchronous operation that writes a certain amount + of data at the specified offset before completion. +

+

+ Start an asynchronous operation to write all of the supplied data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+

+ Start an asynchronous operation to write a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename CompletionCondition,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+

+ Start an asynchronous operation to write all of the supplied data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+

+ Start an asynchronous operation to write a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename CompletionCondition,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/write_at.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write_at/overload1.html b/include/asio/doc/asio/reference/async_write_at/overload1.html new file mode 100644 index 0000000..6874af7 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write_at/overload1.html @@ -0,0 +1,139 @@ + + + +async_write_at (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write all of the supplied data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a random access device at a specified offset. The function call + always returns immediately. The asynchronous operation will continue until + one of the following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + async_write_some_at function, and is known as a composed operation. + The program must ensure that the device performs no overlapping + write operations (such as async_write_at, the device's async_write_some_at + function, or any other composed operations that perform writes) until this + operation completes. Operations are overlapping if the regions defined + by their offsets, and the numbers of bytes to write, intersect. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the AsyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more buffers containing the data to be written. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes written from the buffers. If an error
+  // occurred, this will be less than the sum of the buffer sizes.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::async_write_at(d, 42, asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write_at/overload2.html b/include/asio/doc/asio/reference/async_write_at/overload2.html new file mode 100644 index 0000000..5794e4a --- /dev/null +++ b/include/asio/doc/asio/reference/async_write_at/overload2.html @@ -0,0 +1,164 @@ + + + +async_write_at (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename CompletionCondition,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a random access device at a specified offset. The function call + always returns immediately. The asynchronous operation will continue until + one of the following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + async_write_some_at function, and is known as a composed operation. + The program must ensure that the device performs no overlapping + write operations (such as async_write_at, the device's async_write_some_at + function, or any other composed operations that perform writes) until this + operation completes. Operations are overlapping if the regions defined + by their offsets, and the numbers of bytes to write, intersect. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the AsyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more buffers containing the data to be written. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_write_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the device's async_write_some_at function. +

+
+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes written from the buffers. If an error
+  // occurred, this will be less than the sum of the buffer sizes.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::async_write_at(d, 42,
+    asio::buffer(data, size),
+    asio::transfer_at_least(32),
+    handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write_at/overload3.html b/include/asio/doc/asio/reference/async_write_at/overload3.html new file mode 100644 index 0000000..fb1cf20 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write_at/overload3.html @@ -0,0 +1,124 @@ + + + +async_write_at (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write all of the supplied data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a random access device at a specified offset. The function call + always returns immediately. The asynchronous operation will continue until + one of the following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + async_write_some_at function, and is known as a composed operation. + The program must ensure that the device performs no overlapping + write operations (such as async_write_at, the device's async_write_some_at + function, or any other composed operations that perform writes) until this + operation completes. Operations are overlapping if the regions defined + by their offsets, and the numbers of bytes to write, intersect. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the AsyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
b
+

+ A basic_streambuf + object from which data will be written. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes written from the buffers. If an error
+  // occurred, this will be less than the sum of the buffer sizes.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/async_write_at/overload4.html b/include/asio/doc/asio/reference/async_write_at/overload4.html new file mode 100644 index 0000000..d9a2526 --- /dev/null +++ b/include/asio/doc/asio/reference/async_write_at/overload4.html @@ -0,0 +1,146 @@ + + + +async_write_at (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous operation to write a certain amount of data at the + specified offset. +

+
template<
+    typename AsyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename CompletionCondition,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_at(
+    AsyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write a certain number of bytes + of data to a random access device at a specified offset. The function call + always returns immediately. The asynchronous operation will continue until + one of the following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + async_write_some_at function, and is known as a composed operation. + The program must ensure that the device performs no overlapping + write operations (such as async_write_at, the device's async_write_some_at + function, or any other composed operations that perform writes) until this + operation completes. Operations are overlapping if the regions defined + by their offsets, and the numbers of bytes to write, intersect. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the AsyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
b
+

+ A basic_streambuf + object from which data will be written. Ownership of the streambuf + is retained by the caller, which must guarantee that it remains valid + until the handler is called. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest async_write_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the device's async_write_some_at function. +

+
+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+
+  // Number of bytes written from the buffers. If an error
+  // occurred, this will be less than the sum of the buffer sizes.
+  std::size_t bytes_transferred
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asynchronous_operations.html b/include/asio/doc/asio/reference/asynchronous_operations.html new file mode 100644 index 0000000..55db4bd --- /dev/null +++ b/include/asio/doc/asio/reference/asynchronous_operations.html @@ -0,0 +1,439 @@ + + + +Requirements on asynchronous operations + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This section uses the names Alloc1, Alloc2, alloc1, + alloc2, Args, CompletionHandler, + completion_handler, Executor1, Executor2, + ex1, ex2, f, i, + N, Signature, token, + T[sub i], t[sub i], + work1, and work2 as placeholders for specifying + the requirements below. +

+
+ + General + asynchronous operation concepts +
+

+ An initiating function is a function which may be called + to start an asynchronous operation. A completion handler + is a function object that will be invoked, at most once, with the result + of the asynchronous operation. +

+

+ The lifecycle of an asynchronous operation is comprised of the following + events and phases: +

+

+ — Event 1: The asynchronous operation is started by a call to the initiating + function. +

+

+ — Phase 1: The asynchronous operation is now outstanding. +

+

+ — Event 2: The externally observable side effects of the asynchronous operation, + if any, are fully established. The completion handler is submitted to an + executor. +

+

+ — Phase 2: The asynchronous operation is now completed. +

+

+ — Event 3: The completion handler is called with the result of the asynchronous + operation. +

+

+ In this library, all functions with the prefix async_ are initiating + functions. +

+
+ + Completion + tokens and handlers +
+

+ Initiating functions: +

+

+ — are function templates with template parameter CompletionToken; +

+

+ — accept, as the final parameter, a completion token object + token of type CompletionToken; +

+

+ — specify a completion signature, which is a call signature + (C++Std [func.def]) Signature that determines the arguments + to the completion handler. +

+

+ An initiating function determines the type CompletionHandler + of its completion handler function object by performing typename async_result<decay_t<CompletionToken>, + Signature>::completion_handler_type. The completion handler object + completion_handler is initialized with forward<CompletionToken>(token). + [Note: No other requirements are placed on the type + CompletionToken. —end note] +

+

+ The type CompletionHandler must satisfy the requirements of + Destructible (C++Std [destructible]) and MoveConstructible + (C++Std [moveconstructible]), and be callable with the specified call signature. +

+

+ In this library, all initiating functions specify a Completion + signature element that defines the call signature Signature. + The Completion signature elements in this Technical + Specification have named parameters, and the results of an asynchronous operation + are specified in terms of these names. +

+
+ + Automatic + deduction of initiating function return type +
+

+ The return type of an initiating function is typename async_result<decay_t<CompletionToken>, + Signature>::return_type. +

+

+ For the sake of exposition, this library sometimes annotates functions with + a return type DEDUCED. For every + function declaration that returns DEDUCED, + the meaning is equivalent to specifying the return type as typename + async_result<decay_t<CompletionToken>, Signature>::return_type. +

+
+ + Production + of initiating function return value +
+

+ An initiating function produces its return type as follows: +

+

+ — constructing an object result of type async_result<decay_t<CompletionToken>, + Signature>, initialized as result(completion_handler); + and +

+

+ — using result.get() as the operand of the return statement. +

+

+ [Example: Given an asynchronous operation with Completion + signature void(R1 r1, R2 r2), an initiating function + meeting these requirements may be implemented as follows: +

+
template<class CompletionToken>
+auto async_xyz(T1 t1, T2 t2, CompletionToken&& token)
+{
+  typename async_result<decay_t<CompletionToken>, void(R1, R2)>::completion_handler_type
+    completion_handler(forward<CompletionToken>(token));
+
+  async_result<decay_t<CompletionToken>, void(R1, R2)> result(completion_handler);
+
+  // initiate the operation and cause completion_handler to be invoked with
+  // the result
+
+  return result.get();
+}
+
+

+ For convenience, initiating functions may be implemented using the async_completion + template: +

+
template<class CompletionToken>
+auto async_xyz(T1 t1, T2 t2, CompletionToken&& token)
+{
+  async_completion<CompletionToken, void(R1, R2)> init(token);
+
+  // initiate the operation and cause init.completion_handler to be invoked
+  // with the result
+
+  return init.result.get();
+}
+
+

+ —end example] +

+
+ + Lifetime + of initiating function arguments +
+

+ Unless otherwise specified, the lifetime of arguments to initiating functions + shall be treated as follows: +

+

+ — If the parameter has a pointer type or has a type of lvalue reference to + non-const, the implementation may assume the validity of the pointee or referent, + respectively, until the completion handler is invoked. [Note: + In other words, the program must guarantee the validity of the argument until + the completion handler is invoked. —end note] +

+

+ — Otherwise, the implementation must not assume the validity of the argument + after the initiating function completes. [Note: In other + words, the program is not required to guarantee the validity of the argument + after the initiating function completes. —end note] The + implementation may make copies of the argument, and all copies shall be destroyed + no later than immediately after invocation of the completion handler. +

+
+ + Non-blocking + requirements on initiating functions +
+

+ An initiating function shall not block (C++Std [defns.block]) the calling + thread pending completion of the outstanding operation. +

+

+ [std_note Initiating functions may still block the calling thread for other + reasons. For example, an initiating function may lock a mutex in order to + synchronize access to shared data.] +

+
+ + Associated + executor +
+

+ Certain objects that participate in asynchronous operations have an associated + executor. These are obtained as specified in the sections below. +

+
+ + Associated + I/O executor +
+

+ An asynchronous operation has an associated executor satisfying the Executor requirements. + If not otherwise specified by the asynchronous operation, this associated + executor is an object of type system_executor. +

+

+ All asynchronous operations in this library have an associated executor object + that is determined as follows: +

+

+ — If the initiating function is a member function, the associated executor + is that returned by the get_executor member function on the + same object. +

+

+ — If the initiating function is not a member function, the associated executor + is that returned by the get_executor member function of the + first argument to the initiating function. +

+

+ Let Executor1 be the type of the associated executor. Let ex1 + be a value of type Executor1, representing the associated executor + object obtained as described above. +

+
+ + Associated + completion handler executor +
+

+ A completion handler object of type CompletionHandler has an + associated executor of type Executor2 satisfying the Executor + requirements. The type Executor2 is associated_executor_t<CompletionHandler, + Executor1>. Let ex2 be a value of type Executor2 + obtained by performing get_associated_executor(completion_handler, + ex1). +

+
+ + Outstanding + work +
+

+ Until the asynchronous operation has completed, the asynchronous operation + shall maintain: +

+

+ — an object work1 of type executor_work_guard<Executor1>, + initialized as work1(ex1), and where work1.owns_work() + == true; and +

+

+ — an object work2 of type executor_work_guard<Executor2>, + initialized as work2(ex2), and where work2.owns_work() + == true. +

+
+ + Allocation + of intermediate storage +
+

+ Asynchronous operations may allocate memory. [Note: + Such as a data structure to store copies of the completion_handler + object and the initiating function's arguments. —end note] +

+

+ Let Alloc1 be a type, satisfying the ProtoAllocator + requirements, that represents the asynchronous operation's default allocation + strategy. [Note: Typically std::allocator<void>. + —end note] Let alloc1 be a value of type + Alloc1. +

+

+ A completion handler object of type CompletionHandler has an + associated allocator object alloc2 of type Alloc2 + satisfying the ProtoAllocator + requirements. The type Alloc2 is associated_allocator_t<CompletionHandler, + Alloc1>. Let alloc2 be a value of type Alloc2 + obtained by performing get_associated_allocator(completion_handler, + alloc1). +

+

+ The asynchronous operations defined in this library: +

+

+ — If required, allocate memory using only the completion handler's associated + allocator. +

+

+ — Prior to completion handler execution, deallocate any memory allocated using + the completion handler's associated allocator. +

+

+ [std_note The implementation may perform operating system or underlying API + calls that perform memory allocations not using the associated allocator. + Invocations of the allocator functions may not introduce data races (See + C++Std [res.on.data.races]).] +

+
+ + Execution + of completion handler on completion of asynchronous operation +
+

+ Let Args... be the argument types of the completion signature + Signature and let N + be sizeof...(Args). Let i + be in the range [0,N). + Let T[sub i] be the ith + type in Args... and let t[sub i] + be the ith completion handler argument + associated with T[sub i]. +

+

+ Let f be a function object, callable as f(), that + invokes completion_handler as if by completion_handler(forward<T[sub + 0>(t[sub 0]), ..., + forward<T[sub N-1]>(t[sub N-1]))]. +

+

+ If an asynchonous operation completes immediately (that is, within the thread + of execution calling the initiating function, and before the initiating function + returns), the completion handler shall be submitted for execution as if by + performing ex2.post(std::move(f), alloc2). Otherwise, the completion + handler shall be submitted for execution as if by performing ex2.dispatch(std::move(f), + alloc2). +

+
+ + Completion + handlers and exceptions +
+

+ Completion handlers are permitted to throw exceptions. The effect of any + exception propagated from the execution of a completion handler is determined + by the executor which is executing the completion handler. +

+
+ + Default + completion tokens +
+

+ Every I/O executor type has an associated default completion token type. + This is specified via the default_completion_token trait. This + trait may be used in asynchronous operation declarations as follows: +

+
template <
+    typename IoObject,
+    typename CompletionToken =
+      typename default_completion_token<
+        typename IoObject::executor_type
+      >::type
+  >
+auto async_xyz(
+    IoObject& io_object,
+    CompletionToken&& token =
+      typename default_completion_token<
+        typename IoObject::executor_type
+      >::type{}
+  );
+
+

+ If not specialised, this trait type is void, meaning no default + completion token type is available for the given I/O executor. +

+

+ [Example: The default_completion_token + trait is specialised for the use_awaitable completion token + so that it may be used as shown in the following example: +

+
auto socket = use_awaitable.as_default_on(tcp::socket(my_context));
+// ...
+co_await socket.async_connect(my_endpoint); // Defaults to use_awaitable.
+
+

+ In this example, the type of the socket object is transformed + from tcp::socket to have an I/O executor with the default completion + token set to use_awaitable. +

+

+ Alternatively, the socket type may be computed directly: +

+
using tcp_socket = use_awaitable_t<>::as_default_on_t<tcp::socket>;
+tcp_socket socket(my_context);
+// ...
+co_await socket.async_connect(my_endpoint); // Defaults to use_awaitable.
+
+

+ —end example] +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/asynchronous_socket_operations.html b/include/asio/doc/asio/reference/asynchronous_socket_operations.html new file mode 100644 index 0000000..171294e --- /dev/null +++ b/include/asio/doc/asio/reference/asynchronous_socket_operations.html @@ -0,0 +1,77 @@ + + + +Requirements on asynchronous socket operations + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In this library, asynchronous socket operations are + those member functions having prefix async_. +

+

+ For an object s, a program may initiate asynchronous socket + operations such that there are multiple simultaneously outstanding asynchronous + operations. +

+

+ When there are multiple outstanding asynchronous read + operations on s: +

+

+ — having no argument flags of type socket_base::message_flags, + or +

+

+ — having an argument flags of type socket_base::message_flags + but where (flags & socket_base::message_out_of_band) == 0 +

+

+ then the buffers are filled in the order in which these operations + were issued. The order of invocation of the completion handlers for these + operations is unspecified. +

+

+ When there are multiple outstanding asynchronous read + operations on s having an argument flags + of type socket_base::message_flags where (flags & + socket_base::message_out_of_band) != 0 then the buffers + are filled in the order in which these operations were issued. +

+

+ When there are multiple outstanding asynchronous write + operations on s, the buffers are transmitted + in the order in which these operations were issued. The order of invocation + of the completion handlers for these operations is unspecified. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable.html b/include/asio/doc/asio/reference/awaitable.html new file mode 100644 index 0000000..5c0799b --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable.html @@ -0,0 +1,166 @@ + + + +awaitable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The return type of a coroutine or asynchronous operation. +

+
template<
+    typename T,
+    typename Executor = any_io_executor>
+class awaitable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_type +

+
+

+ The executor type that will be used for the coroutine. +

+
+

+ value_type +

+
+

+ The type of the awaited value. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ awaitable + [constructor] +

+
+

+ Default constructor.
—
Move constructor. +

+
+

+ valid +

+
+

+ Checks if the awaitable refers to a future result. +

+
+

+ ~awaitable + [destructor] +

+
+

+ Destructor. +

+
+
+ + Requirements +
+

+ Header: asio/awaitable.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable/_awaitable.html b/include/asio/doc/asio/reference/awaitable/_awaitable.html new file mode 100644 index 0000000..5c9bd3a --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable/_awaitable.html @@ -0,0 +1,43 @@ + + + +awaitable::~awaitable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~awaitable();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable/awaitable.html b/include/asio/doc/asio/reference/awaitable/awaitable.html new file mode 100644 index 0000000..9543b96 --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable/awaitable.html @@ -0,0 +1,51 @@ + + + +awaitable::awaitable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default constructor. +

+
constexpr awaitable();
+  » more...
+
+

+ Move constructor. +

+
awaitable(
+    awaitable && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable/awaitable/overload1.html b/include/asio/doc/asio/reference/awaitable/awaitable/overload1.html new file mode 100644 index 0000000..05f2185 --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable/awaitable/overload1.html @@ -0,0 +1,43 @@ + + + +awaitable::awaitable (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr awaitable();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable/awaitable/overload2.html b/include/asio/doc/asio/reference/awaitable/awaitable/overload2.html new file mode 100644 index 0000000..d19e4b9 --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable/awaitable/overload2.html @@ -0,0 +1,44 @@ + + + +awaitable::awaitable (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
awaitable(
+    awaitable && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable/executor_type.html b/include/asio/doc/asio/reference/awaitable/executor_type.html new file mode 100644 index 0000000..550fec8 --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable/executor_type.html @@ -0,0 +1,54 @@ + + + +awaitable::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The executor + type that will be used for the coroutine. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/awaitable.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable/valid.html b/include/asio/doc/asio/reference/awaitable/valid.html new file mode 100644 index 0000000..d2b49b9 --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable/valid.html @@ -0,0 +1,44 @@ + + + +awaitable::valid + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Checks if the awaitable refers + to a future result. +

+
bool valid() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/awaitable/value_type.html b/include/asio/doc/asio/reference/awaitable/value_type.html new file mode 100644 index 0000000..c87afc6 --- /dev/null +++ b/include/asio/doc/asio/reference/awaitable/value_type.html @@ -0,0 +1,54 @@ + + + +awaitable::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of the awaited + value. +

+
typedef T value_type;
+
+
+ + Requirements +
+

+ Header: asio/awaitable.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/bad_executor.html b/include/asio/doc/asio/reference/bad_executor.html new file mode 100644 index 0000000..1c1e15d --- /dev/null +++ b/include/asio/doc/asio/reference/bad_executor.html @@ -0,0 +1,102 @@ + + + +bad_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Exception thrown when trying to access an empty polymorphic executor. +

+
class bad_executor :
+  public std::exception
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bad_executor [constructor] +

+
+

+ Constructor. +

+
+

+ what +

+
+

+ Obtain message associated with exception. +

+
+
+ + Requirements +
+

+ Header: asio/executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/bad_executor/bad_executor.html b/include/asio/doc/asio/reference/bad_executor/bad_executor.html new file mode 100644 index 0000000..b7feffe --- /dev/null +++ b/include/asio/doc/asio/reference/bad_executor/bad_executor.html @@ -0,0 +1,43 @@ + + + +bad_executor::bad_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
bad_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/bad_executor/what.html b/include/asio/doc/asio/reference/bad_executor/what.html new file mode 100644 index 0000000..b54e07f --- /dev/null +++ b/include/asio/doc/asio/reference/bad_executor/what.html @@ -0,0 +1,44 @@ + + + +bad_executor::what + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain message associated + with exception. +

+
virtual const char * what() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket.html b/include/asio/doc/asio/reference/basic_datagram_socket.html new file mode 100644 index 0000000..ee45479 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket.html @@ -0,0 +1,918 @@ + + + +basic_datagram_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides datagram-oriented socket functionality. +

+
template<
+    typename Protocol,
+    typename Executor>
+class basic_datagram_socket :
+  public basic_socket< Protocol, Executor >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close if + unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_datagram_socket [constructor] +

+
+

+ Construct a basic_datagram_socket without opening it.
—
+ Construct and open a basic_datagram_socket.
—
Construct + a basic_datagram_socket, opening it and binding it to the given + local endpoint.
—
Construct a basic_datagram_socket + on an existing native socket.
—
Move-construct a basic_datagram_socket + from another.
—
Move-construct a basic_datagram_socket + from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets the + non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_datagram_socket from another.
—
+ Move-assign a basic_datagram_socket from a socket of another protocol + type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive a datagram with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send a datagram to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, or + to have pending error conditions. +

+
+

+ ~basic_datagram_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length of + the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_datagram_socket + class template provides asynchronous and blocking datagram-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/_basic_datagram_socket.html b/include/asio/doc/asio/reference/basic_datagram_socket/_basic_datagram_socket.html new file mode 100644 index 0000000..d0113f1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/_basic_datagram_socket.html @@ -0,0 +1,48 @@ + + + +basic_datagram_socket::~basic_datagram_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the socket. +

+
~basic_datagram_socket();
+
+

+ This function destroys the socket, cancelling any outstanding asynchronous + operations associated with the socket as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/assign.html b/include/asio/doc/asio/reference/basic_datagram_socket/assign.html new file mode 100644 index 0000000..86919ce --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/assign.html @@ -0,0 +1,53 @@ + + + +basic_datagram_socket::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/assign/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/assign/overload1.html new file mode 100644 index 0000000..8b581de --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/assign/overload1.html @@ -0,0 +1,48 @@ + + + +basic_datagram_socket::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/assign/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/assign/overload2.html new file mode 100644 index 0000000..86798f1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/assign/overload2.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_connect.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_connect.html new file mode 100644 index 0000000..bf2a358 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_connect.html @@ -0,0 +1,111 @@ + + + +basic_datagram_socket::async_connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Start + an asynchronous connect. +

+
template<
+    typename ConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    const endpoint_type & peer_endpoint,
+    ConnectHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously connect a socket to the specified + remote endpoint. The function call always returns immediately. +

+

+ The socket is automatically opened if it is not already open. If the connect + fails, and the socket was automatically opened, the socket is not returned + to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. Copies + will be made of the endpoint object as required. +

+
handler
+
+

+ The handler to be called when the connection operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void connect_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Connect succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.async_connect(endpoint, connect_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_receive.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive.html new file mode 100644 index 0000000..81a8452 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive.html @@ -0,0 +1,59 @@ + + + +basic_datagram_socket::async_receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous receive on a connected socket. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_receive/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive/overload1.html new file mode 100644 index 0000000..e018217 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive/overload1.html @@ -0,0 +1,111 @@ + + + +basic_datagram_socket::async_receive (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive on a connected socket. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the datagram + socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_receive operation can only be used with a connected socket. + Use the async_receive_from function to receive data on an unconnected + datagram socket. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_receive/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive/overload2.html new file mode 100644 index 0000000..517b203 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive/overload2.html @@ -0,0 +1,101 @@ + + + +basic_datagram_socket::async_receive (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive on a connected socket. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the datagram + socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_receive operation can only be used with a connected socket. + Use the async_receive_from function to receive data on an unconnected + datagram socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from.html new file mode 100644 index 0000000..99859a2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from.html @@ -0,0 +1,61 @@ + + + +basic_datagram_socket::async_receive_from + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from/overload1.html new file mode 100644 index 0000000..dadbc96 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from/overload1.html @@ -0,0 +1,111 @@ + + + +basic_datagram_socket::async_receive_from (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive a datagram. The function + call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the datagram. Ownership of the sender_endpoint object is retained + by the caller, which must guarantee that it is valid until the + handler is called. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive_from(
+    asio::buffer(data, size), sender_endpoint, handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from/overload2.html new file mode 100644 index 0000000..743ee73 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_receive_from/overload2.html @@ -0,0 +1,100 @@ + + + +basic_datagram_socket::async_receive_from (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive a datagram. The function + call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the datagram. Ownership of the sender_endpoint object is retained + by the caller, which must guarantee that it is valid until the + handler is called. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_send.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_send.html new file mode 100644 index 0000000..34bc0bc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_send.html @@ -0,0 +1,59 @@ + + + +basic_datagram_socket::async_send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous send on a connected socket. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_send/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_send/overload1.html new file mode 100644 index 0000000..6ee9d7d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_send/overload1.html @@ -0,0 +1,110 @@ + + + +basic_datagram_socket::async_send (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send on a connected socket. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send data on the datagram socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_send operation can only be used with a connected socket. Use + the async_send_to function to send data on an unconnected datagram socket. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.async_send(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_send/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_send/overload2.html new file mode 100644 index 0000000..53297c6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_send/overload2.html @@ -0,0 +1,100 @@ + + + +basic_datagram_socket::async_send (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send on a connected socket. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send data on the datagram socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_send operation can only be used with a connected socket. Use + the async_send_to function to send data on an unconnected datagram socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to.html new file mode 100644 index 0000000..b855505 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to.html @@ -0,0 +1,61 @@ + + + +basic_datagram_socket::async_send_to + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to/overload1.html new file mode 100644 index 0000000..1c3b8ca --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to/overload1.html @@ -0,0 +1,111 @@ + + + +basic_datagram_socket::async_send_to (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send a datagram to the specified + remote endpoint. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
destination
+

+ The remote endpoint to which the data will be sent. Copies will + be made of the endpoint as required. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
asio::ip::udp::endpoint destination(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.async_send_to(
+    asio::buffer(data, size), destination, handler);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to/overload2.html new file mode 100644 index 0000000..299b2c3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_send_to/overload2.html @@ -0,0 +1,98 @@ + + + +basic_datagram_socket::async_send_to (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send a datagram to the specified + remote endpoint. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
destination
+

+ The remote endpoint to which the data will be sent. Copies will + be made of the endpoint as required. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/async_wait.html b/include/asio/doc/asio/reference/basic_datagram_socket/async_wait.html new file mode 100644 index 0000000..adbf840 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/async_wait.html @@ -0,0 +1,105 @@ + + + +basic_datagram_socket::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Asynchronously + wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+...
+socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/at_mark.html b/include/asio/doc/asio/reference/basic_datagram_socket/at_mark.html new file mode 100644 index 0000000..5d16a52 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/at_mark.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::at_mark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+  » more...
+
+bool at_mark(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/at_mark/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/at_mark/overload1.html new file mode 100644 index 0000000..8a18e7c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/at_mark/overload1.html @@ -0,0 +1,71 @@ + + + +basic_datagram_socket::at_mark (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/at_mark/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/at_mark/overload2.html new file mode 100644 index 0000000..7b0511e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/at_mark/overload2.html @@ -0,0 +1,72 @@ + + + +basic_datagram_socket::at_mark (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark(
+    asio::error_code & ec) const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/available.html b/include/asio/doc/asio/reference/basic_datagram_socket/available.html new file mode 100644 index 0000000..fb2a1c8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/available.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::available + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the number of bytes available for reading. +

+
std::size_t available() const;
+  » more...
+
+std::size_t available(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/available/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/available/overload1.html new file mode 100644 index 0000000..c4bdc1b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/available/overload1.html @@ -0,0 +1,72 @@ + + + +basic_datagram_socket::available (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available() const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/available/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/available/overload2.html new file mode 100644 index 0000000..6e68dd8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/available/overload2.html @@ -0,0 +1,73 @@ + + + +basic_datagram_socket::available (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available(
+    asio::error_code & ec) const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket.html new file mode 100644 index 0000000..ae87923 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket.html @@ -0,0 +1,126 @@ + + + +basic_datagram_socket::basic_datagram_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_datagram_socket + without opening it. +

+
explicit basic_datagram_socket(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_datagram_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct and open a basic_datagram_socket. +

+
basic_datagram_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_datagram_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_datagram_socket, + opening it and binding it to the given local endpoint. +

+
basic_datagram_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_datagram_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_datagram_socket + on an existing native socket. +

+
basic_datagram_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_datagram_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_datagram_socket + from another. +

+
basic_datagram_socket(
+    basic_datagram_socket && other);
+  » more...
+
+

+ Move-construct a basic_datagram_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_datagram_socket(
+    basic_datagram_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload1.html new file mode 100644 index 0000000..dec5f58 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload1.html @@ -0,0 +1,63 @@ + + + +basic_datagram_socket::basic_datagram_socket (1 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_datagram_socket + without opening it. +

+
basic_datagram_socket(
+    const executor_type & ex);
+
+

+ This constructor creates a datagram socket without opening it. The open() + function must be called before data can be sent or received on the socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload10.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload10.html new file mode 100644 index 0000000..72b40d3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload10.html @@ -0,0 +1,75 @@ + + + +basic_datagram_socket::basic_datagram_socket (10 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_datagram_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_datagram_socket(
+    basic_datagram_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+
+

+ This constructor moves a datagram socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_datagram_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_datagram_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload2.html new file mode 100644 index 0000000..d5d9e48 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload2.html @@ -0,0 +1,67 @@ + + + +basic_datagram_socket::basic_datagram_socket (2 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_datagram_socket + without opening it. +

+
template<
+    typename ExecutionContext>
+basic_datagram_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a datagram socket without opening it. The open() + function must be called before data can be sent or received on the socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload3.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload3.html new file mode 100644 index 0000000..45fe819 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload3.html @@ -0,0 +1,79 @@ + + + +basic_datagram_socket::basic_datagram_socket (3 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_datagram_socket. +

+
basic_datagram_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+
+

+ This constructor creates and opens a datagram socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload4.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload4.html new file mode 100644 index 0000000..899a02f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload4.html @@ -0,0 +1,83 @@ + + + +basic_datagram_socket::basic_datagram_socket (4 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_datagram_socket. +

+
template<
+    typename ExecutionContext>
+basic_datagram_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates and opens a datagram socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload5.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload5.html new file mode 100644 index 0000000..bc8db08 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload5.html @@ -0,0 +1,83 @@ + + + +basic_datagram_socket::basic_datagram_socket (5 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_datagram_socket, + opening it and binding it to the given local endpoint. +

+
basic_datagram_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+
+

+ This constructor creates a datagram socket and automatically opens it + bound to the specified endpoint on the local machine. The protocol used + is the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the datagram socket will + be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload6.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload6.html new file mode 100644 index 0000000..1e5953b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload6.html @@ -0,0 +1,87 @@ + + + +basic_datagram_socket::basic_datagram_socket (6 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_datagram_socket, + opening it and binding it to the given local endpoint. +

+
template<
+    typename ExecutionContext>
+basic_datagram_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a datagram socket and automatically opens it + bound to the specified endpoint on the local machine. The protocol used + is the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the datagram socket will + be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload7.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload7.html new file mode 100644 index 0000000..99a32ba --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload7.html @@ -0,0 +1,86 @@ + + + +basic_datagram_socket::basic_datagram_socket (7 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_datagram_socket + on an existing native socket. +

+
basic_datagram_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+

+ This constructor creates a datagram socket object to hold an existing + native socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload8.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload8.html new file mode 100644 index 0000000..c921b44 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload8.html @@ -0,0 +1,90 @@ + + + +basic_datagram_socket::basic_datagram_socket (8 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_datagram_socket + on an existing native socket. +

+
template<
+    typename ExecutionContext>
+basic_datagram_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a datagram socket object to hold an existing + native socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload9.html b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload9.html new file mode 100644 index 0000000..07bbfa5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/basic_datagram_socket/overload9.html @@ -0,0 +1,71 @@ + + + +basic_datagram_socket::basic_datagram_socket (9 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_datagram_socket + from another. +

+
basic_datagram_socket(
+    basic_datagram_socket && other);
+
+

+ This constructor moves a datagram socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_datagram_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_datagram_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/bind.html b/include/asio/doc/asio/reference/basic_datagram_socket/bind.html new file mode 100644 index 0000000..b97179b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/bind.html @@ -0,0 +1,51 @@ + + + +basic_datagram_socket::bind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bind + the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+  » more...
+
+void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/bind/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/bind/overload1.html new file mode 100644 index 0000000..1726188 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/bind/overload1.html @@ -0,0 +1,86 @@ + + + +basic_datagram_socket::bind (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/bind/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/bind/overload2.html new file mode 100644 index 0000000..7011047 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/bind/overload2.html @@ -0,0 +1,83 @@ + + + +basic_datagram_socket::bind (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+asio::error_code ec;
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/broadcast.html b/include/asio/doc/asio/reference/basic_datagram_socket/broadcast.html new file mode 100644 index 0000000..15c1aa3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/broadcast.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to permit sending of broadcast messages. +

+
typedef implementation_defined broadcast;
+
+

+ Implements the SOL_SOCKET/SO_BROADCAST socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/bytes_readable.html b/include/asio/doc/asio/reference/basic_datagram_socket/bytes_readable.html new file mode 100644 index 0000000..f5f3f6d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/bytes_readable.html @@ -0,0 +1,70 @@ + + + +basic_datagram_socket::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::bytes_readable command(true);
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/cancel.html b/include/asio/doc/asio/reference/basic_datagram_socket/cancel.html new file mode 100644 index 0000000..869e6d1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/cancel.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the socket. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/cancel/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/cancel/overload1.html new file mode 100644 index 0000000..4550c3e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/cancel/overload1.html @@ -0,0 +1,104 @@ + + + +basic_datagram_socket::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/cancel/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/cancel/overload2.html new file mode 100644 index 0000000..f451cee --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/cancel/overload2.html @@ -0,0 +1,105 @@ + + + +basic_datagram_socket::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/close.html b/include/asio/doc/asio/reference/basic_datagram_socket/close.html new file mode 100644 index 0000000..9f5239d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/close.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the socket. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/close/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/close/overload1.html new file mode 100644 index 0000000..1677236 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/close/overload1.html @@ -0,0 +1,73 @@ + + + +basic_datagram_socket::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close();
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. Note that, even if the function indicates an + error, the underlying descriptor is closed. +

+
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/close/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/close/overload2.html new file mode 100644 index 0000000..7774e0b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/close/overload2.html @@ -0,0 +1,87 @@ + + + +basic_datagram_socket::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. Note that, even if + the function indicates an error, the underlying descriptor is closed. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.close(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/connect.html b/include/asio/doc/asio/reference/basic_datagram_socket/connect.html new file mode 100644 index 0000000..57ef916 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/connect.html @@ -0,0 +1,51 @@ + + + +basic_datagram_socket::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Connect + the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+  » more...
+
+void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/connect/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/connect/overload1.html new file mode 100644 index 0000000..bef9f1a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/connect/overload1.html @@ -0,0 +1,92 @@ + + + +basic_datagram_socket::connect (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.connect(endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/connect/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/connect/overload2.html new file mode 100644 index 0000000..eeabfde --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/connect/overload2.html @@ -0,0 +1,89 @@ + + + +basic_datagram_socket::connect (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+asio::error_code ec;
+socket.connect(endpoint, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/debug.html b/include/asio/doc/asio/reference/basic_datagram_socket/debug.html new file mode 100644 index 0000000..0ec4ca9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/debug.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::debug + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to enable socket-level debugging. +

+
typedef implementation_defined debug;
+
+

+ Implements the SOL_SOCKET/SO_DEBUG socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/do_not_route.html b/include/asio/doc/asio/reference/basic_datagram_socket/do_not_route.html new file mode 100644 index 0000000..397640b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/do_not_route.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to prevent routing, use local interfaces only. +

+
typedef implementation_defined do_not_route;
+
+

+ Implements the SOL_SOCKET/SO_DONTROUTE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/enable_connection_aborted.html b/include/asio/doc/asio/reference/basic_datagram_socket/enable_connection_aborted.html new file mode 100644 index 0000000..5930fb2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/enable_connection_aborted.html @@ -0,0 +1,83 @@ + + + +basic_datagram_socket::enable_connection_aborted + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to report aborted connections on accept. +

+
typedef implementation_defined enable_connection_aborted;
+
+

+ Implements a custom socket option that determines whether or not an accept + operation is permitted to fail with asio::error::connection_aborted. + By default the option is false. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/endpoint_type.html b/include/asio/doc/asio/reference/basic_datagram_socket/endpoint_type.html new file mode 100644 index 0000000..42aed35 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_datagram_socket::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/executor_type.html b/include/asio/doc/asio/reference/basic_datagram_socket/executor_type.html new file mode 100644 index 0000000..25d1967 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_datagram_socket::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/get_executor.html b/include/asio/doc/asio/reference/basic_datagram_socket/get_executor.html new file mode 100644 index 0000000..6a2da78 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/get_executor.html @@ -0,0 +1,47 @@ + + + +basic_datagram_socket::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/get_option.html b/include/asio/doc/asio/reference/basic_datagram_socket/get_option.html new file mode 100644 index 0000000..735256e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/get_option.html @@ -0,0 +1,55 @@ + + + +basic_datagram_socket::get_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+  » more...
+
+template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/get_option/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/get_option/overload1.html new file mode 100644 index 0000000..5d5924c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/get_option/overload1.html @@ -0,0 +1,91 @@ + + + +basic_datagram_socket::get_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/get_option/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/get_option/overload2.html new file mode 100644 index 0000000..e69d747 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/get_option/overload2.html @@ -0,0 +1,88 @@ + + + +basic_datagram_socket::get_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+asio::error_code ec;
+socket.get_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/io_control.html b/include/asio/doc/asio/reference/basic_datagram_socket/io_control.html new file mode 100644 index 0000000..165bbee --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/io_control.html @@ -0,0 +1,55 @@ + + + +basic_datagram_socket::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/io_control/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/io_control/overload1.html new file mode 100644 index 0000000..1dbd893 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/io_control/overload1.html @@ -0,0 +1,91 @@ + + + +basic_datagram_socket::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/io_control/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/io_control/overload2.html new file mode 100644 index 0000000..4ec4225 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/io_control/overload2.html @@ -0,0 +1,88 @@ + + + +basic_datagram_socket::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+asio::error_code ec;
+socket.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/is_open.html b/include/asio/doc/asio/reference/basic_datagram_socket/is_open.html new file mode 100644 index 0000000..b83e375 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/is_open.html @@ -0,0 +1,47 @@ + + + +basic_datagram_socket::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Determine + whether the socket is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/keep_alive.html b/include/asio/doc/asio/reference/basic_datagram_socket/keep_alive.html new file mode 100644 index 0000000..5560318 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/keep_alive.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::keep_alive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to send keep-alives. +

+
typedef implementation_defined keep_alive;
+
+

+ Implements the SOL_SOCKET/SO_KEEPALIVE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/linger.html b/include/asio/doc/asio/reference/basic_datagram_socket/linger.html new file mode 100644 index 0000000..0716116 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/linger.html @@ -0,0 +1,83 @@ + + + +basic_datagram_socket::linger + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to specify whether the socket lingers on close if unsent data is + present. +

+
typedef implementation_defined linger;
+
+

+ Implements the SOL_SOCKET/SO_LINGER socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option(true, 30);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option;
+socket.get_option(option);
+bool is_set = option.enabled();
+unsigned short timeout = option.timeout();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint.html b/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint.html new file mode 100644 index 0000000..262ca40 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::local_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+  » more...
+
+endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint/overload1.html new file mode 100644 index 0000000..5a90f46 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_datagram_socket::local_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint/overload2.html new file mode 100644 index 0000000..82fae3b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/local_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_datagram_socket::local_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. Returns a + default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer.html b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer.html new file mode 100644 index 0000000..f2b1e7c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer.html @@ -0,0 +1,51 @@ + + + +basic_datagram_socket::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer/overload1.html new file mode 100644 index 0000000..3efb723 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer/overload1.html @@ -0,0 +1,60 @@ + + + +basic_datagram_socket::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer/overload2.html new file mode 100644 index 0000000..97b2f75 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer/overload2.html @@ -0,0 +1,60 @@ + + + +basic_datagram_socket::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer_type.html b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer_type.html new file mode 100644 index 0000000..ae1dca5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/lowest_layer_type.html @@ -0,0 +1,849 @@ + + + +basic_datagram_socket::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +A + basic_socket + is always the lowest layer. +

+
typedef basic_socket< Protocol, Executor > lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_socket [constructor] +

+
+

+ Construct a basic_socket without opening it.
—
Construct + and open a basic_socket.
—
Construct a basic_socket, + opening it and binding it to the given local endpoint.
+ —
Construct a basic_socket on an existing native socket. +
—
Move-construct a basic_socket from another.
+ —
Move-construct a basic_socket from a socket of another + protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket from another.
—
Move-assign + a basic_socket from a socket of another protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_socket [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket + class template provides functionality that is common to both stream-oriented + and datagram-oriented sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/max_connections.html b/include/asio/doc/asio/reference/basic_datagram_socket/max_connections.html new file mode 100644 index 0000000..cc86032 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/max_connections.html @@ -0,0 +1,48 @@ + + + +basic_datagram_socket::max_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +(Deprecated: + Use max_listen_connections.) The maximum length of the queue of pending + incoming connections. +

+
static const int max_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/max_listen_connections.html b/include/asio/doc/asio/reference/basic_datagram_socket/max_listen_connections.html new file mode 100644 index 0000000..9c6ec64 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/max_listen_connections.html @@ -0,0 +1,47 @@ + + + +basic_datagram_socket::max_listen_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +The + maximum length of the queue of pending incoming connections. +

+
static const int max_listen_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/message_do_not_route.html b/include/asio/doc/asio/reference/basic_datagram_socket/message_do_not_route.html new file mode 100644 index 0000000..7687802 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/message_do_not_route.html @@ -0,0 +1,47 @@ + + + +basic_datagram_socket::message_do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specify + that the data should not be subject to routing. +

+
static const int message_do_not_route = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/message_end_of_record.html b/include/asio/doc/asio/reference/basic_datagram_socket/message_end_of_record.html new file mode 100644 index 0000000..3d05f6a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/message_end_of_record.html @@ -0,0 +1,47 @@ + + + +basic_datagram_socket::message_end_of_record + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specifies + that the data marks the end of a record. +

+
static const int message_end_of_record = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/message_flags.html b/include/asio/doc/asio/reference/basic_datagram_socket/message_flags.html new file mode 100644 index 0000000..4013827 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/message_flags.html @@ -0,0 +1,57 @@ + + + +basic_datagram_socket::message_flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Bitmask + type for flags that can be passed to send and receive operations. +

+
typedef int message_flags;
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/message_out_of_band.html b/include/asio/doc/asio/reference/basic_datagram_socket/message_out_of_band.html new file mode 100644 index 0000000..4277a47 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/message_out_of_band.html @@ -0,0 +1,47 @@ + + + +basic_datagram_socket::message_out_of_band + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Process + out-of-band data. +

+
static const int message_out_of_band = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/message_peek.html b/include/asio/doc/asio/reference/basic_datagram_socket/message_peek.html new file mode 100644 index 0000000..2db5051 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/message_peek.html @@ -0,0 +1,47 @@ + + + +basic_datagram_socket::message_peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Peek + at incoming data without removing it from the input queue. +

+
static const int message_peek = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/native_handle.html b/include/asio/doc/asio/reference/basic_datagram_socket/native_handle.html new file mode 100644 index 0000000..30d096a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/native_handle.html @@ -0,0 +1,52 @@ + + + +basic_datagram_socket::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the native socket representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + socket. This is intended to allow access to native socket functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/native_handle_type.html b/include/asio/doc/asio/reference/basic_datagram_socket/native_handle_type.html new file mode 100644 index 0000000..20927e1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/native_handle_type.html @@ -0,0 +1,54 @@ + + + +basic_datagram_socket::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a socket. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking.html b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking.html new file mode 100644 index 0000000..7d28639 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_datagram_socket::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload1.html new file mode 100644 index 0000000..8f6d752 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload1.html @@ -0,0 +1,145 @@ + + + +basic_datagram_socket::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native socket. This mode has no effect on the behaviour of the socket + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying socket is in non-blocking mode and + direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the socket object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native socket. +

+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload2.html new file mode 100644 index 0000000..10e18cb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload2.html @@ -0,0 +1,158 @@ + + + +basic_datagram_socket::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload3.html new file mode 100644 index 0000000..0640293 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/native_non_blocking/overload3.html @@ -0,0 +1,150 @@ + + + +basic_datagram_socket::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking.html b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking.html new file mode 100644 index 0000000..85c6316 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_datagram_socket::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the socket. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload1.html new file mode 100644 index 0000000..aeabfb7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload1.html @@ -0,0 +1,65 @@ + + + +basic_datagram_socket::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the socket. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the socket's synchronous operations will fail with + asio::error::would_block if they are unable to perform the + requested operation immediately. If false, synchronous operations + will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload2.html new file mode 100644 index 0000000..1d38274 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload2.html @@ -0,0 +1,84 @@ + + + +basic_datagram_socket::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload3.html new file mode 100644 index 0000000..892b7f9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/non_blocking/overload3.html @@ -0,0 +1,76 @@ + + + +basic_datagram_socket::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/open.html b/include/asio/doc/asio/reference/basic_datagram_socket/open.html new file mode 100644 index 0000000..9820f8e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/open.html @@ -0,0 +1,51 @@ + + + +basic_datagram_socket::open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Open + the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+  » more...
+
+void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/open/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/open/overload1.html new file mode 100644 index 0000000..d277faf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/open/overload1.html @@ -0,0 +1,83 @@ + + + +basic_datagram_socket::open (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/open/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/open/overload2.html new file mode 100644 index 0000000..e5c5215 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/open/overload2.html @@ -0,0 +1,80 @@ + + + +basic_datagram_socket::open (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying which protocol is to be used. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::error_code ec;
+socket.open(asio::ip::tcp::v4(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_.html b/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_.html new file mode 100644 index 0000000..b1aa920 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_.html @@ -0,0 +1,58 @@ + + + +basic_datagram_socket::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_datagram_socket + from another. +

+
basic_datagram_socket & operator=(
+    basic_datagram_socket && other);
+  » more...
+
+

+ Move-assign a basic_datagram_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_datagram_socket & >::type operator=(
+    basic_datagram_socket< Protocol1, Executor1 > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_/overload1.html new file mode 100644 index 0000000..a654d42 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_/overload1.html @@ -0,0 +1,71 @@ + + + +basic_datagram_socket::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_datagram_socket + from another. +

+
basic_datagram_socket & operator=(
+    basic_datagram_socket && other);
+
+

+ This assignment operator moves a datagram socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_datagram_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_datagram_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_/overload2.html new file mode 100644 index 0000000..8bc6aa7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/operator_eq_/overload2.html @@ -0,0 +1,74 @@ + + + +basic_datagram_socket::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_datagram_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_datagram_socket & >::type operator=(
+    basic_datagram_socket< Protocol1, Executor1 > && other);
+
+

+ This assignment operator moves a datagram socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_datagram_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_datagram_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/out_of_band_inline.html b/include/asio/doc/asio/reference/basic_datagram_socket/out_of_band_inline.html new file mode 100644 index 0000000..799d07f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/out_of_band_inline.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::out_of_band_inline + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for putting received out-of-band data inline. +

+
typedef implementation_defined out_of_band_inline;
+
+

+ Implements the SOL_SOCKET/SO_OOBINLINE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option;
+socket.get_option(option);
+bool value = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/protocol_type.html b/include/asio/doc/asio/reference/basic_datagram_socket/protocol_type.html new file mode 100644 index 0000000..fe40c93 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_datagram_socket::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive.html new file mode 100644 index 0000000..1f4eadd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive.html @@ -0,0 +1,63 @@ + + + +basic_datagram_socket::receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Receive + some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload1.html new file mode 100644 index 0000000..000ab22 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload1.html @@ -0,0 +1,108 @@ + + + +basic_datagram_socket::receive (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to receive data on the datagram socket. The function + call will block until data has been received successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The receive operation can only be used with a connected socket. Use the + receive_from function to receive data on an unconnected datagram socket. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.receive(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload2.html new file mode 100644 index 0000000..61e9dff --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload2.html @@ -0,0 +1,98 @@ + + + +basic_datagram_socket::receive (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags);
+
+

+ This function is used to receive data on the datagram socket. The function + call will block until data has been received successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The receive operation can only be used with a connected socket. Use the + receive_from function to receive data on an unconnected datagram socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload3.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload3.html new file mode 100644 index 0000000..d061577 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive/overload3.html @@ -0,0 +1,90 @@ + + + +basic_datagram_socket::receive (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to receive data on the datagram socket. The function + call will block until data has been received successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Remarks +
+

+ The receive operation can only be used with a connected socket. Use the + receive_from function to receive data on an unconnected datagram socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive_buffer_size.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive_buffer_size.html new file mode 100644 index 0000000..8ccc02a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::receive_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive buffer size of a socket. +

+
typedef implementation_defined receive_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_RCVBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive_from.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from.html new file mode 100644 index 0000000..d372f9e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from.html @@ -0,0 +1,66 @@ + + + +basic_datagram_socket::receive_from + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Receive + a datagram with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload1.html new file mode 100644 index 0000000..57df6e1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload1.html @@ -0,0 +1,107 @@ + + + +basic_datagram_socket::receive_from (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive a datagram with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint);
+
+

+ This function is used to receive a datagram. The function call will block + until data has been received successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the datagram. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
asio::ip::udp::endpoint sender_endpoint;
+socket.receive_from(
+    asio::buffer(data, size), sender_endpoint);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload2.html new file mode 100644 index 0000000..93a5ead --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload2.html @@ -0,0 +1,95 @@ + + + +basic_datagram_socket::receive_from (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive a datagram with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags);
+
+

+ This function is used to receive a datagram. The function call will block + until data has been received successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the datagram. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload3.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload3.html new file mode 100644 index 0000000..9555c78 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive_from/overload3.html @@ -0,0 +1,87 @@ + + + +basic_datagram_socket::receive_from (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive a datagram with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to receive a datagram. The function call will block + until data has been received successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the datagram. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/receive_low_watermark.html b/include/asio/doc/asio/reference/basic_datagram_socket/receive_low_watermark.html new file mode 100644 index 0000000..f90556c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/receive_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::receive_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive low watermark. +

+
typedef implementation_defined receive_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_RCVLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/release.html b/include/asio/doc/asio/reference/basic_datagram_socket/release.html new file mode 100644 index 0000000..d496066 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/release.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release + ownership of the underlying native socket. +

+
native_handle_type release();
+  » more...
+
+native_handle_type release(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/release/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/release/overload1.html new file mode 100644 index 0000000..04460cd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/release/overload1.html @@ -0,0 +1,74 @@ + + + +basic_datagram_socket::release (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/release/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/release/overload2.html new file mode 100644 index 0000000..b604540 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/release/overload2.html @@ -0,0 +1,75 @@ + + + +basic_datagram_socket::release (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint.html b/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint.html new file mode 100644 index 0000000..13f5baf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_datagram_socket::remote_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+  » more...
+
+endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint/overload1.html new file mode 100644 index 0000000..f6df8a5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_datagram_socket::remote_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint/overload2.html new file mode 100644 index 0000000..6ae08ee --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/remote_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_datagram_socket::remote_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. Returns + a default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/reuse_address.html b/include/asio/doc/asio/reference/basic_datagram_socket/reuse_address.html new file mode 100644 index 0000000..7ff7e5e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/reuse_address.html @@ -0,0 +1,82 @@ + + + +basic_datagram_socket::reuse_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to allow the socket to be bound to an address that is already in + use. +

+
typedef implementation_defined reuse_address;
+
+

+ Implements the SOL_SOCKET/SO_REUSEADDR socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send.html b/include/asio/doc/asio/reference/basic_datagram_socket/send.html new file mode 100644 index 0000000..3913000 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send.html @@ -0,0 +1,63 @@ + + + +basic_datagram_socket::send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Send + some data on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/send/overload1.html new file mode 100644 index 0000000..e8911c2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send/overload1.html @@ -0,0 +1,108 @@ + + + +basic_datagram_socket::send (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to send data on the datagram socket. The function + call will block until the data has been sent successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One ore more data buffers to be sent on the socket. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The send operation can only be used with a connected socket. Use the + send_to function to send data on an unconnected datagram socket. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.send(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/send/overload2.html new file mode 100644 index 0000000..0dbde8e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send/overload2.html @@ -0,0 +1,98 @@ + + + +basic_datagram_socket::send (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+
+

+ This function is used to send data on the datagram socket. The function + call will block until the data has been sent successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One ore more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The send operation can only be used with a connected socket. Use the + send_to function to send data on an unconnected datagram socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send/overload3.html b/include/asio/doc/asio/reference/basic_datagram_socket/send/overload3.html new file mode 100644 index 0000000..751d173 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send/overload3.html @@ -0,0 +1,90 @@ + + + +basic_datagram_socket::send (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to send data on the datagram socket. The function + call will block until the data has been sent successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Remarks +
+

+ The send operation can only be used with a connected socket. Use the + send_to function to send data on an unconnected datagram socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send_buffer_size.html b/include/asio/doc/asio/reference/basic_datagram_socket/send_buffer_size.html new file mode 100644 index 0000000..8baebdf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::send_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send buffer size of a socket. +

+
typedef implementation_defined send_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_SNDBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send_low_watermark.html b/include/asio/doc/asio/reference/basic_datagram_socket/send_low_watermark.html new file mode 100644 index 0000000..023dcf8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_datagram_socket::send_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send low watermark. +

+
typedef implementation_defined send_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_SNDLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send_to.html b/include/asio/doc/asio/reference/basic_datagram_socket/send_to.html new file mode 100644 index 0000000..f054cb1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send_to.html @@ -0,0 +1,66 @@ + + + +basic_datagram_socket::send_to + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Send + a datagram to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload1.html new file mode 100644 index 0000000..631dd7c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload1.html @@ -0,0 +1,107 @@ + + + +basic_datagram_socket::send_to (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send a datagram to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination);
+
+

+ This function is used to send a datagram to the specified remote endpoint. + The function call will block until the data has been sent successfully + or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. +

+
destination
+

+ The remote endpoint to which the data will be sent. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
asio::ip::udp::endpoint destination(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.send_to(asio::buffer(data, size), destination);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload2.html new file mode 100644 index 0000000..790b800 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload2.html @@ -0,0 +1,95 @@ + + + +basic_datagram_socket::send_to (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send a datagram to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags);
+
+

+ This function is used to send a datagram to the specified remote endpoint. + The function call will block until the data has been sent successfully + or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. +

+
destination
+

+ The remote endpoint to which the data will be sent. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload3.html b/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload3.html new file mode 100644 index 0000000..5fe2521 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/send_to/overload3.html @@ -0,0 +1,87 @@ + + + +basic_datagram_socket::send_to (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send a datagram to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to send a datagram to the specified remote endpoint. + The function call will block until the data has been sent successfully + or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. +

+
destination
+

+ The remote endpoint to which the data will be sent. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/set_option.html b/include/asio/doc/asio/reference/basic_datagram_socket/set_option.html new file mode 100644 index 0000000..78111dc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/set_option.html @@ -0,0 +1,55 @@ + + + +basic_datagram_socket::set_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+  » more...
+
+template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/set_option/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/set_option/overload1.html new file mode 100644 index 0000000..40acdee --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/set_option/overload1.html @@ -0,0 +1,90 @@ + + + +basic_datagram_socket::set_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+socket.set_option(option);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/set_option/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/set_option/overload2.html new file mode 100644 index 0000000..76cccd0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/set_option/overload2.html @@ -0,0 +1,87 @@ + + + +basic_datagram_socket::set_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+asio::error_code ec;
+socket.set_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/shutdown.html b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown.html new file mode 100644 index 0000000..714b715 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown.html @@ -0,0 +1,51 @@ + + + +basic_datagram_socket::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+  » more...
+
+void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/shutdown/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown/overload1.html new file mode 100644 index 0000000..eccde94 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown/overload1.html @@ -0,0 +1,88 @@ + + + +basic_datagram_socket::shutdown (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.shutdown(asio::ip::tcp::socket::shutdown_send);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/shutdown/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown/overload2.html new file mode 100644 index 0000000..944e361 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown/overload2.html @@ -0,0 +1,85 @@ + + + +basic_datagram_socket::shutdown (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/shutdown_type.html b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown_type.html new file mode 100644 index 0000000..9803e8c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/shutdown_type.html @@ -0,0 +1,73 @@ + + + +basic_datagram_socket::shutdown_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Different + ways a socket may be shutdown. +

+
enum shutdown_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
shutdown_receive
+

+ Shutdown the receive side of the socket. +

+
shutdown_send
+

+ Shutdown the send side of the socket. +

+
shutdown_both
+

+ Shutdown both send and receive on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/wait.html b/include/asio/doc/asio/reference/basic_datagram_socket/wait.html new file mode 100644 index 0000000..df456af --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/wait.html @@ -0,0 +1,52 @@ + + + +basic_datagram_socket::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait + for the socket to become ready to read, ready to write, or to have pending + error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/wait/overload1.html b/include/asio/doc/asio/reference/basic_datagram_socket/wait/overload1.html new file mode 100644 index 0000000..d9844f2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/wait/overload1.html @@ -0,0 +1,76 @@ + + + +basic_datagram_socket::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.wait(asio::ip::tcp::socket::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/wait/overload2.html b/include/asio/doc/asio/reference/basic_datagram_socket/wait/overload2.html new file mode 100644 index 0000000..b212869 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/wait/overload2.html @@ -0,0 +1,82 @@ + + + +basic_datagram_socket::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.wait(asio::ip::tcp::socket::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket/wait_type.html b/include/asio/doc/asio/reference/basic_datagram_socket/wait_type.html new file mode 100644 index 0000000..8f740d2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket/wait_type.html @@ -0,0 +1,76 @@ + + + +basic_datagram_socket::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a socket to become ready to read. +

+
wait_write
+

+ Wait for a socket to become ready to write. +

+
wait_error
+

+ Wait for a socket to have error conditions pending. +

+
+
+

+ For use with basic_socket::wait() and basic_socket::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket__rebind_executor.html b/include/asio/doc/asio/reference/basic_datagram_socket__rebind_executor.html new file mode 100644 index 0000000..96cd27e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_datagram_socket::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the socket type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The socket type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_datagram_socket__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_datagram_socket__rebind_executor/other.html new file mode 100644 index 0000000..1841804 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_datagram_socket__rebind_executor/other.html @@ -0,0 +1,919 @@ + + + +basic_datagram_socket::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + socket type when rebound to the specified executor. +

+
typedef basic_datagram_socket< Protocol, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_datagram_socket [constructor] +

+
+

+ Construct a basic_datagram_socket without opening it.
+ —
Construct and open a basic_datagram_socket.
—
+ Construct a basic_datagram_socket, opening it and binding it + to the given local endpoint.
—
Construct a basic_datagram_socket + on an existing native socket.
—
Move-construct a + basic_datagram_socket from another.
—
Move-construct + a basic_datagram_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_datagram_socket from another.
—
+ Move-assign a basic_datagram_socket from a socket of another + protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive a datagram with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send a datagram to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_datagram_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_datagram_socket + class template provides asynchronous and blocking datagram-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_datagram_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer.html b/include/asio/doc/asio/reference/basic_deadline_timer.html new file mode 100644 index 0000000..f2cd7cf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer.html @@ -0,0 +1,395 @@ + + + +basic_deadline_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides waitable timer functionality. +

+
template<
+    typename Time,
+    typename TimeTraits = asio::time_traits<Time>,
+    typename Executor = any_io_executor>
+class basic_deadline_timer
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ duration_type +

+
+

+ The duration type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_type +

+
+

+ The time type. +

+
+

+ traits_type +

+
+

+ The time traits type. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_deadline_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a particular + expiry time relative to now.
—
Move-construct a basic_deadline_timer + from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +

+
+

+ expires_at +

+
+

+ Get the timer's expiry time as an absolute time.
—
+ Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ Get the timer's expiry time relative to now.
—
Set + the timer's expiry time relative to now. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_deadline_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_deadline_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_deadline_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A deadline timer is always in one of two states: "expired" or "not + expired". If the wait() or async_wait() function + is called on an expired timer, the wait operation will complete immediately. +

+

+ Most applications will use the deadline_timer + typedef. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait: +

+
// Construct a timer without setting an expiry time.
+asio::deadline_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_from_now(boost::posix_time::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait: +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::deadline_timer timer(my_context,
+    boost::posix_time::time_from_string("2005-12-07 23:59:59.000"));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active deadline_timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the action + associated with the timer is performed only once, use something like this: + used: +

+
void on_some_event()
+{
+  if (my_timer.expires_from_now(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_deadline_timer::expires_from_now() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+
+ + Requirements +
+

+ Header: asio/basic_deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/_basic_deadline_timer.html b/include/asio/doc/asio/reference/basic_deadline_timer/_basic_deadline_timer.html new file mode 100644 index 0000000..12fe285 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/_basic_deadline_timer.html @@ -0,0 +1,48 @@ + + + +basic_deadline_timer::~basic_deadline_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the timer. +

+
~basic_deadline_timer();
+
+

+ This function destroys the timer, cancelling any outstanding asynchronous + wait operations associated with the timer as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/async_wait.html b/include/asio/doc/asio/reference/basic_deadline_timer/async_wait.html new file mode 100644 index 0000000..6200c6d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/async_wait.html @@ -0,0 +1,91 @@ + + + +basic_deadline_timer::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous wait on the timer. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    WaitHandler && handler = DEFAULT);
+
+

+ This function may be used to initiate an asynchronous wait against the + timer. It always returns immediately. +

+

+ For each call to async_wait(), the supplied handler will be + called exactly once. The handler will be called when: +

+
    +
  • + The timer has expired. +
  • +
  • + The timer was cancelled, in which case the handler is passed the error + code asio::error::operation_aborted. +
  • +
+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called when the timer expires. Copies will be made + of the handler as required. The function signature of the handler + must be: +

+
void handler(
+  const asio::error_code& error // Result of operation.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer.html new file mode 100644 index 0000000..2df5245 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer.html @@ -0,0 +1,92 @@ + + + +basic_deadline_timer::basic_deadline_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
explicit basic_deadline_timer(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_deadline_timer(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Constructor to set a particular expiry time as an absolute time. +

+
basic_deadline_timer(
+    const executor_type & ex,
+    const time_type & expiry_time);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_deadline_timer(
+    ExecutionContext & context,
+    const time_type & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Constructor to set a particular expiry time relative to now. +

+
basic_deadline_timer(
+    const executor_type & ex,
+    const duration_type & expiry_time);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_deadline_timer(
+    ExecutionContext & context,
+    const duration_type & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_deadline_timer + from another. +

+
basic_deadline_timer(
+    basic_deadline_timer && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload1.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload1.html new file mode 100644 index 0000000..1175239 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload1.html @@ -0,0 +1,63 @@ + + + +basic_deadline_timer::basic_deadline_timer (1 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor. +

+
basic_deadline_timer(
+    const executor_type & ex);
+
+

+ This constructor creates a timer without setting an expiry time. The + expires_at() or expires_from_now() functions + must be called to set an expiry time before the timer can be waited on. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the timer will use, by default, to dispatch + handlers for any asynchronous operations performed on the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload2.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload2.html new file mode 100644 index 0000000..2a5ace1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload2.html @@ -0,0 +1,67 @@ + + + +basic_deadline_timer::basic_deadline_timer (2 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor. +

+
template<
+    typename ExecutionContext>
+basic_deadline_timer(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a timer without setting an expiry time. The + expires_at() or expires_from_now() functions + must be called to set an expiry time before the timer can be waited on. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the timer + will use, by default, to dispatch handlers for any asynchronous + operations performed on the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload3.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload3.html new file mode 100644 index 0000000..37f3786 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload3.html @@ -0,0 +1,67 @@ + + + +basic_deadline_timer::basic_deadline_timer (3 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time as an absolute time. +

+
basic_deadline_timer(
+    const executor_type & ex,
+    const time_type & expiry_time);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the timer will use, by default, to dispatch + handlers for any asynchronous operations performed on the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, expressed as an absolute + time. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload4.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload4.html new file mode 100644 index 0000000..eb7804a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload4.html @@ -0,0 +1,71 @@ + + + +basic_deadline_timer::basic_deadline_timer (4 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time as an absolute time. +

+
template<
+    typename ExecutionContext>
+basic_deadline_timer(
+    ExecutionContext & context,
+    const time_type & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the timer + will use, by default, to dispatch handlers for any asynchronous + operations performed on the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, expressed as an absolute + time. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload5.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload5.html new file mode 100644 index 0000000..2125c3a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload5.html @@ -0,0 +1,66 @@ + + + +basic_deadline_timer::basic_deadline_timer (5 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time relative to now. +

+
basic_deadline_timer(
+    const executor_type & ex,
+    const duration_type & expiry_time);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the timer will use, by default, to dispatch + handlers for any asynchronous operations performed on the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, relative to now. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload6.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload6.html new file mode 100644 index 0000000..68fd686 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload6.html @@ -0,0 +1,70 @@ + + + +basic_deadline_timer::basic_deadline_timer (6 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time relative to now. +

+
template<
+    typename ExecutionContext>
+basic_deadline_timer(
+    ExecutionContext & context,
+    const duration_type & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the timer + will use, by default, to dispatch handlers for any asynchronous + operations performed on the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, relative to now. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload7.html b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload7.html new file mode 100644 index 0000000..e59af95 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/basic_deadline_timer/overload7.html @@ -0,0 +1,71 @@ + + + +basic_deadline_timer::basic_deadline_timer (7 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_deadline_timer + from another. +

+
basic_deadline_timer(
+    basic_deadline_timer && other);
+
+

+ This constructor moves a timer from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_deadline_timer + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_deadline_timer(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/cancel.html b/include/asio/doc/asio/reference/basic_deadline_timer/cancel.html new file mode 100644 index 0000000..97071ea --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/cancel.html @@ -0,0 +1,49 @@ + + + +basic_deadline_timer::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + any asynchronous operations that are waiting on the timer. +

+
std::size_t cancel();
+  » more...
+
+std::size_t cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/cancel/overload1.html b/include/asio/doc/asio/reference/basic_deadline_timer/cancel/overload1.html new file mode 100644 index 0000000..a5c961a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/cancel/overload1.html @@ -0,0 +1,93 @@ + + + +basic_deadline_timer::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel any asynchronous operations that are waiting on the timer. +

+
std::size_t cancel();
+
+

+ This function forces the completion of any pending asynchronous wait + operations against the timer. The handler for each cancelled operation + will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when cancel() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/cancel/overload2.html b/include/asio/doc/asio/reference/basic_deadline_timer/cancel/overload2.html new file mode 100644 index 0000000..9de9b04 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/cancel/overload2.html @@ -0,0 +1,94 @@ + + + +basic_deadline_timer::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel any asynchronous operations that are waiting on the timer. +

+
std::size_t cancel(
+    asio::error_code & ec);
+
+

+ This function forces the completion of any pending asynchronous wait + operations against the timer. The handler for each cancelled operation + will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Remarks +
+

+ If the timer has already expired when cancel() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one.html b/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one.html new file mode 100644 index 0000000..fbdc441 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one.html @@ -0,0 +1,49 @@ + + + +basic_deadline_timer::cancel_one + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancels + one asynchronous operation that is waiting on the timer. +

+
std::size_t cancel_one();
+  » more...
+
+std::size_t cancel_one(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one/overload1.html b/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one/overload1.html new file mode 100644 index 0000000..86326d4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one/overload1.html @@ -0,0 +1,94 @@ + + + +basic_deadline_timer::cancel_one (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancels one asynchronous operation that is waiting on the timer. +

+
std::size_t cancel_one();
+
+

+ This function forces the completion of one pending asynchronous wait + operation against the timer. Handlers are cancelled in FIFO order. The + handler for the cancelled operation will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. That is, either + 0 or 1. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when cancel_one() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one/overload2.html b/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one/overload2.html new file mode 100644 index 0000000..016f602 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/cancel_one/overload2.html @@ -0,0 +1,95 @@ + + + +basic_deadline_timer::cancel_one (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancels one asynchronous operation that is waiting on the timer. +

+
std::size_t cancel_one(
+    asio::error_code & ec);
+
+

+ This function forces the completion of one pending asynchronous wait + operation against the timer. Handlers are cancelled in FIFO order. The + handler for the cancelled operation will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. That is, either + 0 or 1. +

+
+ + Remarks +
+

+ If the timer has already expired when cancel_one() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/duration_type.html b/include/asio/doc/asio/reference/basic_deadline_timer/duration_type.html new file mode 100644 index 0000000..57c4eb4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/duration_type.html @@ -0,0 +1,54 @@ + + + +basic_deadline_timer::duration_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + duration type. +

+
typedef traits_type::duration_type duration_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/executor_type.html b/include/asio/doc/asio/reference/basic_deadline_timer/executor_type.html new file mode 100644 index 0000000..2d028f8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_deadline_timer::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_at.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at.html new file mode 100644 index 0000000..1b78f06 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at.html @@ -0,0 +1,57 @@ + + + +basic_deadline_timer::expires_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the timer's expiry time as an absolute time. +

+
time_type expires_at() const;
+  » more...
+
+

+ Set the timer's expiry time as an absolute time. +

+
std::size_t expires_at(
+    const time_type & expiry_time);
+  » more...
+
+std::size_t expires_at(
+    const time_type & expiry_time,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload1.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload1.html new file mode 100644 index 0000000..70889be --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload1.html @@ -0,0 +1,47 @@ + + + +basic_deadline_timer::expires_at (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the timer's expiry time as an absolute time. +

+
time_type expires_at() const;
+
+

+ This function may be used to obtain the timer's current expiry time. + Whether the timer has expired or not does not affect this value. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload2.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload2.html new file mode 100644 index 0000000..6363ce9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload2.html @@ -0,0 +1,103 @@ + + + +basic_deadline_timer::expires_at (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the timer's expiry time as an absolute time. +

+
std::size_t expires_at(
+    const time_type & expiry_time);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when expires_at() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload3.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload3.html new file mode 100644 index 0000000..b002cd0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_at/overload3.html @@ -0,0 +1,95 @@ + + + +basic_deadline_timer::expires_at (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the timer's expiry time as an absolute time. +

+
std::size_t expires_at(
+    const time_type & expiry_time,
+    asio::error_code & ec);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Remarks +
+

+ If the timer has already expired when expires_at() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now.html new file mode 100644 index 0000000..8667928 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now.html @@ -0,0 +1,57 @@ + + + +basic_deadline_timer::expires_from_now + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the timer's expiry time relative to now. +

+
duration_type expires_from_now() const;
+  » more...
+
+

+ Set the timer's expiry time relative to now. +

+
std::size_t expires_from_now(
+    const duration_type & expiry_time);
+  » more...
+
+std::size_t expires_from_now(
+    const duration_type & expiry_time,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload1.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload1.html new file mode 100644 index 0000000..3b50948 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload1.html @@ -0,0 +1,47 @@ + + + +basic_deadline_timer::expires_from_now (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the timer's expiry time relative to now. +

+
duration_type expires_from_now() const;
+
+

+ This function may be used to obtain the timer's current expiry time. + Whether the timer has expired or not does not affect this value. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload2.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload2.html new file mode 100644 index 0000000..e224a9a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload2.html @@ -0,0 +1,103 @@ + + + +basic_deadline_timer::expires_from_now (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the timer's expiry time relative to now. +

+
std::size_t expires_from_now(
+    const duration_type & expiry_time);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when expires_from_now() + is called, then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload3.html b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload3.html new file mode 100644 index 0000000..57602c1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/expires_from_now/overload3.html @@ -0,0 +1,95 @@ + + + +basic_deadline_timer::expires_from_now (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the timer's expiry time relative to now. +

+
std::size_t expires_from_now(
+    const duration_type & expiry_time,
+    asio::error_code & ec);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Remarks +
+

+ If the timer has already expired when expires_from_now() + is called, then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/get_executor.html b/include/asio/doc/asio/reference/basic_deadline_timer/get_executor.html new file mode 100644 index 0000000..155a81c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/get_executor.html @@ -0,0 +1,44 @@ + + + +basic_deadline_timer::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/operator_eq_.html b/include/asio/doc/asio/reference/basic_deadline_timer/operator_eq_.html new file mode 100644 index 0000000..3241869 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/operator_eq_.html @@ -0,0 +1,72 @@ + + + +basic_deadline_timer::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_deadline_timer + from another. +

+
basic_deadline_timer & operator=(
+    basic_deadline_timer && other);
+
+

+ This assignment operator moves a timer from one object to another. Cancels + any outstanding asynchronous operations associated with the target object. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_deadline_timer + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_deadline_timer(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/time_type.html b/include/asio/doc/asio/reference/basic_deadline_timer/time_type.html new file mode 100644 index 0000000..fbb37b4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/time_type.html @@ -0,0 +1,54 @@ + + + +basic_deadline_timer::time_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + time type. +

+
typedef traits_type::time_type time_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/traits_type.html b/include/asio/doc/asio/reference/basic_deadline_timer/traits_type.html new file mode 100644 index 0000000..681ff0f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/traits_type.html @@ -0,0 +1,54 @@ + + + +basic_deadline_timer::traits_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + time traits type. +

+
typedef TimeTraits traits_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/wait.html b/include/asio/doc/asio/reference/basic_deadline_timer/wait.html new file mode 100644 index 0000000..10bfc86 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/wait.html @@ -0,0 +1,49 @@ + + + +basic_deadline_timer::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + a blocking wait on the timer. +

+
void wait();
+  » more...
+
+void wait(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/wait/overload1.html b/include/asio/doc/asio/reference/basic_deadline_timer/wait/overload1.html new file mode 100644 index 0000000..3bdbb0f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/wait/overload1.html @@ -0,0 +1,60 @@ + + + +basic_deadline_timer::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform a blocking wait on the timer. +

+
void wait();
+
+

+ This function is used to wait for the timer to expire. This function + blocks and does not return until the timer has expired. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer/wait/overload2.html b/include/asio/doc/asio/reference/basic_deadline_timer/wait/overload2.html new file mode 100644 index 0000000..530b5f9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer/wait/overload2.html @@ -0,0 +1,61 @@ + + + +basic_deadline_timer::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform a blocking wait on the timer. +

+
void wait(
+    asio::error_code & ec);
+
+

+ This function is used to wait for the timer to expire. This function + blocks and does not return until the timer has expired. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer__rebind_executor.html b/include/asio/doc/asio/reference/basic_deadline_timer__rebind_executor.html new file mode 100644 index 0000000..96f8989 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_deadline_timer::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the timer type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The timer type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_deadline_timer__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_deadline_timer__rebind_executor/other.html new file mode 100644 index 0000000..b778968 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_deadline_timer__rebind_executor/other.html @@ -0,0 +1,395 @@ + + + +basic_deadline_timer::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + timer type when rebound to the specified executor. +

+
typedef basic_deadline_timer< Time, TimeTraits, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ duration_type +

+
+

+ The duration type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_type +

+
+

+ The time type. +

+
+

+ traits_type +

+
+

+ The time traits type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_deadline_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a + particular expiry time relative to now.
—
Move-construct + a basic_deadline_timer from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +

+
+

+ expires_at +

+
+

+ Get the timer's expiry time as an absolute time.
—
+ Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ Get the timer's expiry time relative to now.
—
Set + the timer's expiry time relative to now. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_deadline_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_deadline_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_deadline_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A deadline timer is always in one of two states: "expired" or + "not expired". If the wait() or async_wait() + function is called on an expired timer, the wait operation will complete + immediately. +

+

+ Most applications will use the deadline_timer + typedef. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait: +

+
// Construct a timer without setting an expiry time.
+asio::deadline_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_from_now(boost::posix_time::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait: +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::deadline_timer timer(my_context,
+    boost::posix_time::time_from_string("2005-12-07 23:59:59.000"));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active deadline_timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the + action associated with the timer is performed only once, use something + like this: used: +

+
void on_some_event()
+{
+  if (my_timer.expires_from_now(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_deadline_timer::expires_from_now() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+
+ + Requirements +
+

+ Header: asio/basic_deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object.html b/include/asio/doc/asio/reference/basic_io_object.html new file mode 100644 index 0000000..117554c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object.html @@ -0,0 +1,271 @@ + + + +basic_io_object + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Base class for all I/O objects. +

+
template<
+    typename IoObjectService>
+class basic_io_object
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ implementation_type +

+
+

+ The underlying implementation type of I/O object. +

+
+

+ service_type +

+
+

+ The type of the service that will be used to provide I/O operations. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_io_context +

+
+

+ (Deprecated: Use get_executor().) Get the io_context associated + with the object. +

+
+

+ get_io_service +

+
+

+ (Deprecated: Use get_executor().) Get the io_context associated + with the object. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_io_object [constructor] +

+
+

+ Construct a basic_io_object.
—
Move-construct a basic_io_object. +
—
Perform a converting move-construction of a basic_io_object. +

+
+

+ get_implementation +

+
+

+ Get the underlying implementation of the I/O object. +

+
+

+ get_service +

+
+

+ Get the service associated with the I/O object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_io_object. +

+
+

+ ~basic_io_object [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Remarks +
+

+ All I/O objects are non-copyable. However, when using C++0x, certain I/O + objects do support move construction and move assignment. +

+
+ + Requirements +
+

+ Header: asio/basic_io_object.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/_basic_io_object.html b/include/asio/doc/asio/reference/basic_io_object/_basic_io_object.html new file mode 100644 index 0000000..9c48a5e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/_basic_io_object.html @@ -0,0 +1,49 @@ + + + +basic_io_object::~basic_io_object + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~basic_io_object();
+
+

+ Performs: +

+
get_service().destroy(get_implementation());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/basic_io_object.html b/include/asio/doc/asio/reference/basic_io_object/basic_io_object.html new file mode 100644 index 0000000..f24e43c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/basic_io_object.html @@ -0,0 +1,63 @@ + + + +basic_io_object::basic_io_object + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_io_object. +

+
explicit basic_io_object(
+    asio::io_context & io_context);
+  » more...
+
+

+ Move-construct a basic_io_object. +

+
basic_io_object(
+    basic_io_object && other);
+  » more...
+
+

+ Perform a converting move-construction of a basic_io_object. +

+
template<
+    typename IoObjectService1>
+basic_io_object(
+    IoObjectService1 & other_service,
+    typename IoObjectService1::implementation_type & other_implementation);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload1.html b/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload1.html new file mode 100644 index 0000000..b34ea96 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload1.html @@ -0,0 +1,49 @@ + + + +basic_io_object::basic_io_object (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_io_object. +

+
basic_io_object(
+    asio::io_context & io_context);
+
+

+ Performs: +

+
get_service().construct(get_implementation());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload2.html b/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload2.html new file mode 100644 index 0000000..b1d5776 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload2.html @@ -0,0 +1,57 @@ + + + +basic_io_object::basic_io_object (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_io_object. +

+
basic_io_object(
+    basic_io_object && other);
+
+

+ Performs: +

+
get_service().move_construct(
+    get_implementation(), other.get_implementation());
+
+
+ + Remarks +
+

+ Available only for services that support movability, +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload3.html b/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload3.html new file mode 100644 index 0000000..f339a82 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/basic_io_object/overload3.html @@ -0,0 +1,47 @@ + + + +basic_io_object::basic_io_object (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform a converting move-construction of a basic_io_object. +

+
template<
+    typename IoObjectService1>
+basic_io_object(
+    IoObjectService1 & other_service,
+    typename IoObjectService1::implementation_type & other_implementation);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/executor_type.html b/include/asio/doc/asio/reference/basic_io_object/executor_type.html new file mode 100644 index 0000000..907c978 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_io_object::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef asio::io_context::executor_type executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_io_object.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_executor.html b/include/asio/doc/asio/reference/basic_io_object/get_executor.html new file mode 100644 index 0000000..f3b317c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_executor.html @@ -0,0 +1,44 @@ + + + +basic_io_object::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_implementation.html b/include/asio/doc/asio/reference/basic_io_object/get_implementation.html new file mode 100644 index 0000000..86dea88 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_implementation.html @@ -0,0 +1,48 @@ + + + +basic_io_object::get_implementation + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the underlying implementation of the I/O object. +

+
implementation_type & get_implementation();
+  » more...
+
+const implementation_type & get_implementation() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_implementation/overload1.html b/include/asio/doc/asio/reference/basic_io_object/get_implementation/overload1.html new file mode 100644 index 0000000..dd595dc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_implementation/overload1.html @@ -0,0 +1,43 @@ + + + +basic_io_object::get_implementation (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying implementation of the I/O object. +

+
implementation_type & get_implementation();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_implementation/overload2.html b/include/asio/doc/asio/reference/basic_io_object/get_implementation/overload2.html new file mode 100644 index 0000000..129c56c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_implementation/overload2.html @@ -0,0 +1,43 @@ + + + +basic_io_object::get_implementation (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying implementation of the I/O object. +

+
const implementation_type & get_implementation() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_io_context.html b/include/asio/doc/asio/reference/basic_io_object/get_io_context.html new file mode 100644 index 0000000..934ecdb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_io_context.html @@ -0,0 +1,59 @@ + + + +basic_io_object::get_io_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use get_executor().) Get the io_context + associated with the object. +

+
asio::io_context & get_io_context();
+
+

+ This function may be used to obtain the io_context + object that the I/O object uses to dispatch handlers for asynchronous operations. +

+
+ + Return + Value +
+

+ A reference to the io_context + object that the I/O object will use to dispatch handlers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_io_service.html b/include/asio/doc/asio/reference/basic_io_object/get_io_service.html new file mode 100644 index 0000000..41c9820 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_io_service.html @@ -0,0 +1,59 @@ + + + +basic_io_object::get_io_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use get_executor().) Get the io_context + associated with the object. +

+
asio::io_context & get_io_service();
+
+

+ This function may be used to obtain the io_context + object that the I/O object uses to dispatch handlers for asynchronous operations. +

+
+ + Return + Value +
+

+ A reference to the io_context + object that the I/O object will use to dispatch handlers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_service.html b/include/asio/doc/asio/reference/basic_io_object/get_service.html new file mode 100644 index 0000000..6ffd461 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_service.html @@ -0,0 +1,48 @@ + + + +basic_io_object::get_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the service associated with the I/O object. +

+
service_type & get_service();
+  » more...
+
+const service_type & get_service() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_service/overload1.html b/include/asio/doc/asio/reference/basic_io_object/get_service/overload1.html new file mode 100644 index 0000000..93568bf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_service/overload1.html @@ -0,0 +1,43 @@ + + + +basic_io_object::get_service (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the service associated with the I/O object. +

+
service_type & get_service();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/get_service/overload2.html b/include/asio/doc/asio/reference/basic_io_object/get_service/overload2.html new file mode 100644 index 0000000..a1541a9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/get_service/overload2.html @@ -0,0 +1,43 @@ + + + +basic_io_object::get_service (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the service associated with the I/O object. +

+
const service_type & get_service() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/implementation_type.html b/include/asio/doc/asio/reference/basic_io_object/implementation_type.html new file mode 100644 index 0000000..729d749 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/implementation_type.html @@ -0,0 +1,54 @@ + + + +basic_io_object::implementation_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + underlying implementation type of I/O object. +

+
typedef service_type::implementation_type implementation_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_io_object.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/operator_eq_.html b/include/asio/doc/asio/reference/basic_io_object/operator_eq_.html new file mode 100644 index 0000000..9c5f6ea --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/operator_eq_.html @@ -0,0 +1,58 @@ + + + +basic_io_object::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_io_object. +

+
basic_io_object & operator=(
+    basic_io_object && other);
+
+

+ Performs: +

+
get_service().move_assign(get_implementation(),
+    other.get_service(), other.get_implementation());
+
+
+ + Remarks +
+

+ Available only for services that support movability, +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_io_object/service_type.html b/include/asio/doc/asio/reference/basic_io_object/service_type.html new file mode 100644 index 0000000..00c6f41 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_io_object/service_type.html @@ -0,0 +1,54 @@ + + + +basic_io_object::service_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the service that will be used to provide I/O operations. +

+
typedef IoObjectService service_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_io_object.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket.html b/include/asio/doc/asio/reference/basic_raw_socket.html new file mode 100644 index 0000000..da3c842 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket.html @@ -0,0 +1,917 @@ + + + +basic_raw_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides raw-oriented socket functionality. +

+
template<
+    typename Protocol,
+    typename Executor>
+class basic_raw_socket :
+  public basic_socket< Protocol, Executor >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close if + unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_raw_socket [constructor] +

+
+

+ Construct a basic_raw_socket without opening it.
—
+ Construct and open a basic_raw_socket.
—
Construct + a basic_raw_socket, opening it and binding it to the given local + endpoint.
—
Construct a basic_raw_socket on an existing + native socket.
—
Move-construct a basic_raw_socket + from another.
—
Move-construct a basic_raw_socket from + a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets the + non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_raw_socket from another.
—
Move-assign + a basic_raw_socket from a socket of another protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive raw data with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send raw data to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, or + to have pending error conditions. +

+
+

+ ~basic_raw_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length of + the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_raw_socket + class template provides asynchronous and blocking raw-oriented socket functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/_basic_raw_socket.html b/include/asio/doc/asio/reference/basic_raw_socket/_basic_raw_socket.html new file mode 100644 index 0000000..e635c67 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/_basic_raw_socket.html @@ -0,0 +1,48 @@ + + + +basic_raw_socket::~basic_raw_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the socket. +

+
~basic_raw_socket();
+
+

+ This function destroys the socket, cancelling any outstanding asynchronous + operations associated with the socket as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/assign.html b/include/asio/doc/asio/reference/basic_raw_socket/assign.html new file mode 100644 index 0000000..1cf2bf4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/assign.html @@ -0,0 +1,53 @@ + + + +basic_raw_socket::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign an existing + native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/assign/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/assign/overload1.html new file mode 100644 index 0000000..be634d3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/assign/overload1.html @@ -0,0 +1,48 @@ + + + +basic_raw_socket::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/assign/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/assign/overload2.html new file mode 100644 index 0000000..aa38f67 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/assign/overload2.html @@ -0,0 +1,49 @@ + + + +basic_raw_socket::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_connect.html b/include/asio/doc/asio/reference/basic_raw_socket/async_connect.html new file mode 100644 index 0000000..b9bc37d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_connect.html @@ -0,0 +1,111 @@ + + + +basic_raw_socket::async_connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Start + an asynchronous connect. +

+
template<
+    typename ConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    const endpoint_type & peer_endpoint,
+    ConnectHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously connect a socket to the specified + remote endpoint. The function call always returns immediately. +

+

+ The socket is automatically opened if it is not already open. If the connect + fails, and the socket was automatically opened, the socket is not returned + to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. Copies + will be made of the endpoint object as required. +

+
handler
+
+

+ The handler to be called when the connection operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void connect_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Connect succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.async_connect(endpoint, connect_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_receive.html b/include/asio/doc/asio/reference/basic_raw_socket/async_receive.html new file mode 100644 index 0000000..925282d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_receive.html @@ -0,0 +1,59 @@ + + + +basic_raw_socket::async_receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous receive on a connected socket. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_receive/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/async_receive/overload1.html new file mode 100644 index 0000000..85e7266 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_receive/overload1.html @@ -0,0 +1,111 @@ + + + +basic_raw_socket::async_receive (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive on a connected socket. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the raw socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_receive operation can only be used with a connected socket. + Use the async_receive_from function to receive data on an unconnected + raw socket. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_receive/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/async_receive/overload2.html new file mode 100644 index 0000000..f56e3b1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_receive/overload2.html @@ -0,0 +1,101 @@ + + + +basic_raw_socket::async_receive (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive on a connected socket. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the raw socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_receive operation can only be used with a connected socket. + Use the async_receive_from function to receive data on an unconnected + raw socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from.html b/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from.html new file mode 100644 index 0000000..c800752 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from.html @@ -0,0 +1,61 @@ + + + +basic_raw_socket::async_receive_from + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from/overload1.html new file mode 100644 index 0000000..5d87b50 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from/overload1.html @@ -0,0 +1,111 @@ + + + +basic_raw_socket::async_receive_from (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive raw data. The function + call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the data. Ownership of the sender_endpoint object is retained + by the caller, which must guarantee that it is valid until the + handler is called. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive_from(
+    asio::buffer(data, size), 0, sender_endpoint, handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from/overload2.html new file mode 100644 index 0000000..0c46fee --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_receive_from/overload2.html @@ -0,0 +1,100 @@ + + + +basic_raw_socket::async_receive_from (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive raw data. The function + call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the data. Ownership of the sender_endpoint object is retained + by the caller, which must guarantee that it is valid until the + handler is called. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_send.html b/include/asio/doc/asio/reference/basic_raw_socket/async_send.html new file mode 100644 index 0000000..a57c90f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_send.html @@ -0,0 +1,59 @@ + + + +basic_raw_socket::async_send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous send on a connected socket. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_send/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/async_send/overload1.html new file mode 100644 index 0000000..80ebdf9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_send/overload1.html @@ -0,0 +1,110 @@ + + + +basic_raw_socket::async_send (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send on a connected socket. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to send data on the raw socket. The function call + will block until the data has been sent successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_send operation can only be used with a connected socket. Use + the async_send_to function to send data on an unconnected raw socket. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.async_send(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_send/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/async_send/overload2.html new file mode 100644 index 0000000..ce4985d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_send/overload2.html @@ -0,0 +1,100 @@ + + + +basic_raw_socket::async_send (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send on a connected socket. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to send data on the raw socket. The function call + will block until the data has been sent successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The async_send operation can only be used with a connected socket. Use + the async_send_to function to send data on an unconnected raw socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_send_to.html b/include/asio/doc/asio/reference/basic_raw_socket/async_send_to.html new file mode 100644 index 0000000..681979e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_send_to.html @@ -0,0 +1,61 @@ + + + +basic_raw_socket::async_send_to + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_send_to/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/async_send_to/overload1.html new file mode 100644 index 0000000..b0091d4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_send_to/overload1.html @@ -0,0 +1,111 @@ + + + +basic_raw_socket::async_send_to (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send raw data to the specified + remote endpoint. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
destination
+

+ The remote endpoint to which the data will be sent. Copies will + be made of the endpoint as required. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
asio::ip::udp::endpoint destination(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.async_send_to(
+    asio::buffer(data, size), destination, handler);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_send_to/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/async_send_to/overload2.html new file mode 100644 index 0000000..209f94d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_send_to/overload2.html @@ -0,0 +1,98 @@ + + + +basic_raw_socket::async_send_to (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send raw data to the specified + remote endpoint. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
destination
+

+ The remote endpoint to which the data will be sent. Copies will + be made of the endpoint as required. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/async_wait.html b/include/asio/doc/asio/reference/basic_raw_socket/async_wait.html new file mode 100644 index 0000000..5201ce7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/async_wait.html @@ -0,0 +1,105 @@ + + + +basic_raw_socket::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Asynchronously + wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+...
+socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/at_mark.html b/include/asio/doc/asio/reference/basic_raw_socket/at_mark.html new file mode 100644 index 0000000..5e80d90 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/at_mark.html @@ -0,0 +1,49 @@ + + + +basic_raw_socket::at_mark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+  » more...
+
+bool at_mark(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/at_mark/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/at_mark/overload1.html new file mode 100644 index 0000000..6c3d9c4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/at_mark/overload1.html @@ -0,0 +1,71 @@ + + + +basic_raw_socket::at_mark (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/at_mark/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/at_mark/overload2.html new file mode 100644 index 0000000..40e69fc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/at_mark/overload2.html @@ -0,0 +1,72 @@ + + + +basic_raw_socket::at_mark (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark(
+    asio::error_code & ec) const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/available.html b/include/asio/doc/asio/reference/basic_raw_socket/available.html new file mode 100644 index 0000000..90c93c2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/available.html @@ -0,0 +1,49 @@ + + + +basic_raw_socket::available + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the number of bytes available for reading. +

+
std::size_t available() const;
+  » more...
+
+std::size_t available(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/available/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/available/overload1.html new file mode 100644 index 0000000..061d550 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/available/overload1.html @@ -0,0 +1,72 @@ + + + +basic_raw_socket::available (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available() const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/available/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/available/overload2.html new file mode 100644 index 0000000..36cdf8c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/available/overload2.html @@ -0,0 +1,73 @@ + + + +basic_raw_socket::available (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available(
+    asio::error_code & ec) const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket.html new file mode 100644 index 0000000..44949aa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket.html @@ -0,0 +1,126 @@ + + + +basic_raw_socket::basic_raw_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_raw_socket + without opening it. +

+
explicit basic_raw_socket(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_raw_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct and open a basic_raw_socket. +

+
basic_raw_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_raw_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_raw_socket, + opening it and binding it to the given local endpoint. +

+
basic_raw_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_raw_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_raw_socket + on an existing native socket. +

+
basic_raw_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_raw_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_raw_socket + from another. +

+
basic_raw_socket(
+    basic_raw_socket && other);
+  » more...
+
+

+ Move-construct a basic_raw_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_raw_socket(
+    basic_raw_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload1.html new file mode 100644 index 0000000..838e71f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload1.html @@ -0,0 +1,63 @@ + + + +basic_raw_socket::basic_raw_socket (1 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_raw_socket + without opening it. +

+
basic_raw_socket(
+    const executor_type & ex);
+
+

+ This constructor creates a raw socket without opening it. The open() + function must be called before data can be sent or received on the socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload10.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload10.html new file mode 100644 index 0000000..123b0ae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload10.html @@ -0,0 +1,75 @@ + + + +basic_raw_socket::basic_raw_socket (10 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_raw_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_raw_socket(
+    basic_raw_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+
+

+ This constructor moves a raw socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_raw_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_raw_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload2.html new file mode 100644 index 0000000..10c4835 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload2.html @@ -0,0 +1,67 @@ + + + +basic_raw_socket::basic_raw_socket (2 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_raw_socket + without opening it. +

+
template<
+    typename ExecutionContext>
+basic_raw_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a raw socket without opening it. The open() + function must be called before data can be sent or received on the socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload3.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload3.html new file mode 100644 index 0000000..d59ee51 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload3.html @@ -0,0 +1,79 @@ + + + +basic_raw_socket::basic_raw_socket (3 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_raw_socket. +

+
basic_raw_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+
+

+ This constructor creates and opens a raw socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload4.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload4.html new file mode 100644 index 0000000..723681d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload4.html @@ -0,0 +1,83 @@ + + + +basic_raw_socket::basic_raw_socket (4 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_raw_socket. +

+
template<
+    typename ExecutionContext>
+basic_raw_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates and opens a raw socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload5.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload5.html new file mode 100644 index 0000000..c0ac9fc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload5.html @@ -0,0 +1,83 @@ + + + +basic_raw_socket::basic_raw_socket (5 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_raw_socket, + opening it and binding it to the given local endpoint. +

+
basic_raw_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+
+

+ This constructor creates a raw socket and automatically opens it bound + to the specified endpoint on the local machine. The protocol used is + the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the raw socket will be + bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload6.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload6.html new file mode 100644 index 0000000..8718ab1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload6.html @@ -0,0 +1,87 @@ + + + +basic_raw_socket::basic_raw_socket (6 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_raw_socket, + opening it and binding it to the given local endpoint. +

+
template<
+    typename ExecutionContext>
+basic_raw_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a raw socket and automatically opens it bound + to the specified endpoint on the local machine. The protocol used is + the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the raw socket will be + bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload7.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload7.html new file mode 100644 index 0000000..658acc8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload7.html @@ -0,0 +1,86 @@ + + + +basic_raw_socket::basic_raw_socket (7 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_raw_socket + on an existing native socket. +

+
basic_raw_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+

+ This constructor creates a raw socket object to hold an existing native + socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload8.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload8.html new file mode 100644 index 0000000..902d189 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload8.html @@ -0,0 +1,90 @@ + + + +basic_raw_socket::basic_raw_socket (8 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_raw_socket + on an existing native socket. +

+
template<
+    typename ExecutionContext>
+basic_raw_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a raw socket object to hold an existing native + socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload9.html b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload9.html new file mode 100644 index 0000000..442aae0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/basic_raw_socket/overload9.html @@ -0,0 +1,71 @@ + + + +basic_raw_socket::basic_raw_socket (9 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_raw_socket + from another. +

+
basic_raw_socket(
+    basic_raw_socket && other);
+
+

+ This constructor moves a raw socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_raw_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_raw_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/bind.html b/include/asio/doc/asio/reference/basic_raw_socket/bind.html new file mode 100644 index 0000000..999faae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/bind.html @@ -0,0 +1,51 @@ + + + +basic_raw_socket::bind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bind the socket + to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+  » more...
+
+void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/bind/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/bind/overload1.html new file mode 100644 index 0000000..357f121 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/bind/overload1.html @@ -0,0 +1,86 @@ + + + +basic_raw_socket::bind (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/bind/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/bind/overload2.html new file mode 100644 index 0000000..6d49f48 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/bind/overload2.html @@ -0,0 +1,83 @@ + + + +basic_raw_socket::bind (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+asio::error_code ec;
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/broadcast.html b/include/asio/doc/asio/reference/basic_raw_socket/broadcast.html new file mode 100644 index 0000000..0a12521 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/broadcast.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to permit sending of broadcast messages. +

+
typedef implementation_defined broadcast;
+
+

+ Implements the SOL_SOCKET/SO_BROADCAST socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/bytes_readable.html b/include/asio/doc/asio/reference/basic_raw_socket/bytes_readable.html new file mode 100644 index 0000000..a4ce2ac --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/bytes_readable.html @@ -0,0 +1,70 @@ + + + +basic_raw_socket::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::bytes_readable command(true);
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/cancel.html b/include/asio/doc/asio/reference/basic_raw_socket/cancel.html new file mode 100644 index 0000000..0157256 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/cancel.html @@ -0,0 +1,49 @@ + + + +basic_raw_socket::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel all + asynchronous operations associated with the socket. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/cancel/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/cancel/overload1.html new file mode 100644 index 0000000..de3a659 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/cancel/overload1.html @@ -0,0 +1,104 @@ + + + +basic_raw_socket::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/cancel/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/cancel/overload2.html new file mode 100644 index 0000000..e76a643 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/cancel/overload2.html @@ -0,0 +1,105 @@ + + + +basic_raw_socket::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/close.html b/include/asio/doc/asio/reference/basic_raw_socket/close.html new file mode 100644 index 0000000..2c17bda --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/close.html @@ -0,0 +1,48 @@ + + + +basic_raw_socket::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close the socket. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/close/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/close/overload1.html new file mode 100644 index 0000000..debf427 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/close/overload1.html @@ -0,0 +1,73 @@ + + + +basic_raw_socket::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close();
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. Note that, even if the function indicates an + error, the underlying descriptor is closed. +

+
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/close/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/close/overload2.html new file mode 100644 index 0000000..10c579e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/close/overload2.html @@ -0,0 +1,87 @@ + + + +basic_raw_socket::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. Note that, even if + the function indicates an error, the underlying descriptor is closed. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.close(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/connect.html b/include/asio/doc/asio/reference/basic_raw_socket/connect.html new file mode 100644 index 0000000..9dbc015 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/connect.html @@ -0,0 +1,51 @@ + + + +basic_raw_socket::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Connect the + socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+  » more...
+
+void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/connect/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/connect/overload1.html new file mode 100644 index 0000000..70d4beb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/connect/overload1.html @@ -0,0 +1,92 @@ + + + +basic_raw_socket::connect (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.connect(endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/connect/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/connect/overload2.html new file mode 100644 index 0000000..b4a523e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/connect/overload2.html @@ -0,0 +1,89 @@ + + + +basic_raw_socket::connect (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+asio::error_code ec;
+socket.connect(endpoint, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/debug.html b/include/asio/doc/asio/reference/basic_raw_socket/debug.html new file mode 100644 index 0000000..95ea12d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/debug.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::debug + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket option + to enable socket-level debugging. +

+
typedef implementation_defined debug;
+
+

+ Implements the SOL_SOCKET/SO_DEBUG socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/do_not_route.html b/include/asio/doc/asio/reference/basic_raw_socket/do_not_route.html new file mode 100644 index 0000000..a5eff85 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/do_not_route.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to prevent routing, use local interfaces only. +

+
typedef implementation_defined do_not_route;
+
+

+ Implements the SOL_SOCKET/SO_DONTROUTE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/enable_connection_aborted.html b/include/asio/doc/asio/reference/basic_raw_socket/enable_connection_aborted.html new file mode 100644 index 0000000..1d5a1a3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/enable_connection_aborted.html @@ -0,0 +1,83 @@ + + + +basic_raw_socket::enable_connection_aborted + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to report aborted connections on accept. +

+
typedef implementation_defined enable_connection_aborted;
+
+

+ Implements a custom socket option that determines whether or not an accept + operation is permitted to fail with asio::error::connection_aborted. + By default the option is false. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/endpoint_type.html b/include/asio/doc/asio/reference/basic_raw_socket/endpoint_type.html new file mode 100644 index 0000000..46a6a57 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_raw_socket::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/executor_type.html b/include/asio/doc/asio/reference/basic_raw_socket/executor_type.html new file mode 100644 index 0000000..a011d59 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_raw_socket::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/get_executor.html b/include/asio/doc/asio/reference/basic_raw_socket/get_executor.html new file mode 100644 index 0000000..1b7e559 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/get_executor.html @@ -0,0 +1,47 @@ + + + +basic_raw_socket::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/get_option.html b/include/asio/doc/asio/reference/basic_raw_socket/get_option.html new file mode 100644 index 0000000..5839976 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/get_option.html @@ -0,0 +1,55 @@ + + + +basic_raw_socket::get_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+  » more...
+
+template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/get_option/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/get_option/overload1.html new file mode 100644 index 0000000..194ee93 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/get_option/overload1.html @@ -0,0 +1,91 @@ + + + +basic_raw_socket::get_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/get_option/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/get_option/overload2.html new file mode 100644 index 0000000..ddde596 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/get_option/overload2.html @@ -0,0 +1,88 @@ + + + +basic_raw_socket::get_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+asio::error_code ec;
+socket.get_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/io_control.html b/include/asio/doc/asio/reference/basic_raw_socket/io_control.html new file mode 100644 index 0000000..c2a8428 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/io_control.html @@ -0,0 +1,55 @@ + + + +basic_raw_socket::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/io_control/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/io_control/overload1.html new file mode 100644 index 0000000..8c5a49e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/io_control/overload1.html @@ -0,0 +1,91 @@ + + + +basic_raw_socket::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/io_control/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/io_control/overload2.html new file mode 100644 index 0000000..55e9b7e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/io_control/overload2.html @@ -0,0 +1,88 @@ + + + +basic_raw_socket::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+asio::error_code ec;
+socket.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/is_open.html b/include/asio/doc/asio/reference/basic_raw_socket/is_open.html new file mode 100644 index 0000000..5c55f26 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/is_open.html @@ -0,0 +1,47 @@ + + + +basic_raw_socket::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Determine + whether the socket is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/keep_alive.html b/include/asio/doc/asio/reference/basic_raw_socket/keep_alive.html new file mode 100644 index 0000000..6ea9a7a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/keep_alive.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::keep_alive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to send keep-alives. +

+
typedef implementation_defined keep_alive;
+
+

+ Implements the SOL_SOCKET/SO_KEEPALIVE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/linger.html b/include/asio/doc/asio/reference/basic_raw_socket/linger.html new file mode 100644 index 0000000..1ec6fcb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/linger.html @@ -0,0 +1,82 @@ + + + +basic_raw_socket::linger + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket option + to specify whether the socket lingers on close if unsent data is present. +

+
typedef implementation_defined linger;
+
+

+ Implements the SOL_SOCKET/SO_LINGER socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option(true, 30);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option;
+socket.get_option(option);
+bool is_set = option.enabled();
+unsigned short timeout = option.timeout();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint.html b/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint.html new file mode 100644 index 0000000..e22084e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_raw_socket::local_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+  » more...
+
+endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint/overload1.html new file mode 100644 index 0000000..97101ff --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_raw_socket::local_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint/overload2.html new file mode 100644 index 0000000..907246f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/local_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_raw_socket::local_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. Returns a + default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer.html b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer.html new file mode 100644 index 0000000..2298be3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer.html @@ -0,0 +1,51 @@ + + + +basic_raw_socket::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer/overload1.html new file mode 100644 index 0000000..9a1d97c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer/overload1.html @@ -0,0 +1,60 @@ + + + +basic_raw_socket::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer/overload2.html new file mode 100644 index 0000000..c6338ac --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer/overload2.html @@ -0,0 +1,60 @@ + + + +basic_raw_socket::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer_type.html b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer_type.html new file mode 100644 index 0000000..419bbfd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/lowest_layer_type.html @@ -0,0 +1,849 @@ + + + +basic_raw_socket::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +A + basic_socket + is always the lowest layer. +

+
typedef basic_socket< Protocol, Executor > lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_socket [constructor] +

+
+

+ Construct a basic_socket without opening it.
—
Construct + and open a basic_socket.
—
Construct a basic_socket, + opening it and binding it to the given local endpoint.
+ —
Construct a basic_socket on an existing native socket. +
—
Move-construct a basic_socket from another.
+ —
Move-construct a basic_socket from a socket of another + protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket from another.
—
Move-assign + a basic_socket from a socket of another protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_socket [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket + class template provides functionality that is common to both stream-oriented + and datagram-oriented sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/max_connections.html b/include/asio/doc/asio/reference/basic_raw_socket/max_connections.html new file mode 100644 index 0000000..e497c65 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/max_connections.html @@ -0,0 +1,48 @@ + + + +basic_raw_socket::max_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +(Deprecated: + Use max_listen_connections.) The maximum length of the queue of pending + incoming connections. +

+
static const int max_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/max_listen_connections.html b/include/asio/doc/asio/reference/basic_raw_socket/max_listen_connections.html new file mode 100644 index 0000000..051f735 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/max_listen_connections.html @@ -0,0 +1,47 @@ + + + +basic_raw_socket::max_listen_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +The + maximum length of the queue of pending incoming connections. +

+
static const int max_listen_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/message_do_not_route.html b/include/asio/doc/asio/reference/basic_raw_socket/message_do_not_route.html new file mode 100644 index 0000000..f6e6081 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/message_do_not_route.html @@ -0,0 +1,47 @@ + + + +basic_raw_socket::message_do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specify + that the data should not be subject to routing. +

+
static const int message_do_not_route = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/message_end_of_record.html b/include/asio/doc/asio/reference/basic_raw_socket/message_end_of_record.html new file mode 100644 index 0000000..8d20dfc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/message_end_of_record.html @@ -0,0 +1,47 @@ + + + +basic_raw_socket::message_end_of_record + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specifies + that the data marks the end of a record. +

+
static const int message_end_of_record = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/message_flags.html b/include/asio/doc/asio/reference/basic_raw_socket/message_flags.html new file mode 100644 index 0000000..e0164f4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/message_flags.html @@ -0,0 +1,57 @@ + + + +basic_raw_socket::message_flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Bitmask + type for flags that can be passed to send and receive operations. +

+
typedef int message_flags;
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/message_out_of_band.html b/include/asio/doc/asio/reference/basic_raw_socket/message_out_of_band.html new file mode 100644 index 0000000..6e7813a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/message_out_of_band.html @@ -0,0 +1,47 @@ + + + +basic_raw_socket::message_out_of_band + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Process + out-of-band data. +

+
static const int message_out_of_band = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/message_peek.html b/include/asio/doc/asio/reference/basic_raw_socket/message_peek.html new file mode 100644 index 0000000..9d353bc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/message_peek.html @@ -0,0 +1,47 @@ + + + +basic_raw_socket::message_peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Peek + at incoming data without removing it from the input queue. +

+
static const int message_peek = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/native_handle.html b/include/asio/doc/asio/reference/basic_raw_socket/native_handle.html new file mode 100644 index 0000000..68669d0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/native_handle.html @@ -0,0 +1,52 @@ + + + +basic_raw_socket::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the native socket representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + socket. This is intended to allow access to native socket functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/native_handle_type.html b/include/asio/doc/asio/reference/basic_raw_socket/native_handle_type.html new file mode 100644 index 0000000..ac29120 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/native_handle_type.html @@ -0,0 +1,54 @@ + + + +basic_raw_socket::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a socket. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking.html b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking.html new file mode 100644 index 0000000..14ae340 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_raw_socket::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload1.html new file mode 100644 index 0000000..d2ec0ec --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload1.html @@ -0,0 +1,145 @@ + + + +basic_raw_socket::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native socket. This mode has no effect on the behaviour of the socket + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying socket is in non-blocking mode and + direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the socket object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native socket. +

+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload2.html new file mode 100644 index 0000000..f55f524 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload2.html @@ -0,0 +1,158 @@ + + + +basic_raw_socket::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload3.html new file mode 100644 index 0000000..836be19 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/native_non_blocking/overload3.html @@ -0,0 +1,150 @@ + + + +basic_raw_socket::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/non_blocking.html b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking.html new file mode 100644 index 0000000..2ccfc44 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_raw_socket::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the socket. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload1.html new file mode 100644 index 0000000..b73ef9a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload1.html @@ -0,0 +1,65 @@ + + + +basic_raw_socket::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the socket. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the socket's synchronous operations will fail with + asio::error::would_block if they are unable to perform the + requested operation immediately. If false, synchronous operations + will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload2.html new file mode 100644 index 0000000..c28dd66 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload2.html @@ -0,0 +1,84 @@ + + + +basic_raw_socket::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload3.html new file mode 100644 index 0000000..a161a25 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/non_blocking/overload3.html @@ -0,0 +1,76 @@ + + + +basic_raw_socket::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/open.html b/include/asio/doc/asio/reference/basic_raw_socket/open.html new file mode 100644 index 0000000..5366f78 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/open.html @@ -0,0 +1,51 @@ + + + +basic_raw_socket::open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Open the socket + using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+  » more...
+
+void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/open/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/open/overload1.html new file mode 100644 index 0000000..abd880b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/open/overload1.html @@ -0,0 +1,83 @@ + + + +basic_raw_socket::open (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/open/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/open/overload2.html new file mode 100644 index 0000000..0061f7f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/open/overload2.html @@ -0,0 +1,80 @@ + + + +basic_raw_socket::open (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying which protocol is to be used. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::error_code ec;
+socket.open(asio::ip::tcp::v4(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_.html b/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_.html new file mode 100644 index 0000000..fd5f794 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_.html @@ -0,0 +1,58 @@ + + + +basic_raw_socket::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_raw_socket + from another. +

+
basic_raw_socket & operator=(
+    basic_raw_socket && other);
+  » more...
+
+

+ Move-assign a basic_raw_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_raw_socket & >::type operator=(
+    basic_raw_socket< Protocol1, Executor1 > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_/overload1.html new file mode 100644 index 0000000..2e97700 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_/overload1.html @@ -0,0 +1,71 @@ + + + +basic_raw_socket::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_raw_socket + from another. +

+
basic_raw_socket & operator=(
+    basic_raw_socket && other);
+
+

+ This assignment operator moves a raw socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_raw_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_raw_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_/overload2.html new file mode 100644 index 0000000..73d3bb0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/operator_eq_/overload2.html @@ -0,0 +1,74 @@ + + + +basic_raw_socket::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_raw_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_raw_socket & >::type operator=(
+    basic_raw_socket< Protocol1, Executor1 > && other);
+
+

+ This assignment operator moves a raw socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_raw_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_raw_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/out_of_band_inline.html b/include/asio/doc/asio/reference/basic_raw_socket/out_of_band_inline.html new file mode 100644 index 0000000..f2ed22f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/out_of_band_inline.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::out_of_band_inline + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for putting received out-of-band data inline. +

+
typedef implementation_defined out_of_band_inline;
+
+

+ Implements the SOL_SOCKET/SO_OOBINLINE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option;
+socket.get_option(option);
+bool value = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/protocol_type.html b/include/asio/doc/asio/reference/basic_raw_socket/protocol_type.html new file mode 100644 index 0000000..937e955 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_raw_socket::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive.html b/include/asio/doc/asio/reference/basic_raw_socket/receive.html new file mode 100644 index 0000000..371acc3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive.html @@ -0,0 +1,63 @@ + + + +basic_raw_socket::receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Receive some + data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/receive/overload1.html new file mode 100644 index 0000000..51e0896 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive/overload1.html @@ -0,0 +1,108 @@ + + + +basic_raw_socket::receive (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to receive data on the raw socket. The function + call will block until data has been received successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The receive operation can only be used with a connected socket. Use the + receive_from function to receive data on an unconnected raw socket. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.receive(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/receive/overload2.html new file mode 100644 index 0000000..5194422 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive/overload2.html @@ -0,0 +1,98 @@ + + + +basic_raw_socket::receive (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags);
+
+

+ This function is used to receive data on the raw socket. The function + call will block until data has been received successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The receive operation can only be used with a connected socket. Use the + receive_from function to receive data on an unconnected raw socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive/overload3.html b/include/asio/doc/asio/reference/basic_raw_socket/receive/overload3.html new file mode 100644 index 0000000..d0841ae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive/overload3.html @@ -0,0 +1,90 @@ + + + +basic_raw_socket::receive (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to receive data on the raw socket. The function + call will block until data has been received successfully or an error + occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Remarks +
+

+ The receive operation can only be used with a connected socket. Use the + receive_from function to receive data on an unconnected raw socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive_buffer_size.html b/include/asio/doc/asio/reference/basic_raw_socket/receive_buffer_size.html new file mode 100644 index 0000000..01c4928 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::receive_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive buffer size of a socket. +

+
typedef implementation_defined receive_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_RCVBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive_from.html b/include/asio/doc/asio/reference/basic_raw_socket/receive_from.html new file mode 100644 index 0000000..d7a1234 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive_from.html @@ -0,0 +1,66 @@ + + + +basic_raw_socket::receive_from + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Receive + raw data with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload1.html new file mode 100644 index 0000000..8c10feb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload1.html @@ -0,0 +1,107 @@ + + + +basic_raw_socket::receive_from (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive raw data with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint);
+
+

+ This function is used to receive raw data. The function call will block + until data has been received successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the data. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
asio::ip::udp::endpoint sender_endpoint;
+socket.receive_from(
+    asio::buffer(data, size), sender_endpoint);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload2.html new file mode 100644 index 0000000..fcdbf7c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload2.html @@ -0,0 +1,95 @@ + + + +basic_raw_socket::receive_from (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive raw data with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags);
+
+

+ This function is used to receive raw data. The function call will block + until data has been received successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the data. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload3.html b/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload3.html new file mode 100644 index 0000000..4cfe5cc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive_from/overload3.html @@ -0,0 +1,87 @@ + + + +basic_raw_socket::receive_from (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive raw data with the endpoint of the sender. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive_from(
+    const MutableBufferSequence & buffers,
+    endpoint_type & sender_endpoint,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to receive raw data. The function call will block + until data has been received successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
sender_endpoint
+

+ An endpoint object that receives the endpoint of the remote sender + of the data. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/receive_low_watermark.html b/include/asio/doc/asio/reference/basic_raw_socket/receive_low_watermark.html new file mode 100644 index 0000000..070e9b2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/receive_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::receive_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive low watermark. +

+
typedef implementation_defined receive_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_RCVLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/release.html b/include/asio/doc/asio/reference/basic_raw_socket/release.html new file mode 100644 index 0000000..ca89a68 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/release.html @@ -0,0 +1,49 @@ + + + +basic_raw_socket::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release ownership + of the underlying native socket. +

+
native_handle_type release();
+  » more...
+
+native_handle_type release(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/release/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/release/overload1.html new file mode 100644 index 0000000..0a66e8f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/release/overload1.html @@ -0,0 +1,74 @@ + + + +basic_raw_socket::release (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/release/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/release/overload2.html new file mode 100644 index 0000000..5fef965 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/release/overload2.html @@ -0,0 +1,75 @@ + + + +basic_raw_socket::release (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint.html b/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint.html new file mode 100644 index 0000000..833e2fa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_raw_socket::remote_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+  » more...
+
+endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint/overload1.html new file mode 100644 index 0000000..78b4977 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_raw_socket::remote_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint/overload2.html new file mode 100644 index 0000000..e7900e7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/remote_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_raw_socket::remote_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. Returns + a default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/reuse_address.html b/include/asio/doc/asio/reference/basic_raw_socket/reuse_address.html new file mode 100644 index 0000000..c975ed5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/reuse_address.html @@ -0,0 +1,82 @@ + + + +basic_raw_socket::reuse_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to allow the socket to be bound to an address that is already in + use. +

+
typedef implementation_defined reuse_address;
+
+

+ Implements the SOL_SOCKET/SO_REUSEADDR socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send.html b/include/asio/doc/asio/reference/basic_raw_socket/send.html new file mode 100644 index 0000000..4134356 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send.html @@ -0,0 +1,63 @@ + + + +basic_raw_socket::send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Send some data + on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/send/overload1.html new file mode 100644 index 0000000..aca7b5c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send/overload1.html @@ -0,0 +1,107 @@ + + + +basic_raw_socket::send (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to send data on the raw socket. The function call + will block until the data has been sent successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One ore more data buffers to be sent on the socket. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The send operation can only be used with a connected socket. Use the + send_to function to send data on an unconnected raw socket. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.send(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/send/overload2.html new file mode 100644 index 0000000..d3aef34 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send/overload2.html @@ -0,0 +1,97 @@ + + + +basic_raw_socket::send (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+
+

+ This function is used to send data on the raw socket. The function call + will block until the data has been sent successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One ore more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The send operation can only be used with a connected socket. Use the + send_to function to send data on an unconnected raw socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send/overload3.html b/include/asio/doc/asio/reference/basic_raw_socket/send/overload3.html new file mode 100644 index 0000000..7780f67 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send/overload3.html @@ -0,0 +1,89 @@ + + + +basic_raw_socket::send (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on a connected socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to send data on the raw socket. The function call + will block until the data has been sent successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Remarks +
+

+ The send operation can only be used with a connected socket. Use the + send_to function to send data on an unconnected raw socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send_buffer_size.html b/include/asio/doc/asio/reference/basic_raw_socket/send_buffer_size.html new file mode 100644 index 0000000..8a990ae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::send_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send buffer size of a socket. +

+
typedef implementation_defined send_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_SNDBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send_low_watermark.html b/include/asio/doc/asio/reference/basic_raw_socket/send_low_watermark.html new file mode 100644 index 0000000..f8ad342 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_raw_socket::send_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send low watermark. +

+
typedef implementation_defined send_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_SNDLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send_to.html b/include/asio/doc/asio/reference/basic_raw_socket/send_to.html new file mode 100644 index 0000000..da03bf4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send_to.html @@ -0,0 +1,66 @@ + + + +basic_raw_socket::send_to + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Send raw + data to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload1.html new file mode 100644 index 0000000..e6f4e59 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload1.html @@ -0,0 +1,107 @@ + + + +basic_raw_socket::send_to (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send raw data to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination);
+
+

+ This function is used to send raw data to the specified remote endpoint. + The function call will block until the data has been sent successfully + or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. +

+
destination
+

+ The remote endpoint to which the data will be sent. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
asio::ip::udp::endpoint destination(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.send_to(asio::buffer(data, size), destination);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload2.html new file mode 100644 index 0000000..4c9c394 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload2.html @@ -0,0 +1,95 @@ + + + +basic_raw_socket::send_to (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send raw data to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags);
+
+

+ This function is used to send raw data to the specified remote endpoint. + The function call will block until the data has been sent successfully + or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. +

+
destination
+

+ The remote endpoint to which the data will be sent. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload3.html b/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload3.html new file mode 100644 index 0000000..21df3ec --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/send_to/overload3.html @@ -0,0 +1,87 @@ + + + +basic_raw_socket::send_to (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send raw data to the specified endpoint. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send_to(
+    const ConstBufferSequence & buffers,
+    const endpoint_type & destination,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to send raw data to the specified remote endpoint. + The function call will block until the data has been sent successfully + or an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent to the remote endpoint. +

+
destination
+

+ The remote endpoint to which the data will be sent. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/set_option.html b/include/asio/doc/asio/reference/basic_raw_socket/set_option.html new file mode 100644 index 0000000..a2d5cdf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/set_option.html @@ -0,0 +1,55 @@ + + + +basic_raw_socket::set_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+  » more...
+
+template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/set_option/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/set_option/overload1.html new file mode 100644 index 0000000..915a56c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/set_option/overload1.html @@ -0,0 +1,90 @@ + + + +basic_raw_socket::set_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+socket.set_option(option);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/set_option/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/set_option/overload2.html new file mode 100644 index 0000000..2a0b1f7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/set_option/overload2.html @@ -0,0 +1,87 @@ + + + +basic_raw_socket::set_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+asio::error_code ec;
+socket.set_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/shutdown.html b/include/asio/doc/asio/reference/basic_raw_socket/shutdown.html new file mode 100644 index 0000000..d34500c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/shutdown.html @@ -0,0 +1,51 @@ + + + +basic_raw_socket::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+  » more...
+
+void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/shutdown/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/shutdown/overload1.html new file mode 100644 index 0000000..33d0f19 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/shutdown/overload1.html @@ -0,0 +1,88 @@ + + + +basic_raw_socket::shutdown (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.shutdown(asio::ip::tcp::socket::shutdown_send);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/shutdown/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/shutdown/overload2.html new file mode 100644 index 0000000..e50441a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/shutdown/overload2.html @@ -0,0 +1,85 @@ + + + +basic_raw_socket::shutdown (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/shutdown_type.html b/include/asio/doc/asio/reference/basic_raw_socket/shutdown_type.html new file mode 100644 index 0000000..534071d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/shutdown_type.html @@ -0,0 +1,73 @@ + + + +basic_raw_socket::shutdown_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Different + ways a socket may be shutdown. +

+
enum shutdown_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
shutdown_receive
+

+ Shutdown the receive side of the socket. +

+
shutdown_send
+

+ Shutdown the send side of the socket. +

+
shutdown_both
+

+ Shutdown both send and receive on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/wait.html b/include/asio/doc/asio/reference/basic_raw_socket/wait.html new file mode 100644 index 0000000..b49ae75 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/wait.html @@ -0,0 +1,51 @@ + + + +basic_raw_socket::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait for the socket + to become ready to read, ready to write, or to have pending error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/wait/overload1.html b/include/asio/doc/asio/reference/basic_raw_socket/wait/overload1.html new file mode 100644 index 0000000..9054fb3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/wait/overload1.html @@ -0,0 +1,76 @@ + + + +basic_raw_socket::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.wait(asio::ip::tcp::socket::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/wait/overload2.html b/include/asio/doc/asio/reference/basic_raw_socket/wait/overload2.html new file mode 100644 index 0000000..38e15f8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/wait/overload2.html @@ -0,0 +1,82 @@ + + + +basic_raw_socket::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.wait(asio::ip::tcp::socket::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket/wait_type.html b/include/asio/doc/asio/reference/basic_raw_socket/wait_type.html new file mode 100644 index 0000000..2d29984 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket/wait_type.html @@ -0,0 +1,76 @@ + + + +basic_raw_socket::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a socket to become ready to read. +

+
wait_write
+

+ Wait for a socket to become ready to write. +

+
wait_error
+

+ Wait for a socket to have error conditions pending. +

+
+
+

+ For use with basic_socket::wait() and basic_socket::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket__rebind_executor.html b/include/asio/doc/asio/reference/basic_raw_socket__rebind_executor.html new file mode 100644 index 0000000..a5e9680 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_raw_socket::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the socket type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The socket type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_raw_socket__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_raw_socket__rebind_executor/other.html new file mode 100644 index 0000000..3ce6850 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_raw_socket__rebind_executor/other.html @@ -0,0 +1,917 @@ + + + +basic_raw_socket::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + socket type when rebound to the specified executor. +

+
typedef basic_raw_socket< Protocol, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_raw_socket [constructor] +

+
+

+ Construct a basic_raw_socket without opening it.
—
+ Construct and open a basic_raw_socket.
—
Construct + a basic_raw_socket, opening it and binding it to the given local + endpoint.
—
Construct a basic_raw_socket on an existing + native socket.
—
Move-construct a basic_raw_socket + from another.
—
Move-construct a basic_raw_socket + from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_raw_socket from another.
—
Move-assign + a basic_raw_socket from a socket of another protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive raw data with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send raw data to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_raw_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_raw_socket + class template provides asynchronous and blocking raw-oriented socket functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_raw_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket.html b/include/asio/doc/asio/reference/basic_seq_packet_socket.html new file mode 100644 index 0000000..0769ded --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket.html @@ -0,0 +1,871 @@ + + + +basic_seq_packet_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides sequenced packet socket functionality. +

+
template<
+    typename Protocol,
+    typename Executor>
+class basic_seq_packet_socket :
+  public basic_socket< Protocol, Executor >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close if + unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_seq_packet_socket [constructor] +

+
+

+ Construct a basic_seq_packet_socket without opening it.
+ —
Construct and open a basic_seq_packet_socket.
—
+ Construct a basic_seq_packet_socket, opening it and binding it + to the given local endpoint.
—
Construct a basic_seq_packet_socket + on an existing native socket.
—
Move-construct a basic_seq_packet_socket + from another.
—
Move-construct a basic_seq_packet_socket + from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets the + non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_seq_packet_socket from another.
—
+ Move-assign a basic_seq_packet_socket from a socket of another + protocol type. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, or + to have pending error conditions. +

+
+

+ ~basic_seq_packet_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length of + the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_seq_packet_socket + class template provides asynchronous and blocking sequenced packet socket + functionality. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/_basic_seq_packet_socket.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/_basic_seq_packet_socket.html new file mode 100644 index 0000000..97cbb31 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/_basic_seq_packet_socket.html @@ -0,0 +1,48 @@ + + + +basic_seq_packet_socket::~basic_seq_packet_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the socket. +

+
~basic_seq_packet_socket();
+
+

+ This function destroys the socket, cancelling any outstanding asynchronous + operations associated with the socket as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/assign.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/assign.html new file mode 100644 index 0000000..b7b5562 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/assign.html @@ -0,0 +1,53 @@ + + + +basic_seq_packet_socket::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/assign/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/assign/overload1.html new file mode 100644 index 0000000..cc4356f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/assign/overload1.html @@ -0,0 +1,48 @@ + + + +basic_seq_packet_socket::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/assign/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/assign/overload2.html new file mode 100644 index 0000000..9a545bf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/assign/overload2.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/async_connect.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_connect.html new file mode 100644 index 0000000..b42f515 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_connect.html @@ -0,0 +1,111 @@ + + + +basic_seq_packet_socket::async_connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Start + an asynchronous connect. +

+
template<
+    typename ConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    const endpoint_type & peer_endpoint,
+    ConnectHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously connect a socket to the specified + remote endpoint. The function call always returns immediately. +

+

+ The socket is automatically opened if it is not already open. If the connect + fails, and the socket was automatically opened, the socket is not returned + to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. Copies + will be made of the endpoint object as required. +

+
handler
+
+

+ The handler to be called when the connection operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void connect_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Connect succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.async_connect(endpoint, connect_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive.html new file mode 100644 index 0000000..61bf6e0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive.html @@ -0,0 +1,61 @@ + + + +basic_seq_packet_socket::async_receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags & out_flags,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags in_flags,
+    socket_base::message_flags & out_flags,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive/overload1.html new file mode 100644 index 0000000..0336034 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive/overload1.html @@ -0,0 +1,111 @@ + + + +basic_seq_packet_socket::async_receive (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags & out_flags,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the sequenced + packet socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
out_flags
+

+ Once the asynchronous operation completes, contains flags associated + with the received data. For example, if the socket_base::message_end_of_record + bit is set then the received data marks the end of a record. The + caller must guarantee that the referenced variable remains valid + until the handler is called. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive(asio::buffer(data, size), out_flags, handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive/overload2.html new file mode 100644 index 0000000..4d5fbce --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_receive/overload2.html @@ -0,0 +1,118 @@ + + + +basic_seq_packet_socket::async_receive (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags in_flags,
+    socket_base::message_flags & out_flags,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the sequenced + data socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
in_flags
+

+ Flags specifying how the receive call is to be made. +

+
out_flags
+

+ Once the asynchronous operation completes, contains flags associated + with the received data. For example, if the socket_base::message_end_of_record + bit is set then the received data marks the end of a record. The + caller must guarantee that the referenced variable remains valid + until the handler is called. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive(
+    asio::buffer(data, size),
+    0, out_flags, handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/async_send.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_send.html new file mode 100644 index 0000000..e78149a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_send.html @@ -0,0 +1,108 @@ + + + +basic_seq_packet_socket::async_send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send data on the sequenced packet + socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. Although the buffers + object may be copied as necessary, ownership of the underlying memory + blocks is retained by the caller, which must guarantee that they + remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.async_send(asio::buffer(data, size), 0, handler);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/async_wait.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_wait.html new file mode 100644 index 0000000..dc9083a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/async_wait.html @@ -0,0 +1,105 @@ + + + +basic_seq_packet_socket::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Asynchronously + wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+...
+socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark.html new file mode 100644 index 0000000..580efe7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::at_mark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+  » more...
+
+bool at_mark(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark/overload1.html new file mode 100644 index 0000000..888c075 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark/overload1.html @@ -0,0 +1,71 @@ + + + +basic_seq_packet_socket::at_mark (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark/overload2.html new file mode 100644 index 0000000..a941a18 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/at_mark/overload2.html @@ -0,0 +1,72 @@ + + + +basic_seq_packet_socket::at_mark (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark(
+    asio::error_code & ec) const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/available.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/available.html new file mode 100644 index 0000000..957f1c4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/available.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::available + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the number of bytes available for reading. +

+
std::size_t available() const;
+  » more...
+
+std::size_t available(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/available/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/available/overload1.html new file mode 100644 index 0000000..abca371 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/available/overload1.html @@ -0,0 +1,72 @@ + + + +basic_seq_packet_socket::available (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available() const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/available/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/available/overload2.html new file mode 100644 index 0000000..42e0945 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/available/overload2.html @@ -0,0 +1,73 @@ + + + +basic_seq_packet_socket::available (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available(
+    asio::error_code & ec) const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket.html new file mode 100644 index 0000000..9bf67b7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket.html @@ -0,0 +1,126 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_seq_packet_socket + without opening it. +

+
explicit basic_seq_packet_socket(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_seq_packet_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct and open a basic_seq_packet_socket. +

+
basic_seq_packet_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_seq_packet_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_seq_packet_socket, + opening it and binding it to the given local endpoint. +

+
basic_seq_packet_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_seq_packet_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_seq_packet_socket + on an existing native socket. +

+
basic_seq_packet_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_seq_packet_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_seq_packet_socket + from another. +

+
basic_seq_packet_socket(
+    basic_seq_packet_socket && other);
+  » more...
+
+

+ Move-construct a basic_seq_packet_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_seq_packet_socket(
+    basic_seq_packet_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload1.html new file mode 100644 index 0000000..79044bd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload1.html @@ -0,0 +1,64 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (1 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_seq_packet_socket + without opening it. +

+
basic_seq_packet_socket(
+    const executor_type & ex);
+
+

+ This constructor creates a sequenced packet socket without opening it. + The socket needs to be opened and then connected or accepted before data + can be sent or received on it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload10.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload10.html new file mode 100644 index 0000000..05c6c61 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload10.html @@ -0,0 +1,75 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (10 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_seq_packet_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_seq_packet_socket(
+    basic_seq_packet_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+
+

+ This constructor moves a sequenced packet socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_seq_packet_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_seq_packet_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload2.html new file mode 100644 index 0000000..2e8ee5b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload2.html @@ -0,0 +1,68 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (2 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_seq_packet_socket + without opening it. +

+
template<
+    typename ExecutionContext>
+basic_seq_packet_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a sequenced packet socket without opening it. + The socket needs to be opened and then connected or accepted before data + can be sent or received on it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload3.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload3.html new file mode 100644 index 0000000..ccf1d15 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload3.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (3 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_seq_packet_socket. +

+
basic_seq_packet_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+
+

+ This constructor creates and opens a sequenced_packet socket. The socket + needs to be connected or accepted before data can be sent or received + on it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload4.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload4.html new file mode 100644 index 0000000..9d4bf6a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload4.html @@ -0,0 +1,85 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (4 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_seq_packet_socket. +

+
template<
+    typename ExecutionContext>
+basic_seq_packet_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates and opens a sequenced_packet socket. The socket + needs to be connected or accepted before data can be sent or received + on it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload5.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload5.html new file mode 100644 index 0000000..a8d714a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload5.html @@ -0,0 +1,83 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (5 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_seq_packet_socket, + opening it and binding it to the given local endpoint. +

+
basic_seq_packet_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+
+

+ This constructor creates a sequenced packet socket and automatically + opens it bound to the specified endpoint on the local machine. The protocol + used is the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the sequenced packet + socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload6.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload6.html new file mode 100644 index 0000000..aab9f27 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload6.html @@ -0,0 +1,87 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (6 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_seq_packet_socket, + opening it and binding it to the given local endpoint. +

+
template<
+    typename ExecutionContext>
+basic_seq_packet_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a sequenced packet socket and automatically + opens it bound to the specified endpoint on the local machine. The protocol + used is the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the sequenced packet + socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload7.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload7.html new file mode 100644 index 0000000..4c933b5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload7.html @@ -0,0 +1,86 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (7 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_seq_packet_socket + on an existing native socket. +

+
basic_seq_packet_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+

+ This constructor creates a sequenced packet socket object to hold an + existing native socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload8.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload8.html new file mode 100644 index 0000000..31b10a6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload8.html @@ -0,0 +1,90 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (8 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_seq_packet_socket + on an existing native socket. +

+
template<
+    typename ExecutionContext>
+basic_seq_packet_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a sequenced packet socket object to hold an + existing native socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload9.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload9.html new file mode 100644 index 0000000..9cd7ea8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload9.html @@ -0,0 +1,71 @@ + + + +basic_seq_packet_socket::basic_seq_packet_socket (9 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_seq_packet_socket + from another. +

+
basic_seq_packet_socket(
+    basic_seq_packet_socket && other);
+
+

+ This constructor moves a sequenced packet socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_seq_packet_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_seq_packet_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/bind.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/bind.html new file mode 100644 index 0000000..ee169b2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/bind.html @@ -0,0 +1,51 @@ + + + +basic_seq_packet_socket::bind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bind + the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+  » more...
+
+void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/bind/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/bind/overload1.html new file mode 100644 index 0000000..c272244 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/bind/overload1.html @@ -0,0 +1,86 @@ + + + +basic_seq_packet_socket::bind (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/bind/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/bind/overload2.html new file mode 100644 index 0000000..4b67866 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/bind/overload2.html @@ -0,0 +1,83 @@ + + + +basic_seq_packet_socket::bind (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+asio::error_code ec;
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/broadcast.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/broadcast.html new file mode 100644 index 0000000..fc5236e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/broadcast.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to permit sending of broadcast messages. +

+
typedef implementation_defined broadcast;
+
+

+ Implements the SOL_SOCKET/SO_BROADCAST socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/bytes_readable.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/bytes_readable.html new file mode 100644 index 0000000..f6e1d7b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/bytes_readable.html @@ -0,0 +1,70 @@ + + + +basic_seq_packet_socket::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::bytes_readable command(true);
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel.html new file mode 100644 index 0000000..4264f4d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the socket. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel/overload1.html new file mode 100644 index 0000000..efc6d35 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel/overload1.html @@ -0,0 +1,104 @@ + + + +basic_seq_packet_socket::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel/overload2.html new file mode 100644 index 0000000..bf5492d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/cancel/overload2.html @@ -0,0 +1,105 @@ + + + +basic_seq_packet_socket::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/close.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/close.html new file mode 100644 index 0000000..bb87715 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/close.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the socket. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/close/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/close/overload1.html new file mode 100644 index 0000000..d6e04ac --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/close/overload1.html @@ -0,0 +1,73 @@ + + + +basic_seq_packet_socket::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close();
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. Note that, even if the function indicates an + error, the underlying descriptor is closed. +

+
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/close/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/close/overload2.html new file mode 100644 index 0000000..229c465 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/close/overload2.html @@ -0,0 +1,87 @@ + + + +basic_seq_packet_socket::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. Note that, even if + the function indicates an error, the underlying descriptor is closed. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.close(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/connect.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/connect.html new file mode 100644 index 0000000..8ebe20f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/connect.html @@ -0,0 +1,51 @@ + + + +basic_seq_packet_socket::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Connect + the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+  » more...
+
+void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/connect/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/connect/overload1.html new file mode 100644 index 0000000..1de4d0a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/connect/overload1.html @@ -0,0 +1,92 @@ + + + +basic_seq_packet_socket::connect (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.connect(endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/connect/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/connect/overload2.html new file mode 100644 index 0000000..7826542 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/connect/overload2.html @@ -0,0 +1,89 @@ + + + +basic_seq_packet_socket::connect (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+asio::error_code ec;
+socket.connect(endpoint, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/debug.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/debug.html new file mode 100644 index 0000000..741319d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/debug.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::debug + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to enable socket-level debugging. +

+
typedef implementation_defined debug;
+
+

+ Implements the SOL_SOCKET/SO_DEBUG socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/do_not_route.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/do_not_route.html new file mode 100644 index 0000000..69001f8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/do_not_route.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to prevent routing, use local interfaces only. +

+
typedef implementation_defined do_not_route;
+
+

+ Implements the SOL_SOCKET/SO_DONTROUTE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/enable_connection_aborted.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/enable_connection_aborted.html new file mode 100644 index 0000000..d3b3c4d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/enable_connection_aborted.html @@ -0,0 +1,83 @@ + + + +basic_seq_packet_socket::enable_connection_aborted + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to report aborted connections on accept. +

+
typedef implementation_defined enable_connection_aborted;
+
+

+ Implements a custom socket option that determines whether or not an accept + operation is permitted to fail with asio::error::connection_aborted. + By default the option is false. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/endpoint_type.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/endpoint_type.html new file mode 100644 index 0000000..ac52eaf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_seq_packet_socket::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/executor_type.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/executor_type.html new file mode 100644 index 0000000..c0e8b8b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_seq_packet_socket::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/get_executor.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_executor.html new file mode 100644 index 0000000..4e90c1a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_executor.html @@ -0,0 +1,47 @@ + + + +basic_seq_packet_socket::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option.html new file mode 100644 index 0000000..8a919de --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option.html @@ -0,0 +1,55 @@ + + + +basic_seq_packet_socket::get_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+  » more...
+
+template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option/overload1.html new file mode 100644 index 0000000..10fbce2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option/overload1.html @@ -0,0 +1,91 @@ + + + +basic_seq_packet_socket::get_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option/overload2.html new file mode 100644 index 0000000..b1db98c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/get_option/overload2.html @@ -0,0 +1,88 @@ + + + +basic_seq_packet_socket::get_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+asio::error_code ec;
+socket.get_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control.html new file mode 100644 index 0000000..d1cc098 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control.html @@ -0,0 +1,55 @@ + + + +basic_seq_packet_socket::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control/overload1.html new file mode 100644 index 0000000..05626e0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control/overload1.html @@ -0,0 +1,91 @@ + + + +basic_seq_packet_socket::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control/overload2.html new file mode 100644 index 0000000..4cc6810 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/io_control/overload2.html @@ -0,0 +1,88 @@ + + + +basic_seq_packet_socket::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+asio::error_code ec;
+socket.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/is_open.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/is_open.html new file mode 100644 index 0000000..363e675 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/is_open.html @@ -0,0 +1,47 @@ + + + +basic_seq_packet_socket::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Determine + whether the socket is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/keep_alive.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/keep_alive.html new file mode 100644 index 0000000..192fe03 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/keep_alive.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::keep_alive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to send keep-alives. +

+
typedef implementation_defined keep_alive;
+
+

+ Implements the SOL_SOCKET/SO_KEEPALIVE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/linger.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/linger.html new file mode 100644 index 0000000..9ecc77b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/linger.html @@ -0,0 +1,83 @@ + + + +basic_seq_packet_socket::linger + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to specify whether the socket lingers on close if unsent data is + present. +

+
typedef implementation_defined linger;
+
+

+ Implements the SOL_SOCKET/SO_LINGER socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option(true, 30);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option;
+socket.get_option(option);
+bool is_set = option.enabled();
+unsigned short timeout = option.timeout();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint.html new file mode 100644 index 0000000..0030da1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::local_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+  » more...
+
+endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint/overload1.html new file mode 100644 index 0000000..3e86ca9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_seq_packet_socket::local_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint/overload2.html new file mode 100644 index 0000000..edc47c7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/local_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_seq_packet_socket::local_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. Returns a + default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer.html new file mode 100644 index 0000000..316a053 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer.html @@ -0,0 +1,51 @@ + + + +basic_seq_packet_socket::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer/overload1.html new file mode 100644 index 0000000..5ea84b5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer/overload1.html @@ -0,0 +1,60 @@ + + + +basic_seq_packet_socket::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer/overload2.html new file mode 100644 index 0000000..19cf612 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer/overload2.html @@ -0,0 +1,60 @@ + + + +basic_seq_packet_socket::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer_type.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer_type.html new file mode 100644 index 0000000..733b598 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/lowest_layer_type.html @@ -0,0 +1,849 @@ + + + +basic_seq_packet_socket::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +A + basic_socket + is always the lowest layer. +

+
typedef basic_socket< Protocol, Executor > lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_socket [constructor] +

+
+

+ Construct a basic_socket without opening it.
—
Construct + and open a basic_socket.
—
Construct a basic_socket, + opening it and binding it to the given local endpoint.
+ —
Construct a basic_socket on an existing native socket. +
—
Move-construct a basic_socket from another.
+ —
Move-construct a basic_socket from a socket of another + protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket from another.
—
Move-assign + a basic_socket from a socket of another protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_socket [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket + class template provides functionality that is common to both stream-oriented + and datagram-oriented sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/max_connections.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/max_connections.html new file mode 100644 index 0000000..5e89801 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/max_connections.html @@ -0,0 +1,48 @@ + + + +basic_seq_packet_socket::max_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +(Deprecated: + Use max_listen_connections.) The maximum length of the queue of pending + incoming connections. +

+
static const int max_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/max_listen_connections.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/max_listen_connections.html new file mode 100644 index 0000000..f68f7b0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/max_listen_connections.html @@ -0,0 +1,47 @@ + + + +basic_seq_packet_socket::max_listen_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +The + maximum length of the queue of pending incoming connections. +

+
static const int max_listen_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/message_do_not_route.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_do_not_route.html new file mode 100644 index 0000000..bcfdbd1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_do_not_route.html @@ -0,0 +1,47 @@ + + + +basic_seq_packet_socket::message_do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specify + that the data should not be subject to routing. +

+
static const int message_do_not_route = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/message_end_of_record.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_end_of_record.html new file mode 100644 index 0000000..d2b9586 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_end_of_record.html @@ -0,0 +1,47 @@ + + + +basic_seq_packet_socket::message_end_of_record + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specifies + that the data marks the end of a record. +

+
static const int message_end_of_record = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/message_flags.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_flags.html new file mode 100644 index 0000000..8b4ec31 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_flags.html @@ -0,0 +1,57 @@ + + + +basic_seq_packet_socket::message_flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Bitmask + type for flags that can be passed to send and receive operations. +

+
typedef int message_flags;
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/message_out_of_band.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_out_of_band.html new file mode 100644 index 0000000..542957c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_out_of_band.html @@ -0,0 +1,47 @@ + + + +basic_seq_packet_socket::message_out_of_band + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Process + out-of-band data. +

+
static const int message_out_of_band = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/message_peek.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_peek.html new file mode 100644 index 0000000..c8ab698 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/message_peek.html @@ -0,0 +1,47 @@ + + + +basic_seq_packet_socket::message_peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Peek + at incoming data without removing it from the input queue. +

+
static const int message_peek = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/native_handle.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_handle.html new file mode 100644 index 0000000..a708768 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_handle.html @@ -0,0 +1,52 @@ + + + +basic_seq_packet_socket::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the native socket representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + socket. This is intended to allow access to native socket functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/native_handle_type.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_handle_type.html new file mode 100644 index 0000000..0f62b80 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_handle_type.html @@ -0,0 +1,54 @@ + + + +basic_seq_packet_socket::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a socket. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking.html new file mode 100644 index 0000000..16fcc57 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_seq_packet_socket::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload1.html new file mode 100644 index 0000000..7078183 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload1.html @@ -0,0 +1,145 @@ + + + +basic_seq_packet_socket::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native socket. This mode has no effect on the behaviour of the socket + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying socket is in non-blocking mode and + direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the socket object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native socket. +

+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload2.html new file mode 100644 index 0000000..85b0b8f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload2.html @@ -0,0 +1,158 @@ + + + +basic_seq_packet_socket::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload3.html new file mode 100644 index 0000000..9b64878 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/native_non_blocking/overload3.html @@ -0,0 +1,150 @@ + + + +basic_seq_packet_socket::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking.html new file mode 100644 index 0000000..187c67a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_seq_packet_socket::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the socket. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload1.html new file mode 100644 index 0000000..dd2d0af --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload1.html @@ -0,0 +1,65 @@ + + + +basic_seq_packet_socket::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the socket. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the socket's synchronous operations will fail with + asio::error::would_block if they are unable to perform the + requested operation immediately. If false, synchronous operations + will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload2.html new file mode 100644 index 0000000..85b06f4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload2.html @@ -0,0 +1,84 @@ + + + +basic_seq_packet_socket::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload3.html new file mode 100644 index 0000000..9aeb153 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/non_blocking/overload3.html @@ -0,0 +1,76 @@ + + + +basic_seq_packet_socket::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/open.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/open.html new file mode 100644 index 0000000..86c9f8b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/open.html @@ -0,0 +1,51 @@ + + + +basic_seq_packet_socket::open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Open + the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+  » more...
+
+void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/open/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/open/overload1.html new file mode 100644 index 0000000..b95cd31 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/open/overload1.html @@ -0,0 +1,83 @@ + + + +basic_seq_packet_socket::open (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/open/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/open/overload2.html new file mode 100644 index 0000000..8102ceb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/open/overload2.html @@ -0,0 +1,80 @@ + + + +basic_seq_packet_socket::open (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying which protocol is to be used. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::error_code ec;
+socket.open(asio::ip::tcp::v4(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_.html new file mode 100644 index 0000000..c88dc84 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_.html @@ -0,0 +1,58 @@ + + + +basic_seq_packet_socket::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_seq_packet_socket + from another. +

+
basic_seq_packet_socket & operator=(
+    basic_seq_packet_socket && other);
+  » more...
+
+

+ Move-assign a basic_seq_packet_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_seq_packet_socket & >::type operator=(
+    basic_seq_packet_socket< Protocol1, Executor1 > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_/overload1.html new file mode 100644 index 0000000..a0dace7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_/overload1.html @@ -0,0 +1,72 @@ + + + +basic_seq_packet_socket::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_seq_packet_socket + from another. +

+
basic_seq_packet_socket & operator=(
+    basic_seq_packet_socket && other);
+
+

+ This assignment operator moves a sequenced packet socket from one object + to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_seq_packet_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_seq_packet_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_/overload2.html new file mode 100644 index 0000000..9e737d3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/operator_eq_/overload2.html @@ -0,0 +1,75 @@ + + + +basic_seq_packet_socket::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_seq_packet_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_seq_packet_socket & >::type operator=(
+    basic_seq_packet_socket< Protocol1, Executor1 > && other);
+
+

+ This assignment operator moves a sequenced packet socket from one object + to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_seq_packet_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_seq_packet_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/out_of_band_inline.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/out_of_band_inline.html new file mode 100644 index 0000000..55fb91d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/out_of_band_inline.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::out_of_band_inline + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for putting received out-of-band data inline. +

+
typedef implementation_defined out_of_band_inline;
+
+

+ Implements the SOL_SOCKET/SO_OOBINLINE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option;
+socket.get_option(option);
+bool value = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/protocol_type.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/protocol_type.html new file mode 100644 index 0000000..c4c298f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_seq_packet_socket::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/receive.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive.html new file mode 100644 index 0000000..df4651b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive.html @@ -0,0 +1,69 @@ + + + +basic_seq_packet_socket::receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Receive + some data on the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags & out_flags);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags in_flags,
+    socket_base::message_flags & out_flags);
+  » more...
+
+

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags in_flags,
+    socket_base::message_flags & out_flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload1.html new file mode 100644 index 0000000..272ecd5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload1.html @@ -0,0 +1,108 @@ + + + +basic_seq_packet_socket::receive (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags & out_flags);
+
+

+ This function is used to receive data on the sequenced packet socket. + The function call will block until data has been received successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
out_flags
+

+ After the receive call completes, contains flags associated with + the received data. For example, if the socket_base::message_end_of_record + bit is set then the received data marks the end of a record. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.receive(asio::buffer(data, size), out_flags);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload2.html new file mode 100644 index 0000000..21cf12e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload2.html @@ -0,0 +1,123 @@ + + + +basic_seq_packet_socket::receive (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags in_flags,
+    socket_base::message_flags & out_flags);
+
+

+ This function is used to receive data on the sequenced packet socket. + The function call will block until data has been received successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
in_flags
+

+ Flags specifying how the receive call is to be made. +

+
out_flags
+

+ After the receive call completes, contains flags associated with + the received data. For example, if the socket_base::message_end_of_record + bit is set then the received data marks the end of a record. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The receive operation may not receive all of the requested number of + bytes. Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.receive(asio::buffer(data, size), 0, out_flags);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload3.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload3.html new file mode 100644 index 0000000..5283bd6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive/overload3.html @@ -0,0 +1,99 @@ + + + +basic_seq_packet_socket::receive (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags in_flags,
+    socket_base::message_flags & out_flags,
+    asio::error_code & ec);
+
+

+ This function is used to receive data on the sequenced packet socket. + The function call will block until data has been received successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
in_flags
+

+ Flags specifying how the receive call is to be made. +

+
out_flags
+

+ After the receive call completes, contains flags associated with + the received data. For example, if the socket_base::message_end_of_record + bit is set then the received data marks the end of a record. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The receive operation may not receive all of the requested number of + bytes. Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/receive_buffer_size.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive_buffer_size.html new file mode 100644 index 0000000..1752590 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::receive_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive buffer size of a socket. +

+
typedef implementation_defined receive_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_RCVBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/receive_low_watermark.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive_low_watermark.html new file mode 100644 index 0000000..552b826 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/receive_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::receive_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive low watermark. +

+
typedef implementation_defined receive_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_RCVLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/release.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/release.html new file mode 100644 index 0000000..2ea9217 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/release.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release + ownership of the underlying native socket. +

+
native_handle_type release();
+  » more...
+
+native_handle_type release(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/release/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/release/overload1.html new file mode 100644 index 0000000..c00f677 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/release/overload1.html @@ -0,0 +1,74 @@ + + + +basic_seq_packet_socket::release (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/release/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/release/overload2.html new file mode 100644 index 0000000..f08a8ff --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/release/overload2.html @@ -0,0 +1,75 @@ + + + +basic_seq_packet_socket::release (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint.html new file mode 100644 index 0000000..4525f20 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_seq_packet_socket::remote_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+  » more...
+
+endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint/overload1.html new file mode 100644 index 0000000..a294e62 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_seq_packet_socket::remote_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint/overload2.html new file mode 100644 index 0000000..26b4804 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/remote_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_seq_packet_socket::remote_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. Returns + a default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/reuse_address.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/reuse_address.html new file mode 100644 index 0000000..d555510 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/reuse_address.html @@ -0,0 +1,82 @@ + + + +basic_seq_packet_socket::reuse_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to allow the socket to be bound to an address that is already in + use. +

+
typedef implementation_defined reuse_address;
+
+

+ Implements the SOL_SOCKET/SO_REUSEADDR socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/send.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/send.html new file mode 100644 index 0000000..f27abae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/send.html @@ -0,0 +1,57 @@ + + + +basic_seq_packet_socket::send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Send + some data on the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/send/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/send/overload1.html new file mode 100644 index 0000000..78aa858 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/send/overload1.html @@ -0,0 +1,105 @@ + + + +basic_seq_packet_socket::send (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+
+

+ This function is used to send data on the sequenced packet socket. The + function call will block until the data has been sent successfully, or + an until error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.send(asio::buffer(data, size), 0);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/send/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/send/overload2.html new file mode 100644 index 0000000..b935cb4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/send/overload2.html @@ -0,0 +1,92 @@ + + + +basic_seq_packet_socket::send (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to send data on the sequenced packet socket. The + function call will block the data has been sent successfully, or an until + error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The send operation may not transmit all of the data to the peer. Consider + using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/send_buffer_size.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/send_buffer_size.html new file mode 100644 index 0000000..b96a377 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/send_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::send_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send buffer size of a socket. +

+
typedef implementation_defined send_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_SNDBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/send_low_watermark.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/send_low_watermark.html new file mode 100644 index 0000000..f2be8a2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/send_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_seq_packet_socket::send_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send low watermark. +

+
typedef implementation_defined send_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_SNDLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option.html new file mode 100644 index 0000000..e247780 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option.html @@ -0,0 +1,55 @@ + + + +basic_seq_packet_socket::set_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+  » more...
+
+template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option/overload1.html new file mode 100644 index 0000000..c0baa29 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option/overload1.html @@ -0,0 +1,90 @@ + + + +basic_seq_packet_socket::set_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+socket.set_option(option);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option/overload2.html new file mode 100644 index 0000000..35790c7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/set_option/overload2.html @@ -0,0 +1,87 @@ + + + +basic_seq_packet_socket::set_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+asio::error_code ec;
+socket.set_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown.html new file mode 100644 index 0000000..eb213cc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown.html @@ -0,0 +1,51 @@ + + + +basic_seq_packet_socket::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+  » more...
+
+void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown/overload1.html new file mode 100644 index 0000000..2dd3eba --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown/overload1.html @@ -0,0 +1,88 @@ + + + +basic_seq_packet_socket::shutdown (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.shutdown(asio::ip::tcp::socket::shutdown_send);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown/overload2.html new file mode 100644 index 0000000..d42664a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown/overload2.html @@ -0,0 +1,85 @@ + + + +basic_seq_packet_socket::shutdown (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown_type.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown_type.html new file mode 100644 index 0000000..2cd8fcd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/shutdown_type.html @@ -0,0 +1,73 @@ + + + +basic_seq_packet_socket::shutdown_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Different + ways a socket may be shutdown. +

+
enum shutdown_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
shutdown_receive
+

+ Shutdown the receive side of the socket. +

+
shutdown_send
+

+ Shutdown the send side of the socket. +

+
shutdown_both
+

+ Shutdown both send and receive on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/wait.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait.html new file mode 100644 index 0000000..d5f1973 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait.html @@ -0,0 +1,52 @@ + + + +basic_seq_packet_socket::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait + for the socket to become ready to read, ready to write, or to have pending + error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/wait/overload1.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait/overload1.html new file mode 100644 index 0000000..1634086 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait/overload1.html @@ -0,0 +1,76 @@ + + + +basic_seq_packet_socket::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.wait(asio::ip::tcp::socket::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/wait/overload2.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait/overload2.html new file mode 100644 index 0000000..7f7f5bd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait/overload2.html @@ -0,0 +1,82 @@ + + + +basic_seq_packet_socket::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.wait(asio::ip::tcp::socket::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket/wait_type.html b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait_type.html new file mode 100644 index 0000000..53f9133 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket/wait_type.html @@ -0,0 +1,76 @@ + + + +basic_seq_packet_socket::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a socket to become ready to read. +

+
wait_write
+

+ Wait for a socket to become ready to write. +

+
wait_error
+

+ Wait for a socket to have error conditions pending. +

+
+
+

+ For use with basic_socket::wait() and basic_socket::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket__rebind_executor.html b/include/asio/doc/asio/reference/basic_seq_packet_socket__rebind_executor.html new file mode 100644 index 0000000..131af8b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_seq_packet_socket::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the socket type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The socket type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_seq_packet_socket__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_seq_packet_socket__rebind_executor/other.html new file mode 100644 index 0000000..afbb336 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_seq_packet_socket__rebind_executor/other.html @@ -0,0 +1,872 @@ + + + +basic_seq_packet_socket::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + socket type when rebound to the specified executor. +

+
typedef basic_seq_packet_socket< Protocol, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_seq_packet_socket [constructor] +

+
+

+ Construct a basic_seq_packet_socket without opening it.
+ —
Construct and open a basic_seq_packet_socket.
— +
Construct a basic_seq_packet_socket, opening it and binding + it to the given local endpoint.
—
Construct a basic_seq_packet_socket + on an existing native socket.
—
Move-construct a + basic_seq_packet_socket from another.
—
Move-construct + a basic_seq_packet_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_seq_packet_socket from another.
—
+ Move-assign a basic_seq_packet_socket from a socket of another + protocol type. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_seq_packet_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_seq_packet_socket + class template provides asynchronous and blocking sequenced packet socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_seq_packet_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port.html b/include/asio/doc/asio/reference/basic_serial_port.html new file mode 100644 index 0000000..a4ad04e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port.html @@ -0,0 +1,387 @@ + + + +basic_serial_port + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides serial port functionality. +

+
template<
+    typename Executor = any_io_executor>
+class basic_serial_port :
+  public serial_port_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the serial port type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A basic_basic_serial_port is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a serial port. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native serial port to the serial port. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_serial_port [constructor] +

+
+

+ Construct a basic_serial_port without opening it.
—
+ Construct and open a basic_serial_port.
—
Construct + a basic_serial_port on an existing native serial port.
— +
Move-construct a basic_serial_port from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the serial port. +

+
+

+ close +

+
+

+ Close the serial port. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the serial port. +

+
+

+ is_open +

+
+

+ Determine whether the serial port is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native serial port representation. +

+
+

+ open +

+
+

+ Open the serial port using the specified device name. +

+
+

+ operator= +

+
+

+ Move-assign a basic_serial_port from another. +

+
+

+ read_some +

+
+

+ Read some data from the serial port. +

+
+

+ send_break +

+
+

+ Send a break sequence to the serial port. +

+
+

+ set_option +

+
+

+ Set an option on the serial port. +

+
+

+ write_some +

+
+

+ Write some data to the serial port. +

+
+

+ ~basic_serial_port [destructor] +

+
+

+ Destroys the serial port. +

+
+

+ The basic_serial_port + class provides a wrapper over serial port functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_serial_port.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/_basic_serial_port.html b/include/asio/doc/asio/reference/basic_serial_port/_basic_serial_port.html new file mode 100644 index 0000000..1c6c55d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/_basic_serial_port.html @@ -0,0 +1,48 @@ + + + +basic_serial_port::~basic_serial_port + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the serial port. +

+
~basic_serial_port();
+
+

+ This function destroys the serial port, cancelling any outstanding asynchronous + wait operations associated with the serial port as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/assign.html b/include/asio/doc/asio/reference/basic_serial_port/assign.html new file mode 100644 index 0000000..7371d98 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/assign.html @@ -0,0 +1,51 @@ + + + +basic_serial_port::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign an + existing native serial port to the serial port. +

+
void assign(
+    const native_handle_type & native_serial_port);
+  » more...
+
+void assign(
+    const native_handle_type & native_serial_port,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/assign/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/assign/overload1.html new file mode 100644 index 0000000..174d6ac --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/assign/overload1.html @@ -0,0 +1,44 @@ + + + +basic_serial_port::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native serial port to the serial port. +

+
void assign(
+    const native_handle_type & native_serial_port);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/assign/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/assign/overload2.html new file mode 100644 index 0000000..a9b98f8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/assign/overload2.html @@ -0,0 +1,45 @@ + + + +basic_serial_port::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native serial port to the serial port. +

+
void assign(
+    const native_handle_type & native_serial_port,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/async_read_some.html b/include/asio/doc/asio/reference/basic_serial_port/async_read_some.html new file mode 100644 index 0000000..32aed01 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/async_read_some.html @@ -0,0 +1,114 @@ + + + +basic_serial_port::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data from the serial port. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes read.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The read operation may not read all of the requested number of bytes. Consider + using the async_read + function if you need to ensure that the requested amount of data is read + before the asynchronous operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
basic_serial_port.async_read_some(
+    asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/async_write_some.html b/include/asio/doc/asio/reference/basic_serial_port/async_write_some.html new file mode 100644 index 0000000..f15d957 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/async_write_some.html @@ -0,0 +1,114 @@ + + + +basic_serial_port::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write data to the serial port. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the serial port. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes written.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The write operation may not transmit all of the data to the peer. Consider + using the async_write + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
basic_serial_port.async_write_some(
+    asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port.html new file mode 100644 index 0000000..4d11e77 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port.html @@ -0,0 +1,108 @@ + + + +basic_serial_port::basic_serial_port + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_serial_port + without opening it. +

+
explicit basic_serial_port(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_serial_port(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_serial_port >::type *  = 0);
+  » more...
+
+

+ Construct and open a basic_serial_port. +

+
basic_serial_port(
+    const executor_type & ex,
+    const char * device);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_serial_port(
+    ExecutionContext & context,
+    const char * device,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+basic_serial_port(
+    const executor_type & ex,
+    const std::string & device);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_serial_port(
+    ExecutionContext & context,
+    const std::string & device,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_serial_port + on an existing native serial port. +

+
basic_serial_port(
+    const executor_type & ex,
+    const native_handle_type & native_serial_port);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_serial_port(
+    ExecutionContext & context,
+    const native_handle_type & native_serial_port,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_serial_port + from another. +

+
basic_serial_port(
+    basic_serial_port && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload1.html new file mode 100644 index 0000000..dc3784a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload1.html @@ -0,0 +1,63 @@ + + + +basic_serial_port::basic_serial_port (1 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_serial_port + without opening it. +

+
basic_serial_port(
+    const executor_type & ex);
+
+

+ This constructor creates a serial port without opening it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the serial port will use, by default, to + dispatch handlers for any asynchronous operations performed on + the serial port. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload2.html new file mode 100644 index 0000000..f19933a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload2.html @@ -0,0 +1,66 @@ + + + +basic_serial_port::basic_serial_port (2 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_serial_port + without opening it. +

+
template<
+    typename ExecutionContext>
+basic_serial_port(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_serial_port >::type *  = 0);
+
+

+ This constructor creates a serial port without opening it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the serial + port will use, by default, to dispatch handlers for any asynchronous + operations performed on the serial port. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload3.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload3.html new file mode 100644 index 0000000..d18dd66 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload3.html @@ -0,0 +1,68 @@ + + + +basic_serial_port::basic_serial_port (3 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_serial_port. +

+
basic_serial_port(
+    const executor_type & ex,
+    const char * device);
+
+

+ This constructor creates and opens a serial port for the specified device + name. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the serial port will use, by default, to + dispatch handlers for any asynchronous operations performed on + the serial port. +

+
device
+

+ The platform-specific device name for this serial port. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload4.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload4.html new file mode 100644 index 0000000..66bc921 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload4.html @@ -0,0 +1,71 @@ + + + +basic_serial_port::basic_serial_port (4 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_serial_port. +

+
template<
+    typename ExecutionContext>
+basic_serial_port(
+    ExecutionContext & context,
+    const char * device,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates and opens a serial port for the specified device + name. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the serial + port will use, by default, to dispatch handlers for any asynchronous + operations performed on the serial port. +

+
device
+

+ The platform-specific device name for this serial port. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload5.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload5.html new file mode 100644 index 0000000..7031cbc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload5.html @@ -0,0 +1,68 @@ + + + +basic_serial_port::basic_serial_port (5 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_serial_port. +

+
basic_serial_port(
+    const executor_type & ex,
+    const std::string & device);
+
+

+ This constructor creates and opens a serial port for the specified device + name. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the serial port will use, by default, to + dispatch handlers for any asynchronous operations performed on + the serial port. +

+
device
+

+ The platform-specific device name for this serial port. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload6.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload6.html new file mode 100644 index 0000000..d025a8f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload6.html @@ -0,0 +1,71 @@ + + + +basic_serial_port::basic_serial_port (6 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_serial_port. +

+
template<
+    typename ExecutionContext>
+basic_serial_port(
+    ExecutionContext & context,
+    const std::string & device,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates and opens a serial port for the specified device + name. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the serial + port will use, by default, to dispatch handlers for any asynchronous + operations performed on the serial port. +

+
device
+

+ The platform-specific device name for this serial port. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload7.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload7.html new file mode 100644 index 0000000..a5de38b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload7.html @@ -0,0 +1,82 @@ + + + +basic_serial_port::basic_serial_port (7 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_serial_port + on an existing native serial port. +

+
basic_serial_port(
+    const executor_type & ex,
+    const native_handle_type & native_serial_port);
+
+

+ This constructor creates a serial port object to hold an existing native + serial port. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the serial port will use, by default, to + dispatch handlers for any asynchronous operations performed on + the serial port. +

+
native_serial_port
+

+ A native serial port. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload8.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload8.html new file mode 100644 index 0000000..d712d8b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload8.html @@ -0,0 +1,85 @@ + + + +basic_serial_port::basic_serial_port (8 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_serial_port + on an existing native serial port. +

+
template<
+    typename ExecutionContext>
+basic_serial_port(
+    ExecutionContext & context,
+    const native_handle_type & native_serial_port,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a serial port object to hold an existing native + serial port. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the serial + port will use, by default, to dispatch handlers for any asynchronous + operations performed on the serial port. +

+
native_serial_port
+

+ A native serial port. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload9.html b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload9.html new file mode 100644 index 0000000..766a78c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/basic_serial_port/overload9.html @@ -0,0 +1,71 @@ + + + +basic_serial_port::basic_serial_port (9 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_serial_port + from another. +

+
basic_serial_port(
+    basic_serial_port && other);
+
+

+ This constructor moves a serial port from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_serial_port + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_serial_port(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/cancel.html b/include/asio/doc/asio/reference/basic_serial_port/cancel.html new file mode 100644 index 0000000..d74de36 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/cancel.html @@ -0,0 +1,49 @@ + + + +basic_serial_port::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel all + asynchronous operations associated with the serial port. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/cancel/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/cancel/overload1.html new file mode 100644 index 0000000..a591c44 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/cancel/overload1.html @@ -0,0 +1,61 @@ + + + +basic_serial_port::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the serial port. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/cancel/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/cancel/overload2.html new file mode 100644 index 0000000..6cc698c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/cancel/overload2.html @@ -0,0 +1,62 @@ + + + +basic_serial_port::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the serial port. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/close.html b/include/asio/doc/asio/reference/basic_serial_port/close.html new file mode 100644 index 0000000..37b8233 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/close.html @@ -0,0 +1,49 @@ + + + +basic_serial_port::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close the serial + port. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/close/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/close/overload1.html new file mode 100644 index 0000000..f6c31ec --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/close/overload1.html @@ -0,0 +1,61 @@ + + + +basic_serial_port::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the serial port. +

+
void close();
+
+

+ This function is used to close the serial port. Any asynchronous read + or write operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/close/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/close/overload2.html new file mode 100644 index 0000000..2551127 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/close/overload2.html @@ -0,0 +1,62 @@ + + + +basic_serial_port::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the serial port. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the serial port. Any asynchronous read + or write operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/executor_type.html b/include/asio/doc/asio/reference/basic_serial_port/executor_type.html new file mode 100644 index 0000000..82d9661 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_serial_port::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_serial_port.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/get_executor.html b/include/asio/doc/asio/reference/basic_serial_port/get_executor.html new file mode 100644 index 0000000..e7d31a0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/get_executor.html @@ -0,0 +1,44 @@ + + + +basic_serial_port::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/get_option.html b/include/asio/doc/asio/reference/basic_serial_port/get_option.html new file mode 100644 index 0000000..b0f1006 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/get_option.html @@ -0,0 +1,55 @@ + + + +basic_serial_port::get_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + an option from the serial port. +

+
template<
+    typename GettableSerialPortOption>
+void get_option(
+    GettableSerialPortOption & option) const;
+  » more...
+
+template<
+    typename GettableSerialPortOption>
+void get_option(
+    GettableSerialPortOption & option,
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/get_option/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/get_option/overload1.html new file mode 100644 index 0000000..f603b6b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/get_option/overload1.html @@ -0,0 +1,76 @@ + + + +basic_serial_port::get_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an option from the serial port. +

+
template<
+    typename GettableSerialPortOption>
+void get_option(
+    GettableSerialPortOption & option) const;
+
+

+ This function is used to get the current value of an option on the serial + port. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the serial port. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/get_option/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/get_option/overload2.html new file mode 100644 index 0000000..c1563a9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/get_option/overload2.html @@ -0,0 +1,68 @@ + + + +basic_serial_port::get_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an option from the serial port. +

+
template<
+    typename GettableSerialPortOption>
+void get_option(
+    GettableSerialPortOption & option,
+    asio::error_code & ec) const;
+
+

+ This function is used to get the current value of an option on the serial + port. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the serial port. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/is_open.html b/include/asio/doc/asio/reference/basic_serial_port/is_open.html new file mode 100644 index 0000000..851b3aa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/is_open.html @@ -0,0 +1,44 @@ + + + +basic_serial_port::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the serial port is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/lowest_layer.html b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer.html new file mode 100644 index 0000000..a927924 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer.html @@ -0,0 +1,51 @@ + + + +basic_serial_port::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/lowest_layer/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer/overload1.html new file mode 100644 index 0000000..f79c018 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer/overload1.html @@ -0,0 +1,57 @@ + + + +basic_serial_port::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a basic_serial_port + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/lowest_layer/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer/overload2.html new file mode 100644 index 0000000..b65d4dc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer/overload2.html @@ -0,0 +1,57 @@ + + + +basic_serial_port::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a basic_serial_port + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/lowest_layer_type.html b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer_type.html new file mode 100644 index 0000000..45ff81c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/lowest_layer_type.html @@ -0,0 +1,387 @@ + + + +basic_serial_port::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + basic_basic_serial_port is always the lowest layer. +

+
typedef basic_serial_port lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the serial port type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A basic_basic_serial_port is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a serial port. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native serial port to the serial port. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_serial_port [constructor] +

+
+

+ Construct a basic_serial_port without opening it.
—
+ Construct and open a basic_serial_port.
—
Construct + a basic_serial_port on an existing native serial port.
+ —
Move-construct a basic_serial_port from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the serial + port. +

+
+

+ close +

+
+

+ Close the serial port. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the serial port. +

+
+

+ is_open +

+
+

+ Determine whether the serial port is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native serial port representation. +

+
+

+ open +

+
+

+ Open the serial port using the specified device name. +

+
+

+ operator= +

+
+

+ Move-assign a basic_serial_port from another. +

+
+

+ read_some +

+
+

+ Read some data from the serial port. +

+
+

+ send_break +

+
+

+ Send a break sequence to the serial port. +

+
+

+ set_option +

+
+

+ Set an option on the serial port. +

+
+

+ write_some +

+
+

+ Write some data to the serial port. +

+
+

+ ~basic_serial_port [destructor] +

+
+

+ Destroys the serial port. +

+
+

+ The basic_serial_port + class provides a wrapper over serial port functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_serial_port.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/native_handle.html b/include/asio/doc/asio/reference/basic_serial_port/native_handle.html new file mode 100644 index 0000000..e64deb9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/native_handle.html @@ -0,0 +1,49 @@ + + + +basic_serial_port::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the native serial port representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + serial port. This is intended to allow access to native serial port functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/native_handle_type.html b/include/asio/doc/asio/reference/basic_serial_port/native_handle_type.html new file mode 100644 index 0000000..cd7adf9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/native_handle_type.html @@ -0,0 +1,54 @@ + + + +basic_serial_port::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a serial port. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_serial_port.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/open.html b/include/asio/doc/asio/reference/basic_serial_port/open.html new file mode 100644 index 0000000..3846610 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/open.html @@ -0,0 +1,51 @@ + + + +basic_serial_port::open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Open the serial + port using the specified device name. +

+
void open(
+    const std::string & device);
+  » more...
+
+void open(
+    const std::string & device,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/open/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/open/overload1.html new file mode 100644 index 0000000..81a0330 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/open/overload1.html @@ -0,0 +1,73 @@ + + + +basic_serial_port::open (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Open the serial port using the specified device name. +

+
void open(
+    const std::string & device);
+
+

+ This function opens the serial port for the specified device name. +

+
+ + Parameters +
+
+

+
+
device
+

+ The platform-specific device name. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/open/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/open/overload2.html new file mode 100644 index 0000000..3f1ac5f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/open/overload2.html @@ -0,0 +1,66 @@ + + + +basic_serial_port::open (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Open the serial port using the specified device name. +

+
void open(
+    const std::string & device,
+    asio::error_code & ec);
+
+

+ This function opens the serial port using the given platform-specific + device name. +

+
+ + Parameters +
+
+

+
+
device
+

+ The platform-specific device name. +

+
ec
+

+ Set the indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/operator_eq_.html b/include/asio/doc/asio/reference/basic_serial_port/operator_eq_.html new file mode 100644 index 0000000..59c719b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/operator_eq_.html @@ -0,0 +1,71 @@ + + + +basic_serial_port::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_serial_port + from another. +

+
basic_serial_port & operator=(
+    basic_serial_port && other);
+
+

+ This assignment operator moves a serial port from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_serial_port + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_serial_port(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/read_some.html b/include/asio/doc/asio/reference/basic_serial_port/read_some.html new file mode 100644 index 0000000..3fd690e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/read_some.html @@ -0,0 +1,55 @@ + + + +basic_serial_port::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read + some data from the serial port. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/read_some/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/read_some/overload1.html new file mode 100644 index 0000000..befc0a4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/read_some/overload1.html @@ -0,0 +1,111 @@ + + + +basic_serial_port::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the serial port. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to read data from the serial port. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
basic_serial_port.read_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/read_some/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/read_some/overload2.html new file mode 100644 index 0000000..7679ade --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/read_some/overload2.html @@ -0,0 +1,87 @@ + + + +basic_serial_port::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the serial port. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to read data from the serial port. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/send_break.html b/include/asio/doc/asio/reference/basic_serial_port/send_break.html new file mode 100644 index 0000000..45c0c1e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/send_break.html @@ -0,0 +1,49 @@ + + + +basic_serial_port::send_break + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Send + a break sequence to the serial port. +

+
void send_break();
+  » more...
+
+void send_break(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/send_break/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/send_break/overload1.html new file mode 100644 index 0000000..c894b24 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/send_break/overload1.html @@ -0,0 +1,60 @@ + + + +basic_serial_port::send_break (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send a break sequence to the serial port. +

+
void send_break();
+
+

+ This function causes a break sequence of platform-specific duration to + be sent out the serial port. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/send_break/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/send_break/overload2.html new file mode 100644 index 0000000..e78df44 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/send_break/overload2.html @@ -0,0 +1,61 @@ + + + +basic_serial_port::send_break (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send a break sequence to the serial port. +

+
void send_break(
+    asio::error_code & ec);
+
+

+ This function causes a break sequence of platform-specific duration to + be sent out the serial port. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/set_option.html b/include/asio/doc/asio/reference/basic_serial_port/set_option.html new file mode 100644 index 0000000..89e66be --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/set_option.html @@ -0,0 +1,55 @@ + + + +basic_serial_port::set_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + an option on the serial port. +

+
template<
+    typename SettableSerialPortOption>
+void set_option(
+    const SettableSerialPortOption & option);
+  » more...
+
+template<
+    typename SettableSerialPortOption>
+void set_option(
+    const SettableSerialPortOption & option,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/set_option/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/set_option/overload1.html new file mode 100644 index 0000000..d0a8e58 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/set_option/overload1.html @@ -0,0 +1,75 @@ + + + +basic_serial_port::set_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set an option on the serial port. +

+
template<
+    typename SettableSerialPortOption>
+void set_option(
+    const SettableSerialPortOption & option);
+
+

+ This function is used to set an option on the serial port. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be set on the serial port. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/set_option/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/set_option/overload2.html new file mode 100644 index 0000000..5bdd36d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/set_option/overload2.html @@ -0,0 +1,67 @@ + + + +basic_serial_port::set_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set an option on the serial port. +

+
template<
+    typename SettableSerialPortOption>
+void set_option(
+    const SettableSerialPortOption & option,
+    asio::error_code & ec);
+
+

+ This function is used to set an option on the serial port. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be set on the serial port. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/write_some.html b/include/asio/doc/asio/reference/basic_serial_port/write_some.html new file mode 100644 index 0000000..2edeb70 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/write_some.html @@ -0,0 +1,55 @@ + + + +basic_serial_port::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + some data to the serial port. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/write_some/overload1.html b/include/asio/doc/asio/reference/basic_serial_port/write_some/overload1.html new file mode 100644 index 0000000..e973848 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/write_some/overload1.html @@ -0,0 +1,111 @@ + + + +basic_serial_port::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the serial port. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to write data to the serial port. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the serial port. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
basic_serial_port.write_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port/write_some/overload2.html b/include/asio/doc/asio/reference/basic_serial_port/write_some/overload2.html new file mode 100644 index 0000000..d7b2e24 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port/write_some/overload2.html @@ -0,0 +1,87 @@ + + + +basic_serial_port::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the serial port. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to write data to the serial port. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the serial port. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port__rebind_executor.html b/include/asio/doc/asio/reference/basic_serial_port__rebind_executor.html new file mode 100644 index 0000000..680ead6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_serial_port::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the serial port type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The serial port type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_serial_port.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_serial_port__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_serial_port__rebind_executor/other.html new file mode 100644 index 0000000..83a0171 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_serial_port__rebind_executor/other.html @@ -0,0 +1,387 @@ + + + +basic_serial_port::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + serial port type when rebound to the specified executor. +

+
typedef basic_serial_port< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the serial port type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A basic_basic_serial_port is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a serial port. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native serial port to the serial port. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_serial_port [constructor] +

+
+

+ Construct a basic_serial_port without opening it.
—
+ Construct and open a basic_serial_port.
—
Construct + a basic_serial_port on an existing native serial port.
+ —
Move-construct a basic_serial_port from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the serial + port. +

+
+

+ close +

+
+

+ Close the serial port. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the serial port. +

+
+

+ is_open +

+
+

+ Determine whether the serial port is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native serial port representation. +

+
+

+ open +

+
+

+ Open the serial port using the specified device name. +

+
+

+ operator= +

+
+

+ Move-assign a basic_serial_port from another. +

+
+

+ read_some +

+
+

+ Read some data from the serial port. +

+
+

+ send_break +

+
+

+ Send a break sequence to the serial port. +

+
+

+ set_option +

+
+

+ Set an option on the serial port. +

+
+

+ write_some +

+
+

+ Write some data to the serial port. +

+
+

+ ~basic_serial_port [destructor] +

+
+

+ Destroys the serial port. +

+
+

+ The basic_serial_port + class provides a wrapper over serial port functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_serial_port.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set.html b/include/asio/doc/asio/reference/basic_signal_set.html new file mode 100644 index 0000000..aeae8e2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set.html @@ -0,0 +1,310 @@ + + + +basic_signal_set + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides signal functionality. +

+
template<
+    typename Executor = any_io_executor>
+class basic_signal_set
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the signal set type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add +

+
+

+ Add a signal to a signal_set. +

+
+

+ async_wait +

+
+

+ Start an asynchronous operation to wait for a signal to be delivered. +

+
+

+ basic_signal_set [constructor] +

+
+

+ Construct a signal set without adding any signals.
—
+ Construct a signal set and add one signal.
—
Construct + a signal set and add two signals.
—
Construct a signal + set and add three signals. +

+
+

+ cancel +

+
+

+ Cancel all operations associated with the signal set. +

+
+

+ clear +

+
+

+ Remove all signals from a signal_set. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ remove +

+
+

+ Remove a signal from a signal_set. +

+
+

+ ~basic_signal_set [destructor] +

+
+

+ Destroys the signal set. +

+
+

+ The basic_signal_set + class provides the ability to perform an asynchronous wait for one or more + signals to occur. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ Performing an asynchronous wait: +

+
void handler(
+    const asio::error_code& error,
+    int signal_number)
+{
+  if (!error)
+  {
+    // A signal occurred.
+  }
+}
+
+...
+
+// Construct a signal set registered for process termination.
+asio::signal_set signals(my_context, SIGINT, SIGTERM);
+
+// Start an asynchronous wait for one of the signals to occur.
+signals.async_wait(handler);
+
+
+ + Queueing + of signal notifications +
+

+ If a signal is registered with a signal_set, and the signal occurs when there + are no waiting handlers, then the signal notification is queued. The next + async_wait operation on that signal_set will dequeue the notification. If + multiple notifications are queued, subsequent async_wait operations dequeue + them one at a time. Signal notifications are dequeued in order of ascending + signal number. +

+

+ If a signal number is removed from a signal_set (using the remove + or erase member functions) then any queued notifications for + that signal are discarded. +

+
+ + Multiple + registration of signals +
+

+ The same signal number may be registered with different signal_set objects. + When the signal occurs, one handler is called for each signal_set object. +

+

+ Note that multiple registration only works for signals that are registered + using Asio. The application must not also register a signal handler using + functions such as signal() or sigaction(). +

+
+ + Signal + masking on POSIX platforms +
+

+ POSIX allows signals to be blocked using functions such as sigprocmask() + and pthread_sigmask(). For signals to be delivered, programs + must ensure that any signals registered using signal_set objects are unblocked + in at least one thread. +

+
+ + Requirements +
+

+ Header: asio/basic_signal_set.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/_basic_signal_set.html b/include/asio/doc/asio/reference/basic_signal_set/_basic_signal_set.html new file mode 100644 index 0000000..ec783fc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/_basic_signal_set.html @@ -0,0 +1,48 @@ + + + +basic_signal_set::~basic_signal_set + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the signal set. +

+
~basic_signal_set();
+
+

+ This function destroys the signal set, cancelling any outstanding asynchronous + wait operations associated with the signal set as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/add.html b/include/asio/doc/asio/reference/basic_signal_set/add.html new file mode 100644 index 0000000..e32feb3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/add.html @@ -0,0 +1,51 @@ + + + +basic_signal_set::add + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Add a signal to a + signal_set. +

+
void add(
+    int signal_number);
+  » more...
+
+void add(
+    int signal_number,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/add/overload1.html b/include/asio/doc/asio/reference/basic_signal_set/add/overload1.html new file mode 100644 index 0000000..0cd1ee4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/add/overload1.html @@ -0,0 +1,74 @@ + + + +basic_signal_set::add (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Add a signal to a signal_set. +

+
void add(
+    int signal_number);
+
+

+ This function adds the specified signal to the set. It has no effect + if the signal is already in the set. +

+
+ + Parameters +
+
+

+
+
signal_number
+

+ The signal to be added to the set. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/add/overload2.html b/include/asio/doc/asio/reference/basic_signal_set/add/overload2.html new file mode 100644 index 0000000..982a00d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/add/overload2.html @@ -0,0 +1,66 @@ + + + +basic_signal_set::add (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Add a signal to a signal_set. +

+
void add(
+    int signal_number,
+    asio::error_code & ec);
+
+

+ This function adds the specified signal to the set. It has no effect + if the signal is already in the set. +

+
+ + Parameters +
+
+

+
+
signal_number
+

+ The signal to be added to the set. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/async_wait.html b/include/asio/doc/asio/reference/basic_signal_set/async_wait.html new file mode 100644 index 0000000..e547f64 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/async_wait.html @@ -0,0 +1,92 @@ + + + +basic_signal_set::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous operation to wait for a signal to be delivered. +

+
template<
+    typename SignalHandler = DEFAULT>
+DEDUCED async_wait(
+    SignalHandler && handler = DEFAULT);
+
+

+ This function may be used to initiate an asynchronous wait against the + signal set. It always returns immediately. +

+

+ For each call to async_wait(), the supplied handler will be + called exactly once. The handler will be called when: +

+
    +
  • + One of the registered signals in the signal set occurs; or +
  • +
  • + The signal set was cancelled, in which case the handler is passed the + error code asio::error::operation_aborted. +
  • +
+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called when the signal occurs. Copies will be made + of the handler as required. The function signature of the handler + must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  int signal_number // Indicates which signal occurred.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set.html new file mode 100644 index 0000000..8d86cc9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set.html @@ -0,0 +1,107 @@ + + + +basic_signal_set::basic_signal_set + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a signal set without adding any signals. +

+
explicit basic_signal_set(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_signal_set(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a signal set and add one signal. +

+
basic_signal_set(
+    const executor_type & ex,
+    int signal_number_1);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_signal_set(
+    ExecutionContext & context,
+    int signal_number_1,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a signal set and add two signals. +

+
basic_signal_set(
+    const executor_type & ex,
+    int signal_number_1,
+    int signal_number_2);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_signal_set(
+    ExecutionContext & context,
+    int signal_number_1,
+    int signal_number_2,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a signal set and add three signals. +

+
basic_signal_set(
+    const executor_type & ex,
+    int signal_number_1,
+    int signal_number_2,
+    int signal_number_3);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_signal_set(
+    ExecutionContext & context,
+    int signal_number_1,
+    int signal_number_2,
+    int signal_number_3,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload1.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload1.html new file mode 100644 index 0000000..5d78b85 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload1.html @@ -0,0 +1,62 @@ + + + +basic_signal_set::basic_signal_set (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set without adding any signals. +

+
basic_signal_set(
+    const executor_type & ex);
+
+

+ This constructor creates a signal set without registering for any signals. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the signal set will use, by default, to dispatch + handlers for any asynchronous operations performed on the signal + set. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload2.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload2.html new file mode 100644 index 0000000..0155d2a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload2.html @@ -0,0 +1,65 @@ + + + +basic_signal_set::basic_signal_set (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set without adding any signals. +

+
template<
+    typename ExecutionContext>
+basic_signal_set(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a signal set without registering for any signals. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the signal + set will use, by default, to dispatch handlers for any asynchronous + operations performed on the signal set. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload3.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload3.html new file mode 100644 index 0000000..cf95ac7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload3.html @@ -0,0 +1,77 @@ + + + +basic_signal_set::basic_signal_set (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set and add one signal. +

+
basic_signal_set(
+    const executor_type & ex,
+    int signal_number_1);
+
+

+ This constructor creates a signal set and registers for one signal. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the signal set will use, by default, to dispatch + handlers for any asynchronous operations performed on the signal + set. +

+
signal_number_1
+

+ The signal number to be added. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to performing: +

+
asio::signal_set signals(ex);
+signals.add(signal_number_1);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload4.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload4.html new file mode 100644 index 0000000..cd5e13f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload4.html @@ -0,0 +1,80 @@ + + + +basic_signal_set::basic_signal_set (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set and add one signal. +

+
template<
+    typename ExecutionContext>
+basic_signal_set(
+    ExecutionContext & context,
+    int signal_number_1,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a signal set and registers for one signal. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the signal + set will use, by default, to dispatch handlers for any asynchronous + operations performed on the signal set. +

+
signal_number_1
+

+ The signal number to be added. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to performing: +

+
asio::signal_set signals(context);
+signals.add(signal_number_1);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload5.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload5.html new file mode 100644 index 0000000..f2c5530 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload5.html @@ -0,0 +1,83 @@ + + + +basic_signal_set::basic_signal_set (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set and add two signals. +

+
basic_signal_set(
+    const executor_type & ex,
+    int signal_number_1,
+    int signal_number_2);
+
+

+ This constructor creates a signal set and registers for two signals. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the signal set will use, by default, to dispatch + handlers for any asynchronous operations performed on the signal + set. +

+
signal_number_1
+

+ The first signal number to be added. +

+
signal_number_2
+

+ The second signal number to be added. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to performing: +

+
asio::signal_set signals(ex);
+signals.add(signal_number_1);
+signals.add(signal_number_2);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload6.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload6.html new file mode 100644 index 0000000..5893207 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload6.html @@ -0,0 +1,86 @@ + + + +basic_signal_set::basic_signal_set (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set and add two signals. +

+
template<
+    typename ExecutionContext>
+basic_signal_set(
+    ExecutionContext & context,
+    int signal_number_1,
+    int signal_number_2,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a signal set and registers for two signals. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the signal + set will use, by default, to dispatch handlers for any asynchronous + operations performed on the signal set. +

+
signal_number_1
+

+ The first signal number to be added. +

+
signal_number_2
+

+ The second signal number to be added. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to performing: +

+
asio::signal_set signals(context);
+signals.add(signal_number_1);
+signals.add(signal_number_2);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload7.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload7.html new file mode 100644 index 0000000..a008bb6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload7.html @@ -0,0 +1,89 @@ + + + +basic_signal_set::basic_signal_set (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set and add three signals. +

+
basic_signal_set(
+    const executor_type & ex,
+    int signal_number_1,
+    int signal_number_2,
+    int signal_number_3);
+
+

+ This constructor creates a signal set and registers for three signals. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the signal set will use, by default, to dispatch + handlers for any asynchronous operations performed on the signal + set. +

+
signal_number_1
+

+ The first signal number to be added. +

+
signal_number_2
+

+ The second signal number to be added. +

+
signal_number_3
+

+ The third signal number to be added. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to performing: +

+
asio::signal_set signals(ex);
+signals.add(signal_number_1);
+signals.add(signal_number_2);
+signals.add(signal_number_3);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload8.html b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload8.html new file mode 100644 index 0000000..407eb8e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/basic_signal_set/overload8.html @@ -0,0 +1,92 @@ + + + +basic_signal_set::basic_signal_set (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a signal set and add three signals. +

+
template<
+    typename ExecutionContext>
+basic_signal_set(
+    ExecutionContext & context,
+    int signal_number_1,
+    int signal_number_2,
+    int signal_number_3,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a signal set and registers for three signals. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the signal + set will use, by default, to dispatch handlers for any asynchronous + operations performed on the signal set. +

+
signal_number_1
+

+ The first signal number to be added. +

+
signal_number_2
+

+ The second signal number to be added. +

+
signal_number_3
+

+ The third signal number to be added. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to performing: +

+
asio::signal_set signals(context);
+signals.add(signal_number_1);
+signals.add(signal_number_2);
+signals.add(signal_number_3);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/cancel.html b/include/asio/doc/asio/reference/basic_signal_set/cancel.html new file mode 100644 index 0000000..a36d779 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/cancel.html @@ -0,0 +1,49 @@ + + + +basic_signal_set::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel all + operations associated with the signal set. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/cancel/overload1.html b/include/asio/doc/asio/reference/basic_signal_set/cancel/overload1.html new file mode 100644 index 0000000..8d79481 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/cancel/overload1.html @@ -0,0 +1,85 @@ + + + +basic_signal_set::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all operations associated with the signal set. +

+
void cancel();
+
+

+ This function forces the completion of any pending asynchronous wait + operations against the signal set. The handler for each cancelled operation + will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancellation does not alter the set of registered signals. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If a registered signal occurred before cancel() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/cancel/overload2.html b/include/asio/doc/asio/reference/basic_signal_set/cancel/overload2.html new file mode 100644 index 0000000..e102ea9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/cancel/overload2.html @@ -0,0 +1,86 @@ + + + +basic_signal_set::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all operations associated with the signal set. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function forces the completion of any pending asynchronous wait + operations against the signal set. The handler for each cancelled operation + will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancellation does not alter the set of registered signals. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ If a registered signal occurred before cancel() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/clear.html b/include/asio/doc/asio/reference/basic_signal_set/clear.html new file mode 100644 index 0000000..93fce97 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/clear.html @@ -0,0 +1,49 @@ + + + +basic_signal_set::clear + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Remove all signals + from a signal_set. +

+
void clear();
+  » more...
+
+void clear(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/clear/overload1.html b/include/asio/doc/asio/reference/basic_signal_set/clear/overload1.html new file mode 100644 index 0000000..058b50a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/clear/overload1.html @@ -0,0 +1,67 @@ + + + +basic_signal_set::clear (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Remove all signals from a signal_set. +

+
void clear();
+
+

+ This function removes all signals from the set. It has no effect if the + set is already empty. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Removes all queued notifications. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/clear/overload2.html b/include/asio/doc/asio/reference/basic_signal_set/clear/overload2.html new file mode 100644 index 0000000..c9fd4cc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/clear/overload2.html @@ -0,0 +1,68 @@ + + + +basic_signal_set::clear (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Remove all signals from a signal_set. +

+
void clear(
+    asio::error_code & ec);
+
+

+ This function removes all signals from the set. It has no effect if the + set is already empty. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Removes all queued notifications. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/executor_type.html b/include/asio/doc/asio/reference/basic_signal_set/executor_type.html new file mode 100644 index 0000000..8201500 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_signal_set::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_signal_set.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/get_executor.html b/include/asio/doc/asio/reference/basic_signal_set/get_executor.html new file mode 100644 index 0000000..74643f8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/get_executor.html @@ -0,0 +1,44 @@ + + + +basic_signal_set::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/remove.html b/include/asio/doc/asio/reference/basic_signal_set/remove.html new file mode 100644 index 0000000..06775d0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/remove.html @@ -0,0 +1,51 @@ + + + +basic_signal_set::remove + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Remove a signal + from a signal_set. +

+
void remove(
+    int signal_number);
+  » more...
+
+void remove(
+    int signal_number,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/remove/overload1.html b/include/asio/doc/asio/reference/basic_signal_set/remove/overload1.html new file mode 100644 index 0000000..2d639c7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/remove/overload1.html @@ -0,0 +1,82 @@ + + + +basic_signal_set::remove (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Remove a signal from a signal_set. +

+
void remove(
+    int signal_number);
+
+

+ This function removes the specified signal from the set. It has no effect + if the signal is not in the set. +

+
+ + Parameters +
+
+

+
+
signal_number
+

+ The signal to be removed from the set. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Removes any notifications that have been queued for the specified signal + number. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set/remove/overload2.html b/include/asio/doc/asio/reference/basic_signal_set/remove/overload2.html new file mode 100644 index 0000000..deea467 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set/remove/overload2.html @@ -0,0 +1,74 @@ + + + +basic_signal_set::remove (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Remove a signal from a signal_set. +

+
void remove(
+    int signal_number,
+    asio::error_code & ec);
+
+

+ This function removes the specified signal from the set. It has no effect + if the signal is not in the set. +

+
+ + Parameters +
+
+

+
+
signal_number
+

+ The signal to be removed from the set. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Removes any notifications that have been queued for the specified signal + number. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set__rebind_executor.html b/include/asio/doc/asio/reference/basic_signal_set__rebind_executor.html new file mode 100644 index 0000000..fd01a50 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_signal_set::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the signal set type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The signal set type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_signal_set.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_signal_set__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_signal_set__rebind_executor/other.html new file mode 100644 index 0000000..58c58cb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_signal_set__rebind_executor/other.html @@ -0,0 +1,310 @@ + + + +basic_signal_set::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + signal set type when rebound to the specified executor. +

+
typedef basic_signal_set< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the signal set type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add +

+
+

+ Add a signal to a signal_set. +

+
+

+ async_wait +

+
+

+ Start an asynchronous operation to wait for a signal to be delivered. +

+
+

+ basic_signal_set [constructor] +

+
+

+ Construct a signal set without adding any signals.
—
+ Construct a signal set and add one signal.
—
Construct + a signal set and add two signals.
—
Construct a signal + set and add three signals. +

+
+

+ cancel +

+
+

+ Cancel all operations associated with the signal set. +

+
+

+ clear +

+
+

+ Remove all signals from a signal_set. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ remove +

+
+

+ Remove a signal from a signal_set. +

+
+

+ ~basic_signal_set [destructor] +

+
+

+ Destroys the signal set. +

+
+

+ The basic_signal_set + class provides the ability to perform an asynchronous wait for one or more + signals to occur. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ Performing an asynchronous wait: +

+
void handler(
+    const asio::error_code& error,
+    int signal_number)
+{
+  if (!error)
+  {
+    // A signal occurred.
+  }
+}
+
+...
+
+// Construct a signal set registered for process termination.
+asio::signal_set signals(my_context, SIGINT, SIGTERM);
+
+// Start an asynchronous wait for one of the signals to occur.
+signals.async_wait(handler);
+
+
+ + Queueing + of signal notifications +
+

+ If a signal is registered with a signal_set, and the signal occurs when + there are no waiting handlers, then the signal notification is queued. + The next async_wait operation on that signal_set will dequeue the notification. + If multiple notifications are queued, subsequent async_wait operations + dequeue them one at a time. Signal notifications are dequeued in order + of ascending signal number. +

+

+ If a signal number is removed from a signal_set (using the remove + or erase member functions) then any queued notifications for + that signal are discarded. +

+
+ + Multiple + registration of signals +
+

+ The same signal number may be registered with different signal_set objects. + When the signal occurs, one handler is called for each signal_set object. +

+

+ Note that multiple registration only works for signals that are registered + using Asio. The application must not also register a signal handler using + functions such as signal() or sigaction(). +

+
+ + Signal + masking on POSIX platforms +
+

+ POSIX allows signals to be blocked using functions such as sigprocmask() + and pthread_sigmask(). For signals to be delivered, programs + must ensure that any signals registered using signal_set objects are unblocked + in at least one thread. +

+
+ + Requirements +
+

+ Header: asio/basic_signal_set.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket.html b/include/asio/doc/asio/reference/basic_socket.html new file mode 100644 index 0000000..0fabb32 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket.html @@ -0,0 +1,845 @@ + + + +basic_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides socket functionality. +

+
template<
+    typename Protocol,
+    typename Executor>
+class basic_socket :
+  public socket_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close if + unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_socket [constructor] +

+
+

+ Construct a basic_socket without opening it.
—
Construct + and open a basic_socket.
—
Construct a basic_socket, + opening it and binding it to the given local endpoint.
— +
Construct a basic_socket on an existing native socket. +
—
Move-construct a basic_socket from another.
+ —
Move-construct a basic_socket from a socket of another protocol + type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets the + non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket from another.
—
Move-assign + a basic_socket from a socket of another protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, or + to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_socket [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length of + the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket + class template provides functionality that is common to both stream-oriented + and datagram-oriented sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/_basic_socket.html b/include/asio/doc/asio/reference/basic_socket/_basic_socket.html new file mode 100644 index 0000000..2ab3f19 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/_basic_socket.html @@ -0,0 +1,48 @@ + + + +basic_socket::~basic_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~basic_socket();
+
+

+ This function destroys the socket, cancelling any outstanding asynchronous + operations associated with the socket as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/assign.html b/include/asio/doc/asio/reference/basic_socket/assign.html new file mode 100644 index 0000000..baf4ff0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/assign.html @@ -0,0 +1,53 @@ + + + +basic_socket::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign an existing + native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/assign/overload1.html b/include/asio/doc/asio/reference/basic_socket/assign/overload1.html new file mode 100644 index 0000000..ddbd962 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/assign/overload1.html @@ -0,0 +1,45 @@ + + + +basic_socket::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/assign/overload2.html b/include/asio/doc/asio/reference/basic_socket/assign/overload2.html new file mode 100644 index 0000000..ac85af2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/assign/overload2.html @@ -0,0 +1,46 @@ + + + +basic_socket::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/async_connect.html b/include/asio/doc/asio/reference/basic_socket/async_connect.html new file mode 100644 index 0000000..5b385c3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/async_connect.html @@ -0,0 +1,108 @@ + + + +basic_socket::async_connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous connect. +

+
template<
+    typename ConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    const endpoint_type & peer_endpoint,
+    ConnectHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously connect a socket to the specified + remote endpoint. The function call always returns immediately. +

+

+ The socket is automatically opened if it is not already open. If the connect + fails, and the socket was automatically opened, the socket is not returned + to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. Copies + will be made of the endpoint object as required. +

+
handler
+
+

+ The handler to be called when the connection operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void connect_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Connect succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.async_connect(endpoint, connect_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/async_wait.html b/include/asio/doc/asio/reference/basic_socket/async_wait.html new file mode 100644 index 0000000..78c7b25 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/async_wait.html @@ -0,0 +1,102 @@ + + + +basic_socket::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Asynchronously + wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+...
+socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/at_mark.html b/include/asio/doc/asio/reference/basic_socket/at_mark.html new file mode 100644 index 0000000..ef24448 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/at_mark.html @@ -0,0 +1,49 @@ + + + +basic_socket::at_mark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine whether + the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+  » more...
+
+bool at_mark(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/at_mark/overload1.html b/include/asio/doc/asio/reference/basic_socket/at_mark/overload1.html new file mode 100644 index 0000000..b5630b4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/at_mark/overload1.html @@ -0,0 +1,68 @@ + + + +basic_socket::at_mark (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/at_mark/overload2.html b/include/asio/doc/asio/reference/basic_socket/at_mark/overload2.html new file mode 100644 index 0000000..430d8be --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/at_mark/overload2.html @@ -0,0 +1,69 @@ + + + +basic_socket::at_mark (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark(
+    asio::error_code & ec) const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/available.html b/include/asio/doc/asio/reference/basic_socket/available.html new file mode 100644 index 0000000..8d4ce30 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/available.html @@ -0,0 +1,49 @@ + + + +basic_socket::available + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine the + number of bytes available for reading. +

+
std::size_t available() const;
+  » more...
+
+std::size_t available(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/available/overload1.html b/include/asio/doc/asio/reference/basic_socket/available/overload1.html new file mode 100644 index 0000000..fbc1d19 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/available/overload1.html @@ -0,0 +1,69 @@ + + + +basic_socket::available (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the number of bytes available for reading. +

+
std::size_t available() const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/available/overload2.html b/include/asio/doc/asio/reference/basic_socket/available/overload2.html new file mode 100644 index 0000000..73ac14f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/available/overload2.html @@ -0,0 +1,70 @@ + + + +basic_socket::available (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the number of bytes available for reading. +

+
std::size_t available(
+    asio::error_code & ec) const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket.html b/include/asio/doc/asio/reference/basic_socket/basic_socket.html new file mode 100644 index 0000000..e88a37c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket.html @@ -0,0 +1,126 @@ + + + +basic_socket::basic_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_socket + without opening it. +

+
explicit basic_socket(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct and open a basic_socket. +

+
basic_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_socket, + opening it and binding it to the given local endpoint. +

+
basic_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_socket + on an existing native socket. +

+
basic_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_socket + from another. +

+
basic_socket(
+    basic_socket && other);
+  » more...
+
+

+ Move-construct a basic_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_socket(
+    basic_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload1.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload1.html new file mode 100644 index 0000000..6e7353c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload1.html @@ -0,0 +1,62 @@ + + + +basic_socket::basic_socket (1 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket + without opening it. +

+
basic_socket(
+    const executor_type & ex);
+
+

+ This constructor creates a socket without opening it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload10.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload10.html new file mode 100644 index 0000000..687559c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload10.html @@ -0,0 +1,74 @@ + + + +basic_socket::basic_socket (10 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_socket(
+    basic_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+
+

+ This constructor moves a socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload2.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload2.html new file mode 100644 index 0000000..6cb8bc2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload2.html @@ -0,0 +1,66 @@ + + + +basic_socket::basic_socket (2 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket + without opening it. +

+
template<
+    typename ExecutionContext>
+basic_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a socket without opening it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload3.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload3.html new file mode 100644 index 0000000..9d5552f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload3.html @@ -0,0 +1,79 @@ + + + +basic_socket::basic_socket (3 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_socket. +

+
basic_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+
+

+ This constructor creates and opens a socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload4.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload4.html new file mode 100644 index 0000000..caae62f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload4.html @@ -0,0 +1,83 @@ + + + +basic_socket::basic_socket (4 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_socket. +

+
template<
+    typename ExecutionContext>
+basic_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates and opens a socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload5.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload5.html new file mode 100644 index 0000000..9d7aaf4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload5.html @@ -0,0 +1,82 @@ + + + +basic_socket::basic_socket (5 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket, + opening it and binding it to the given local endpoint. +

+
basic_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+
+

+ This constructor creates a socket and automatically opens it bound to + the specified endpoint on the local machine. The protocol used is the + protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload6.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload6.html new file mode 100644 index 0000000..7b1f1ba --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload6.html @@ -0,0 +1,86 @@ + + + +basic_socket::basic_socket (6 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket, + opening it and binding it to the given local endpoint. +

+
template<
+    typename ExecutionContext>
+basic_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a socket and automatically opens it bound to + the specified endpoint on the local machine. The protocol used is the + protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload7.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload7.html new file mode 100644 index 0000000..988a953 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload7.html @@ -0,0 +1,85 @@ + + + +basic_socket::basic_socket (7 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket + on an existing native socket. +

+
basic_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+

+ This constructor creates a socket object to hold an existing native socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ A native socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload8.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload8.html new file mode 100644 index 0000000..59e406b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload8.html @@ -0,0 +1,89 @@ + + + +basic_socket::basic_socket (8 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket + on an existing native socket. +

+
template<
+    typename ExecutionContext>
+basic_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a socket object to hold an existing native socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ A native socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/basic_socket/overload9.html b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload9.html new file mode 100644 index 0000000..e42377f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/basic_socket/overload9.html @@ -0,0 +1,70 @@ + + + +basic_socket::basic_socket (9 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_socket + from another. +

+
basic_socket(
+    basic_socket && other);
+
+

+ This constructor moves a socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/bind.html b/include/asio/doc/asio/reference/basic_socket/bind.html new file mode 100644 index 0000000..117cda7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/bind.html @@ -0,0 +1,51 @@ + + + +basic_socket::bind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bind the socket to the + given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+  » more...
+
+void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/bind/overload1.html b/include/asio/doc/asio/reference/basic_socket/bind/overload1.html new file mode 100644 index 0000000..8d766b9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/bind/overload1.html @@ -0,0 +1,83 @@ + + + +basic_socket::bind (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/bind/overload2.html b/include/asio/doc/asio/reference/basic_socket/bind/overload2.html new file mode 100644 index 0000000..bdc0eb1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/bind/overload2.html @@ -0,0 +1,80 @@ + + + +basic_socket::bind (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+asio::error_code ec;
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/broadcast.html b/include/asio/doc/asio/reference/basic_socket/broadcast.html new file mode 100644 index 0000000..fced0c0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/broadcast.html @@ -0,0 +1,81 @@ + + + +basic_socket::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket option + to permit sending of broadcast messages. +

+
typedef implementation_defined broadcast;
+
+

+ Implements the SOL_SOCKET/SO_BROADCAST socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/bytes_readable.html b/include/asio/doc/asio/reference/basic_socket/bytes_readable.html new file mode 100644 index 0000000..d932409 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/bytes_readable.html @@ -0,0 +1,70 @@ + + + +basic_socket::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::bytes_readable command(true);
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/cancel.html b/include/asio/doc/asio/reference/basic_socket/cancel.html new file mode 100644 index 0000000..71ec943 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/cancel.html @@ -0,0 +1,49 @@ + + + +basic_socket::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel all asynchronous + operations associated with the socket. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/cancel/overload1.html b/include/asio/doc/asio/reference/basic_socket/cancel/overload1.html new file mode 100644 index 0000000..29c73bd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/cancel/overload1.html @@ -0,0 +1,101 @@ + + + +basic_socket::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/cancel/overload2.html b/include/asio/doc/asio/reference/basic_socket/cancel/overload2.html new file mode 100644 index 0000000..60f0535 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/cancel/overload2.html @@ -0,0 +1,102 @@ + + + +basic_socket::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/close.html b/include/asio/doc/asio/reference/basic_socket/close.html new file mode 100644 index 0000000..e907e28 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/close.html @@ -0,0 +1,48 @@ + + + +basic_socket::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close the socket. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/close/overload1.html b/include/asio/doc/asio/reference/basic_socket/close/overload1.html new file mode 100644 index 0000000..3279eff --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/close/overload1.html @@ -0,0 +1,70 @@ + + + +basic_socket::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the socket. +

+
void close();
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. Note that, even if the function indicates an + error, the underlying descriptor is closed. +

+
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/close/overload2.html b/include/asio/doc/asio/reference/basic_socket/close/overload2.html new file mode 100644 index 0000000..6cae458 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/close/overload2.html @@ -0,0 +1,84 @@ + + + +basic_socket::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the socket. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. Note that, even if + the function indicates an error, the underlying descriptor is closed. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.close(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/connect.html b/include/asio/doc/asio/reference/basic_socket/connect.html new file mode 100644 index 0000000..99825d9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/connect.html @@ -0,0 +1,51 @@ + + + +basic_socket::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Connect the socket + to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+  » more...
+
+void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/connect/overload1.html b/include/asio/doc/asio/reference/basic_socket/connect/overload1.html new file mode 100644 index 0000000..c5d19e9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/connect/overload1.html @@ -0,0 +1,89 @@ + + + +basic_socket::connect (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.connect(endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/connect/overload2.html b/include/asio/doc/asio/reference/basic_socket/connect/overload2.html new file mode 100644 index 0000000..e4e1da4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/connect/overload2.html @@ -0,0 +1,86 @@ + + + +basic_socket::connect (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+asio::error_code ec;
+socket.connect(endpoint, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/debug.html b/include/asio/doc/asio/reference/basic_socket/debug.html new file mode 100644 index 0000000..46d381f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/debug.html @@ -0,0 +1,81 @@ + + + +basic_socket::debug + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket option to enable + socket-level debugging. +

+
typedef implementation_defined debug;
+
+

+ Implements the SOL_SOCKET/SO_DEBUG socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/do_not_route.html b/include/asio/doc/asio/reference/basic_socket/do_not_route.html new file mode 100644 index 0000000..7267d43 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/do_not_route.html @@ -0,0 +1,81 @@ + + + +basic_socket::do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to prevent routing, use local interfaces only. +

+
typedef implementation_defined do_not_route;
+
+

+ Implements the SOL_SOCKET/SO_DONTROUTE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/enable_connection_aborted.html b/include/asio/doc/asio/reference/basic_socket/enable_connection_aborted.html new file mode 100644 index 0000000..ab404ca --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/enable_connection_aborted.html @@ -0,0 +1,83 @@ + + + +basic_socket::enable_connection_aborted + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to report aborted connections on accept. +

+
typedef implementation_defined enable_connection_aborted;
+
+

+ Implements a custom socket option that determines whether or not an accept + operation is permitted to fail with asio::error::connection_aborted. + By default the option is false. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/endpoint_type.html b/include/asio/doc/asio/reference/basic_socket/endpoint_type.html new file mode 100644 index 0000000..85de705 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_socket::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The endpoint + type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/executor_type.html b/include/asio/doc/asio/reference/basic_socket/executor_type.html new file mode 100644 index 0000000..894395c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_socket::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/get_executor.html b/include/asio/doc/asio/reference/basic_socket/get_executor.html new file mode 100644 index 0000000..d8b5bbf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/get_executor.html @@ -0,0 +1,44 @@ + + + +basic_socket::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/get_option.html b/include/asio/doc/asio/reference/basic_socket/get_option.html new file mode 100644 index 0000000..18ebef1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/get_option.html @@ -0,0 +1,55 @@ + + + +basic_socket::get_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get an option + from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+  » more...
+
+template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/get_option/overload1.html b/include/asio/doc/asio/reference/basic_socket/get_option/overload1.html new file mode 100644 index 0000000..e1e03a3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/get_option/overload1.html @@ -0,0 +1,88 @@ + + + +basic_socket::get_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/get_option/overload2.html b/include/asio/doc/asio/reference/basic_socket/get_option/overload2.html new file mode 100644 index 0000000..b5c9412 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/get_option/overload2.html @@ -0,0 +1,85 @@ + + + +basic_socket::get_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+asio::error_code ec;
+socket.get_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/io_control.html b/include/asio/doc/asio/reference/basic_socket/io_control.html new file mode 100644 index 0000000..066c666 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/io_control.html @@ -0,0 +1,55 @@ + + + +basic_socket::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform an + IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/io_control/overload1.html b/include/asio/doc/asio/reference/basic_socket/io_control/overload1.html new file mode 100644 index 0000000..f1a0c6a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/io_control/overload1.html @@ -0,0 +1,88 @@ + + + +basic_socket::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/io_control/overload2.html b/include/asio/doc/asio/reference/basic_socket/io_control/overload2.html new file mode 100644 index 0000000..9d56106 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/io_control/overload2.html @@ -0,0 +1,85 @@ + + + +basic_socket::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+asio::error_code ec;
+socket.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/is_open.html b/include/asio/doc/asio/reference/basic_socket/is_open.html new file mode 100644 index 0000000..c2046cc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/is_open.html @@ -0,0 +1,44 @@ + + + +basic_socket::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine whether + the socket is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/keep_alive.html b/include/asio/doc/asio/reference/basic_socket/keep_alive.html new file mode 100644 index 0000000..e74bb68 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/keep_alive.html @@ -0,0 +1,81 @@ + + + +basic_socket::keep_alive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket option + to send keep-alives. +

+
typedef implementation_defined keep_alive;
+
+

+ Implements the SOL_SOCKET/SO_KEEPALIVE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/linger.html b/include/asio/doc/asio/reference/basic_socket/linger.html new file mode 100644 index 0000000..b883e37 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/linger.html @@ -0,0 +1,82 @@ + + + +basic_socket::linger + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket option to specify + whether the socket lingers on close if unsent data is present. +

+
typedef implementation_defined linger;
+
+

+ Implements the SOL_SOCKET/SO_LINGER socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option(true, 30);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option;
+socket.get_option(option);
+bool is_set = option.enabled();
+unsigned short timeout = option.timeout();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/local_endpoint.html b/include/asio/doc/asio/reference/basic_socket/local_endpoint.html new file mode 100644 index 0000000..3535e2b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/local_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_socket::local_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+  » more...
+
+endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/local_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_socket/local_endpoint/overload1.html new file mode 100644 index 0000000..3028f70 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/local_endpoint/overload1.html @@ -0,0 +1,75 @@ + + + +basic_socket::local_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/local_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_socket/local_endpoint/overload2.html new file mode 100644 index 0000000..1097c6f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/local_endpoint/overload2.html @@ -0,0 +1,82 @@ + + + +basic_socket::local_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. Returns a + default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/lowest_layer.html b/include/asio/doc/asio/reference/basic_socket/lowest_layer.html new file mode 100644 index 0000000..f1318d8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/lowest_layer.html @@ -0,0 +1,51 @@ + + + +basic_socket::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a reference + to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/lowest_layer/overload1.html b/include/asio/doc/asio/reference/basic_socket/lowest_layer/overload1.html new file mode 100644 index 0000000..1548cc6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/lowest_layer/overload1.html @@ -0,0 +1,57 @@ + + + +basic_socket::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/lowest_layer/overload2.html b/include/asio/doc/asio/reference/basic_socket/lowest_layer/overload2.html new file mode 100644 index 0000000..e5eee8d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/lowest_layer/overload2.html @@ -0,0 +1,57 @@ + + + +basic_socket::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/lowest_layer_type.html b/include/asio/doc/asio/reference/basic_socket/lowest_layer_type.html new file mode 100644 index 0000000..75ce33c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/lowest_layer_type.html @@ -0,0 +1,846 @@ + + + +basic_socket::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + basic_socket + is always the lowest layer. +

+
typedef basic_socket< Protocol, Executor > lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_socket [constructor] +

+
+

+ Construct a basic_socket without opening it.
—
Construct + and open a basic_socket.
—
Construct a basic_socket, + opening it and binding it to the given local endpoint.
+ —
Construct a basic_socket on an existing native socket. +
—
Move-construct a basic_socket from another.
+ —
Move-construct a basic_socket from a socket of another + protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket from another.
—
Move-assign + a basic_socket from a socket of another protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_socket [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket + class template provides functionality that is common to both stream-oriented + and datagram-oriented sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/max_connections.html b/include/asio/doc/asio/reference/basic_socket/max_connections.html new file mode 100644 index 0000000..439f3d9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/max_connections.html @@ -0,0 +1,48 @@ + + + +basic_socket::max_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +(Deprecated: + Use max_listen_connections.) The maximum length of the queue of pending + incoming connections. +

+
static const int max_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/max_listen_connections.html b/include/asio/doc/asio/reference/basic_socket/max_listen_connections.html new file mode 100644 index 0000000..4d9e5ea --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/max_listen_connections.html @@ -0,0 +1,47 @@ + + + +basic_socket::max_listen_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +The + maximum length of the queue of pending incoming connections. +

+
static const int max_listen_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/message_do_not_route.html b/include/asio/doc/asio/reference/basic_socket/message_do_not_route.html new file mode 100644 index 0000000..1395267 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/message_do_not_route.html @@ -0,0 +1,47 @@ + + + +basic_socket::message_do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specify + that the data should not be subject to routing. +

+
static const int message_do_not_route = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/message_end_of_record.html b/include/asio/doc/asio/reference/basic_socket/message_end_of_record.html new file mode 100644 index 0000000..7a4222d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/message_end_of_record.html @@ -0,0 +1,47 @@ + + + +basic_socket::message_end_of_record + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specifies + that the data marks the end of a record. +

+
static const int message_end_of_record = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/message_flags.html b/include/asio/doc/asio/reference/basic_socket/message_flags.html new file mode 100644 index 0000000..1f98d7b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/message_flags.html @@ -0,0 +1,57 @@ + + + +basic_socket::message_flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Bitmask + type for flags that can be passed to send and receive operations. +

+
typedef int message_flags;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/message_out_of_band.html b/include/asio/doc/asio/reference/basic_socket/message_out_of_band.html new file mode 100644 index 0000000..59666cf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/message_out_of_band.html @@ -0,0 +1,47 @@ + + + +basic_socket::message_out_of_band + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Process + out-of-band data. +

+
static const int message_out_of_band = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/message_peek.html b/include/asio/doc/asio/reference/basic_socket/message_peek.html new file mode 100644 index 0000000..31281d7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/message_peek.html @@ -0,0 +1,47 @@ + + + +basic_socket::message_peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Peek at + incoming data without removing it from the input queue. +

+
static const int message_peek = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/native_handle.html b/include/asio/doc/asio/reference/basic_socket/native_handle.html new file mode 100644 index 0000000..b777f3e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/native_handle.html @@ -0,0 +1,49 @@ + + + +basic_socket::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + native socket representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + socket. This is intended to allow access to native socket functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/native_handle_type.html b/include/asio/doc/asio/reference/basic_socket/native_handle_type.html new file mode 100644 index 0000000..88482aa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/native_handle_type.html @@ -0,0 +1,54 @@ + + + +basic_socket::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a socket. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/native_non_blocking.html b/include/asio/doc/asio/reference/basic_socket/native_non_blocking.html new file mode 100644 index 0000000..cd939ad --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_socket::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload1.html new file mode 100644 index 0000000..45b419b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload1.html @@ -0,0 +1,142 @@ + + + +basic_socket::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Gets the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native socket. This mode has no effect on the behaviour of the socket + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying socket is in non-blocking mode and + direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the socket object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native socket. +

+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload2.html new file mode 100644 index 0000000..24fc340 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload2.html @@ -0,0 +1,155 @@ + + + +basic_socket::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload3.html new file mode 100644 index 0000000..d6e567e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/native_non_blocking/overload3.html @@ -0,0 +1,147 @@ + + + +basic_socket::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/non_blocking.html b/include/asio/doc/asio/reference/basic_socket/non_blocking.html new file mode 100644 index 0000000..a295654 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_socket::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets the + non-blocking mode of the socket. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_socket/non_blocking/overload1.html new file mode 100644 index 0000000..44cd14f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/non_blocking/overload1.html @@ -0,0 +1,62 @@ + + + +basic_socket::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Gets the non-blocking mode of the socket. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the socket's synchronous operations will fail with + asio::error::would_block if they are unable to perform the + requested operation immediately. If false, synchronous operations + will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_socket/non_blocking/overload2.html new file mode 100644 index 0000000..7ea37d7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/non_blocking/overload2.html @@ -0,0 +1,81 @@ + + + +basic_socket::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_socket/non_blocking/overload3.html new file mode 100644 index 0000000..99a9155 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/non_blocking/overload3.html @@ -0,0 +1,73 @@ + + + +basic_socket::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/open.html b/include/asio/doc/asio/reference/basic_socket/open.html new file mode 100644 index 0000000..b3dff1b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/open.html @@ -0,0 +1,51 @@ + + + +basic_socket::open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Open the socket using the + specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+  » more...
+
+void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/open/overload1.html b/include/asio/doc/asio/reference/basic_socket/open/overload1.html new file mode 100644 index 0000000..2840aae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/open/overload1.html @@ -0,0 +1,80 @@ + + + +basic_socket::open (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/open/overload2.html b/include/asio/doc/asio/reference/basic_socket/open/overload2.html new file mode 100644 index 0000000..212c187 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/open/overload2.html @@ -0,0 +1,77 @@ + + + +basic_socket::open (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying which protocol is to be used. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::error_code ec;
+socket.open(asio::ip::tcp::v4(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/operator_eq_.html b/include/asio/doc/asio/reference/basic_socket/operator_eq_.html new file mode 100644 index 0000000..3ad402d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/operator_eq_.html @@ -0,0 +1,58 @@ + + + +basic_socket::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_socket + from another. +

+
basic_socket & operator=(
+    basic_socket && other);
+  » more...
+
+

+ Move-assign a basic_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket & >::type operator=(
+    basic_socket< Protocol1, Executor1 > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/operator_eq_/overload1.html b/include/asio/doc/asio/reference/basic_socket/operator_eq_/overload1.html new file mode 100644 index 0000000..8ff48cf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/operator_eq_/overload1.html @@ -0,0 +1,70 @@ + + + +basic_socket::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_socket + from another. +

+
basic_socket & operator=(
+    basic_socket && other);
+
+

+ This assignment operator moves a socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/operator_eq_/overload2.html b/include/asio/doc/asio/reference/basic_socket/operator_eq_/overload2.html new file mode 100644 index 0000000..a47c84a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/operator_eq_/overload2.html @@ -0,0 +1,73 @@ + + + +basic_socket::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket & >::type operator=(
+    basic_socket< Protocol1, Executor1 > && other);
+
+

+ This assignment operator moves a socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/out_of_band_inline.html b/include/asio/doc/asio/reference/basic_socket/out_of_band_inline.html new file mode 100644 index 0000000..ea1e8f1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/out_of_band_inline.html @@ -0,0 +1,81 @@ + + + +basic_socket::out_of_band_inline + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for putting received out-of-band data inline. +

+
typedef implementation_defined out_of_band_inline;
+
+

+ Implements the SOL_SOCKET/SO_OOBINLINE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option;
+socket.get_option(option);
+bool value = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/protocol_type.html b/include/asio/doc/asio/reference/basic_socket/protocol_type.html new file mode 100644 index 0000000..7d7dcdf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_socket::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The protocol + type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/receive_buffer_size.html b/include/asio/doc/asio/reference/basic_socket/receive_buffer_size.html new file mode 100644 index 0000000..5004a91 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/receive_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_socket::receive_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive buffer size of a socket. +

+
typedef implementation_defined receive_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_RCVBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/receive_low_watermark.html b/include/asio/doc/asio/reference/basic_socket/receive_low_watermark.html new file mode 100644 index 0000000..e017cf2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/receive_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_socket::receive_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive low watermark. +

+
typedef implementation_defined receive_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_RCVLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/release.html b/include/asio/doc/asio/reference/basic_socket/release.html new file mode 100644 index 0000000..de51b88 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/release.html @@ -0,0 +1,49 @@ + + + +basic_socket::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release ownership + of the underlying native socket. +

+
native_handle_type release();
+  » more...
+
+native_handle_type release(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/release/overload1.html b/include/asio/doc/asio/reference/basic_socket/release/overload1.html new file mode 100644 index 0000000..c0f244b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/release/overload1.html @@ -0,0 +1,71 @@ + + + +basic_socket::release (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Release ownership of the underlying native socket. +

+
native_handle_type release();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/release/overload2.html b/include/asio/doc/asio/reference/basic_socket/release/overload2.html new file mode 100644 index 0000000..bbbce7a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/release/overload2.html @@ -0,0 +1,72 @@ + + + +basic_socket::release (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Release ownership of the underlying native socket. +

+
native_handle_type release(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/remote_endpoint.html b/include/asio/doc/asio/reference/basic_socket/remote_endpoint.html new file mode 100644 index 0000000..3e53445 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/remote_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_socket::remote_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+  » more...
+
+endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/remote_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_socket/remote_endpoint/overload1.html new file mode 100644 index 0000000..fa08bab --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/remote_endpoint/overload1.html @@ -0,0 +1,75 @@ + + + +basic_socket::remote_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/remote_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_socket/remote_endpoint/overload2.html new file mode 100644 index 0000000..2fec277 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/remote_endpoint/overload2.html @@ -0,0 +1,82 @@ + + + +basic_socket::remote_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. Returns + a default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/reuse_address.html b/include/asio/doc/asio/reference/basic_socket/reuse_address.html new file mode 100644 index 0000000..406dbb9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/reuse_address.html @@ -0,0 +1,82 @@ + + + +basic_socket::reuse_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to allow the socket to be bound to an address that is already in + use. +

+
typedef implementation_defined reuse_address;
+
+

+ Implements the SOL_SOCKET/SO_REUSEADDR socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/send_buffer_size.html b/include/asio/doc/asio/reference/basic_socket/send_buffer_size.html new file mode 100644 index 0000000..82e1a9a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/send_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_socket::send_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send buffer size of a socket. +

+
typedef implementation_defined send_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_SNDBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/send_low_watermark.html b/include/asio/doc/asio/reference/basic_socket/send_low_watermark.html new file mode 100644 index 0000000..714a521 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/send_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_socket::send_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send low watermark. +

+
typedef implementation_defined send_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_SNDLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/set_option.html b/include/asio/doc/asio/reference/basic_socket/set_option.html new file mode 100644 index 0000000..da99e7a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/set_option.html @@ -0,0 +1,55 @@ + + + +basic_socket::set_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set an option + on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+  » more...
+
+template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/set_option/overload1.html b/include/asio/doc/asio/reference/basic_socket/set_option/overload1.html new file mode 100644 index 0000000..b122784 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/set_option/overload1.html @@ -0,0 +1,87 @@ + + + +basic_socket::set_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+socket.set_option(option);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/set_option/overload2.html b/include/asio/doc/asio/reference/basic_socket/set_option/overload2.html new file mode 100644 index 0000000..d059de2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/set_option/overload2.html @@ -0,0 +1,84 @@ + + + +basic_socket::set_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+asio::error_code ec;
+socket.set_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/shutdown.html b/include/asio/doc/asio/reference/basic_socket/shutdown.html new file mode 100644 index 0000000..573aef5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/shutdown.html @@ -0,0 +1,51 @@ + + + +basic_socket::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable sends or + receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+  » more...
+
+void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/shutdown/overload1.html b/include/asio/doc/asio/reference/basic_socket/shutdown/overload1.html new file mode 100644 index 0000000..8202866 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/shutdown/overload1.html @@ -0,0 +1,85 @@ + + + +basic_socket::shutdown (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.shutdown(asio::ip::tcp::socket::shutdown_send);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/shutdown/overload2.html b/include/asio/doc/asio/reference/basic_socket/shutdown/overload2.html new file mode 100644 index 0000000..15d6309 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/shutdown/overload2.html @@ -0,0 +1,82 @@ + + + +basic_socket::shutdown (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/shutdown_type.html b/include/asio/doc/asio/reference/basic_socket/shutdown_type.html new file mode 100644 index 0000000..b00dde8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/shutdown_type.html @@ -0,0 +1,73 @@ + + + +basic_socket::shutdown_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Different + ways a socket may be shutdown. +

+
enum shutdown_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
shutdown_receive
+

+ Shutdown the receive side of the socket. +

+
shutdown_send
+

+ Shutdown the send side of the socket. +

+
shutdown_both
+

+ Shutdown both send and receive on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/wait.html b/include/asio/doc/asio/reference/basic_socket/wait.html new file mode 100644 index 0000000..2aefa5d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/wait.html @@ -0,0 +1,51 @@ + + + +basic_socket::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait for the socket to + become ready to read, ready to write, or to have pending error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/wait/overload1.html b/include/asio/doc/asio/reference/basic_socket/wait/overload1.html new file mode 100644 index 0000000..f73c8eb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/wait/overload1.html @@ -0,0 +1,73 @@ + + + +basic_socket::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.wait(asio::ip::tcp::socket::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/wait/overload2.html b/include/asio/doc/asio/reference/basic_socket/wait/overload2.html new file mode 100644 index 0000000..c5af813 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/wait/overload2.html @@ -0,0 +1,79 @@ + + + +basic_socket::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.wait(asio::ip::tcp::socket::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket/wait_type.html b/include/asio/doc/asio/reference/basic_socket/wait_type.html new file mode 100644 index 0000000..27e05b3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket/wait_type.html @@ -0,0 +1,75 @@ + + + +basic_socket::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Wait types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a socket to become ready to read. +

+
wait_write
+

+ Wait for a socket to become ready to write. +

+
wait_error
+

+ Wait for a socket to have error conditions pending. +

+
+
+

+ For use with basic_socket::wait() and basic_socket::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket__rebind_executor.html b/include/asio/doc/asio/reference/basic_socket__rebind_executor.html new file mode 100644 index 0000000..ed995d4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_socket::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the socket type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The socket type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_socket__rebind_executor/other.html new file mode 100644 index 0000000..20f6368 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket__rebind_executor/other.html @@ -0,0 +1,845 @@ + + + +basic_socket::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + socket type when rebound to the specified executor. +

+
typedef basic_socket< Protocol, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_socket [constructor] +

+
+

+ Construct a basic_socket without opening it.
—
Construct + and open a basic_socket.
—
Construct a basic_socket, + opening it and binding it to the given local endpoint.
+ —
Construct a basic_socket on an existing native socket. +
—
Move-construct a basic_socket from another.
+ —
Move-construct a basic_socket from a socket of another + protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket from another.
—
Move-assign + a basic_socket from a socket of another protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_socket [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket + class template provides functionality that is common to both stream-oriented + and datagram-oriented sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor.html b/include/asio/doc/asio/reference/basic_socket_acceptor.html new file mode 100644 index 0000000..f419c61 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor.html @@ -0,0 +1,776 @@ + + + +basic_socket_acceptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides the ability to accept new connections. +

+
template<
+    typename Protocol,
+    typename Executor>
+class basic_socket_acceptor :
+  public socket_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the acceptor type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close if + unsent data is present. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of an acceptor. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ accept +

+
+

+ Accept a new connection.
—
Accept a new connection + and obtain the endpoint of the peer. +

+
+

+ assign +

+
+

+ Assigns an existing native acceptor to the acceptor. +

+
+

+ async_accept +

+
+

+ Start an asynchronous accept. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the acceptor to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ basic_socket_acceptor [constructor] +

+
+

+ Construct an acceptor without opening it.
—
Construct + an open acceptor.
—
Construct an acceptor opened on + the given endpoint.
—
Construct a basic_socket_acceptor + on an existing native acceptor.
—
Move-construct a + basic_socket_acceptor from another.
—
Move-construct + a basic_socket_acceptor from an acceptor of another protocol type. +

+
+

+ bind +

+
+

+ Bind the acceptor to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the acceptor. +

+
+

+ close +

+
+

+ Close the acceptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the acceptor. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the acceptor. +

+
+

+ is_open +

+
+

+ Determine whether the acceptor is open. +

+
+

+ listen +

+
+

+ Place the acceptor into the state where it will listen for new + connections. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the acceptor. +

+
+

+ native_handle +

+
+

+ Get the native acceptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native acceptor implementation. +
—
Sets the non-blocking mode of the native acceptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the acceptor.
—
Sets + the non-blocking mode of the acceptor. +

+
+

+ open +

+
+

+ Open the acceptor using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_acceptor from another.
—
+ Move-assign a basic_socket_acceptor from an acceptor of another + protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native acceptor. +

+
+

+ set_option +

+
+

+ Set an option on the acceptor. +

+
+

+ wait +

+
+

+ Wait for the acceptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_socket_acceptor [destructor] +

+
+

+ Destroys the acceptor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length of + the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket_acceptor + class template is used for accepting new socket connections. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ Opening a socket acceptor with the SO_REUSEADDR option enabled: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port);
+acceptor.open(endpoint.protocol());
+acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true));
+acceptor.bind(endpoint);
+acceptor.listen();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/_basic_socket_acceptor.html b/include/asio/doc/asio/reference/basic_socket_acceptor/_basic_socket_acceptor.html new file mode 100644 index 0000000..e35fa30 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/_basic_socket_acceptor.html @@ -0,0 +1,48 @@ + + + +basic_socket_acceptor::~basic_socket_acceptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the acceptor. +

+
~basic_socket_acceptor();
+
+

+ This function destroys the acceptor, cancelling any outstanding asynchronous + operations associated with the acceptor as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept.html new file mode 100644 index 0000000..56fb287 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept.html @@ -0,0 +1,157 @@ + + + +basic_socket_acceptor::accept + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Accept + a new connection. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+void accept(
+    basic_socket< Protocol1, Executor1 > & peer,
+    typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Protocol1,
+    typename Executor1>
+void accept(
+    basic_socket< Protocol1, Executor1 > & peer,
+    asio::error_code & ec,
+    typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *  = 0);
+  » more...
+
+

+ Accept a new connection and obtain the endpoint of the peer. +

+
template<
+    typename Executor1>
+void accept(
+    basic_socket< protocol_type, Executor1 > & peer,
+    endpoint_type & peer_endpoint);
+  » more...
+
+template<
+    typename Executor1>
+void accept(
+    basic_socket< protocol_type, Executor1 > & peer,
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+  » more...
+
+Protocol::socket::template rebind_executor< executor_type >::other accept();
+  » more...
+
+Protocol::socket::template rebind_executor< executor_type >::other accept(
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const Executor1 & ex,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const Executor1 & ex,
+    asio::error_code & ec,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    asio::error_code & ec,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+Protocol::socket::template rebind_executor< executor_type >::other accept(
+    endpoint_type & peer_endpoint);
+  » more...
+
+Protocol::socket::template rebind_executor< executor_type >::other accept(
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const Executor1 & ex,
+    endpoint_type & peer_endpoint,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    endpoint_type & peer_endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const executor_type & ex,
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload1.html new file mode 100644 index 0000000..76b697c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload1.html @@ -0,0 +1,88 @@ + + + +basic_socket_acceptor::accept (1 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+void accept(
+    basic_socket< Protocol1, Executor1 > & peer,
+    typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer into the + given socket. The function call will block until a new connection has + been accepted successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
peer
+

+ The socket into which the new connection will be accepted. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(my_context);
+acceptor.accept(socket);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload10.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload10.html new file mode 100644 index 0000000..97bee26 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload10.html @@ -0,0 +1,96 @@ + + + +basic_socket_acceptor::accept (10 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    asio::error_code & ec,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
context
+

+ The I/O execution context object to be used for the newly accepted + socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ On success, a socket object representing the newly accepted connection. + On error, a socket object where is_open() is false. +

+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec));
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload11.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload11.html new file mode 100644 index 0000000..ef3136e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload11.html @@ -0,0 +1,97 @@ + + + +basic_socket_acceptor::accept (11 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
Protocol::socket::template rebind_executor< executor_type >::other accept(
+    endpoint_type & peer_endpoint);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. +

+
+
+
+ + Return + Value +
+

+ A socket object representing the newly accepted connection. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+asio::ip::tcp::socket socket(acceptor.accept(endpoint));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload12.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload12.html new file mode 100644 index 0000000..c783e86 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload12.html @@ -0,0 +1,94 @@ + + + +basic_socket_acceptor::accept (12 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
Protocol::socket::template rebind_executor< executor_type >::other accept(
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ On success, a socket object representing the newly accepted connection. + On error, a socket object where is_open() is false. +

+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+asio::ip::tcp::socket socket(acceptor.accept(endpoint, ec));
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload13.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload13.html new file mode 100644 index 0000000..ae3f5b1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload13.html @@ -0,0 +1,106 @@ + + + +basic_socket_acceptor::accept (13 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const Executor1 & ex,
+    endpoint_type & peer_endpoint,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor object to be used for the newly accepted socket. +

+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. +

+
+
+
+ + Return + Value +
+

+ A socket object representing the newly accepted connection. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+asio::ip::tcp::socket socket(
+    acceptor.accept(my_context2, endpoint));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload14.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload14.html new file mode 100644 index 0000000..f61c066 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload14.html @@ -0,0 +1,107 @@ + + + +basic_socket_acceptor::accept (14 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    endpoint_type & peer_endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
context
+

+ The I/O execution context object to be used for the newly accepted + socket. +

+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. +

+
+
+
+ + Return + Value +
+

+ A socket object representing the newly accepted connection. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+asio::ip::tcp::socket socket(
+    acceptor.accept(my_context2, endpoint));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload15.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload15.html new file mode 100644 index 0000000..54cde24 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload15.html @@ -0,0 +1,103 @@ + + + +basic_socket_acceptor::accept (15 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const executor_type & ex,
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor object to be used for the newly accepted socket. +

+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ On success, a socket object representing the newly accepted connection. + On error, a socket object where is_open() is false. +

+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+asio::ip::tcp::socket socket(
+    acceptor.accept(my_context2, endpoint, ec));
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload16.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload16.html new file mode 100644 index 0000000..d145037 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload16.html @@ -0,0 +1,104 @@ + + + +basic_socket_acceptor::accept (16 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
context
+

+ The I/O execution context object to be used for the newly accepted + socket. +

+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ On success, a socket object representing the newly accepted connection. + On error, a socket object where is_open() is false. +

+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+asio::ip::tcp::socket socket(
+    acceptor.accept(my_context2, endpoint, ec));
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload2.html new file mode 100644 index 0000000..ca11b94 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload2.html @@ -0,0 +1,85 @@ + + + +basic_socket_acceptor::accept (2 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+void accept(
+    basic_socket< Protocol1, Executor1 > & peer,
+    asio::error_code & ec,
+    typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer into the + given socket. The function call will block until a new connection has + been accepted successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
peer
+

+ The socket into which the new connection will be accepted. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(my_context);
+asio::error_code ec;
+acceptor.accept(socket, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload3.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload3.html new file mode 100644 index 0000000..72ad0fe --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload3.html @@ -0,0 +1,94 @@ + + + +basic_socket_acceptor::accept (3 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection and obtain the endpoint of the peer. +

+
template<
+    typename Executor1>
+void accept(
+    basic_socket< protocol_type, Executor1 > & peer,
+    endpoint_type & peer_endpoint);
+
+

+ This function is used to accept a new connection from a peer into the + given socket, and additionally provide the endpoint of the remote peer. + The function call will block until a new connection has been accepted + successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
peer
+

+ The socket into which the new connection will be accepted. +

+
peer_endpoint
+

+ An endpoint object which will receive the endpoint of the remote + peer. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint;
+acceptor.accept(socket, endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload4.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload4.html new file mode 100644 index 0000000..fa03215 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload4.html @@ -0,0 +1,91 @@ + + + +basic_socket_acceptor::accept (4 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection and obtain the endpoint of the peer. +

+
template<
+    typename Executor1>
+void accept(
+    basic_socket< protocol_type, Executor1 > & peer,
+    endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+
+

+ This function is used to accept a new connection from a peer into the + given socket, and additionally provide the endpoint of the remote peer. + The function call will block until a new connection has been accepted + successfully or an error occurs. +

+
+ + Parameters +
+
+

+
+
peer
+

+ The socket into which the new connection will be accepted. +

+
peer_endpoint
+

+ An endpoint object which will receive the endpoint of the remote + peer. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint;
+asio::error_code ec;
+acceptor.accept(socket, endpoint, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload5.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload5.html new file mode 100644 index 0000000..74d7f32 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload5.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::accept (5 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
Protocol::socket::template rebind_executor< executor_type >::other accept();
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Return + Value +
+

+ A socket object representing the newly accepted connection. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(acceptor.accept());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload6.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload6.html new file mode 100644 index 0000000..8c7e356 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload6.html @@ -0,0 +1,87 @@ + + + +basic_socket_acceptor::accept (6 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
Protocol::socket::template rebind_executor< executor_type >::other accept(
+    asio::error_code & ec);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ On success, a socket object representing the newly accepted connection. + On error, a socket object where is_open() is false. +

+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(acceptor.accept(ec));
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload7.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload7.html new file mode 100644 index 0000000..3ffaef0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload7.html @@ -0,0 +1,98 @@ + + + +basic_socket_acceptor::accept (7 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const Executor1 & ex,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor object to be used for the newly accepted socket. +

+
+
+
+ + Return + Value +
+

+ A socket object representing the newly accepted connection. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(acceptor.accept());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload8.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload8.html new file mode 100644 index 0000000..71ddf0b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload8.html @@ -0,0 +1,99 @@ + + + +basic_socket_acceptor::accept (8 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename ExecutionContext>
+Protocol::socket::template rebind_executor< typename ExecutionContext::executor_type >::other accept(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
context
+

+ The I/O execution context object to be used for the newly accepted + socket. +

+
+
+
+ + Return + Value +
+

+ A socket object representing the newly accepted connection. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(acceptor.accept());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload9.html b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload9.html new file mode 100644 index 0000000..61d39cb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/accept/overload9.html @@ -0,0 +1,95 @@ + + + +basic_socket_acceptor::accept (9 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Accept a new connection. +

+
template<
+    typename Executor1>
+Protocol::socket::template rebind_executor< Executor1 >::other accept(
+    const Executor1 & ex,
+    asio::error_code & ec,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+
+

+ This function is used to accept a new connection from a peer. The function + call will block until a new connection has been accepted successfully + or an error occurs. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor object to be used for the newly accepted socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ On success, a socket object representing the newly accepted connection. + On error, a socket object where is_open() is false. +

+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec));
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/assign.html b/include/asio/doc/asio/reference/basic_socket_acceptor/assign.html new file mode 100644 index 0000000..8c046ce --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/assign.html @@ -0,0 +1,53 @@ + + + +basic_socket_acceptor::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assigns + an existing native acceptor to the acceptor. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor);
+  » more...
+
+void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/assign/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/assign/overload1.html new file mode 100644 index 0000000..4bb86d0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/assign/overload1.html @@ -0,0 +1,45 @@ + + + +basic_socket_acceptor::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assigns an existing native acceptor to the acceptor. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/assign/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/assign/overload2.html new file mode 100644 index 0000000..9c3a1c8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/assign/overload2.html @@ -0,0 +1,46 @@ + + + +basic_socket_acceptor::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assigns an existing native acceptor to the acceptor. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept.html new file mode 100644 index 0000000..8597660 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept.html @@ -0,0 +1,112 @@ + + + +basic_socket_acceptor::async_accept + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous accept. +

+
template<
+    typename Protocol1,
+    typename Executor1,
+    typename AcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    basic_socket< Protocol1, Executor1 > & peer,
+    AcceptHandler && handler = DEFAULT,
+    typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Executor1,
+    typename AcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    basic_socket< protocol_type, Executor1 > & peer,
+    endpoint_type & peer_endpoint,
+    AcceptHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    MoveAcceptHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename Executor1,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    const Executor1 & ex,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    ExecutionContext & context,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+template<
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    endpoint_type & peer_endpoint,
+    MoveAcceptHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename Executor1,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    const Executor1 & ex,
+    endpoint_type & peer_endpoint,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    ExecutionContext & context,
+    endpoint_type & peer_endpoint,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload1.html new file mode 100644 index 0000000..94a56d6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload1.html @@ -0,0 +1,106 @@ + + + +basic_socket_acceptor::async_accept (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename Protocol1,
+    typename Executor1,
+    typename AcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    basic_socket< Protocol1, Executor1 > & peer,
+    AcceptHandler && handler = DEFAULT,
+    typename enable_if< is_convertible< Protocol, Protocol1 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously accept a new connection into + a socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
peer
+

+ The socket into which the new connection will be accepted. Ownership + of the peer object is retained by the caller, which must guarantee + that it is valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void accept_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Accept succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::socket socket(my_context);
+acceptor.async_accept(socket, accept_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload2.html new file mode 100644 index 0000000..71804e6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload2.html @@ -0,0 +1,94 @@ + + + +basic_socket_acceptor::async_accept (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename Executor1,
+    typename AcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    basic_socket< protocol_type, Executor1 > & peer,
+    endpoint_type & peer_endpoint,
+    AcceptHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously accept a new connection into + a socket, and additionally obtain the endpoint of the remote peer. The + function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
peer
+

+ The socket into which the new connection will be accepted. Ownership + of the peer object is retained by the caller, which must guarantee + that it is valid until the handler is called. +

+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. Ownership of the peer_endpoint object is retained by + the caller, which must guarantee that it is valid until the handler + is called. +

+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload3.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload3.html new file mode 100644 index 0000000..c178fd6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload3.html @@ -0,0 +1,104 @@ + + + +basic_socket_acceptor::async_accept (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    MoveAcceptHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously accept a new connection. The + function call always returns immediately. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+  // On success, the newly accepted socket.
+  typename Protocol::socket::template
+    rebind_executor<executor_type>::other peer
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void accept_handler(const asio::error_code& error,
+    asio::ip::tcp::socket peer)
+{
+  if (!error)
+  {
+    // Accept succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+acceptor.async_accept(accept_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload4.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload4.html new file mode 100644 index 0000000..ad07d00 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload4.html @@ -0,0 +1,109 @@ + + + +basic_socket_acceptor::async_accept (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename Executor1,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    const Executor1 & ex,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously accept a new connection. The + function call always returns immediately. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor object to be used for the newly accepted socket. +

+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  typename Protocol::socket::template rebind_executor<
+    Executor1>::other peer // On success, the newly accepted socket.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void accept_handler(const asio::error_code& error,
+    asio::ip::tcp::socket peer)
+{
+  if (!error)
+  {
+    // Accept succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+acceptor.async_accept(my_context2, accept_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload5.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload5.html new file mode 100644 index 0000000..382aa15 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload5.html @@ -0,0 +1,111 @@ + + + +basic_socket_acceptor::async_accept (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename ExecutionContext,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    ExecutionContext & context,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to asynchronously accept a new connection. The + function call always returns immediately. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
context
+

+ The I/O execution context object to be used for the newly accepted + socket. +

+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  typename Protocol::socket::template rebind_executor<
+    typename ExecutionContext::executor_type>::other peer
+      // On success, the newly accepted socket.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void accept_handler(const asio::error_code& error,
+    asio::ip::tcp::socket peer)
+{
+  if (!error)
+  {
+    // Accept succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+acceptor.async_accept(my_context2, accept_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload6.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload6.html new file mode 100644 index 0000000..a65a4f1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload6.html @@ -0,0 +1,113 @@ + + + +basic_socket_acceptor::async_accept (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    endpoint_type & peer_endpoint,
+    MoveAcceptHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously accept a new connection. The + function call always returns immediately. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. Ownership of the peer_endpoint object is retained by + the caller, which must guarantee that it is valid until the handler + is called. +

+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  // Result of operation.
+  const asio::error_code& error,
+  // On success, the newly accepted socket.
+  typename Protocol::socket::template
+    rebind_executor<executor_type>::other peer
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void accept_handler(const asio::error_code& error,
+    asio::ip::tcp::socket peer)
+{
+  if (!error)
+  {
+    // Accept succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+acceptor.async_accept(endpoint, accept_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload7.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload7.html new file mode 100644 index 0000000..29fc21e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload7.html @@ -0,0 +1,118 @@ + + + +basic_socket_acceptor::async_accept (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename Executor1,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    const Executor1 & ex,
+    endpoint_type & peer_endpoint,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_executor< Executor1 >::value||execution::is_executor< Executor1 >::value >::type *  = 0);
+
+

+ This function is used to asynchronously accept a new connection. The + function call always returns immediately. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor object to be used for the newly accepted socket. +

+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. Ownership of the peer_endpoint object is retained by + the caller, which must guarantee that it is valid until the handler + is called. +

+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  typename Protocol::socket::template rebind_executor<
+    Executor1>::other peer // On success, the newly accepted socket.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void accept_handler(const asio::error_code& error,
+    asio::ip::tcp::socket peer)
+{
+  if (!error)
+  {
+    // Accept succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+acceptor.async_accept(my_context2, endpoint, accept_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload8.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload8.html new file mode 100644 index 0000000..d60b382 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_accept/overload8.html @@ -0,0 +1,120 @@ + + + +basic_socket_acceptor::async_accept (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous accept. +

+
template<
+    typename ExecutionContext,
+    typename MoveAcceptHandler = DEFAULT>
+DEDUCED async_accept(
+    ExecutionContext & context,
+    endpoint_type & peer_endpoint,
+    MoveAcceptHandler && handler = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to asynchronously accept a new connection. The + function call always returns immediately. +

+

+ This overload requires that the Protocol template parameter satisfy the + AcceptableProtocol type requirements. +

+
+ + Parameters +
+
+

+
+
context
+

+ The I/O execution context object to be used for the newly accepted + socket. +

+
peer_endpoint
+

+ An endpoint object into which the endpoint of the remote peer will + be written. Ownership of the peer_endpoint object is retained by + the caller, which must guarantee that it is valid until the handler + is called. +

+
handler
+
+

+ The handler to be called when the accept operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  typename Protocol::socket::template rebind_executor<
+    typename ExecutionContext::executor_type>::other peer
+      // On success, the newly accepted socket.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void accept_handler(const asio::error_code& error,
+    asio::ip::tcp::socket peer)
+{
+  if (!error)
+  {
+    // Accept succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint;
+acceptor.async_accept(my_context2, endpoint, accept_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/async_wait.html b/include/asio/doc/asio/reference/basic_socket_acceptor/async_wait.html new file mode 100644 index 0000000..c296ef9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/async_wait.html @@ -0,0 +1,104 @@ + + + +basic_socket_acceptor::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Asynchronously + wait for the acceptor to become ready to read, ready to write, or to have + pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for an acceptor to + enter a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired acceptor state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::acceptor acceptor(my_context);
+...
+acceptor.async_wait(
+    asio::ip::tcp::acceptor::wait_read,
+    wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor.html new file mode 100644 index 0000000..6afd2ae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor.html @@ -0,0 +1,126 @@ + + + +basic_socket_acceptor::basic_socket_acceptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an acceptor without opening it. +

+
explicit basic_socket_acceptor(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_socket_acceptor(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct an open acceptor. +

+
basic_socket_acceptor(
+    const executor_type & ex,
+    const protocol_type & protocol);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_socket_acceptor(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct an acceptor opened on the given endpoint. +

+
basic_socket_acceptor(
+    const executor_type & ex,
+    const endpoint_type & endpoint,
+    bool reuse_addr = true);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_socket_acceptor(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    bool reuse_addr = true,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_socket_acceptor + on an existing native acceptor. +

+
basic_socket_acceptor(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_socket_acceptor(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_socket_acceptor + from another. +

+
basic_socket_acceptor(
+    basic_socket_acceptor && other);
+  » more...
+
+

+ Move-construct a basic_socket_acceptor + from an acceptor of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_socket_acceptor(
+    basic_socket_acceptor< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload1.html new file mode 100644 index 0000000..a1dae28 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload1.html @@ -0,0 +1,63 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (1 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an acceptor without opening it. +

+
basic_socket_acceptor(
+    const executor_type & ex);
+
+

+ This constructor creates an acceptor without opening it to listen for + new connections. The open() function must be called before + the acceptor can accept new socket connections. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the acceptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the acceptor. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload10.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload10.html new file mode 100644 index 0000000..386d375 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload10.html @@ -0,0 +1,75 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (10 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_socket_acceptor + from an acceptor of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_socket_acceptor(
+    basic_socket_acceptor< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+
+

+ This constructor moves an acceptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket_acceptor + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket_acceptor(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload2.html new file mode 100644 index 0000000..a6d71d9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload2.html @@ -0,0 +1,67 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (2 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an acceptor without opening it. +

+
template<
+    typename ExecutionContext>
+basic_socket_acceptor(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates an acceptor without opening it to listen for + new connections. The open() function must be called before + the acceptor can accept new socket connections. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the acceptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the acceptor. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload3.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload3.html new file mode 100644 index 0000000..5b56546 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload3.html @@ -0,0 +1,79 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (3 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an open acceptor. +

+
basic_socket_acceptor(
+    const executor_type & ex,
+    const protocol_type & protocol);
+
+

+ This constructor creates an acceptor and automatically opens it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the acceptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the acceptor. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload4.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload4.html new file mode 100644 index 0000000..6a33da8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload4.html @@ -0,0 +1,83 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (4 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an open acceptor. +

+
template<
+    typename ExecutionContext>
+basic_socket_acceptor(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates an acceptor and automatically opens it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the acceptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the acceptor. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload5.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload5.html new file mode 100644 index 0000000..ed4dcd8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload5.html @@ -0,0 +1,100 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (5 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an acceptor opened on the given endpoint. +

+
basic_socket_acceptor(
+    const executor_type & ex,
+    const endpoint_type & endpoint,
+    bool reuse_addr = true);
+
+

+ This constructor creates an acceptor and automatically opens it to listen + for new connections on the specified endpoint. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the acceptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the acceptor. +

+
endpoint
+

+ An endpoint on the local machine on which the acceptor will listen + for new connections. +

+
reuse_addr
+

+ Whether the constructor should set the socket option socket_base::reuse_address. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to the following code: +

+
basic_socket_acceptor<Protocol> acceptor(my_context);
+acceptor.open(endpoint.protocol());
+if (reuse_addr)
+  acceptor.set_option(socket_base::reuse_address(true));
+acceptor.bind(endpoint);
+acceptor.listen();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload6.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload6.html new file mode 100644 index 0000000..f457733 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload6.html @@ -0,0 +1,104 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (6 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an acceptor opened on the given endpoint. +

+
template<
+    typename ExecutionContext>
+basic_socket_acceptor(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    bool reuse_addr = true,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates an acceptor and automatically opens it to listen + for new connections on the specified endpoint. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the acceptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the acceptor. +

+
endpoint
+

+ An endpoint on the local machine on which the acceptor will listen + for new connections. +

+
reuse_addr
+

+ Whether the constructor should set the socket option socket_base::reuse_address. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This constructor is equivalent to the following code: +

+
basic_socket_acceptor<Protocol> acceptor(my_context);
+acceptor.open(endpoint.protocol());
+if (reuse_addr)
+  acceptor.set_option(socket_base::reuse_address(true));
+acceptor.bind(endpoint);
+acceptor.listen();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload7.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload7.html new file mode 100644 index 0000000..9af9b1c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload7.html @@ -0,0 +1,86 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (7 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket_acceptor + on an existing native acceptor. +

+
basic_socket_acceptor(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor);
+
+

+ This constructor creates an acceptor object to hold an existing native + acceptor. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the acceptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the acceptor. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_acceptor
+

+ A native acceptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload8.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload8.html new file mode 100644 index 0000000..339ac03 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload8.html @@ -0,0 +1,90 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (8 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket_acceptor + on an existing native acceptor. +

+
template<
+    typename ExecutionContext>
+basic_socket_acceptor(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_acceptor,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates an acceptor object to hold an existing native + acceptor. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the acceptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the acceptor. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_acceptor
+

+ A native acceptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload9.html b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload9.html new file mode 100644 index 0000000..9c616d4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload9.html @@ -0,0 +1,71 @@ + + + +basic_socket_acceptor::basic_socket_acceptor (9 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_socket_acceptor + from another. +

+
basic_socket_acceptor(
+    basic_socket_acceptor && other);
+
+

+ This constructor moves an acceptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket_acceptor + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket_acceptor(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/bind.html b/include/asio/doc/asio/reference/basic_socket_acceptor/bind.html new file mode 100644 index 0000000..530febd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/bind.html @@ -0,0 +1,51 @@ + + + +basic_socket_acceptor::bind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bind + the acceptor to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+  » more...
+
+void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/bind/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/bind/overload1.html new file mode 100644 index 0000000..8721232 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/bind/overload1.html @@ -0,0 +1,84 @@ + + + +basic_socket_acceptor::bind (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Bind the acceptor to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+
+

+ This function binds the socket acceptor to the specified endpoint on + the local machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket acceptor will + be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345);
+acceptor.open(endpoint.protocol());
+acceptor.bind(endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/bind/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/bind/overload2.html new file mode 100644 index 0000000..38f2a19 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/bind/overload2.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::bind (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Bind the acceptor to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+
+

+ This function binds the socket acceptor to the specified endpoint on + the local machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket acceptor will + be bound. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345);
+acceptor.open(endpoint.protocol());
+asio::error_code ec;
+acceptor.bind(endpoint, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/broadcast.html b/include/asio/doc/asio/reference/basic_socket_acceptor/broadcast.html new file mode 100644 index 0000000..f7816e2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/broadcast.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to permit sending of broadcast messages. +

+
typedef implementation_defined broadcast;
+
+

+ Implements the SOL_SOCKET/SO_BROADCAST socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/bytes_readable.html b/include/asio/doc/asio/reference/basic_socket_acceptor/bytes_readable.html new file mode 100644 index 0000000..32dd2fd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/bytes_readable.html @@ -0,0 +1,70 @@ + + + +basic_socket_acceptor::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::bytes_readable command(true);
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/cancel.html b/include/asio/doc/asio/reference/basic_socket_acceptor/cancel.html new file mode 100644 index 0000000..0063b5e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/cancel.html @@ -0,0 +1,49 @@ + + + +basic_socket_acceptor::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the acceptor. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/cancel/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/cancel/overload1.html new file mode 100644 index 0000000..2a04179 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/cancel/overload1.html @@ -0,0 +1,61 @@ + + + +basic_socket_acceptor::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the acceptor. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/cancel/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/cancel/overload2.html new file mode 100644 index 0000000..c01e41f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/cancel/overload2.html @@ -0,0 +1,62 @@ + + + +basic_socket_acceptor::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the acceptor. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/close.html b/include/asio/doc/asio/reference/basic_socket_acceptor/close.html new file mode 100644 index 0000000..43f0a02 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/close.html @@ -0,0 +1,49 @@ + + + +basic_socket_acceptor::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the acceptor. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/close/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/close/overload1.html new file mode 100644 index 0000000..5a3fabd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/close/overload1.html @@ -0,0 +1,64 @@ + + + +basic_socket_acceptor::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the acceptor. +

+
void close();
+
+

+ This function is used to close the acceptor. Any asynchronous accept + operations will be cancelled immediately. +

+

+ A subsequent call to open() is required before the acceptor + can again be used to again perform socket accept operations. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/close/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/close/overload2.html new file mode 100644 index 0000000..fb63bc8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/close/overload2.html @@ -0,0 +1,78 @@ + + + +basic_socket_acceptor::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the acceptor. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the acceptor. Any asynchronous accept + operations will be cancelled immediately. +

+

+ A subsequent call to open() is required before the acceptor + can again be used to again perform socket accept operations. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::error_code ec;
+acceptor.close(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/debug.html b/include/asio/doc/asio/reference/basic_socket_acceptor/debug.html new file mode 100644 index 0000000..8a7bcbb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/debug.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::debug + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to enable socket-level debugging. +

+
typedef implementation_defined debug;
+
+

+ Implements the SOL_SOCKET/SO_DEBUG socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/do_not_route.html b/include/asio/doc/asio/reference/basic_socket_acceptor/do_not_route.html new file mode 100644 index 0000000..e92c3ef --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/do_not_route.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to prevent routing, use local interfaces only. +

+
typedef implementation_defined do_not_route;
+
+

+ Implements the SOL_SOCKET/SO_DONTROUTE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/enable_connection_aborted.html b/include/asio/doc/asio/reference/basic_socket_acceptor/enable_connection_aborted.html new file mode 100644 index 0000000..c32fc34 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/enable_connection_aborted.html @@ -0,0 +1,83 @@ + + + +basic_socket_acceptor::enable_connection_aborted + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to report aborted connections on accept. +

+
typedef implementation_defined enable_connection_aborted;
+
+

+ Implements a custom socket option that determines whether or not an accept + operation is permitted to fail with asio::error::connection_aborted. + By default the option is false. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/endpoint_type.html b/include/asio/doc/asio/reference/basic_socket_acceptor/endpoint_type.html new file mode 100644 index 0000000..d0a6cbb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_acceptor::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/executor_type.html b/include/asio/doc/asio/reference/basic_socket_acceptor/executor_type.html new file mode 100644 index 0000000..db5e4ff --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_acceptor::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/get_executor.html b/include/asio/doc/asio/reference/basic_socket_acceptor/get_executor.html new file mode 100644 index 0000000..8ee85a9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/get_executor.html @@ -0,0 +1,44 @@ + + + +basic_socket_acceptor::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/get_option.html b/include/asio/doc/asio/reference/basic_socket_acceptor/get_option.html new file mode 100644 index 0000000..f4a9b47 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/get_option.html @@ -0,0 +1,55 @@ + + + +basic_socket_acceptor::get_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + an option from the acceptor. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+  » more...
+
+template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/get_option/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/get_option/overload1.html new file mode 100644 index 0000000..e2fcaaa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/get_option/overload1.html @@ -0,0 +1,88 @@ + + + +basic_socket_acceptor::get_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an option from the acceptor. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+
+

+ This function is used to get the current value of an option on the acceptor. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the acceptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_REUSEADDR option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::acceptor::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/get_option/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/get_option/overload2.html new file mode 100644 index 0000000..a981302 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/get_option/overload2.html @@ -0,0 +1,85 @@ + + + +basic_socket_acceptor::get_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an option from the acceptor. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+
+

+ This function is used to get the current value of an option on the acceptor. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the acceptor. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_REUSEADDR option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::acceptor::reuse_address option;
+asio::error_code ec;
+acceptor.get_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+bool is_set = option.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/io_control.html b/include/asio/doc/asio/reference/basic_socket_acceptor/io_control.html new file mode 100644 index 0000000..c861150 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/io_control.html @@ -0,0 +1,55 @@ + + + +basic_socket_acceptor::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + an IO control command on the acceptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/io_control/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/io_control/overload1.html new file mode 100644 index 0000000..b583030 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/io_control/overload1.html @@ -0,0 +1,87 @@ + + + +basic_socket_acceptor::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform an IO control command on the acceptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the acceptor. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the acceptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::acceptor::non_blocking_io command(true);
+socket.io_control(command);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/io_control/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/io_control/overload2.html new file mode 100644 index 0000000..9e9d388 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/io_control/overload2.html @@ -0,0 +1,84 @@ + + + +basic_socket_acceptor::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform an IO control command on the acceptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the acceptor. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the acceptor. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::acceptor::non_blocking_io command(true);
+asio::error_code ec;
+socket.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/is_open.html b/include/asio/doc/asio/reference/basic_socket_acceptor/is_open.html new file mode 100644 index 0000000..438e23b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/is_open.html @@ -0,0 +1,44 @@ + + + +basic_socket_acceptor::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the acceptor is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/keep_alive.html b/include/asio/doc/asio/reference/basic_socket_acceptor/keep_alive.html new file mode 100644 index 0000000..fa85439 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/keep_alive.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::keep_alive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to send keep-alives. +

+
typedef implementation_defined keep_alive;
+
+

+ Implements the SOL_SOCKET/SO_KEEPALIVE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/linger.html b/include/asio/doc/asio/reference/basic_socket_acceptor/linger.html new file mode 100644 index 0000000..f7027aa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/linger.html @@ -0,0 +1,83 @@ + + + +basic_socket_acceptor::linger + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to specify whether the socket lingers on close if unsent data is + present. +

+
typedef implementation_defined linger;
+
+

+ Implements the SOL_SOCKET/SO_LINGER socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option(true, 30);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option;
+socket.get_option(option);
+bool is_set = option.enabled();
+unsigned short timeout = option.timeout();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/listen.html b/include/asio/doc/asio/reference/basic_socket_acceptor/listen.html new file mode 100644 index 0000000..3e2054f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/listen.html @@ -0,0 +1,51 @@ + + + +basic_socket_acceptor::listen + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Place + the acceptor into the state where it will listen for new connections. +

+
void listen(
+    int backlog = socket_base::max_listen_connections);
+  » more...
+
+void listen(
+    int backlog,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/listen/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/listen/overload1.html new file mode 100644 index 0000000..372e28c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/listen/overload1.html @@ -0,0 +1,74 @@ + + + +basic_socket_acceptor::listen (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Place the acceptor into the state where it will listen for new connections. +

+
void listen(
+    int backlog = socket_base::max_listen_connections);
+
+

+ This function puts the socket acceptor into the state where it may accept + new connections. +

+
+ + Parameters +
+
+

+
+
backlog
+

+ The maximum length of the queue of pending connections. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/listen/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/listen/overload2.html new file mode 100644 index 0000000..102dec1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/listen/overload2.html @@ -0,0 +1,79 @@ + + + +basic_socket_acceptor::listen (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Place the acceptor into the state where it will listen for new connections. +

+
void listen(
+    int backlog,
+    asio::error_code & ec);
+
+

+ This function puts the socket acceptor into the state where it may accept + new connections. +

+
+ + Parameters +
+
+

+
+
backlog
+

+ The maximum length of the queue of pending connections. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::error_code ec;
+acceptor.listen(asio::socket_base::max_listen_connections, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint.html b/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint.html new file mode 100644 index 0000000..068cf8d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_socket_acceptor::local_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the local endpoint of the acceptor. +

+
endpoint_type local_endpoint() const;
+  » more...
+
+endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint/overload1.html new file mode 100644 index 0000000..2a05947 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint/overload1.html @@ -0,0 +1,75 @@ + + + +basic_socket_acceptor::local_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the local endpoint of the acceptor. +

+
endpoint_type local_endpoint() const;
+
+

+ This function is used to obtain the locally bound endpoint of the acceptor. +

+
+ + Return + Value +
+

+ An object that represents the local endpoint of the acceptor. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint/overload2.html new file mode 100644 index 0000000..b9ac19b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/local_endpoint/overload2.html @@ -0,0 +1,83 @@ + + + +basic_socket_acceptor::local_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the local endpoint of the acceptor. +

+
endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the locally bound endpoint of the acceptor. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the local endpoint of the acceptor. Returns + a default-constructed endpoint object if an error occurred and the error + handler did not throw an exception. +

+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/max_connections.html b/include/asio/doc/asio/reference/basic_socket_acceptor/max_connections.html new file mode 100644 index 0000000..e16602a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/max_connections.html @@ -0,0 +1,48 @@ + + + +basic_socket_acceptor::max_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +(Deprecated: + Use max_listen_connections.) The maximum length of the queue of pending + incoming connections. +

+
static const int max_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/max_listen_connections.html b/include/asio/doc/asio/reference/basic_socket_acceptor/max_listen_connections.html new file mode 100644 index 0000000..16f1614 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/max_listen_connections.html @@ -0,0 +1,47 @@ + + + +basic_socket_acceptor::max_listen_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +The + maximum length of the queue of pending incoming connections. +

+
static const int max_listen_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/message_do_not_route.html b/include/asio/doc/asio/reference/basic_socket_acceptor/message_do_not_route.html new file mode 100644 index 0000000..076c6b9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/message_do_not_route.html @@ -0,0 +1,47 @@ + + + +basic_socket_acceptor::message_do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specify + that the data should not be subject to routing. +

+
static const int message_do_not_route = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/message_end_of_record.html b/include/asio/doc/asio/reference/basic_socket_acceptor/message_end_of_record.html new file mode 100644 index 0000000..6e7f419 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/message_end_of_record.html @@ -0,0 +1,47 @@ + + + +basic_socket_acceptor::message_end_of_record + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specifies + that the data marks the end of a record. +

+
static const int message_end_of_record = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/message_flags.html b/include/asio/doc/asio/reference/basic_socket_acceptor/message_flags.html new file mode 100644 index 0000000..61e5664 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/message_flags.html @@ -0,0 +1,57 @@ + + + +basic_socket_acceptor::message_flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Bitmask + type for flags that can be passed to send and receive operations. +

+
typedef int message_flags;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/message_out_of_band.html b/include/asio/doc/asio/reference/basic_socket_acceptor/message_out_of_band.html new file mode 100644 index 0000000..6a53f09 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/message_out_of_band.html @@ -0,0 +1,47 @@ + + + +basic_socket_acceptor::message_out_of_band + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Process + out-of-band data. +

+
static const int message_out_of_band = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/message_peek.html b/include/asio/doc/asio/reference/basic_socket_acceptor/message_peek.html new file mode 100644 index 0000000..0f4352a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/message_peek.html @@ -0,0 +1,47 @@ + + + +basic_socket_acceptor::message_peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Peek + at incoming data without removing it from the input queue. +

+
static const int message_peek = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/native_handle.html b/include/asio/doc/asio/reference/basic_socket_acceptor/native_handle.html new file mode 100644 index 0000000..3f79aae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/native_handle.html @@ -0,0 +1,49 @@ + + + +basic_socket_acceptor::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the native acceptor representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + acceptor. This is intended to allow access to native acceptor functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/native_handle_type.html b/include/asio/doc/asio/reference/basic_socket_acceptor/native_handle_type.html new file mode 100644 index 0000000..c10118d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/native_handle_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_acceptor::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of an acceptor. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking.html b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking.html new file mode 100644 index 0000000..2a1595d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_socket_acceptor::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native acceptor implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native acceptor implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload1.html new file mode 100644 index 0000000..035887a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload1.html @@ -0,0 +1,67 @@ + + + +basic_socket_acceptor::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Gets the non-blocking mode of the native acceptor implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native acceptor. This mode has no effect on the behaviour of the acceptor + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying acceptor is in non-blocking mode + and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the acceptor object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native acceptor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload2.html new file mode 100644 index 0000000..b59dd2a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload2.html @@ -0,0 +1,80 @@ + + + +basic_socket_acceptor::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the native acceptor implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native acceptor. It has no effect on the behaviour of the acceptor object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying acceptor is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload3.html new file mode 100644 index 0000000..107d970 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/native_non_blocking/overload3.html @@ -0,0 +1,72 @@ + + + +basic_socket_acceptor::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the native acceptor implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native acceptor. It has no effect on the behaviour of the acceptor object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying acceptor is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking.html b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking.html new file mode 100644 index 0000000..5719e8e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_socket_acceptor::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the acceptor. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the acceptor. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload1.html new file mode 100644 index 0000000..042d6b6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload1.html @@ -0,0 +1,62 @@ + + + +basic_socket_acceptor::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Gets the non-blocking mode of the acceptor. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the acceptor's synchronous operations will fail + with asio::error::would_block if they are unable to perform + the requested operation immediately. If false, synchronous + operations will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload2.html new file mode 100644 index 0000000..8a66e44 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload2.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the acceptor. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the acceptor's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload3.html new file mode 100644 index 0000000..7015c48 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/non_blocking/overload3.html @@ -0,0 +1,73 @@ + + + +basic_socket_acceptor::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the acceptor. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the acceptor's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/open.html b/include/asio/doc/asio/reference/basic_socket_acceptor/open.html new file mode 100644 index 0000000..2b7a842 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/open.html @@ -0,0 +1,51 @@ + + + +basic_socket_acceptor::open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Open + the acceptor using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+  » more...
+
+void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/open/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/open/overload1.html new file mode 100644 index 0000000..3725b3e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/open/overload1.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::open (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Open the acceptor using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+
+

+ This function opens the socket acceptor so that it will use the specified + protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying which protocol is to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+acceptor.open(asio::ip::tcp::v4());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/open/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/open/overload2.html new file mode 100644 index 0000000..0e71f93 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/open/overload2.html @@ -0,0 +1,78 @@ + + + +basic_socket_acceptor::open (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Open the acceptor using the specified protocol. +

+
void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+
+

+ This function opens the socket acceptor so that it will use the specified + protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying which protocol is to be used. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::acceptor acceptor(my_context);
+asio::error_code ec;
+acceptor.open(asio::ip::tcp::v4(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_.html b/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_.html new file mode 100644 index 0000000..c893d5f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_.html @@ -0,0 +1,58 @@ + + + +basic_socket_acceptor::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_socket_acceptor + from another. +

+
basic_socket_acceptor & operator=(
+    basic_socket_acceptor && other);
+  » more...
+
+

+ Move-assign a basic_socket_acceptor + from an acceptor of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket_acceptor & >::type operator=(
+    basic_socket_acceptor< Protocol1, Executor1 > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_/overload1.html new file mode 100644 index 0000000..f1e7a87 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_/overload1.html @@ -0,0 +1,71 @@ + + + +basic_socket_acceptor::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_socket_acceptor + from another. +

+
basic_socket_acceptor & operator=(
+    basic_socket_acceptor && other);
+
+

+ This assignment operator moves an acceptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket_acceptor + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket_acceptor(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_/overload2.html new file mode 100644 index 0000000..c5f8560 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/operator_eq_/overload2.html @@ -0,0 +1,74 @@ + + + +basic_socket_acceptor::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_socket_acceptor + from an acceptor of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_socket_acceptor & >::type operator=(
+    basic_socket_acceptor< Protocol1, Executor1 > && other);
+
+

+ This assignment operator moves an acceptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_socket_acceptor + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_socket_acceptor(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/out_of_band_inline.html b/include/asio/doc/asio/reference/basic_socket_acceptor/out_of_band_inline.html new file mode 100644 index 0000000..6e05ffc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/out_of_band_inline.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::out_of_band_inline + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for putting received out-of-band data inline. +

+
typedef implementation_defined out_of_band_inline;
+
+

+ Implements the SOL_SOCKET/SO_OOBINLINE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option;
+socket.get_option(option);
+bool value = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/protocol_type.html b/include/asio/doc/asio/reference/basic_socket_acceptor/protocol_type.html new file mode 100644 index 0000000..49edb99 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_acceptor::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/receive_buffer_size.html b/include/asio/doc/asio/reference/basic_socket_acceptor/receive_buffer_size.html new file mode 100644 index 0000000..4795fd0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/receive_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::receive_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive buffer size of a socket. +

+
typedef implementation_defined receive_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_RCVBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/receive_low_watermark.html b/include/asio/doc/asio/reference/basic_socket_acceptor/receive_low_watermark.html new file mode 100644 index 0000000..f156173 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/receive_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::receive_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive low watermark. +

+
typedef implementation_defined receive_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_RCVLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/release.html b/include/asio/doc/asio/reference/basic_socket_acceptor/release.html new file mode 100644 index 0000000..3ccb8e3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/release.html @@ -0,0 +1,49 @@ + + + +basic_socket_acceptor::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release + ownership of the underlying native acceptor. +

+
native_handle_type release();
+  » more...
+
+native_handle_type release(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/release/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/release/overload1.html new file mode 100644 index 0000000..0544fa6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/release/overload1.html @@ -0,0 +1,71 @@ + + + +basic_socket_acceptor::release (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Release ownership of the underlying native acceptor. +

+
native_handle_type release();
+
+

+ This function causes all outstanding asynchronous accept operations to + finish immediately, and the handlers for cancelled operations will be + passed the asio::error::operation_aborted error. Ownership + of the native acceptor is then transferred to the caller. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/release/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/release/overload2.html new file mode 100644 index 0000000..c9d0629 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/release/overload2.html @@ -0,0 +1,72 @@ + + + +basic_socket_acceptor::release (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Release ownership of the underlying native acceptor. +

+
native_handle_type release(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous accept operations to + finish immediately, and the handlers for cancelled operations will be + passed the asio::error::operation_aborted error. Ownership + of the native acceptor is then transferred to the caller. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/reuse_address.html b/include/asio/doc/asio/reference/basic_socket_acceptor/reuse_address.html new file mode 100644 index 0000000..b9de123 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/reuse_address.html @@ -0,0 +1,82 @@ + + + +basic_socket_acceptor::reuse_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to allow the socket to be bound to an address that is already in + use. +

+
typedef implementation_defined reuse_address;
+
+

+ Implements the SOL_SOCKET/SO_REUSEADDR socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/send_buffer_size.html b/include/asio/doc/asio/reference/basic_socket_acceptor/send_buffer_size.html new file mode 100644 index 0000000..2c66502 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/send_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::send_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send buffer size of a socket. +

+
typedef implementation_defined send_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_SNDBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/send_low_watermark.html b/include/asio/doc/asio/reference/basic_socket_acceptor/send_low_watermark.html new file mode 100644 index 0000000..fe6c7ca --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/send_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_socket_acceptor::send_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send low watermark. +

+
typedef implementation_defined send_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_SNDLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/set_option.html b/include/asio/doc/asio/reference/basic_socket_acceptor/set_option.html new file mode 100644 index 0000000..c1099ea --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/set_option.html @@ -0,0 +1,55 @@ + + + +basic_socket_acceptor::set_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + an option on the acceptor. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+  » more...
+
+template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/set_option/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/set_option/overload1.html new file mode 100644 index 0000000..47e4704 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/set_option/overload1.html @@ -0,0 +1,87 @@ + + + +basic_socket_acceptor::set_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set an option on the acceptor. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+
+

+ This function is used to set an option on the acceptor. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the acceptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Setting the SOL_SOCKET/SO_REUSEADDR option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::acceptor::reuse_address option(true);
+acceptor.set_option(option);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/set_option/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/set_option/overload2.html new file mode 100644 index 0000000..57ad4b5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/set_option/overload2.html @@ -0,0 +1,84 @@ + + + +basic_socket_acceptor::set_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set an option on the acceptor. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+
+

+ This function is used to set an option on the acceptor. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the acceptor. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Setting the SOL_SOCKET/SO_REUSEADDR option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::ip::tcp::acceptor::reuse_address option(true);
+asio::error_code ec;
+acceptor.set_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/shutdown_type.html b/include/asio/doc/asio/reference/basic_socket_acceptor/shutdown_type.html new file mode 100644 index 0000000..394fc57 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/shutdown_type.html @@ -0,0 +1,73 @@ + + + +basic_socket_acceptor::shutdown_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Different + ways a socket may be shutdown. +

+
enum shutdown_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
shutdown_receive
+

+ Shutdown the receive side of the socket. +

+
shutdown_send
+

+ Shutdown the send side of the socket. +

+
shutdown_both
+

+ Shutdown both send and receive on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/wait.html b/include/asio/doc/asio/reference/basic_socket_acceptor/wait.html new file mode 100644 index 0000000..aa1b607 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/wait.html @@ -0,0 +1,52 @@ + + + +basic_socket_acceptor::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait + for the acceptor to become ready to read, ready to write, or to have pending + error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/wait/overload1.html b/include/asio/doc/asio/reference/basic_socket_acceptor/wait/overload1.html new file mode 100644 index 0000000..5d61f69 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/wait/overload1.html @@ -0,0 +1,73 @@ + + + +basic_socket_acceptor::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wait for the acceptor to become ready to read, ready to write, or to + have pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for an acceptor to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired acceptor state. +

+
+
+
+ + Example +
+

+ Waiting for an acceptor to become readable. +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+acceptor.wait(asio::ip::tcp::acceptor::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/wait/overload2.html b/include/asio/doc/asio/reference/basic_socket_acceptor/wait/overload2.html new file mode 100644 index 0000000..4c1464a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/wait/overload2.html @@ -0,0 +1,79 @@ + + + +basic_socket_acceptor::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wait for the acceptor to become ready to read, ready to write, or to + have pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for an acceptor to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired acceptor state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for an acceptor to become readable. +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::error_code ec;
+acceptor.wait(asio::ip::tcp::acceptor::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor/wait_type.html b/include/asio/doc/asio/reference/basic_socket_acceptor/wait_type.html new file mode 100644 index 0000000..6e943aa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor/wait_type.html @@ -0,0 +1,76 @@ + + + +basic_socket_acceptor::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a socket to become ready to read. +

+
wait_write
+

+ Wait for a socket to become ready to write. +

+
wait_error
+

+ Wait for a socket to have error conditions pending. +

+
+
+

+ For use with basic_socket::wait() and basic_socket::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor__rebind_executor.html b/include/asio/doc/asio/reference/basic_socket_acceptor__rebind_executor.html new file mode 100644 index 0000000..318c78f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_socket_acceptor::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the acceptor type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The socket type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_acceptor__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_socket_acceptor__rebind_executor/other.html new file mode 100644 index 0000000..528c702 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_acceptor__rebind_executor/other.html @@ -0,0 +1,777 @@ + + + +basic_socket_acceptor::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + socket type when rebound to the specified executor. +

+
typedef basic_socket_acceptor< Protocol, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the acceptor type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of an acceptor. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ accept +

+
+

+ Accept a new connection.
—
Accept a new connection + and obtain the endpoint of the peer. +

+
+

+ assign +

+
+

+ Assigns an existing native acceptor to the acceptor. +

+
+

+ async_accept +

+
+

+ Start an asynchronous accept. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the acceptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_socket_acceptor [constructor] +

+
+

+ Construct an acceptor without opening it.
—
Construct + an open acceptor.
—
Construct an acceptor opened + on the given endpoint.
—
Construct a basic_socket_acceptor + on an existing native acceptor.
—
Move-construct + a basic_socket_acceptor from another.
—
Move-construct + a basic_socket_acceptor from an acceptor of another protocol + type. +

+
+

+ bind +

+
+

+ Bind the acceptor to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the acceptor. +

+
+

+ close +

+
+

+ Close the acceptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the acceptor. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the acceptor. +

+
+

+ is_open +

+
+

+ Determine whether the acceptor is open. +

+
+

+ listen +

+
+

+ Place the acceptor into the state where it will listen for new + connections. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the acceptor. +

+
+

+ native_handle +

+
+

+ Get the native acceptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native acceptor implementation. +
—
Sets the non-blocking mode of the native acceptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the acceptor.
—
Sets + the non-blocking mode of the acceptor. +

+
+

+ open +

+
+

+ Open the acceptor using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_acceptor from another.
—
+ Move-assign a basic_socket_acceptor from an acceptor of another + protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native acceptor. +

+
+

+ set_option +

+
+

+ Set an option on the acceptor. +

+
+

+ wait +

+
+

+ Wait for the acceptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_socket_acceptor [destructor] +

+
+

+ Destroys the acceptor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket_acceptor + class template is used for accepting new socket connections. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ Opening a socket acceptor with the SO_REUSEADDR option enabled: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port);
+acceptor.open(endpoint.protocol());
+acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true));
+acceptor.bind(endpoint);
+acceptor.listen();
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_acceptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream.html b/include/asio/doc/asio/reference/basic_socket_iostream.html new file mode 100644 index 0000000..b9aca4d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream.html @@ -0,0 +1,329 @@ + + + +basic_socket_iostream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Iostream interface for a socket. +

+
template<
+    typename Protocol,
+    typename Clock = chrono::steady_clock,
+    typename WaitTraits = wait_traits<Clock>>
+class basic_socket_iostream
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type. +

+
+

+ duration_type +

+
+

+ (Deprecated: Use duration.) The duration type. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ time_point +

+
+

+ The time type. +

+
+

+ time_type +

+
+

+ (Deprecated: Use time_point.) The time type. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_socket_iostream [constructor] +

+
+

+ Construct a basic_socket_iostream without establishing a connection. +
—
Construct a basic_socket_iostream from the supplied + socket.
—
Move-construct a basic_socket_iostream from + another.
—
Establish a connection to an endpoint corresponding + to a resolver query. +

+
+

+ close +

+
+

+ Close the connection. +

+
+

+ connect +

+
+

+ Establish a connection to an endpoint corresponding to a resolver + query. +

+
+

+ error +

+
+

+ Get the last error associated with the stream. +

+
+

+ expires_after +

+
+

+ Set the stream's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time as an + absolute time.
—
Set the stream's expiry time as an + absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set the + stream's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the stream's expiry time as an absolute time. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_iostream from another. +

+
+

+ rdbuf +

+
+

+ Return a pointer to the underlying streambuf. +

+
+

+ socket +

+
+

+ Get a reference to the underlying socket. +

+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream.html b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream.html new file mode 100644 index 0000000..ddce74e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream.html @@ -0,0 +1,75 @@ + + + +basic_socket_iostream::basic_socket_iostream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_socket_iostream + without establishing a connection. +

+
basic_socket_iostream();
+  » more...
+
+

+ Construct a basic_socket_iostream + from the supplied socket. +

+
explicit basic_socket_iostream(
+    basic_stream_socket< protocol_type > s);
+  » more...
+
+

+ Move-construct a basic_socket_iostream + from another. +

+
basic_socket_iostream(
+    basic_socket_iostream && other);
+  » more...
+
+

+ Establish a connection to an endpoint corresponding to a resolver query. +

+
template<
+    typename T1,
+    ... ,
+    typename TN>
+explicit basic_socket_iostream(
+    T1 t1,
+    ... ,
+    TN tn);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload1.html b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload1.html new file mode 100644 index 0000000..e4011d6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload1.html @@ -0,0 +1,44 @@ + + + +basic_socket_iostream::basic_socket_iostream (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket_iostream + without establishing a connection. +

+
basic_socket_iostream();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload2.html b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload2.html new file mode 100644 index 0000000..2fd813f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload2.html @@ -0,0 +1,45 @@ + + + +basic_socket_iostream::basic_socket_iostream (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket_iostream + from the supplied socket. +

+
basic_socket_iostream(
+    basic_stream_socket< protocol_type > s);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload3.html b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload3.html new file mode 100644 index 0000000..20667c3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload3.html @@ -0,0 +1,45 @@ + + + +basic_socket_iostream::basic_socket_iostream (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_socket_iostream + from another. +

+
basic_socket_iostream(
+    basic_socket_iostream && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload4.html b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload4.html new file mode 100644 index 0000000..f8912cf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/basic_socket_iostream/overload4.html @@ -0,0 +1,55 @@ + + + +basic_socket_iostream::basic_socket_iostream (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establish a connection to an endpoint corresponding to a resolver query. +

+
template<
+    typename T1,
+    ... ,
+    typename TN>
+basic_socket_iostream(
+    T1 t1,
+    ... ,
+    TN tn);
+
+

+ This constructor automatically establishes a connection based on the + supplied resolver query parameters. The arguments are used to construct + a resolver query object. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/clock_type.html b/include/asio/doc/asio/reference/basic_socket_iostream/clock_type.html new file mode 100644 index 0000000..d2c9217 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/clock_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_iostream::clock_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + clock type. +

+
typedef Clock clock_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/close.html b/include/asio/doc/asio/reference/basic_socket_iostream/close.html new file mode 100644 index 0000000..29b1ff1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/close.html @@ -0,0 +1,44 @@ + + + +basic_socket_iostream::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the connection. +

+
void close();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/connect.html b/include/asio/doc/asio/reference/basic_socket_iostream/connect.html new file mode 100644 index 0000000..8c714bc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/connect.html @@ -0,0 +1,56 @@ + + + +basic_socket_iostream::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Establish + a connection to an endpoint corresponding to a resolver query. +

+
template<
+    typename T1,
+    ... ,
+    typename TN>
+void connect(
+    T1 t1,
+    ... ,
+    TN tn);
+
+

+ This function automatically establishes a connection based on the supplied + resolver query parameters. The arguments are used to construct a resolver + query object. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/duration.html b/include/asio/doc/asio/reference/basic_socket_iostream/duration.html new file mode 100644 index 0000000..321f2d9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/duration.html @@ -0,0 +1,54 @@ + + + +basic_socket_iostream::duration + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + duration type. +

+
typedef WaitTraits::duration duration;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/duration_type.html b/include/asio/doc/asio/reference/basic_socket_iostream/duration_type.html new file mode 100644 index 0000000..ad15e9f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/duration_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_iostream::duration_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use duration.) The duration type. +

+
typedef WaitTraits::duration_type duration_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/endpoint_type.html b/include/asio/doc/asio/reference/basic_socket_iostream/endpoint_type.html new file mode 100644 index 0000000..d0189ec --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_iostream::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/error.html b/include/asio/doc/asio/reference/basic_socket_iostream/error.html new file mode 100644 index 0000000..d9064d7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/error.html @@ -0,0 +1,65 @@ + + + +basic_socket_iostream::error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the last error associated with the stream. +

+
const asio::error_code & error() const;
+
+
+ + Return + Value +
+

+ An error_code corresponding to the last error from the stream. +

+
+ + Example +
+

+ To print the error associated with a failure to establish a connection: +

+
tcp::iostream s("www.boost.org", "http");
+if (!s)
+{
+  std::cout << "Error: " << s.error().message() << std::endl;
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expires_after.html b/include/asio/doc/asio/reference/basic_socket_iostream/expires_after.html new file mode 100644 index 0000000..8f78c04 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expires_after.html @@ -0,0 +1,63 @@ + + + +basic_socket_iostream::expires_after + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the stream's expiry time relative to now. +

+
void expires_after(
+    const duration & expiry_time);
+
+

+ This function sets the expiry time associated with the stream. Stream operations + performed after this time (where the operations cannot be completed using + the internal buffers) will fail with the error asio::error::operation_aborted. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expires_at.html b/include/asio/doc/asio/reference/basic_socket_iostream/expires_at.html new file mode 100644 index 0000000..978af93 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expires_at.html @@ -0,0 +1,53 @@ + + + +basic_socket_iostream::expires_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use expiry().) Get the stream's expiry time as an absolute + time. +

+
time_point expires_at() const;
+  » more...
+
+

+ Set the stream's expiry time as an absolute time. +

+
void expires_at(
+    const time_point & expiry_time);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expires_at/overload1.html b/include/asio/doc/asio/reference/basic_socket_iostream/expires_at/overload1.html new file mode 100644 index 0000000..1e4bfef --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expires_at/overload1.html @@ -0,0 +1,52 @@ + + + +basic_socket_iostream::expires_at (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expiry().) Get the stream's expiry time + as an absolute time. +

+
time_point expires_at() const;
+
+
+ + Return + Value +
+

+ An absolute time value representing the stream's expiry time. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expires_at/overload2.html b/include/asio/doc/asio/reference/basic_socket_iostream/expires_at/overload2.html new file mode 100644 index 0000000..85a4dfc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expires_at/overload2.html @@ -0,0 +1,62 @@ + + + +basic_socket_iostream::expires_at (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the stream's expiry time as an absolute time. +

+
void expires_at(
+    const time_point & expiry_time);
+
+

+ This function sets the expiry time associated with the stream. Stream + operations performed after this time (where the operations cannot be + completed using the internal buffers) will fail with the error asio::error::operation_aborted. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the stream. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now.html b/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now.html new file mode 100644 index 0000000..94e330f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now.html @@ -0,0 +1,53 @@ + + + +basic_socket_iostream::expires_from_now + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use expiry().) Get the stream's expiry time relative to now. +

+
duration expires_from_now() const;
+  » more...
+
+

+ (Deprecated: Use expires_after().) Set the stream's expiry + time relative to now. +

+
void expires_from_now(
+    const duration & expiry_time);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now/overload1.html b/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now/overload1.html new file mode 100644 index 0000000..97b6012 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now/overload1.html @@ -0,0 +1,52 @@ + + + +basic_socket_iostream::expires_from_now (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expiry().) Get the stream's expiry time + relative to now. +

+
duration expires_from_now() const;
+
+
+ + Return + Value +
+

+ A relative time value representing the stream's expiry time. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now/overload2.html b/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now/overload2.html new file mode 100644 index 0000000..6cd4e76 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expires_from_now/overload2.html @@ -0,0 +1,63 @@ + + + +basic_socket_iostream::expires_from_now (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expires_after().) Set the stream's expiry + time relative to now. +

+
void expires_from_now(
+    const duration & expiry_time);
+
+

+ This function sets the expiry time associated with the stream. Stream + operations performed after this time (where the operations cannot be + completed using the internal buffers) will fail with the error asio::error::operation_aborted. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/expiry.html b/include/asio/doc/asio/reference/basic_socket_iostream/expiry.html new file mode 100644 index 0000000..328216f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/expiry.html @@ -0,0 +1,52 @@ + + + +basic_socket_iostream::expiry + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the stream's expiry time as an absolute time. +

+
time_point expiry() const;
+
+
+ + Return + Value +
+

+ An absolute time value representing the stream's expiry time. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/operator_eq_.html b/include/asio/doc/asio/reference/basic_socket_iostream/operator_eq_.html new file mode 100644 index 0000000..ff870c6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/operator_eq_.html @@ -0,0 +1,46 @@ + + + +basic_socket_iostream::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_socket_iostream + from another. +

+
basic_socket_iostream & operator=(
+    basic_socket_iostream && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/protocol_type.html b/include/asio/doc/asio/reference/basic_socket_iostream/protocol_type.html new file mode 100644 index 0000000..a8707d1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_iostream::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/rdbuf.html b/include/asio/doc/asio/reference/basic_socket_iostream/rdbuf.html new file mode 100644 index 0000000..9fbab9e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/rdbuf.html @@ -0,0 +1,44 @@ + + + +basic_socket_iostream::rdbuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Return + a pointer to the underlying streambuf. +

+
basic_socket_streambuf< Protocol, Clock, WaitTraits > * rdbuf() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/socket.html b/include/asio/doc/asio/reference/basic_socket_iostream/socket.html new file mode 100644 index 0000000..c610ebb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/socket.html @@ -0,0 +1,44 @@ + + + +basic_socket_iostream::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the underlying socket. +

+
basic_socket< Protocol > & socket();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/time_point.html b/include/asio/doc/asio/reference/basic_socket_iostream/time_point.html new file mode 100644 index 0000000..aabc319 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/time_point.html @@ -0,0 +1,54 @@ + + + +basic_socket_iostream::time_point + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + time type. +

+
typedef WaitTraits::time_point time_point;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_iostream/time_type.html b/include/asio/doc/asio/reference/basic_socket_iostream/time_type.html new file mode 100644 index 0000000..d102de1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_iostream/time_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_iostream::time_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use time_point.) The time type. +

+
typedef WaitTraits::time_type time_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_iostream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf.html b/include/asio/doc/asio/reference/basic_socket_streambuf.html new file mode 100644 index 0000000..0aa5c07 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf.html @@ -0,0 +1,402 @@ + + + +basic_socket_streambuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Iostream streambuf for a socket. +

+
template<
+    typename Protocol,
+    typename Clock = chrono::steady_clock,
+    typename WaitTraits = wait_traits<Clock>>
+class basic_socket_streambuf :
+  basic_socket< Protocol >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type. +

+
+

+ duration_type +

+
+

+ (Deprecated: Use duration.) The duration type. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ time_point +

+
+

+ The time type. +

+
+

+ time_type +

+
+

+ (Deprecated: Use time_point.) The time type. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_socket_streambuf [constructor] +

+
+

+ Construct a basic_socket_streambuf without establishing a connection. +
—
Construct a basic_socket_streambuf from the supplied + socket.
—
Move-construct a basic_socket_streambuf from + another. +

+
+

+ close +

+
+

+ Close the connection. +

+
+

+ connect +

+
+

+ Establish a connection. +

+
+

+ error +

+
+

+ Get the last error associated with the stream buffer. +

+
+

+ expires_after +

+
+

+ Set the stream buffer's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the stream buffer's expiry time + as an absolute time.
—
Set the stream buffer's expiry + time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the stream buffer's expiry time + relative to now.
—
(Deprecated: Use expires_after().) + Set the stream buffer's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the stream buffer's expiry time as an absolute time. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_streambuf from another. +

+
+

+ puberror +

+
+

+ (Deprecated: Use error().) Get the last error associated with the + stream buffer. +

+
+

+ socket +

+
+

+ Get a reference to the underlying socket. +

+
+

+ ~basic_socket_streambuf [destructor] +

+
+

+ Destructor flushes buffered data. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ overflow +

+
+
+

+ setbuf +

+
+
+

+ sync +

+
+
+

+ underflow +

+
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/_basic_socket_streambuf.html b/include/asio/doc/asio/reference/basic_socket_streambuf/_basic_socket_streambuf.html new file mode 100644 index 0000000..5755169 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/_basic_socket_streambuf.html @@ -0,0 +1,44 @@ + + + +basic_socket_streambuf::~basic_socket_streambuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor + flushes buffered data. +

+
virtual ~basic_socket_streambuf();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf.html b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf.html new file mode 100644 index 0000000..721be20 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf.html @@ -0,0 +1,62 @@ + + + +basic_socket_streambuf::basic_socket_streambuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_socket_streambuf + without establishing a connection. +

+
basic_socket_streambuf();
+  » more...
+
+

+ Construct a basic_socket_streambuf + from the supplied socket. +

+
explicit basic_socket_streambuf(
+    basic_stream_socket< protocol_type > s);
+  » more...
+
+

+ Move-construct a basic_socket_streambuf + from another. +

+
basic_socket_streambuf(
+    basic_socket_streambuf && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload1.html b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload1.html new file mode 100644 index 0000000..f7162c8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload1.html @@ -0,0 +1,44 @@ + + + +basic_socket_streambuf::basic_socket_streambuf (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket_streambuf + without establishing a connection. +

+
basic_socket_streambuf();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload2.html b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload2.html new file mode 100644 index 0000000..78f6736 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload2.html @@ -0,0 +1,45 @@ + + + +basic_socket_streambuf::basic_socket_streambuf (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_socket_streambuf + from the supplied socket. +

+
basic_socket_streambuf(
+    basic_stream_socket< protocol_type > s);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload3.html b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload3.html new file mode 100644 index 0000000..60362a9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload3.html @@ -0,0 +1,45 @@ + + + +basic_socket_streambuf::basic_socket_streambuf (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_socket_streambuf + from another. +

+
basic_socket_streambuf(
+    basic_socket_streambuf && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/clock_type.html b/include/asio/doc/asio/reference/basic_socket_streambuf/clock_type.html new file mode 100644 index 0000000..1d6b2aa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/clock_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::clock_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + clock type. +

+
typedef Clock clock_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/close.html b/include/asio/doc/asio/reference/basic_socket_streambuf/close.html new file mode 100644 index 0000000..26d1b0c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/close.html @@ -0,0 +1,53 @@ + + + +basic_socket_streambuf::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the connection. +

+
basic_socket_streambuf * close();
+
+
+ + Return + Value +
+

+ this if a connection was successfully established, a null + pointer otherwise. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/connect.html b/include/asio/doc/asio/reference/basic_socket_streambuf/connect.html new file mode 100644 index 0000000..fa339f0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/connect.html @@ -0,0 +1,56 @@ + + + +basic_socket_streambuf::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Establish + a connection. +

+
basic_socket_streambuf * connect(
+    const endpoint_type & endpoint);
+  » more...
+
+template<
+    typename T1,
+    ... ,
+    typename TN>
+basic_socket_streambuf * connect(
+    T1 t1,
+    ... ,
+    TN tn);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/connect/overload1.html b/include/asio/doc/asio/reference/basic_socket_streambuf/connect/overload1.html new file mode 100644 index 0000000..3f6ed25 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/connect/overload1.html @@ -0,0 +1,56 @@ + + + +basic_socket_streambuf::connect (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establish a connection. +

+
basic_socket_streambuf * connect(
+    const endpoint_type & endpoint);
+
+

+ This function establishes a connection to the specified endpoint. +

+
+ + Return + Value +
+

+ this if a connection was successfully established, a null + pointer otherwise. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/connect/overload2.html b/include/asio/doc/asio/reference/basic_socket_streambuf/connect/overload2.html new file mode 100644 index 0000000..5090ca7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/connect/overload2.html @@ -0,0 +1,64 @@ + + + +basic_socket_streambuf::connect (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establish a connection. +

+
template<
+    typename T1,
+    ... ,
+    typename TN>
+basic_socket_streambuf * connect(
+    T1 t1,
+    ... ,
+    TN tn);
+
+

+ This function automatically establishes a connection based on the supplied + resolver query parameters. The arguments are used to construct a resolver + query object. +

+
+ + Return + Value +
+

+ this if a connection was successfully established, a null + pointer otherwise. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/duration.html b/include/asio/doc/asio/reference/basic_socket_streambuf/duration.html new file mode 100644 index 0000000..9ee2145 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/duration.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::duration + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + duration type. +

+
typedef WaitTraits::duration duration;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/duration_type.html b/include/asio/doc/asio/reference/basic_socket_streambuf/duration_type.html new file mode 100644 index 0000000..a0a2aa8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/duration_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::duration_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use duration.) The duration type. +

+
typedef WaitTraits::duration_type duration_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/endpoint_type.html b/include/asio/doc/asio/reference/basic_socket_streambuf/endpoint_type.html new file mode 100644 index 0000000..e9809b0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/error.html b/include/asio/doc/asio/reference/basic_socket_streambuf/error.html new file mode 100644 index 0000000..42fdb39 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/error.html @@ -0,0 +1,53 @@ + + + +basic_socket_streambuf::error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the last error associated with the stream buffer. +

+
const asio::error_code & error() const;
+
+
+ + Return + Value +
+

+ An error_code corresponding to the last error from the stream + buffer. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expires_after.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_after.html new file mode 100644 index 0000000..9b8a526 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_after.html @@ -0,0 +1,63 @@ + + + +basic_socket_streambuf::expires_after + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the stream buffer's expiry time relative to now. +

+
void expires_after(
+    const duration & expiry_time);
+
+

+ This function sets the expiry time associated with the stream. Stream operations + performed after this time (where the operations cannot be completed using + the internal buffers) will fail with the error asio::error::operation_aborted. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at.html new file mode 100644 index 0000000..ba00f8f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at.html @@ -0,0 +1,53 @@ + + + +basic_socket_streambuf::expires_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use expiry().) Get the stream buffer's expiry time as an absolute + time. +

+
time_point expires_at() const;
+  » more...
+
+

+ Set the stream buffer's expiry time as an absolute time. +

+
void expires_at(
+    const time_point & expiry_time);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at/overload1.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at/overload1.html new file mode 100644 index 0000000..a823c78 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at/overload1.html @@ -0,0 +1,52 @@ + + + +basic_socket_streambuf::expires_at (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expiry().) Get the stream buffer's expiry + time as an absolute time. +

+
time_point expires_at() const;
+
+
+ + Return + Value +
+

+ An absolute time value representing the stream buffer's expiry time. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at/overload2.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at/overload2.html new file mode 100644 index 0000000..8ccdbd5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_at/overload2.html @@ -0,0 +1,62 @@ + + + +basic_socket_streambuf::expires_at (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the stream buffer's expiry time as an absolute time. +

+
void expires_at(
+    const time_point & expiry_time);
+
+

+ This function sets the expiry time associated with the stream. Stream + operations performed after this time (where the operations cannot be + completed using the internal buffers) will fail with the error asio::error::operation_aborted. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the stream. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now.html new file mode 100644 index 0000000..82c12dd --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::expires_from_now + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use expiry().) Get the stream buffer's expiry time relative + to now. +

+
duration expires_from_now() const;
+  » more...
+
+

+ (Deprecated: Use expires_after().) Set the stream buffer's + expiry time relative to now. +

+
void expires_from_now(
+    const duration & expiry_time);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now/overload1.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now/overload1.html new file mode 100644 index 0000000..aa68ebe --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now/overload1.html @@ -0,0 +1,52 @@ + + + +basic_socket_streambuf::expires_from_now (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expiry().) Get the stream buffer's expiry + time relative to now. +

+
duration expires_from_now() const;
+
+
+ + Return + Value +
+

+ A relative time value representing the stream buffer's expiry time. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now/overload2.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now/overload2.html new file mode 100644 index 0000000..f099b48 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expires_from_now/overload2.html @@ -0,0 +1,63 @@ + + + +basic_socket_streambuf::expires_from_now (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expires_after().) Set the stream buffer's + expiry time relative to now. +

+
void expires_from_now(
+    const duration & expiry_time);
+
+

+ This function sets the expiry time associated with the stream. Stream + operations performed after this time (where the operations cannot be + completed using the internal buffers) will fail with the error asio::error::operation_aborted. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/expiry.html b/include/asio/doc/asio/reference/basic_socket_streambuf/expiry.html new file mode 100644 index 0000000..9ae579e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/expiry.html @@ -0,0 +1,52 @@ + + + +basic_socket_streambuf::expiry + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the stream buffer's expiry time as an absolute time. +

+
time_point expiry() const;
+
+
+ + Return + Value +
+

+ An absolute time value representing the stream buffer's expiry time. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/operator_eq_.html b/include/asio/doc/asio/reference/basic_socket_streambuf/operator_eq_.html new file mode 100644 index 0000000..08ccc85 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/operator_eq_.html @@ -0,0 +1,46 @@ + + + +basic_socket_streambuf::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_socket_streambuf + from another. +

+
basic_socket_streambuf & operator=(
+    basic_socket_streambuf && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/overflow.html b/include/asio/doc/asio/reference/basic_socket_streambuf/overflow.html new file mode 100644 index 0000000..2c9adff --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/overflow.html @@ -0,0 +1,43 @@ + + + +basic_socket_streambuf::overflow + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
int_type overflow(
+    int_type c);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/protocol_type.html b/include/asio/doc/asio/reference/basic_socket_streambuf/protocol_type.html new file mode 100644 index 0000000..284495a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/puberror.html b/include/asio/doc/asio/reference/basic_socket_streambuf/puberror.html new file mode 100644 index 0000000..3a2665a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/puberror.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::puberror + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use error().) Get the last error associated with the stream + buffer. +

+
const asio::error_code & puberror() const;
+
+
+ + Return + Value +
+

+ An error_code corresponding to the last error from the stream + buffer. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/setbuf.html b/include/asio/doc/asio/reference/basic_socket_streambuf/setbuf.html new file mode 100644 index 0000000..539b0de --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/setbuf.html @@ -0,0 +1,44 @@ + + + +basic_socket_streambuf::setbuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
std::streambuf * setbuf(
+    char_type * s,
+    std::streamsize n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/socket.html b/include/asio/doc/asio/reference/basic_socket_streambuf/socket.html new file mode 100644 index 0000000..a21ba5c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/socket.html @@ -0,0 +1,44 @@ + + + +basic_socket_streambuf::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the underlying socket. +

+
basic_socket< Protocol > & socket();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/sync.html b/include/asio/doc/asio/reference/basic_socket_streambuf/sync.html new file mode 100644 index 0000000..5789314 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/sync.html @@ -0,0 +1,42 @@ + + + +basic_socket_streambuf::sync + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
int sync();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/time_point.html b/include/asio/doc/asio/reference/basic_socket_streambuf/time_point.html new file mode 100644 index 0000000..734f874 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/time_point.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::time_point + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + time type. +

+
typedef WaitTraits::time_point time_point;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/time_type.html b/include/asio/doc/asio/reference/basic_socket_streambuf/time_type.html new file mode 100644 index 0000000..a25a0e0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/time_type.html @@ -0,0 +1,54 @@ + + + +basic_socket_streambuf::time_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use time_point.) The time type. +

+
typedef WaitTraits::time_type time_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_socket_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_socket_streambuf/underflow.html b/include/asio/doc/asio/reference/basic_socket_streambuf/underflow.html new file mode 100644 index 0000000..27f7984 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_socket_streambuf/underflow.html @@ -0,0 +1,42 @@ + + + +basic_socket_streambuf::underflow + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
int_type underflow();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket.html b/include/asio/doc/asio/reference/basic_stream_socket.html new file mode 100644 index 0000000..3644d49 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket.html @@ -0,0 +1,919 @@ + + + +basic_stream_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides stream-oriented socket functionality. +

+
template<
+    typename Protocol,
+    typename Executor>
+class basic_stream_socket :
+  public basic_socket< Protocol, Executor >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close if + unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_stream_socket [constructor] +

+
+

+ Construct a basic_stream_socket without opening it.
—
+ Construct and open a basic_stream_socket.
—
Construct + a basic_stream_socket, opening it and binding it to the given local + endpoint.
—
Construct a basic_stream_socket on an existing + native socket.
—
Move-construct a basic_stream_socket + from another.
—
Move-construct a basic_stream_socket + from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets the + non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_stream_socket from another.
—
Move-assign + a basic_stream_socket from a socket of another protocol type. +

+
+

+ read_some +

+
+

+ Read some data from the socket. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, or + to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the socket. +

+
+

+ ~basic_stream_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length of + the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_stream_socket + class template provides asynchronous and blocking stream-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/_basic_stream_socket.html b/include/asio/doc/asio/reference/basic_stream_socket/_basic_stream_socket.html new file mode 100644 index 0000000..a6a80c0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/_basic_stream_socket.html @@ -0,0 +1,48 @@ + + + +basic_stream_socket::~basic_stream_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the socket. +

+
~basic_stream_socket();
+
+

+ This function destroys the socket, cancelling any outstanding asynchronous + operations associated with the socket as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/assign.html b/include/asio/doc/asio/reference/basic_stream_socket/assign.html new file mode 100644 index 0000000..8c0f635 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/assign.html @@ -0,0 +1,53 @@ + + + +basic_stream_socket::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/assign/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/assign/overload1.html new file mode 100644 index 0000000..6262b73 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/assign/overload1.html @@ -0,0 +1,48 @@ + + + +basic_stream_socket::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/assign/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/assign/overload2.html new file mode 100644 index 0000000..f97f52e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/assign/overload2.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Assign an existing native socket to the socket. +

+
void assign(
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_connect.html b/include/asio/doc/asio/reference/basic_stream_socket/async_connect.html new file mode 100644 index 0000000..4c53c31 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_connect.html @@ -0,0 +1,111 @@ + + + +basic_stream_socket::async_connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Start + an asynchronous connect. +

+
template<
+    typename ConnectHandler = DEFAULT>
+DEDUCED async_connect(
+    const endpoint_type & peer_endpoint,
+    ConnectHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously connect a socket to the specified + remote endpoint. The function call always returns immediately. +

+

+ The socket is automatically opened if it is not already open. If the connect + fails, and the socket was automatically opened, the socket is not returned + to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. Copies + will be made of the endpoint object as required. +

+
handler
+
+

+ The handler to be called when the connection operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void connect_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Connect succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.async_connect(endpoint, connect_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_read_some.html b/include/asio/doc/asio/reference/basic_stream_socket/async_read_some.html new file mode 100644 index 0000000..78ab408 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_read_some.html @@ -0,0 +1,113 @@ + + + +basic_stream_socket::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data from the stream socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes read.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The read operation may not read all of the requested number of bytes. Consider + using the async_read + function if you need to ensure that the requested amount of data is read + before the asynchronous operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
socket.async_read_some(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_receive.html b/include/asio/doc/asio/reference/basic_stream_socket/async_receive.html new file mode 100644 index 0000000..1772491 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_receive.html @@ -0,0 +1,59 @@ + + + +basic_stream_socket::async_receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_receive/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/async_receive/overload1.html new file mode 100644 index 0000000..73c6c67 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_receive/overload1.html @@ -0,0 +1,112 @@ + + + +basic_stream_socket::async_receive (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the stream + socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The receive operation may not receive all of the requested number of + bytes. Consider using the async_read + function if you need to ensure that the requested amount of data is received + before the asynchronous operation completes. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_receive/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/async_receive/overload2.html new file mode 100644 index 0000000..e558288 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_receive/overload2.html @@ -0,0 +1,117 @@ + + + +basic_stream_socket::async_receive (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous receive. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously receive data from the stream + socket. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. Although + the buffers object may be copied as necessary, ownership of the + underlying memory blocks is retained by the caller, which must + guarantee that they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
handler
+
+

+ The handler to be called when the receive operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes received.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The receive operation may not receive all of the requested number of + bytes. Consider using the async_read + function if you need to ensure that the requested amount of data is received + before the asynchronous operation completes. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.async_receive(asio::buffer(data, size), 0, handler);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_send.html b/include/asio/doc/asio/reference/basic_stream_socket/async_send.html new file mode 100644 index 0000000..accd76d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_send.html @@ -0,0 +1,59 @@ + + + +basic_stream_socket::async_send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_send/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/async_send/overload1.html new file mode 100644 index 0000000..d6988ff --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_send/overload1.html @@ -0,0 +1,112 @@ + + + +basic_stream_socket::async_send (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send data on the stream socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The send operation may not transmit all of the data to the peer. Consider + using the async_write + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.async_send(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_send/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/async_send/overload2.html new file mode 100644 index 0000000..38d0880 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_send/overload2.html @@ -0,0 +1,117 @@ + + + +basic_stream_socket::async_send (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous send. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously send data on the stream socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
handler
+
+

+ The handler to be called when the send operation completes. Copies + will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes sent.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The send operation may not transmit all of the data to the peer. Consider + using the async_write + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.async_send(asio::buffer(data, size), 0, handler);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_wait.html b/include/asio/doc/asio/reference/basic_stream_socket/async_wait.html new file mode 100644 index 0000000..d2aa043 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_wait.html @@ -0,0 +1,105 @@ + + + +basic_stream_socket::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Asynchronously + wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::ip::tcp::socket socket(my_context);
+...
+socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/async_write_some.html b/include/asio/doc/asio/reference/basic_stream_socket/async_write_some.html new file mode 100644 index 0000000..e976a58 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/async_write_some.html @@ -0,0 +1,113 @@ + + + +basic_stream_socket::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write data to the stream socket. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the socket. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes written.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The write operation may not transmit all of the data to the peer. Consider + using the async_write + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
socket.async_write_some(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/at_mark.html b/include/asio/doc/asio/reference/basic_stream_socket/at_mark.html new file mode 100644 index 0000000..4f10576 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/at_mark.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::at_mark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+  » more...
+
+bool at_mark(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/at_mark/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/at_mark/overload1.html new file mode 100644 index 0000000..5a1e562 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/at_mark/overload1.html @@ -0,0 +1,71 @@ + + + +basic_stream_socket::at_mark (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark() const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/at_mark/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/at_mark/overload2.html new file mode 100644 index 0000000..b0b55e4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/at_mark/overload2.html @@ -0,0 +1,72 @@ + + + +basic_stream_socket::at_mark (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine whether the socket is at the out-of-band data mark. +

+
bool at_mark(
+    asio::error_code & ec) const;
+
+

+ This function is used to check whether the socket input is currently + positioned at the out-of-band data mark. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A bool indicating whether the socket is at the out-of-band data mark. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/available.html b/include/asio/doc/asio/reference/basic_stream_socket/available.html new file mode 100644 index 0000000..7ffcb86 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/available.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::available + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the number of bytes available for reading. +

+
std::size_t available() const;
+  » more...
+
+std::size_t available(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/available/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/available/overload1.html new file mode 100644 index 0000000..43b9e9c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/available/overload1.html @@ -0,0 +1,72 @@ + + + +basic_stream_socket::available (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available() const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/available/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/available/overload2.html new file mode 100644 index 0000000..c0244c8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/available/overload2.html @@ -0,0 +1,73 @@ + + + +basic_stream_socket::available (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Determine the number of bytes available for reading. +

+
std::size_t available(
+    asio::error_code & ec) const;
+
+

+ This function is used to determine the number of bytes that may be read + without blocking. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes that may be read without blocking, or 0 if an error + occurs. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket.html new file mode 100644 index 0000000..f5c27fb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket.html @@ -0,0 +1,126 @@ + + + +basic_stream_socket::basic_stream_socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_stream_socket + without opening it. +

+
explicit basic_stream_socket(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_stream_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct and open a basic_stream_socket. +

+
basic_stream_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_stream_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_stream_socket, + opening it and binding it to the given local endpoint. +

+
basic_stream_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_stream_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a basic_stream_socket + on an existing native socket. +

+
basic_stream_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_stream_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_stream_socket + from another. +

+
basic_stream_socket(
+    basic_stream_socket && other);
+  » more...
+
+

+ Move-construct a basic_stream_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_stream_socket(
+    basic_stream_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload1.html new file mode 100644 index 0000000..f7bacca --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload1.html @@ -0,0 +1,64 @@ + + + +basic_stream_socket::basic_stream_socket (1 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_stream_socket + without opening it. +

+
basic_stream_socket(
+    const executor_type & ex);
+
+

+ This constructor creates a stream socket without opening it. The socket + needs to be opened and then connected or accepted before data can be + sent or received on it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload10.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload10.html new file mode 100644 index 0000000..ac9a10c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload10.html @@ -0,0 +1,75 @@ + + + +basic_stream_socket::basic_stream_socket (10 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_stream_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+basic_stream_socket(
+    basic_stream_socket< Protocol1, Executor1 > && other,
+    typename enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value >::type *  = 0);
+
+

+ This constructor moves a stream socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_stream_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_stream_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload2.html new file mode 100644 index 0000000..5539d03 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload2.html @@ -0,0 +1,68 @@ + + + +basic_stream_socket::basic_stream_socket (2 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_stream_socket + without opening it. +

+
template<
+    typename ExecutionContext>
+basic_stream_socket(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a stream socket without opening it. The socket + needs to be opened and then connected or accepted before data can be + sent or received on it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload3.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload3.html new file mode 100644 index 0000000..6fa66e8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload3.html @@ -0,0 +1,80 @@ + + + +basic_stream_socket::basic_stream_socket (3 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_stream_socket. +

+
basic_stream_socket(
+    const executor_type & ex,
+    const protocol_type & protocol);
+
+

+ This constructor creates and opens a stream socket. The socket needs + to be connected or accepted before data can be sent or received on it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload4.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload4.html new file mode 100644 index 0000000..96154b7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload4.html @@ -0,0 +1,84 @@ + + + +basic_stream_socket::basic_stream_socket (4 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct and open a basic_stream_socket. +

+
template<
+    typename ExecutionContext>
+basic_stream_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates and opens a stream socket. The socket needs + to be connected or accepted before data can be sent or received on it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload5.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload5.html new file mode 100644 index 0000000..6cd34d8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload5.html @@ -0,0 +1,83 @@ + + + +basic_stream_socket::basic_stream_socket (5 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_stream_socket, + opening it and binding it to the given local endpoint. +

+
basic_stream_socket(
+    const executor_type & ex,
+    const endpoint_type & endpoint);
+
+

+ This constructor creates a stream socket and automatically opens it bound + to the specified endpoint on the local machine. The protocol used is + the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the stream socket will + be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload6.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload6.html new file mode 100644 index 0000000..c85940f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload6.html @@ -0,0 +1,87 @@ + + + +basic_stream_socket::basic_stream_socket (6 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_stream_socket, + opening it and binding it to the given local endpoint. +

+
template<
+    typename ExecutionContext>
+basic_stream_socket(
+    ExecutionContext & context,
+    const endpoint_type & endpoint,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a stream socket and automatically opens it bound + to the specified endpoint on the local machine. The protocol used is + the protocol associated with the given endpoint. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
endpoint
+

+ An endpoint on the local machine to which the stream socket will + be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload7.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload7.html new file mode 100644 index 0000000..1c9cc65 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload7.html @@ -0,0 +1,86 @@ + + + +basic_stream_socket::basic_stream_socket (7 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_stream_socket + on an existing native socket. +

+
basic_stream_socket(
+    const executor_type & ex,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket);
+
+

+ This constructor creates a stream socket object to hold an existing native + socket. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the socket will use, by default, to dispatch + handlers for any asynchronous operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload8.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload8.html new file mode 100644 index 0000000..93f263b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload8.html @@ -0,0 +1,90 @@ + + + +basic_stream_socket::basic_stream_socket (8 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_stream_socket + on an existing native socket. +

+
template<
+    typename ExecutionContext>
+basic_stream_socket(
+    ExecutionContext & context,
+    const protocol_type & protocol,
+    const native_handle_type & native_socket,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a stream socket object to hold an existing native + socket. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the socket + will use, by default, to dispatch handlers for any asynchronous + operations performed on the socket. +

+
protocol
+

+ An object specifying protocol parameters to be used. +

+
native_socket
+

+ The new underlying socket implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload9.html b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload9.html new file mode 100644 index 0000000..556c484 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/basic_stream_socket/overload9.html @@ -0,0 +1,71 @@ + + + +basic_stream_socket::basic_stream_socket (9 of 10 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_stream_socket + from another. +

+
basic_stream_socket(
+    basic_stream_socket && other);
+
+

+ This constructor moves a stream socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_stream_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_stream_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/bind.html b/include/asio/doc/asio/reference/basic_stream_socket/bind.html new file mode 100644 index 0000000..58b7309 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/bind.html @@ -0,0 +1,51 @@ + + + +basic_stream_socket::bind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bind the + socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+  » more...
+
+void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/bind/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/bind/overload1.html new file mode 100644 index 0000000..1c0427d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/bind/overload1.html @@ -0,0 +1,86 @@ + + + +basic_stream_socket::bind (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/bind/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/bind/overload2.html new file mode 100644 index 0000000..fc7e9ce --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/bind/overload2.html @@ -0,0 +1,83 @@ + + + +basic_stream_socket::bind (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Bind the socket to the given local endpoint. +

+
void bind(
+    const endpoint_type & endpoint,
+    asio::error_code & ec);
+
+

+ This function binds the socket to the specified endpoint on the local + machine. +

+
+ + Parameters +
+
+

+
+
endpoint
+

+ An endpoint on the local machine to which the socket will be bound. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+asio::error_code ec;
+socket.bind(asio::ip::tcp::endpoint(
+      asio::ip::tcp::v4(), 12345), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/broadcast.html b/include/asio/doc/asio/reference/basic_stream_socket/broadcast.html new file mode 100644 index 0000000..90cebdb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/broadcast.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to permit sending of broadcast messages. +

+
typedef implementation_defined broadcast;
+
+

+ Implements the SOL_SOCKET/SO_BROADCAST socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/bytes_readable.html b/include/asio/doc/asio/reference/basic_stream_socket/bytes_readable.html new file mode 100644 index 0000000..d0766ea --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/bytes_readable.html @@ -0,0 +1,70 @@ + + + +basic_stream_socket::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::bytes_readable command(true);
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/cancel.html b/include/asio/doc/asio/reference/basic_stream_socket/cancel.html new file mode 100644 index 0000000..4feb667 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/cancel.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the socket. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/cancel/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/cancel/overload1.html new file mode 100644 index 0000000..3acabb7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/cancel/overload1.html @@ -0,0 +1,104 @@ + + + +basic_stream_socket::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/cancel/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/cancel/overload2.html new file mode 100644 index 0000000..a9f1190 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/cancel/overload2.html @@ -0,0 +1,105 @@ + + + +basic_stream_socket::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Cancel all asynchronous operations associated with the socket. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls to cancel() will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions of + Windows, unless ASIO_ENABLE_CANCELIO is defined. However, the CancelIo + function has two issues that should be considered before enabling its + use: +

+
    +
  • + It will only cancel asynchronous operations that were initiated in + the current thread. +
  • +
  • + It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +
  • +
+

+ For portable cancellation, consider using one of the following alternatives: +

+
    +
  • + Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +
  • +
  • + Use the close() function to simultaneously cancel the + outstanding operations and close the socket. +
  • +
+

+ When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx + function is always used. This function does not have the problems described + above. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/close.html b/include/asio/doc/asio/reference/basic_stream_socket/close.html new file mode 100644 index 0000000..2f45d2b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/close.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close the + socket. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/close/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/close/overload1.html new file mode 100644 index 0000000..4046735 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/close/overload1.html @@ -0,0 +1,73 @@ + + + +basic_stream_socket::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close();
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. Note that, even if the function indicates an + error, the underlying descriptor is closed. +

+
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/close/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/close/overload2.html new file mode 100644 index 0000000..96b5fe1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/close/overload2.html @@ -0,0 +1,87 @@ + + + +basic_stream_socket::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Close the socket. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the socket. Any asynchronous send, receive + or connect operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. Note that, even if + the function indicates an error, the underlying descriptor is closed. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.close(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + Remarks +
+

+ For portable behaviour with respect to graceful closure of a connected + socket, call shutdown() before closing the socket. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/connect.html b/include/asio/doc/asio/reference/basic_stream_socket/connect.html new file mode 100644 index 0000000..5d5c1a8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/connect.html @@ -0,0 +1,51 @@ + + + +basic_stream_socket::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Connect + the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+  » more...
+
+void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/connect/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/connect/overload1.html new file mode 100644 index 0000000..ef90766 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/connect/overload1.html @@ -0,0 +1,92 @@ + + + +basic_stream_socket::connect (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+socket.connect(endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/connect/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/connect/overload2.html new file mode 100644 index 0000000..7efdcec --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/connect/overload2.html @@ -0,0 +1,89 @@ + + + +basic_stream_socket::connect (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Connect the socket to the specified endpoint. +

+
void connect(
+    const endpoint_type & peer_endpoint,
+    asio::error_code & ec);
+
+

+ This function is used to connect a socket to the specified remote endpoint. + The function call will block until the connection is successfully made + or an error occurs. +

+

+ The socket is automatically opened if it is not already open. If the + connect fails, and the socket was automatically opened, the socket is + not returned to the closed state. +

+
+ + Parameters +
+
+

+
+
peer_endpoint
+

+ The remote endpoint to which the socket will be connected. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::ip::tcp::endpoint endpoint(
+    asio::ip::address::from_string("1.2.3.4"), 12345);
+asio::error_code ec;
+socket.connect(endpoint, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/debug.html b/include/asio/doc/asio/reference/basic_stream_socket/debug.html new file mode 100644 index 0000000..7bb4068 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/debug.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::debug + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to enable socket-level debugging. +

+
typedef implementation_defined debug;
+
+

+ Implements the SOL_SOCKET/SO_DEBUG socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/do_not_route.html b/include/asio/doc/asio/reference/basic_stream_socket/do_not_route.html new file mode 100644 index 0000000..7996703 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/do_not_route.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to prevent routing, use local interfaces only. +

+
typedef implementation_defined do_not_route;
+
+

+ Implements the SOL_SOCKET/SO_DONTROUTE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/enable_connection_aborted.html b/include/asio/doc/asio/reference/basic_stream_socket/enable_connection_aborted.html new file mode 100644 index 0000000..5b3a807 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/enable_connection_aborted.html @@ -0,0 +1,83 @@ + + + +basic_stream_socket::enable_connection_aborted + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to report aborted connections on accept. +

+
typedef implementation_defined enable_connection_aborted;
+
+

+ Implements a custom socket option that determines whether or not an accept + operation is permitted to fail with asio::error::connection_aborted. + By default the option is false. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/endpoint_type.html b/include/asio/doc/asio/reference/basic_stream_socket/endpoint_type.html new file mode 100644 index 0000000..93aca64 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/endpoint_type.html @@ -0,0 +1,54 @@ + + + +basic_stream_socket::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef Protocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/executor_type.html b/include/asio/doc/asio/reference/basic_stream_socket/executor_type.html new file mode 100644 index 0000000..45bec26 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_stream_socket::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/get_executor.html b/include/asio/doc/asio/reference/basic_stream_socket/get_executor.html new file mode 100644 index 0000000..dfc2726 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/get_executor.html @@ -0,0 +1,47 @@ + + + +basic_stream_socket::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/get_option.html b/include/asio/doc/asio/reference/basic_stream_socket/get_option.html new file mode 100644 index 0000000..e2a0c18 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/get_option.html @@ -0,0 +1,55 @@ + + + +basic_stream_socket::get_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+  » more...
+
+template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/get_option/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/get_option/overload1.html new file mode 100644 index 0000000..3da246e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/get_option/overload1.html @@ -0,0 +1,91 @@ + + + +basic_stream_socket::get_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/get_option/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/get_option/overload2.html new file mode 100644 index 0000000..41468b6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/get_option/overload2.html @@ -0,0 +1,88 @@ + + + +basic_stream_socket::get_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get an option from the socket. +

+
template<
+    typename GettableSocketOption>
+void get_option(
+    GettableSocketOption & option,
+    asio::error_code & ec) const;
+
+

+ This function is used to get the current value of an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The option value to be obtained from the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::keep_alive option;
+asio::error_code ec;
+socket.get_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+bool is_set = option.value();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/io_control.html b/include/asio/doc/asio/reference/basic_stream_socket/io_control.html new file mode 100644 index 0000000..1322479 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/io_control.html @@ -0,0 +1,55 @@ + + + +basic_stream_socket::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/io_control/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/io_control/overload1.html new file mode 100644 index 0000000..b97ffc6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/io_control/overload1.html @@ -0,0 +1,91 @@ + + + +basic_stream_socket::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/io_control/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/io_control/overload2.html new file mode 100644 index 0000000..c1106d5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/io_control/overload2.html @@ -0,0 +1,88 @@ + + + +basic_stream_socket::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Perform an IO control command on the socket. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the socket. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::socket::bytes_readable command;
+asio::error_code ec;
+socket.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/is_open.html b/include/asio/doc/asio/reference/basic_stream_socket/is_open.html new file mode 100644 index 0000000..9fefcd1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/is_open.html @@ -0,0 +1,47 @@ + + + +basic_stream_socket::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Determine + whether the socket is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/keep_alive.html b/include/asio/doc/asio/reference/basic_stream_socket/keep_alive.html new file mode 100644 index 0000000..8615999 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/keep_alive.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::keep_alive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to send keep-alives. +

+
typedef implementation_defined keep_alive;
+
+

+ Implements the SOL_SOCKET/SO_KEEPALIVE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/linger.html b/include/asio/doc/asio/reference/basic_stream_socket/linger.html new file mode 100644 index 0000000..16d2a29 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/linger.html @@ -0,0 +1,83 @@ + + + +basic_stream_socket::linger + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to specify whether the socket lingers on close if unsent data is + present. +

+
typedef implementation_defined linger;
+
+

+ Implements the SOL_SOCKET/SO_LINGER socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option(true, 30);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option;
+socket.get_option(option);
+bool is_set = option.enabled();
+unsigned short timeout = option.timeout();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint.html b/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint.html new file mode 100644 index 0000000..9abfd3a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::local_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+  » more...
+
+endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint/overload1.html new file mode 100644 index 0000000..901d955 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_stream_socket::local_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint() const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint/overload2.html new file mode 100644 index 0000000..683ae5b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/local_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_stream_socket::local_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the local endpoint of the socket. +

+
endpoint_type local_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the locally bound endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the local endpoint of the socket. Returns a + default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer.html b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer.html new file mode 100644 index 0000000..b68a28d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer.html @@ -0,0 +1,51 @@ + + + +basic_stream_socket::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer/overload1.html new file mode 100644 index 0000000..ae39f2f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer/overload1.html @@ -0,0 +1,60 @@ + + + +basic_stream_socket::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer/overload2.html new file mode 100644 index 0000000..71eab16 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer/overload2.html @@ -0,0 +1,60 @@ + + + +basic_stream_socket::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a basic_socket + cannot contain any further layers, it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer_type.html b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer_type.html new file mode 100644 index 0000000..af836bf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/lowest_layer_type.html @@ -0,0 +1,849 @@ + + + +basic_stream_socket::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +A + basic_socket + is always the lowest layer. +

+
typedef basic_socket< Protocol, Executor > lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_socket [constructor] +

+
+

+ Construct a basic_socket without opening it.
—
Construct + and open a basic_socket.
—
Construct a basic_socket, + opening it and binding it to the given local endpoint.
+ —
Construct a basic_socket on an existing native socket. +
—
Move-construct a basic_socket from another.
+ —
Move-construct a basic_socket from a socket of another + protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket from another.
—
Move-assign + a basic_socket from a socket of another protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_socket [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket + class template provides functionality that is common to both stream-oriented + and datagram-oriented sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/max_connections.html b/include/asio/doc/asio/reference/basic_stream_socket/max_connections.html new file mode 100644 index 0000000..c58589c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/max_connections.html @@ -0,0 +1,48 @@ + + + +basic_stream_socket::max_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +(Deprecated: + Use max_listen_connections.) The maximum length of the queue of pending + incoming connections. +

+
static const int max_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/max_listen_connections.html b/include/asio/doc/asio/reference/basic_stream_socket/max_listen_connections.html new file mode 100644 index 0000000..4e9df14 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/max_listen_connections.html @@ -0,0 +1,47 @@ + + + +basic_stream_socket::max_listen_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +The + maximum length of the queue of pending incoming connections. +

+
static const int max_listen_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/message_do_not_route.html b/include/asio/doc/asio/reference/basic_stream_socket/message_do_not_route.html new file mode 100644 index 0000000..78ef058 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/message_do_not_route.html @@ -0,0 +1,47 @@ + + + +basic_stream_socket::message_do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specify + that the data should not be subject to routing. +

+
static const int message_do_not_route = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/message_end_of_record.html b/include/asio/doc/asio/reference/basic_stream_socket/message_end_of_record.html new file mode 100644 index 0000000..2314e7d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/message_end_of_record.html @@ -0,0 +1,47 @@ + + + +basic_stream_socket::message_end_of_record + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Specifies + that the data marks the end of a record. +

+
static const int message_end_of_record = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/message_flags.html b/include/asio/doc/asio/reference/basic_stream_socket/message_flags.html new file mode 100644 index 0000000..6092c8f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/message_flags.html @@ -0,0 +1,57 @@ + + + +basic_stream_socket::message_flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Bitmask + type for flags that can be passed to send and receive operations. +

+
typedef int message_flags;
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/message_out_of_band.html b/include/asio/doc/asio/reference/basic_stream_socket/message_out_of_band.html new file mode 100644 index 0000000..d7dc82a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/message_out_of_band.html @@ -0,0 +1,47 @@ + + + +basic_stream_socket::message_out_of_band + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Process + out-of-band data. +

+
static const int message_out_of_band = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/message_peek.html b/include/asio/doc/asio/reference/basic_stream_socket/message_peek.html new file mode 100644 index 0000000..98b02e5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/message_peek.html @@ -0,0 +1,47 @@ + + + +basic_stream_socket::message_peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Peek + at incoming data without removing it from the input queue. +

+
static const int message_peek = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/native_handle.html b/include/asio/doc/asio/reference/basic_stream_socket/native_handle.html new file mode 100644 index 0000000..fb1f3b7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/native_handle.html @@ -0,0 +1,52 @@ + + + +basic_stream_socket::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ +Get + the native socket representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + socket. This is intended to allow access to native socket functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/native_handle_type.html b/include/asio/doc/asio/reference/basic_stream_socket/native_handle_type.html new file mode 100644 index 0000000..db98c93 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/native_handle_type.html @@ -0,0 +1,54 @@ + + + +basic_stream_socket::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a socket. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking.html b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking.html new file mode 100644 index 0000000..396109b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_stream_socket::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload1.html new file mode 100644 index 0000000..a4a8704 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload1.html @@ -0,0 +1,145 @@ + + + +basic_stream_socket::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the native socket implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native socket. This mode has no effect on the behaviour of the socket + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying socket is in non-blocking mode and + direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the socket object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native socket. +

+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload2.html new file mode 100644 index 0000000..2325ad1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload2.html @@ -0,0 +1,158 @@ + + + +basic_stream_socket::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload3.html new file mode 100644 index 0000000..c2b09dc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/native_non_blocking/overload3.html @@ -0,0 +1,150 @@ + + + +basic_stream_socket::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the native socket implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native socket. It has no effect on the behaviour of the socket object's + synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying socket is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + Example +
+

+ This function is intended to allow the encapsulation of arbitrary non-blocking + system calls as asynchronous operations, in a way that is transparent + to the user of the socket object. The following example illustrates how + Linux's sendfile system call might be encapsulated: +

+
template <typename Handler>
+struct sendfile_op
+{
+  tcp::socket& sock_;
+  int fd_;
+  Handler handler_;
+  off_t offset_;
+  std::size_t total_bytes_transferred_;
+
+  // Function call operator meeting WriteHandler requirements.
+  // Used as the handler for the async_write_some operation.
+  void operator()(asio::error_code ec, std::size_t)
+  {
+    // Put the underlying socket into non-blocking mode.
+    if (!ec)
+      if (!sock_.native_non_blocking())
+        sock_.native_non_blocking(true, ec);
+
+    if (!ec)
+    {
+      for (;;)
+      {
+        // Try the system call.
+        errno = 0;
+        int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+        ec = asio::error_code(n < 0 ? errno : 0,
+            asio::error::get_system_category());
+        total_bytes_transferred_ += ec ? 0 : n;
+
+        // Retry operation immediately if interrupted by signal.
+        if (ec == asio::error::interrupted)
+          continue;
+
+        // Check if we need to run the operation again.
+        if (ec == asio::error::would_block
+            || ec == asio::error::try_again)
+        {
+          // We have to wait for the socket to become ready again.
+          sock_.async_wait(tcp::socket::wait_write, *this);
+          return;
+        }
+
+        if (ec || n == 0)
+        {
+          // An error occurred, or we have reached the end of the file.
+          // Either way we must exit the loop so we can call the handler.
+          break;
+        }
+
+        // Loop around to try calling sendfile again.
+      }
+    }
+
+    // Pass result back to user's handler.
+    handler_(ec, total_bytes_transferred_);
+  }
+};
+
+template <typename Handler>
+void async_sendfile(tcp::socket& sock, int fd, Handler h)
+{
+  sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+  sock.async_wait(tcp::socket::wait_write, op);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/non_blocking.html b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking.html new file mode 100644 index 0000000..9dbdd1f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking.html @@ -0,0 +1,57 @@ + + + +basic_stream_socket::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the socket. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload1.html new file mode 100644 index 0000000..080d11a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload1.html @@ -0,0 +1,65 @@ + + + +basic_stream_socket::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Gets the non-blocking mode of the socket. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the socket's synchronous operations will fail with + asio::error::would_block if they are unable to perform the + requested operation immediately. If false, synchronous operations + will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload2.html new file mode 100644 index 0000000..79870b7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload2.html @@ -0,0 +1,84 @@ + + + +basic_stream_socket::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload3.html b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload3.html new file mode 100644 index 0000000..0b31481 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/non_blocking/overload3.html @@ -0,0 +1,76 @@ + + + +basic_stream_socket::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Sets the non-blocking mode of the socket. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the socket's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/open.html b/include/asio/doc/asio/reference/basic_stream_socket/open.html new file mode 100644 index 0000000..c47512c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/open.html @@ -0,0 +1,51 @@ + + + +basic_stream_socket::open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Open the + socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+  » more...
+
+void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/open/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/open/overload1.html new file mode 100644 index 0000000..b2167c9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/open/overload1.html @@ -0,0 +1,83 @@ + + + +basic_stream_socket::open (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol = protocol_type());
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying protocol parameters to be used. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+socket.open(asio::ip::tcp::v4());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/open/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/open/overload2.html new file mode 100644 index 0000000..3e358d8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/open/overload2.html @@ -0,0 +1,80 @@ + + + +basic_stream_socket::open (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Open the socket using the specified protocol. +

+
void open(
+    const protocol_type & protocol,
+    asio::error_code & ec);
+
+

+ This function opens the socket so that it will use the specified protocol. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ An object specifying which protocol is to be used. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+asio::error_code ec;
+socket.open(asio::ip::tcp::v4(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_.html b/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_.html new file mode 100644 index 0000000..65794e0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_.html @@ -0,0 +1,58 @@ + + + +basic_stream_socket::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_stream_socket + from another. +

+
basic_stream_socket & operator=(
+    basic_stream_socket && other);
+  » more...
+
+

+ Move-assign a basic_stream_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_stream_socket & >::type operator=(
+    basic_stream_socket< Protocol1, Executor1 > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_/overload1.html new file mode 100644 index 0000000..87f78c1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_/overload1.html @@ -0,0 +1,71 @@ + + + +basic_stream_socket::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_stream_socket + from another. +

+
basic_stream_socket & operator=(
+    basic_stream_socket && other);
+
+

+ This assignment operator moves a stream socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_stream_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_stream_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_/overload2.html new file mode 100644 index 0000000..2b25107 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/operator_eq_/overload2.html @@ -0,0 +1,74 @@ + + + +basic_stream_socket::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_stream_socket + from a socket of another protocol type. +

+
template<
+    typename Protocol1,
+    typename Executor1>
+enable_if< is_convertible< Protocol1, Protocol >::value &&is_convertible< Executor1, Executor >::value, basic_stream_socket & >::type operator=(
+    basic_stream_socket< Protocol1, Executor1 > && other);
+
+

+ This assignment operator moves a stream socket from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_stream_socket + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_stream_socket(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/out_of_band_inline.html b/include/asio/doc/asio/reference/basic_stream_socket/out_of_band_inline.html new file mode 100644 index 0000000..064ffa2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/out_of_band_inline.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::out_of_band_inline + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for putting received out-of-band data inline. +

+
typedef implementation_defined out_of_band_inline;
+
+

+ Implements the SOL_SOCKET/SO_OOBINLINE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option;
+socket.get_option(option);
+bool value = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/protocol_type.html b/include/asio/doc/asio/reference/basic_stream_socket/protocol_type.html new file mode 100644 index 0000000..9913970 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/protocol_type.html @@ -0,0 +1,54 @@ + + + +basic_stream_socket::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/read_some.html b/include/asio/doc/asio/reference/basic_stream_socket/read_some.html new file mode 100644 index 0000000..d343944 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/read_some.html @@ -0,0 +1,55 @@ + + + +basic_stream_socket::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read + some data from the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/read_some/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/read_some/overload1.html new file mode 100644 index 0000000..e210d0f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/read_some/overload1.html @@ -0,0 +1,111 @@ + + + +basic_stream_socket::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to read data from the stream socket. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
socket.read_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/read_some/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/read_some/overload2.html new file mode 100644 index 0000000..d2c3349 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/read_some/overload2.html @@ -0,0 +1,87 @@ + + + +basic_stream_socket::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to read data from the stream socket. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/receive.html b/include/asio/doc/asio/reference/basic_stream_socket/receive.html new file mode 100644 index 0000000..9c1e646 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/receive.html @@ -0,0 +1,66 @@ + + + +basic_stream_socket::receive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Receive + some data on the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags);
+  » more...
+
+

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/receive/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/receive/overload1.html new file mode 100644 index 0000000..75a7eb2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/receive/overload1.html @@ -0,0 +1,111 @@ + + + +basic_stream_socket::receive (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to receive data on the stream socket. The function + call will block until one or more bytes of data has been received successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The receive operation may not receive all of the requested number of + bytes. Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.receive(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/receive/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/receive/overload2.html new file mode 100644 index 0000000..10062aa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/receive/overload2.html @@ -0,0 +1,116 @@ + + + +basic_stream_socket::receive (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on the socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags);
+
+

+ This function is used to receive data on the stream socket. The function + call will block until one or more bytes of data has been received successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The receive operation may not receive all of the requested number of + bytes. Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To receive into a single data buffer use the buffer + function as follows: +

+
socket.receive(asio::buffer(data, size), 0);
+
+

+ See the buffer + documentation for information on receiving into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/receive/overload3.html b/include/asio/doc/asio/reference/basic_stream_socket/receive/overload3.html new file mode 100644 index 0000000..ea8eb2b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/receive/overload3.html @@ -0,0 +1,92 @@ + + + +basic_stream_socket::receive (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Receive some data on a connected socket. +

+
template<
+    typename MutableBufferSequence>
+std::size_t receive(
+    const MutableBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to receive data on the stream socket. The function + call will block until one or more bytes of data has been received successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be received. +

+
flags
+

+ Flags specifying how the receive call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes received. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The receive operation may not receive all of the requested number of + bytes. Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/receive_buffer_size.html b/include/asio/doc/asio/reference/basic_stream_socket/receive_buffer_size.html new file mode 100644 index 0000000..c6f4dc8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/receive_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::receive_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive buffer size of a socket. +

+
typedef implementation_defined receive_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_RCVBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/receive_low_watermark.html b/include/asio/doc/asio/reference/basic_stream_socket/receive_low_watermark.html new file mode 100644 index 0000000..99f5322 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/receive_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::receive_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the receive low watermark. +

+
typedef implementation_defined receive_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_RCVLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/release.html b/include/asio/doc/asio/reference/basic_stream_socket/release.html new file mode 100644 index 0000000..a60d44b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/release.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release + ownership of the underlying native socket. +

+
native_handle_type release();
+  » more...
+
+native_handle_type release(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/release/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/release/overload1.html new file mode 100644 index 0000000..3cbbe9c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/release/overload1.html @@ -0,0 +1,74 @@ + + + +basic_stream_socket::release (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release();
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/release/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/release/overload2.html new file mode 100644 index 0000000..253e75e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/release/overload2.html @@ -0,0 +1,75 @@ + + + +basic_stream_socket::release (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Release ownership of the underlying native socket. +

+
native_handle_type release(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous connect, send and receive + operations to finish immediately, and the handlers for cancelled operations + will be passed the asio::error::operation_aborted error. + Ownership of the native socket is then transferred to the caller. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ This function is unsupported on Windows versions prior to Windows 8.1, + and will fail with asio::error::operation_not_supported + on these platforms. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint.html b/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint.html new file mode 100644 index 0000000..a48d369 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint.html @@ -0,0 +1,49 @@ + + + +basic_stream_socket::remote_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+  » more...
+
+endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint/overload1.html new file mode 100644 index 0000000..77620d3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint/overload1.html @@ -0,0 +1,78 @@ + + + +basic_stream_socket::remote_endpoint (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint() const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint/overload2.html new file mode 100644 index 0000000..61f9f98 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/remote_endpoint/overload2.html @@ -0,0 +1,85 @@ + + + +basic_stream_socket::remote_endpoint (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Get the remote endpoint of the socket. +

+
endpoint_type remote_endpoint(
+    asio::error_code & ec) const;
+
+

+ This function is used to obtain the remote endpoint of the socket. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ An object that represents the remote endpoint of the socket. Returns + a default-constructed endpoint object if an error occurred. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/reuse_address.html b/include/asio/doc/asio/reference/basic_stream_socket/reuse_address.html new file mode 100644 index 0000000..91c6f1d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/reuse_address.html @@ -0,0 +1,82 @@ + + + +basic_stream_socket::reuse_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option to allow the socket to be bound to an address that is already in + use. +

+
typedef implementation_defined reuse_address;
+
+

+ Implements the SOL_SOCKET/SO_REUSEADDR socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/send.html b/include/asio/doc/asio/reference/basic_stream_socket/send.html new file mode 100644 index 0000000..e704643 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/send.html @@ -0,0 +1,63 @@ + + + +basic_stream_socket::send + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Send some + data on the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/send/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/send/overload1.html new file mode 100644 index 0000000..6556f98 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/send/overload1.html @@ -0,0 +1,110 @@ + + + +basic_stream_socket::send (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to send data on the stream socket. The function + call will block until one or more bytes of the data has been sent successfully, + or an until error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The send operation may not transmit all of the data to the peer. Consider + using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.send(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/send/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/send/overload2.html new file mode 100644 index 0000000..b03b442 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/send/overload2.html @@ -0,0 +1,115 @@ + + + +basic_stream_socket::send (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags);
+
+

+ This function is used to send data on the stream socket. The function + call will block until one or more bytes of the data has been sent successfully, + or an until error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The send operation may not transmit all of the data to the peer. Consider + using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + Example +
+

+ To send a single data buffer use the buffer + function as follows: +

+
socket.send(asio::buffer(data, size), 0);
+
+

+ See the buffer + documentation for information on sending multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/send/overload3.html b/include/asio/doc/asio/reference/basic_stream_socket/send/overload3.html new file mode 100644 index 0000000..a06c157 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/send/overload3.html @@ -0,0 +1,92 @@ + + + +basic_stream_socket::send (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Send some data on the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t send(
+    const ConstBufferSequence & buffers,
+    socket_base::message_flags flags,
+    asio::error_code & ec);
+
+

+ This function is used to send data on the stream socket. The function + call will block until one or more bytes of the data has been sent successfully, + or an until error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be sent on the socket. +

+
flags
+

+ Flags specifying how the send call is to be made. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes sent. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The send operation may not transmit all of the data to the peer. Consider + using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/send_buffer_size.html b/include/asio/doc/asio/reference/basic_stream_socket/send_buffer_size.html new file mode 100644 index 0000000..1dfb80a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/send_buffer_size.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::send_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send buffer size of a socket. +

+
typedef implementation_defined send_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_SNDBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/send_low_watermark.html b/include/asio/doc/asio/reference/basic_stream_socket/send_low_watermark.html new file mode 100644 index 0000000..5751364 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/send_low_watermark.html @@ -0,0 +1,81 @@ + + + +basic_stream_socket::send_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Socket + option for the send low watermark. +

+
typedef implementation_defined send_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_SNDLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/set_option.html b/include/asio/doc/asio/reference/basic_stream_socket/set_option.html new file mode 100644 index 0000000..b89e9cc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/set_option.html @@ -0,0 +1,55 @@ + + + +basic_stream_socket::set_option + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+  » more...
+
+template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/set_option/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/set_option/overload1.html new file mode 100644 index 0000000..2179ec0 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/set_option/overload1.html @@ -0,0 +1,90 @@ + + + +basic_stream_socket::set_option (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+socket.set_option(option);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/set_option/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/set_option/overload2.html new file mode 100644 index 0000000..95c412f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/set_option/overload2.html @@ -0,0 +1,87 @@ + + + +basic_stream_socket::set_option (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Set an option on the socket. +

+
template<
+    typename SettableSocketOption>
+void set_option(
+    const SettableSocketOption & option,
+    asio::error_code & ec);
+
+

+ This function is used to set an option on the socket. +

+
+ + Parameters +
+
+

+
+
option
+

+ The new option value to be set on the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Setting the IPPROTO_TCP/TCP_NODELAY option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+asio::error_code ec;
+socket.set_option(option, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/shutdown.html b/include/asio/doc/asio/reference/basic_stream_socket/shutdown.html new file mode 100644 index 0000000..13f9cc3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/shutdown.html @@ -0,0 +1,51 @@ + + + +basic_stream_socket::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+  » more...
+
+void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/shutdown/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/shutdown/overload1.html new file mode 100644 index 0000000..d8a7d60 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/shutdown/overload1.html @@ -0,0 +1,88 @@ + + + +basic_stream_socket::shutdown (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.shutdown(asio::ip::tcp::socket::shutdown_send);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/shutdown/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/shutdown/overload2.html new file mode 100644 index 0000000..8440301 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/shutdown/overload2.html @@ -0,0 +1,85 @@ + + + +basic_stream_socket::shutdown (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Disable sends or receives on the socket. +

+
void shutdown(
+    shutdown_type what,
+    asio::error_code & ec);
+
+

+ This function is used to disable send operations, receive operations, + or both. +

+
+ + Parameters +
+
+

+
+
what
+

+ Determines what types of operation will no longer be allowed. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Shutting down the send side of the socket: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/shutdown_type.html b/include/asio/doc/asio/reference/basic_stream_socket/shutdown_type.html new file mode 100644 index 0000000..12e7c9f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/shutdown_type.html @@ -0,0 +1,73 @@ + + + +basic_stream_socket::shutdown_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Different + ways a socket may be shutdown. +

+
enum shutdown_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
shutdown_receive
+

+ Shutdown the receive side of the socket. +

+
shutdown_send
+

+ Shutdown the send side of the socket. +

+
shutdown_both
+

+ Shutdown both send and receive on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/wait.html b/include/asio/doc/asio/reference/basic_stream_socket/wait.html new file mode 100644 index 0000000..4ab8eae --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/wait.html @@ -0,0 +1,52 @@ + + + +basic_stream_socket::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait for + the socket to become ready to read, ready to write, or to have pending + error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/wait/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/wait/overload1.html new file mode 100644 index 0000000..8d5ef12 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/wait/overload1.html @@ -0,0 +1,76 @@ + + + +basic_stream_socket::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+socket.wait(asio::ip::tcp::socket::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/wait/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/wait/overload2.html new file mode 100644 index 0000000..3709c84 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/wait/overload2.html @@ -0,0 +1,82 @@ + + + +basic_stream_socket::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from basic_socket. +

+

+ Wait for the socket to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for a socket to enter + a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired socket state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for a socket to become readable. +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::error_code ec;
+socket.wait(asio::ip::tcp::socket::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/wait_type.html b/include/asio/doc/asio/reference/basic_stream_socket/wait_type.html new file mode 100644 index 0000000..95b8825 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/wait_type.html @@ -0,0 +1,76 @@ + + + +basic_stream_socket::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from socket_base. +

+

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a socket to become ready to read. +

+
wait_write
+

+ Wait for a socket to become ready to write. +

+
wait_error
+

+ Wait for a socket to have error conditions pending. +

+
+
+

+ For use with basic_socket::wait() and basic_socket::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/write_some.html b/include/asio/doc/asio/reference/basic_stream_socket/write_some.html new file mode 100644 index 0000000..14b6a64 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/write_some.html @@ -0,0 +1,55 @@ + + + +basic_stream_socket::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + some data to the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/write_some/overload1.html b/include/asio/doc/asio/reference/basic_stream_socket/write_some/overload1.html new file mode 100644 index 0000000..76f6e0c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/write_some/overload1.html @@ -0,0 +1,111 @@ + + + +basic_stream_socket::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to write data to the stream socket. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the socket. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
socket.write_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket/write_some/overload2.html b/include/asio/doc/asio/reference/basic_stream_socket/write_some/overload2.html new file mode 100644 index 0000000..fdde2c5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket/write_some/overload2.html @@ -0,0 +1,87 @@ + + + +basic_stream_socket::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the socket. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to write data to the stream socket. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the socket. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket__rebind_executor.html b/include/asio/doc/asio/reference/basic_stream_socket__rebind_executor.html new file mode 100644 index 0000000..7a2250e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_stream_socket::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the socket type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The socket type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_stream_socket__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_stream_socket__rebind_executor/other.html new file mode 100644 index 0000000..5d9b6f2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_stream_socket__rebind_executor/other.html @@ -0,0 +1,920 @@ + + + +basic_stream_socket::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + socket type when rebound to the specified executor. +

+
typedef basic_stream_socket< Protocol, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_stream_socket [constructor] +

+
+

+ Construct a basic_stream_socket without opening it.
—
+ Construct and open a basic_stream_socket.
—
Construct + a basic_stream_socket, opening it and binding it to the given + local endpoint.
—
Construct a basic_stream_socket + on an existing native socket.
—
Move-construct a + basic_stream_socket from another.
—
Move-construct + a basic_stream_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_stream_socket from another.
—
+ Move-assign a basic_stream_socket from a socket of another protocol + type. +

+
+

+ read_some +

+
+

+ Read some data from the socket. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the socket. +

+
+

+ ~basic_stream_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_stream_socket + class template provides asynchronous and blocking stream-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/basic_stream_socket.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf.html b/include/asio/doc/asio/reference/basic_streambuf.html new file mode 100644 index 0000000..5653531 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf.html @@ -0,0 +1,364 @@ + + + +basic_streambuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Automatically resizable buffer class based on std::streambuf. +

+
template<
+    typename Allocator = std::allocator<char>>
+class basic_streambuf :
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffers_type +

+
+

+ The type used to represent the input sequence as a list of buffers. +

+
+

+ mutable_buffers_type +

+
+

+ The type used to represent the output sequence as a list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_streambuf [constructor] +

+
+

+ Construct a basic_streambuf object. +

+
+

+ capacity +

+
+

+ Get the current capacity of the basic_streambuf. +

+
+

+ commit +

+
+

+ Move characters from the output sequence to the input sequence. +

+
+

+ consume +

+
+

+ Remove characters from the input sequence. +

+
+

+ data +

+
+

+ Get a list of buffers that represents the input sequence. +

+
+

+ max_size +

+
+

+ Get the maximum size of the basic_streambuf. +

+
+

+ prepare +

+
+

+ Get a list of buffers that represents the output sequence, with + the given size. +

+
+

+ size +

+
+

+ Get the size of the input sequence. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ overflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ reserve +

+
+
+

+ underflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ The basic_streambuf class is derived from std::streambuf + to associate the streambuf's input and output sequences with one or more + character arrays. These character arrays are internal to the basic_streambuf + object, but direct access to the array elements is provided to permit them + to be used efficiently with I/O operations. Characters written to the output + sequence of a basic_streambuf object are appended to the input + sequence of the same object. +

+

+ The basic_streambuf class's public interface is intended to + permit the following implementation strategies: +

+
    +
  • + A single contiguous character array, which is reallocated as necessary + to accommodate changes in the size of the character sequence. This is + the implementation approach currently used in Asio. +
  • +
  • + A sequence of one or more character arrays, where each array is of the + same size. Additional character array objects are appended to the sequence + to accommodate changes in the size of the character sequence. +
  • +
  • + A sequence of one or more character arrays of varying sizes. Additional + character array objects are appended to the sequence to accommodate changes + in the size of the character sequence. +
  • +
+

+ The constructor for basic_streambuf + accepts a size_t argument specifying the maximum of the sum + of the sizes of the input sequence and output sequence. During the lifetime + of the basic_streambuf object, the following invariant holds: +

+
size() <= max_size()
+
+

+ Any member function that would, if successful, cause the invariant to be + violated shall throw an exception of class std::length_error. +

+

+ The constructor for basic_streambuf takes an Allocator argument. + A copy of this argument is used for any memory allocation performed, by the + constructor and by all member functions, during the lifetime of each basic_streambuf + object. +

+
+ + Examples +
+

+ Writing directly from an streambuf to a socket: +

+
asio::streambuf b;
+std::ostream os(&b);
+os << "Hello, World!\n";
+
+// try sending some data in input sequence
+size_t n = sock.send(b.data());
+
+b.consume(n); // sent data is removed from input sequence
+
+

+ Reading from a socket directly into a streambuf: +

+
asio::streambuf b;
+
+// reserve 512 bytes in output sequence
+asio::streambuf::mutable_buffers_type bufs = b.prepare(512);
+
+size_t n = sock.receive(bufs);
+
+// received data is "committed" from output sequence to input sequence
+b.commit(n);
+
+std::istream is(&b);
+std::string s;
+is >> s;
+
+
+ + Requirements +
+

+ Header: asio/basic_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/basic_streambuf.html b/include/asio/doc/asio/reference/basic_streambuf/basic_streambuf.html new file mode 100644 index 0000000..624057b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/basic_streambuf.html @@ -0,0 +1,51 @@ + + + +basic_streambuf::basic_streambuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_streambuf + object. +

+
basic_streambuf(
+    std::size_t maximum_size = (std::numeric_limits< std::size_t >::max)(),
+    const Allocator & allocator = Allocator());
+
+

+ Constructs a streambuf with the specified maximum size. The initial size + of the streambuf's input sequence is 0. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/capacity.html b/include/asio/doc/asio/reference/basic_streambuf/capacity.html new file mode 100644 index 0000000..d9897d7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/capacity.html @@ -0,0 +1,52 @@ + + + +basic_streambuf::capacity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the current + capacity of the basic_streambuf. +

+
std::size_t capacity() const;
+
+
+ + Return Value +
+

+ The current total capacity of the streambuf, i.e. for both the input sequence + and output sequence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/commit.html b/include/asio/doc/asio/reference/basic_streambuf/commit.html new file mode 100644 index 0000000..a3323ce --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/commit.html @@ -0,0 +1,62 @@ + + + +basic_streambuf::commit + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move characters + from the output sequence to the input sequence. +

+
void commit(
+    std::size_t n);
+
+

+ Appends n characters from the start of the output sequence + to the input sequence. The beginning of the output sequence is advanced + by n characters. +

+

+ Requires a preceding call prepare(x) where x >= n, + and no intervening operations that modify the input or output sequence. +

+
+ + Remarks +
+

+ If n is greater than the size of the output sequence, the + entire output sequence is moved to the input sequence and no error is issued. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/const_buffers_type.html b/include/asio/doc/asio/reference/basic_streambuf/const_buffers_type.html new file mode 100644 index 0000000..195792c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/const_buffers_type.html @@ -0,0 +1,54 @@ + + + +basic_streambuf::const_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent the input sequence as a list of buffers. +

+
typedef implementation_defined const_buffers_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/consume.html b/include/asio/doc/asio/reference/basic_streambuf/consume.html new file mode 100644 index 0000000..800b53f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/consume.html @@ -0,0 +1,56 @@ + + + +basic_streambuf::consume + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Remove characters + from the input sequence. +

+
void consume(
+    std::size_t n);
+
+

+ Removes n characters from the beginning of the input sequence. +

+
+ + Remarks +
+

+ If n is greater than the size of the input sequence, the entire + input sequence is consumed and no error is issued. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/data.html b/include/asio/doc/asio/reference/basic_streambuf/data.html new file mode 100644 index 0000000..03329d6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/data.html @@ -0,0 +1,61 @@ + + + +basic_streambuf::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a list of buffers + that represents the input sequence. +

+
const_buffers_type data() const;
+
+
+ + Return + Value +
+

+ An object of type const_buffers_type that satisfies ConstBufferSequence + requirements, representing all character arrays in the input sequence. +

+
+ + Remarks +
+

+ The returned object is invalidated by any basic_streambuf + member function that modifies the input sequence or output sequence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/max_size.html b/include/asio/doc/asio/reference/basic_streambuf/max_size.html new file mode 100644 index 0000000..109464b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/max_size.html @@ -0,0 +1,52 @@ + + + +basic_streambuf::max_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the maximum + size of the basic_streambuf. +

+
std::size_t max_size() const;
+
+
+ + Return Value +
+

+ The allowed maximum of the sum of the sizes of the input sequence and output + sequence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/mutable_buffers_type.html b/include/asio/doc/asio/reference/basic_streambuf/mutable_buffers_type.html new file mode 100644 index 0000000..b6b22d9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/mutable_buffers_type.html @@ -0,0 +1,54 @@ + + + +basic_streambuf::mutable_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent the output sequence as a list of buffers. +

+
typedef implementation_defined mutable_buffers_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/overflow.html b/include/asio/doc/asio/reference/basic_streambuf/overflow.html new file mode 100644 index 0000000..add3113 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/overflow.html @@ -0,0 +1,51 @@ + + + +basic_streambuf::overflow + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Override + std::streambuf behaviour. +

+
int_type overflow(
+    int_type c);
+
+

+ Behaves according to the specification of std::streambuf::overflow(), + with the specialisation that std::length_error is thrown if + appending the character to the input sequence would require the condition + size() > max_size() to be true. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/prepare.html b/include/asio/doc/asio/reference/basic_streambuf/prepare.html new file mode 100644 index 0000000..cf723eb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/prepare.html @@ -0,0 +1,79 @@ + + + +basic_streambuf::prepare + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a list + of buffers that represents the output sequence, with the given size. +

+
mutable_buffers_type prepare(
+    std::size_t n);
+
+

+ Ensures that the output sequence can accommodate n characters, + reallocating character array objects as necessary. +

+
+ + Return Value +
+

+ An object of type mutable_buffers_type that satisfies MutableBufferSequence + requirements, representing character array objects at the start of the + output sequence such that the sum of the buffer sizes is n. +

+
+ + Exceptions +
+
+

+
+
std::length_error
+

+ If size() + n > max_size(). +

+
+
+
+ + Remarks +
+

+ The returned object is invalidated by any basic_streambuf + member function that modifies the input sequence or output sequence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/reserve.html b/include/asio/doc/asio/reference/basic_streambuf/reserve.html new file mode 100644 index 0000000..21c5c88 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/reserve.html @@ -0,0 +1,43 @@ + + + +basic_streambuf::reserve + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void reserve(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/size.html b/include/asio/doc/asio/reference/basic_streambuf/size.html new file mode 100644 index 0000000..24d5ea4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/size.html @@ -0,0 +1,62 @@ + + + +basic_streambuf::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the size of the + input sequence. +

+
std::size_t size() const;
+
+
+ + Return + Value +
+

+ The size of the input sequence. The value is equal to that calculated for + s in the following code: +

+
size_t s = 0;
+const_buffers_type bufs = data();
+const_buffers_type::const_iterator i = bufs.begin();
+while (i != bufs.end())
+{
+  const_buffer buf(*i++);
+  s += buf.size();
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf/underflow.html b/include/asio/doc/asio/reference/basic_streambuf/underflow.html new file mode 100644 index 0000000..4840514 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf/underflow.html @@ -0,0 +1,47 @@ + + + +basic_streambuf::underflow + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Override + std::streambuf behaviour. +

+
int_type underflow();
+
+

+ Behaves according to the specification of std::streambuf::underflow(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref.html b/include/asio/doc/asio/reference/basic_streambuf_ref.html new file mode 100644 index 0000000..58e56f1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref.html @@ -0,0 +1,227 @@ + + + +basic_streambuf_ref + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adapts basic_streambuf + to the dynamic buffer sequence type requirements. +

+
template<
+    typename Allocator = std::allocator<char>>
+class basic_streambuf_ref
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffers_type +

+
+

+ The type used to represent the input sequence as a list of buffers. +

+
+

+ mutable_buffers_type +

+
+

+ The type used to represent the output sequence as a list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_streambuf_ref [constructor] +

+
+

+ Construct a basic_streambuf_ref for the given basic_streambuf object. +
—
Copy construct a basic_streambuf_ref.
—
+ Move construct a basic_streambuf_ref. +

+
+

+ capacity +

+
+

+ Get the current capacity of the dynamic buffer. +

+
+

+ commit +

+
+

+ Move bytes from the output sequence to the input sequence. +

+
+

+ consume +

+
+

+ Remove characters from the input sequence. +

+
+

+ data +

+
+

+ Get a list of buffers that represents the input sequence. +

+
+

+ max_size +

+
+

+ Get the maximum size of the dynamic buffer. +

+
+

+ prepare +

+
+

+ Get a list of buffers that represents the output sequence, with + the given size. +

+
+

+ size +

+
+

+ Get the size of the input sequence. +

+
+
+ + Requirements +
+

+ Header: asio/basic_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref.html b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref.html new file mode 100644 index 0000000..d983404 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref.html @@ -0,0 +1,62 @@ + + + +basic_streambuf_ref::basic_streambuf_ref + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a basic_streambuf_ref + for the given basic_streambuf + object. +

+
explicit basic_streambuf_ref(
+    basic_streambuf< Allocator > & sb);
+  » more...
+
+

+ Copy construct a basic_streambuf_ref. +

+
basic_streambuf_ref(
+    const basic_streambuf_ref & other);
+  » more...
+
+

+ Move construct a basic_streambuf_ref. +

+
basic_streambuf_ref(
+    basic_streambuf_ref && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload1.html b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload1.html new file mode 100644 index 0000000..34e3959 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload1.html @@ -0,0 +1,46 @@ + + + +basic_streambuf_ref::basic_streambuf_ref (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a basic_streambuf_ref + for the given basic_streambuf + object. +

+
basic_streambuf_ref(
+    basic_streambuf< Allocator > & sb);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload2.html b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload2.html new file mode 100644 index 0000000..3fd5438 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload2.html @@ -0,0 +1,44 @@ + + + +basic_streambuf_ref::basic_streambuf_ref (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy construct a basic_streambuf_ref. +

+
basic_streambuf_ref(
+    const basic_streambuf_ref & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload3.html b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload3.html new file mode 100644 index 0000000..2e78e73 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload3.html @@ -0,0 +1,44 @@ + + + +basic_streambuf_ref::basic_streambuf_ref (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move construct a basic_streambuf_ref. +

+
basic_streambuf_ref(
+    basic_streambuf_ref && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/capacity.html b/include/asio/doc/asio/reference/basic_streambuf_ref/capacity.html new file mode 100644 index 0000000..3fdef2e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/capacity.html @@ -0,0 +1,44 @@ + + + +basic_streambuf_ref::capacity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the current capacity of the dynamic buffer. +

+
std::size_t capacity() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/commit.html b/include/asio/doc/asio/reference/basic_streambuf_ref/commit.html new file mode 100644 index 0000000..9068f9b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/commit.html @@ -0,0 +1,45 @@ + + + +basic_streambuf_ref::commit + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move + bytes from the output sequence to the input sequence. +

+
void commit(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/const_buffers_type.html b/include/asio/doc/asio/reference/basic_streambuf_ref/const_buffers_type.html new file mode 100644 index 0000000..e544907 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/const_buffers_type.html @@ -0,0 +1,363 @@ + + + +basic_streambuf_ref::const_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent the input sequence as a list of buffers. +

+
typedef basic_streambuf< Allocator >::const_buffers_type const_buffers_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffers_type +

+
+

+ The type used to represent the input sequence as a list of buffers. +

+
+

+ mutable_buffers_type +

+
+

+ The type used to represent the output sequence as a list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_streambuf [constructor] +

+
+

+ Construct a basic_streambuf object. +

+
+

+ capacity +

+
+

+ Get the current capacity of the basic_streambuf. +

+
+

+ commit +

+
+

+ Move characters from the output sequence to the input sequence. +

+
+

+ consume +

+
+

+ Remove characters from the input sequence. +

+
+

+ data +

+
+

+ Get a list of buffers that represents the input sequence. +

+
+

+ max_size +

+
+

+ Get the maximum size of the basic_streambuf. +

+
+

+ prepare +

+
+

+ Get a list of buffers that represents the output sequence, with + the given size. +

+
+

+ size +

+
+

+ Get the size of the input sequence. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ overflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ reserve +

+
+
+

+ underflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ The basic_streambuf class is derived from std::streambuf + to associate the streambuf's input and output sequences with one or more + character arrays. These character arrays are internal to the basic_streambuf + object, but direct access to the array elements is provided to permit them + to be used efficiently with I/O operations. Characters written to the output + sequence of a basic_streambuf object are appended to the input + sequence of the same object. +

+

+ The basic_streambuf class's public interface is intended to + permit the following implementation strategies: +

+
    +
  • + A single contiguous character array, which is reallocated as necessary + to accommodate changes in the size of the character sequence. This + is the implementation approach currently used in Asio. +
  • +
  • + A sequence of one or more character arrays, where each array is of + the same size. Additional character array objects are appended to the + sequence to accommodate changes in the size of the character sequence. +
  • +
  • + A sequence of one or more character arrays of varying sizes. Additional + character array objects are appended to the sequence to accommodate + changes in the size of the character sequence. +
  • +
+

+ The constructor for basic_streambuf + accepts a size_t argument specifying the maximum of the sum + of the sizes of the input sequence and output sequence. During the lifetime + of the basic_streambuf object, the following invariant holds: +

+
size() <= max_size()
+
+

+ Any member function that would, if successful, cause the invariant to be + violated shall throw an exception of class std::length_error. +

+

+ The constructor for basic_streambuf takes an Allocator argument. + A copy of this argument is used for any memory allocation performed, by + the constructor and by all member functions, during the lifetime of each + basic_streambuf object. +

+
+ + Examples +
+

+ Writing directly from an streambuf to a socket: +

+
asio::streambuf b;
+std::ostream os(&b);
+os << "Hello, World!\n";
+
+// try sending some data in input sequence
+size_t n = sock.send(b.data());
+
+b.consume(n); // sent data is removed from input sequence
+
+

+ Reading from a socket directly into a streambuf: +

+
asio::streambuf b;
+
+// reserve 512 bytes in output sequence
+asio::streambuf::mutable_buffers_type bufs = b.prepare(512);
+
+size_t n = sock.receive(bufs);
+
+// received data is "committed" from output sequence to input sequence
+b.commit(n);
+
+std::istream is(&b);
+std::string s;
+is >> s;
+
+
+ + Requirements +
+

+ Header: asio/basic_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/consume.html b/include/asio/doc/asio/reference/basic_streambuf_ref/consume.html new file mode 100644 index 0000000..8f6170a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/consume.html @@ -0,0 +1,45 @@ + + + +basic_streambuf_ref::consume + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Remove + characters from the input sequence. +

+
void consume(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/data.html b/include/asio/doc/asio/reference/basic_streambuf_ref/data.html new file mode 100644 index 0000000..6ec7cac --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/data.html @@ -0,0 +1,44 @@ + + + +basic_streambuf_ref::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a list + of buffers that represents the input sequence. +

+
const_buffers_type data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/max_size.html b/include/asio/doc/asio/reference/basic_streambuf_ref/max_size.html new file mode 100644 index 0000000..b61c643 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/max_size.html @@ -0,0 +1,44 @@ + + + +basic_streambuf_ref::max_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the maximum size of the dynamic buffer. +

+
std::size_t max_size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/mutable_buffers_type.html b/include/asio/doc/asio/reference/basic_streambuf_ref/mutable_buffers_type.html new file mode 100644 index 0000000..d8fbe53 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/mutable_buffers_type.html @@ -0,0 +1,363 @@ + + + +basic_streambuf_ref::mutable_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent the output sequence as a list of buffers. +

+
typedef basic_streambuf< Allocator >::mutable_buffers_type mutable_buffers_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffers_type +

+
+

+ The type used to represent the input sequence as a list of buffers. +

+
+

+ mutable_buffers_type +

+
+

+ The type used to represent the output sequence as a list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_streambuf [constructor] +

+
+

+ Construct a basic_streambuf object. +

+
+

+ capacity +

+
+

+ Get the current capacity of the basic_streambuf. +

+
+

+ commit +

+
+

+ Move characters from the output sequence to the input sequence. +

+
+

+ consume +

+
+

+ Remove characters from the input sequence. +

+
+

+ data +

+
+

+ Get a list of buffers that represents the input sequence. +

+
+

+ max_size +

+
+

+ Get the maximum size of the basic_streambuf. +

+
+

+ prepare +

+
+

+ Get a list of buffers that represents the output sequence, with + the given size. +

+
+

+ size +

+
+

+ Get the size of the input sequence. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ overflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ reserve +

+
+
+

+ underflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ The basic_streambuf class is derived from std::streambuf + to associate the streambuf's input and output sequences with one or more + character arrays. These character arrays are internal to the basic_streambuf + object, but direct access to the array elements is provided to permit them + to be used efficiently with I/O operations. Characters written to the output + sequence of a basic_streambuf object are appended to the input + sequence of the same object. +

+

+ The basic_streambuf class's public interface is intended to + permit the following implementation strategies: +

+
    +
  • + A single contiguous character array, which is reallocated as necessary + to accommodate changes in the size of the character sequence. This + is the implementation approach currently used in Asio. +
  • +
  • + A sequence of one or more character arrays, where each array is of + the same size. Additional character array objects are appended to the + sequence to accommodate changes in the size of the character sequence. +
  • +
  • + A sequence of one or more character arrays of varying sizes. Additional + character array objects are appended to the sequence to accommodate + changes in the size of the character sequence. +
  • +
+

+ The constructor for basic_streambuf + accepts a size_t argument specifying the maximum of the sum + of the sizes of the input sequence and output sequence. During the lifetime + of the basic_streambuf object, the following invariant holds: +

+
size() <= max_size()
+
+

+ Any member function that would, if successful, cause the invariant to be + violated shall throw an exception of class std::length_error. +

+

+ The constructor for basic_streambuf takes an Allocator argument. + A copy of this argument is used for any memory allocation performed, by + the constructor and by all member functions, during the lifetime of each + basic_streambuf object. +

+
+ + Examples +
+

+ Writing directly from an streambuf to a socket: +

+
asio::streambuf b;
+std::ostream os(&b);
+os << "Hello, World!\n";
+
+// try sending some data in input sequence
+size_t n = sock.send(b.data());
+
+b.consume(n); // sent data is removed from input sequence
+
+

+ Reading from a socket directly into a streambuf: +

+
asio::streambuf b;
+
+// reserve 512 bytes in output sequence
+asio::streambuf::mutable_buffers_type bufs = b.prepare(512);
+
+size_t n = sock.receive(bufs);
+
+// received data is "committed" from output sequence to input sequence
+b.commit(n);
+
+std::istream is(&b);
+std::string s;
+is >> s;
+
+
+ + Requirements +
+

+ Header: asio/basic_streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/prepare.html b/include/asio/doc/asio/reference/basic_streambuf_ref/prepare.html new file mode 100644 index 0000000..841d1be --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/prepare.html @@ -0,0 +1,45 @@ + + + +basic_streambuf_ref::prepare + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a list of buffers that represents the output sequence, with the given size. +

+
mutable_buffers_type prepare(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_streambuf_ref/size.html b/include/asio/doc/asio/reference/basic_streambuf_ref/size.html new file mode 100644 index 0000000..591a92f --- /dev/null +++ b/include/asio/doc/asio/reference/basic_streambuf_ref/size.html @@ -0,0 +1,44 @@ + + + +basic_streambuf_ref::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the size + of the input sequence. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor.html b/include/asio/doc/asio/reference/basic_system_executor.html new file mode 100644 index 0000000..63cc109 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor.html @@ -0,0 +1,278 @@ + + + +basic_system_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An executor that uses arbitrary threads. +

+
template<
+    typename Blocking,
+    typename Relationship,
+    typename Allocator>
+class basic_system_executor
+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_system_executor [constructor] +

+
+

+ Default constructor. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the executor that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the executor that it has some outstanding work to do. +

+
+

+ post +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the allocator property.
—
+ Query the occupancy (recommended number of work items) for the + system context. +

+
+

+ query [static] +

+
+

+ Query the current value of the mapping property.
—
+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.always property.
+ —
Obtain an executor with the blocking.never property.
+ —
Obtain an executor with the relationship.continuation property. +
—
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the specified allocator property. +
—
Obtain an executor with the default allocator property. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+

+ The system executor represents an execution context where functions are permitted + to run on arbitrary threads. When the blocking.never property is established, + the system executor will schedule the function to run on an unspecified system + thread pool. When either blocking.possibly or blocking.always is established, + the executor invokes the function immediately. +

+
+ + Requirements +
+

+ Header: asio/system_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/basic_system_executor.html b/include/asio/doc/asio/reference/basic_system_executor/basic_system_executor.html new file mode 100644 index 0000000..2a6e4c9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/basic_system_executor.html @@ -0,0 +1,44 @@ + + + +basic_system_executor::basic_system_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
basic_system_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/context.html b/include/asio/doc/asio/reference/basic_system_executor/context.html new file mode 100644 index 0000000..e009caf --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/context.html @@ -0,0 +1,44 @@ + + + +basic_system_executor::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the underlying execution context. +

+
system_context & context() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/defer.html b/include/asio/doc/asio/reference/basic_system_executor/defer.html new file mode 100644 index 0000000..334da71 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/defer.html @@ -0,0 +1,80 @@ + + + +basic_system_executor::defer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the system executor to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void defer(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object will never be executed inside this function. + Instead, it will be scheduled to run on an unspecified system thread pool. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/dispatch.html b/include/asio/doc/asio/reference/basic_system_executor/dispatch.html new file mode 100644 index 0000000..c8629ce --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/dispatch.html @@ -0,0 +1,79 @@ + + + +basic_system_executor::dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the system executor to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void dispatch(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object will always be executed inside this function. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/execute.html b/include/asio/doc/asio/reference/basic_system_executor/execute.html new file mode 100644 index 0000000..f19f1f9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/execute.html @@ -0,0 +1,57 @@ + + + +basic_system_executor::execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Execution + function. +

+
template<
+    typename Function>
+void execute(
+    Function && f) const;
+
+

+ Do not call this function directly. It is intended for use with the execution::execute + customisation point. +

+

+ For example: +

+
asio::system_executor ex;
+execution::execute(ex, my_function_object);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/on_work_finished.html b/include/asio/doc/asio/reference/basic_system_executor/on_work_finished.html new file mode 100644 index 0000000..3fc8f5c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/on_work_finished.html @@ -0,0 +1,47 @@ + + + +basic_system_executor::on_work_finished + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the executor that some work is no longer outstanding. +

+
void on_work_finished() const;
+
+

+ For the system executor, this is a no-op. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/on_work_started.html b/include/asio/doc/asio/reference/basic_system_executor/on_work_started.html new file mode 100644 index 0000000..0228fa1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/on_work_started.html @@ -0,0 +1,47 @@ + + + +basic_system_executor::on_work_started + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the executor that it has some outstanding work to do. +

+
void on_work_started() const;
+
+

+ For the system executor, this is a no-op. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/operator_eq__eq_.html b/include/asio/doc/asio/reference/basic_system_executor/operator_eq__eq_.html new file mode 100644 index 0000000..e053070 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/operator_eq__eq_.html @@ -0,0 +1,59 @@ + + + +basic_system_executor::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two executors for equality. +

+
friend bool operator==(
+    const basic_system_executor & ,
+    const basic_system_executor & );
+
+

+ Two executors are equal if they refer to the same underlying io_context. +

+
+ + Requirements +
+

+ Header: asio/system_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/operator_not__eq_.html b/include/asio/doc/asio/reference/basic_system_executor/operator_not__eq_.html new file mode 100644 index 0000000..da063ef --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/operator_not__eq_.html @@ -0,0 +1,59 @@ + + + +basic_system_executor::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two executors for inequality. +

+
friend bool operator!=(
+    const basic_system_executor & ,
+    const basic_system_executor & );
+
+

+ Two executors are equal if they refer to the same underlying io_context. +

+
+ + Requirements +
+

+ Header: asio/system_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/post.html b/include/asio/doc/asio/reference/basic_system_executor/post.html new file mode 100644 index 0000000..5d54b51 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/post.html @@ -0,0 +1,80 @@ + + + +basic_system_executor::post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the system executor to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void post(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object will never be executed inside this function. + Instead, it will be scheduled to run on an unspecified system thread pool. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query.html b/include/asio/doc/asio/reference/basic_system_executor/query.html new file mode 100644 index 0000000..c011c3e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query.html @@ -0,0 +1,59 @@ + + + +basic_system_executor::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Query + the current value of the allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr Allocator query(
+    execution::allocator_t< OtherAllocator > ) const;
+  » more...
+
+constexpr Allocator query(
+    execution::allocator_t< void > ) const;
+  » more...
+
+

+ Query the occupancy (recommended number of work items) for the system context. +

+
std::size_t query(
+    execution::occupancy_t ) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query/overload1.html b/include/asio/doc/asio/reference/basic_system_executor/query/overload1.html new file mode 100644 index 0000000..859714a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query/overload1.html @@ -0,0 +1,58 @@ + + + +basic_system_executor::query (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr Allocator query(
+    execution::allocator_t< OtherAllocator > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
asio::system_executor ex;
+auto alloc = asio::query(ex,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query/overload2.html b/include/asio/doc/asio/reference/basic_system_executor/query/overload2.html new file mode 100644 index 0000000..99330c2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query/overload2.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::query (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the allocator property. +

+
constexpr Allocator query(
+    execution::allocator_t< void > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
asio::system_executor ex;
+auto alloc = asio::query(ex,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query/overload3.html b/include/asio/doc/asio/reference/basic_system_executor/query/overload3.html new file mode 100644 index 0000000..3813311 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query/overload3.html @@ -0,0 +1,57 @@ + + + +basic_system_executor::query (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the occupancy (recommended number of work items) for the system + context. +

+
std::size_t query(
+    execution::occupancy_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
asio::system_executor ex;
+std::size_t occupancy = asio::query(
+    ex, asio::execution::occupancy);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query__static.html b/include/asio/doc/asio/reference/basic_system_executor/query__static.html new file mode 100644 index 0000000..dfabee9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query__static.html @@ -0,0 +1,67 @@ + + + +basic_system_executor::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Query + the current value of the mapping property. +

+
static constexpr execution::mapping_t query(
+    execution::mapping_t );
+  » more...
+
+

+ Query the current value of the context property. +

+
static system_context & query(
+    execution::context_t );
+  » more...
+
+

+ Query the current value of the blocking property. +

+
static constexpr execution::blocking_t query(
+    execution::blocking_t );
+  » more...
+
+

+ Query the current value of the relationship property. +

+
static constexpr execution::relationship_t query(
+    execution::relationship_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query__static/overload1.html b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload1.html new file mode 100644 index 0000000..e8b9671 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload1.html @@ -0,0 +1,57 @@ + + + +basic_system_executor::query (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the mapping property. +

+
static constexpr execution::mapping_t query(
+    execution::mapping_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
asio::system_executor ex;
+if (asio::query(ex, asio::execution::mapping)
+      == asio::execution::mapping.thread)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query__static/overload2.html b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload2.html new file mode 100644 index 0000000..23451ba --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload2.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::query (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the context property. +

+
static system_context & query(
+    execution::context_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
asio::system_executor ex;
+asio::system_context& pool = asio::query(
+    ex, asio::execution::context);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query__static/overload3.html b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload3.html new file mode 100644 index 0000000..d9228ac --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload3.html @@ -0,0 +1,57 @@ + + + +basic_system_executor::query (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the blocking property. +

+
static constexpr execution::blocking_t query(
+    execution::blocking_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
asio::system_executor ex;
+if (asio::query(ex, asio::execution::blocking)
+      == asio::execution::blocking.always)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/query__static/overload4.html b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload4.html new file mode 100644 index 0000000..9116f2c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/query__static/overload4.html @@ -0,0 +1,57 @@ + + + +basic_system_executor::query (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the relationship property. +

+
static constexpr execution::relationship_t query(
+    execution::relationship_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
asio::system_executor ex;
+if (asio::query(ex, asio::execution::relationship)
+      == asio::execution::relationship.continuation)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require.html b/include/asio/doc/asio/reference/basic_system_executor/require.html new file mode 100644 index 0000000..26caa32 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require.html @@ -0,0 +1,90 @@ + + + +basic_system_executor::require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an executor with the blocking.possibly property. +

+
basic_system_executor< execution::blocking_t::possibly_t, Relationship, Allocator > require(
+    execution::blocking_t::possibly_t ) const;
+  » more...
+
+

+ Obtain an executor with the blocking.always property. +

+
basic_system_executor< execution::blocking_t::always_t, Relationship, Allocator > require(
+    execution::blocking_t::always_t ) const;
+  » more...
+
+

+ Obtain an executor with the blocking.never property. +

+
basic_system_executor< execution::blocking_t::never_t, Relationship, Allocator > require(
+    execution::blocking_t::never_t ) const;
+  » more...
+
+

+ Obtain an executor with the relationship.continuation property. +

+
basic_system_executor< Blocking, execution::relationship_t::continuation_t, Allocator > require(
+    execution::relationship_t::continuation_t ) const;
+  » more...
+
+

+ Obtain an executor with the relationship.fork property. +

+
basic_system_executor< Blocking, execution::relationship_t::fork_t, Allocator > require(
+    execution::relationship_t::fork_t ) const;
+  » more...
+
+

+ Obtain an executor with the specified allocator property. +

+
template<
+    typename OtherAllocator>
+basic_system_executor< Blocking, Relationship, OtherAllocator > require(
+    execution::allocator_t< OtherAllocator > a) const;
+  » more...
+
+

+ Obtain an executor with the default allocator property. +

+
basic_system_executor< Blocking, Relationship, std::allocator< void > > require(
+    execution::allocator_t< void > ) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require/overload1.html b/include/asio/doc/asio/reference/basic_system_executor/require/overload1.html new file mode 100644 index 0000000..210fd42 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require/overload1.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::require (1 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.possibly property. +

+
basic_system_executor< execution::blocking_t::possibly_t, Relationship, Allocator > require(
+    execution::blocking_t::possibly_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
asio::system_executor ex1;
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.possibly);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require/overload2.html b/include/asio/doc/asio/reference/basic_system_executor/require/overload2.html new file mode 100644 index 0000000..67d968b --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require/overload2.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::require (2 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.always property. +

+
basic_system_executor< execution::blocking_t::always_t, Relationship, Allocator > require(
+    execution::blocking_t::always_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
asio::system_executor ex1;
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.always);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require/overload3.html b/include/asio/doc/asio/reference/basic_system_executor/require/overload3.html new file mode 100644 index 0000000..ac4bfe2 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require/overload3.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::require (3 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.never property. +

+
basic_system_executor< execution::blocking_t::never_t, Relationship, Allocator > require(
+    execution::blocking_t::never_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
asio::system_executor ex1;
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.never);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require/overload4.html b/include/asio/doc/asio/reference/basic_system_executor/require/overload4.html new file mode 100644 index 0000000..bd14baa --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require/overload4.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::require (4 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the relationship.continuation property. +

+
basic_system_executor< Blocking, execution::relationship_t::continuation_t, Allocator > require(
+    execution::relationship_t::continuation_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
asio::system_executor ex1;
+auto ex2 = asio::require(ex1,
+    asio::execution::relationship.continuation);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require/overload5.html b/include/asio/doc/asio/reference/basic_system_executor/require/overload5.html new file mode 100644 index 0000000..ffb1fbc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require/overload5.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::require (5 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the relationship.fork property. +

+
basic_system_executor< Blocking, execution::relationship_t::fork_t, Allocator > require(
+    execution::relationship_t::fork_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
asio::system_executor ex1;
+auto ex2 = asio::require(ex1,
+    asio::execution::relationship.fork);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require/overload6.html b/include/asio/doc/asio/reference/basic_system_executor/require/overload6.html new file mode 100644 index 0000000..0920c5a --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require/overload6.html @@ -0,0 +1,58 @@ + + + +basic_system_executor::require (6 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the specified allocator property. +

+
template<
+    typename OtherAllocator>
+basic_system_executor< Blocking, Relationship, OtherAllocator > require(
+    execution::allocator_t< OtherAllocator > a) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
asio::system_executor ex1;
+auto ex2 = asio::require(ex1,
+    asio::execution::allocator(my_allocator));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_system_executor/require/overload7.html b/include/asio/doc/asio/reference/basic_system_executor/require/overload7.html new file mode 100644 index 0000000..57ff59d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_system_executor/require/overload7.html @@ -0,0 +1,56 @@ + + + +basic_system_executor::require (7 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the default allocator property. +

+
basic_system_executor< Blocking, Relationship, std::allocator< void > > require(
+    execution::allocator_t< void > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
asio::system_executor ex1;
+auto ex2 = asio::require(ex1,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer.html b/include/asio/doc/asio/reference/basic_waitable_timer.html new file mode 100644 index 0000000..e805e89 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer.html @@ -0,0 +1,448 @@ + + + +basic_waitable_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides waitable timer functionality. +

+
template<
+    typename Clock,
+    typename WaitTraits,
+    typename Executor>
+class basic_waitable_timer
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type of the clock. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_point +

+
+

+ The time point type of the clock. +

+
+

+ traits_type +

+
+

+ The wait traits type. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_waitable_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a particular + expiry time relative to now.
—
Move-construct a basic_waitable_timer + from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancel + any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancels + one asynchronous operation that is waiting on the timer. +

+
+

+ expires_after +

+
+

+ Set the timer's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time as an absolute + time.
—
Set the timer's expiry time as an absolute + time.
—
(Deprecated: Use non-error_code overload.) + Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set the + timer's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the timer's expiry time as an absolute time. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_waitable_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_waitable_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_waitable_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A waitable timer is always in one of two states: "expired" or "not + expired". If the wait() or async_wait() function + is called on an expired timer, the wait operation will complete immediately. +

+

+ Most applications will use one of the steady_timer, + system_timer + or high_resolution_timer + typedefs. +

+
+ + Remarks +
+

+ This waitable timer functionality is for use with the C++11 standard library's + <chrono> facility, or with the Boost.Chrono library. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait (C++11): +

+
// Construct a timer without setting an expiry time.
+asio::steady_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_after(std::chrono::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait (C++11): +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::steady_timer timer(my_context,
+    std::chrono::steady_clock::now() + std::chrono::seconds(60));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active waitable timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the action + associated with the timer is performed only once, use something like this: + used: +

+
void on_some_event()
+{
+  if (my_timer.expires_after(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_waitable_timer::expires_after() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/_basic_waitable_timer.html b/include/asio/doc/asio/reference/basic_waitable_timer/_basic_waitable_timer.html new file mode 100644 index 0000000..d9967c6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/_basic_waitable_timer.html @@ -0,0 +1,48 @@ + + + +basic_waitable_timer::~basic_waitable_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the timer. +

+
~basic_waitable_timer();
+
+

+ This function destroys the timer, cancelling any outstanding asynchronous + wait operations associated with the timer as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/async_wait.html b/include/asio/doc/asio/reference/basic_waitable_timer/async_wait.html new file mode 100644 index 0000000..b027a62 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/async_wait.html @@ -0,0 +1,91 @@ + + + +basic_waitable_timer::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous wait on the timer. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    WaitHandler && handler = DEFAULT);
+
+

+ This function may be used to initiate an asynchronous wait against the + timer. It always returns immediately. +

+

+ For each call to async_wait(), the supplied handler will be + called exactly once. The handler will be called when: +

+
    +
  • + The timer has expired. +
  • +
  • + The timer was cancelled, in which case the handler is passed the error + code asio::error::operation_aborted. +
  • +
+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called when the timer expires. Copies will be made + of the handler as required. The function signature of the handler + must be: +

+
void handler(
+  const asio::error_code& error // Result of operation.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer.html new file mode 100644 index 0000000..ab9b450 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer.html @@ -0,0 +1,99 @@ + + + +basic_waitable_timer::basic_waitable_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
explicit basic_waitable_timer(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_waitable_timer(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Constructor to set a particular expiry time as an absolute time. +

+
basic_waitable_timer(
+    const executor_type & ex,
+    const time_point & expiry_time);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_waitable_timer(
+    ExecutionContext & context,
+    const time_point & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Constructor to set a particular expiry time relative to now. +

+
basic_waitable_timer(
+    const executor_type & ex,
+    const duration & expiry_time);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_waitable_timer(
+    ExecutionContext & context,
+    const duration & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a basic_waitable_timer + from another. +

+
basic_waitable_timer(
+    basic_waitable_timer && other);
+  » more...
+
+template<
+    typename Executor1>
+basic_waitable_timer(
+    basic_waitable_timer< Clock, WaitTraits, Executor1 > && other,
+    typename enable_if< is_convertible< Executor1, Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload1.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload1.html new file mode 100644 index 0000000..7bee535 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload1.html @@ -0,0 +1,63 @@ + + + +basic_waitable_timer::basic_waitable_timer (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor. +

+
basic_waitable_timer(
+    const executor_type & ex);
+
+

+ This constructor creates a timer without setting an expiry time. The + expires_at() or expires_after() functions must + be called to set an expiry time before the timer can be waited on. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the timer will use, by default, to dispatch + handlers for any asynchronous operations performed on the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload2.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload2.html new file mode 100644 index 0000000..6c37f60 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload2.html @@ -0,0 +1,67 @@ + + + +basic_waitable_timer::basic_waitable_timer (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor. +

+
template<
+    typename ExecutionContext>
+basic_waitable_timer(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a timer without setting an expiry time. The + expires_at() or expires_after() functions must + be called to set an expiry time before the timer can be waited on. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the timer + will use, by default, to dispatch handlers for any asynchronous + operations performed on the timer. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload3.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload3.html new file mode 100644 index 0000000..68edf43 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload3.html @@ -0,0 +1,68 @@ + + + +basic_waitable_timer::basic_waitable_timer (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time as an absolute time. +

+
basic_waitable_timer(
+    const executor_type & ex,
+    const time_point & expiry_time);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor object that the timer will use, by default, to + dispatch handlers for any asynchronous operations performed on + the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, expressed as an absolute + time. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload4.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload4.html new file mode 100644 index 0000000..22185d3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload4.html @@ -0,0 +1,71 @@ + + + +basic_waitable_timer::basic_waitable_timer (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time as an absolute time. +

+
template<
+    typename ExecutionContext>
+basic_waitable_timer(
+    ExecutionContext & context,
+    const time_point & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the timer + will use, by default, to dispatch handlers for any asynchronous + operations performed on the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, expressed as an absolute + time. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload5.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload5.html new file mode 100644 index 0000000..aeef268 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload5.html @@ -0,0 +1,66 @@ + + + +basic_waitable_timer::basic_waitable_timer (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time relative to now. +

+
basic_waitable_timer(
+    const executor_type & ex,
+    const duration & expiry_time);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the timer will use, by default, to dispatch + handlers for any asynchronous operations performed on the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, relative to now. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload6.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload6.html new file mode 100644 index 0000000..44f1402 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload6.html @@ -0,0 +1,70 @@ + + + +basic_waitable_timer::basic_waitable_timer (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor to set a particular expiry time relative to now. +

+
template<
+    typename ExecutionContext>
+basic_waitable_timer(
+    ExecutionContext & context,
+    const duration & expiry_time,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a timer and sets the expiry time. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the timer + will use, by default, to dispatch handlers for any asynchronous + operations performed on the timer. +

+
expiry_time
+

+ The expiry time to be used for the timer, relative to now. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload7.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload7.html new file mode 100644 index 0000000..e4602e3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload7.html @@ -0,0 +1,71 @@ + + + +basic_waitable_timer::basic_waitable_timer (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_waitable_timer + from another. +

+
basic_waitable_timer(
+    basic_waitable_timer && other);
+
+

+ This constructor moves a timer from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_waitable_timer + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_waitable_timer(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload8.html b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload8.html new file mode 100644 index 0000000..3c173cc --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/basic_waitable_timer/overload8.html @@ -0,0 +1,74 @@ + + + +basic_waitable_timer::basic_waitable_timer (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a basic_waitable_timer + from another. +

+
template<
+    typename Executor1>
+basic_waitable_timer(
+    basic_waitable_timer< Clock, WaitTraits, Executor1 > && other,
+    typename enable_if< is_convertible< Executor1, Executor >::value >::type *  = 0);
+
+

+ This constructor moves a timer from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_waitable_timer + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_waitable_timer(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/cancel.html b/include/asio/doc/asio/reference/basic_waitable_timer/cancel.html new file mode 100644 index 0000000..013d4d3 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/cancel.html @@ -0,0 +1,53 @@ + + + +basic_waitable_timer::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + any asynchronous operations that are waiting on the timer. +

+
std::size_t cancel();
+  » more...
+
+

+ (Deprecated: Use non-error_code overload.) Cancel any asynchronous operations + that are waiting on the timer. +

+
std::size_t cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/cancel/overload1.html b/include/asio/doc/asio/reference/basic_waitable_timer/cancel/overload1.html new file mode 100644 index 0000000..4335002 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/cancel/overload1.html @@ -0,0 +1,93 @@ + + + +basic_waitable_timer::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel any asynchronous operations that are waiting on the timer. +

+
std::size_t cancel();
+
+

+ This function forces the completion of any pending asynchronous wait + operations against the timer. The handler for each cancelled operation + will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when cancel() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/cancel/overload2.html b/include/asio/doc/asio/reference/basic_waitable_timer/cancel/overload2.html new file mode 100644 index 0000000..2305366 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/cancel/overload2.html @@ -0,0 +1,95 @@ + + + +basic_waitable_timer::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use non-error_code overload.) Cancel any asynchronous operations + that are waiting on the timer. +

+
std::size_t cancel(
+    asio::error_code & ec);
+
+

+ This function forces the completion of any pending asynchronous wait + operations against the timer. The handler for each cancelled operation + will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Remarks +
+

+ If the timer has already expired when cancel() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one.html b/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one.html new file mode 100644 index 0000000..9080deb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one.html @@ -0,0 +1,53 @@ + + + +basic_waitable_timer::cancel_one + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancels + one asynchronous operation that is waiting on the timer. +

+
std::size_t cancel_one();
+  » more...
+
+

+ (Deprecated: Use non-error_code overload.) Cancels one asynchronous operation + that is waiting on the timer. +

+
std::size_t cancel_one(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one/overload1.html b/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one/overload1.html new file mode 100644 index 0000000..e39724d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one/overload1.html @@ -0,0 +1,94 @@ + + + +basic_waitable_timer::cancel_one (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancels one asynchronous operation that is waiting on the timer. +

+
std::size_t cancel_one();
+
+

+ This function forces the completion of one pending asynchronous wait + operation against the timer. Handlers are cancelled in FIFO order. The + handler for the cancelled operation will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. That is, either + 0 or 1. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when cancel_one() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one/overload2.html b/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one/overload2.html new file mode 100644 index 0000000..3641dd5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/cancel_one/overload2.html @@ -0,0 +1,96 @@ + + + +basic_waitable_timer::cancel_one (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use non-error_code overload.) Cancels one asynchronous operation + that is waiting on the timer. +

+
std::size_t cancel_one(
+    asio::error_code & ec);
+
+

+ This function forces the completion of one pending asynchronous wait + operation against the timer. Handlers are cancelled in FIFO order. The + handler for the cancelled operation will be invoked with the asio::error::operation_aborted + error code. +

+

+ Cancelling the timer does not change the expiry time. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. That is, either + 0 or 1. +

+
+ + Remarks +
+

+ If the timer has already expired when cancel_one() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/clock_type.html b/include/asio/doc/asio/reference/basic_waitable_timer/clock_type.html new file mode 100644 index 0000000..b97c7b6 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/clock_type.html @@ -0,0 +1,54 @@ + + + +basic_waitable_timer::clock_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + clock type. +

+
typedef Clock clock_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/duration.html b/include/asio/doc/asio/reference/basic_waitable_timer/duration.html new file mode 100644 index 0000000..248db47 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/duration.html @@ -0,0 +1,54 @@ + + + +basic_waitable_timer::duration + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + duration type of the clock. +

+
typedef clock_type::duration duration;
+
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/executor_type.html b/include/asio/doc/asio/reference/basic_waitable_timer/executor_type.html new file mode 100644 index 0000000..4a53e1e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/executor_type.html @@ -0,0 +1,54 @@ + + + +basic_waitable_timer::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_after.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_after.html new file mode 100644 index 0000000..8706c4d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_after.html @@ -0,0 +1,104 @@ + + + +basic_waitable_timer::expires_after + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the timer's expiry time relative to now. +

+
std::size_t expires_after(
+    const duration & expiry_time);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when expires_after() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_at.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at.html new file mode 100644 index 0000000..d695d5e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at.html @@ -0,0 +1,62 @@ + + + +basic_waitable_timer::expires_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use expiry().) Get the timer's expiry time as an absolute + time. +

+
time_point expires_at() const;
+  » more...
+
+

+ Set the timer's expiry time as an absolute time. +

+
std::size_t expires_at(
+    const time_point & expiry_time);
+  » more...
+
+

+ (Deprecated: Use non-error_code overload.) Set the timer's expiry time + as an absolute time. +

+
std::size_t expires_at(
+    const time_point & expiry_time,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload1.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload1.html new file mode 100644 index 0000000..a545e01 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload1.html @@ -0,0 +1,48 @@ + + + +basic_waitable_timer::expires_at (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expiry().) Get the timer's expiry time + as an absolute time. +

+
time_point expires_at() const;
+
+

+ This function may be used to obtain the timer's current expiry time. + Whether the timer has expired or not does not affect this value. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload2.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload2.html new file mode 100644 index 0000000..b908748 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload2.html @@ -0,0 +1,103 @@ + + + +basic_waitable_timer::expires_at (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the timer's expiry time as an absolute time. +

+
std::size_t expires_at(
+    const time_point & expiry_time);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when expires_at() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload3.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload3.html new file mode 100644 index 0000000..7222dac --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_at/overload3.html @@ -0,0 +1,96 @@ + + + +basic_waitable_timer::expires_at (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use non-error_code overload.) Set the timer's expiry time + as an absolute time. +

+
std::size_t expires_at(
+    const time_point & expiry_time,
+    asio::error_code & ec);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Remarks +
+

+ If the timer has already expired when expires_at() is called, + then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now.html new file mode 100644 index 0000000..77d8492 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now.html @@ -0,0 +1,58 @@ + + + +basic_waitable_timer::expires_from_now + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use expiry().) Get the timer's expiry time relative to now. +

+
duration expires_from_now() const;
+  » more...
+
+

+ (Deprecated: Use expires_after().) Set the timer's expiry + time relative to now. +

+
std::size_t expires_from_now(
+    const duration & expiry_time);
+  » more...
+
+std::size_t expires_from_now(
+    const duration & expiry_time,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload1.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload1.html new file mode 100644 index 0000000..5221086 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload1.html @@ -0,0 +1,48 @@ + + + +basic_waitable_timer::expires_from_now (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expiry().) Get the timer's expiry time + relative to now. +

+
duration expires_from_now() const;
+
+

+ This function may be used to obtain the timer's current expiry time. + Whether the timer has expired or not does not affect this value. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload2.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload2.html new file mode 100644 index 0000000..b69c1f4 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload2.html @@ -0,0 +1,104 @@ + + + +basic_waitable_timer::expires_from_now (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expires_after().) Set the timer's expiry + time relative to now. +

+
std::size_t expires_from_now(
+    const duration & expiry_time);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ If the timer has already expired when expires_from_now() + is called, then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload3.html b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload3.html new file mode 100644 index 0000000..1d3c380 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expires_from_now/overload3.html @@ -0,0 +1,96 @@ + + + +basic_waitable_timer::expires_from_now (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use expires_after().) Set the timer's expiry + time relative to now. +

+
std::size_t expires_from_now(
+    const duration & expiry_time,
+    asio::error_code & ec);
+
+

+ This function sets the expiry time. Any pending asynchronous wait operations + will be cancelled. The handler for each cancelled operation will be invoked + with the asio::error::operation_aborted error code. +

+
+ + Parameters +
+
+

+
+
expiry_time
+

+ The expiry time to be used for the timer. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of asynchronous operations that were cancelled. +

+
+ + Remarks +
+

+ If the timer has already expired when expires_from_now() + is called, then the handlers for asynchronous wait operations will: +

+
    +
  • + have already been invoked; or +
  • +
  • + have been queued for invocation in the near future. +
  • +
+

+ These handlers can no longer be cancelled, and therefore are passed an + error code that indicates the successful completion of the wait operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/expiry.html b/include/asio/doc/asio/reference/basic_waitable_timer/expiry.html new file mode 100644 index 0000000..ec1d361 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/expiry.html @@ -0,0 +1,48 @@ + + + +basic_waitable_timer::expiry + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the timer's expiry time as an absolute time. +

+
time_point expiry() const;
+
+

+ This function may be used to obtain the timer's current expiry time. Whether + the timer has expired or not does not affect this value. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/get_executor.html b/include/asio/doc/asio/reference/basic_waitable_timer/get_executor.html new file mode 100644 index 0000000..cd096e8 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/get_executor.html @@ -0,0 +1,44 @@ + + + +basic_waitable_timer::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_.html b/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_.html new file mode 100644 index 0000000..902952c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_.html @@ -0,0 +1,53 @@ + + + +basic_waitable_timer::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a basic_waitable_timer + from another. +

+
basic_waitable_timer & operator=(
+    basic_waitable_timer && other);
+  » more...
+
+template<
+    typename Executor1>
+enable_if< is_convertible< Executor1, Executor >::value, basic_waitable_timer & >::type operator=(
+    basic_waitable_timer< Clock, WaitTraits, Executor1 > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_/overload1.html b/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_/overload1.html new file mode 100644 index 0000000..fe98f38 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_/overload1.html @@ -0,0 +1,72 @@ + + + +basic_waitable_timer::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_waitable_timer + from another. +

+
basic_waitable_timer & operator=(
+    basic_waitable_timer && other);
+
+

+ This assignment operator moves a timer from one object to another. Cancels + any outstanding asynchronous operations associated with the target object. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_waitable_timer + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_waitable_timer(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_/overload2.html b/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_/overload2.html new file mode 100644 index 0000000..2ecee19 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/operator_eq_/overload2.html @@ -0,0 +1,74 @@ + + + +basic_waitable_timer::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign a basic_waitable_timer + from another. +

+
template<
+    typename Executor1>
+enable_if< is_convertible< Executor1, Executor >::value, basic_waitable_timer & >::type operator=(
+    basic_waitable_timer< Clock, WaitTraits, Executor1 > && other);
+
+

+ This assignment operator moves a timer from one object to another. Cancels + any outstanding asynchronous operations associated with the target object. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other basic_waitable_timer + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_waitable_timer(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/time_point.html b/include/asio/doc/asio/reference/basic_waitable_timer/time_point.html new file mode 100644 index 0000000..840ad05 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/time_point.html @@ -0,0 +1,54 @@ + + + +basic_waitable_timer::time_point + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + time point type of the clock. +

+
typedef clock_type::time_point time_point;
+
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/traits_type.html b/include/asio/doc/asio/reference/basic_waitable_timer/traits_type.html new file mode 100644 index 0000000..78e632e --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/traits_type.html @@ -0,0 +1,54 @@ + + + +basic_waitable_timer::traits_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + wait traits type. +

+
typedef WaitTraits traits_type;
+
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/wait.html b/include/asio/doc/asio/reference/basic_waitable_timer/wait.html new file mode 100644 index 0000000..57aa125 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/wait.html @@ -0,0 +1,49 @@ + + + +basic_waitable_timer::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + a blocking wait on the timer. +

+
void wait();
+  » more...
+
+void wait(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/wait/overload1.html b/include/asio/doc/asio/reference/basic_waitable_timer/wait/overload1.html new file mode 100644 index 0000000..c5c30b5 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/wait/overload1.html @@ -0,0 +1,60 @@ + + + +basic_waitable_timer::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform a blocking wait on the timer. +

+
void wait();
+
+

+ This function is used to wait for the timer to expire. This function + blocks and does not return until the timer has expired. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer/wait/overload2.html b/include/asio/doc/asio/reference/basic_waitable_timer/wait/overload2.html new file mode 100644 index 0000000..a1e38db --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer/wait/overload2.html @@ -0,0 +1,61 @@ + + + +basic_waitable_timer::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform a blocking wait on the timer. +

+
void wait(
+    asio::error_code & ec);
+
+

+ This function is used to wait for the timer to expire. This function + blocks and does not return until the timer has expired. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer__rebind_executor.html b/include/asio/doc/asio/reference/basic_waitable_timer__rebind_executor.html new file mode 100644 index 0000000..086898d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer__rebind_executor.html @@ -0,0 +1,88 @@ + + + +basic_waitable_timer::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the timer type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The timer type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_waitable_timer__rebind_executor/other.html b/include/asio/doc/asio/reference/basic_waitable_timer__rebind_executor/other.html new file mode 100644 index 0000000..624784c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_waitable_timer__rebind_executor/other.html @@ -0,0 +1,448 @@ + + + +basic_waitable_timer::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + timer type when rebound to the specified executor. +

+
typedef basic_waitable_timer< Clock, WaitTraits, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type of the clock. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_point +

+
+

+ The time point type of the clock. +

+
+

+ traits_type +

+
+

+ The wait traits type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_waitable_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a + particular expiry time relative to now.
—
Move-construct + a basic_waitable_timer from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancel + any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancels + one asynchronous operation that is waiting on the timer. +

+
+

+ expires_after +

+
+

+ Set the timer's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time as an + absolute time.
—
Set the timer's expiry time as an + absolute time.
—
(Deprecated: Use non-error_code + overload.) Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set + the timer's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the timer's expiry time as an absolute time. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_waitable_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_waitable_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_waitable_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A waitable timer is always in one of two states: "expired" or + "not expired". If the wait() or async_wait() + function is called on an expired timer, the wait operation will complete + immediately. +

+

+ Most applications will use one of the steady_timer, + system_timer + or high_resolution_timer + typedefs. +

+
+ + Remarks +
+

+ This waitable timer functionality is for use with the C++11 standard library's + <chrono> facility, or with the Boost.Chrono library. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait (C++11): +

+
// Construct a timer without setting an expiry time.
+asio::steady_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_after(std::chrono::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait (C++11): +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::steady_timer timer(my_context,
+    std::chrono::steady_clock::now() + std::chrono::seconds(60));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active waitable timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the + action associated with the timer is performed only once, use something + like this: used: +

+
void on_some_event()
+{
+  if (my_timer.expires_after(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_waitable_timer::expires_after() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+
+ + Requirements +
+

+ Header: asio/basic_waitable_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_yield_context.html b/include/asio/doc/asio/reference/basic_yield_context.html new file mode 100644 index 0000000..d438ac9 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_yield_context.html @@ -0,0 +1,172 @@ + + + +basic_yield_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Context object the represents the currently executing coroutine. +

+
template<
+    typename Handler>
+class basic_yield_context
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ callee_type +

+
+

+ The coroutine callee type, used by the implementation. +

+
+

+ caller_type +

+
+

+ The coroutine caller type, used by the implementation. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_yield_context [constructor] +

+
+

+ Construct a yield context to represent the specified coroutine. +
—
Construct a yield context from another yield context + type. +

+
+

+ operator[] +

+
+

+ Return a yield context that sets the specified error_code. +

+
+

+ The basic_yield_context + class is used to represent the currently executing stackful coroutine. A + basic_yield_context + may be passed as a handler to an asynchronous operation. For example: +

+
template <typename Handler>
+void my_coroutine(basic_yield_context<Handler> yield)
+{
+  ...
+  std::size_t n = my_socket.async_read_some(buffer, yield);
+  ...
+}
+
+

+ The initiating function (async_read_some in the above example) suspends the + current coroutine. The coroutine is resumed when the asynchronous operation + completes, and the result of the operation is returned. +

+
+ + Requirements +
+

+ Header: asio/spawn.hpp +

+

+ Convenience header: None +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context.html b/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context.html new file mode 100644 index 0000000..fb6fbb7 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context.html @@ -0,0 +1,57 @@ + + + +basic_yield_context::basic_yield_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a yield context to represent the specified coroutine. +

+
basic_yield_context(
+    const detail::weak_ptr< callee_type > & coro,
+    caller_type & ca,
+    Handler & handler);
+  » more...
+
+

+ Construct a yield context from another yield context type. +

+
template<
+    typename OtherHandler>
+basic_yield_context(
+    const basic_yield_context< OtherHandler > & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context/overload1.html b/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context/overload1.html new file mode 100644 index 0000000..3d291f1 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context/overload1.html @@ -0,0 +1,51 @@ + + + +basic_yield_context::basic_yield_context (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a yield context to represent the specified coroutine. +

+
basic_yield_context(
+    const detail::weak_ptr< callee_type > & coro,
+    caller_type & ca,
+    Handler & handler);
+
+

+ Most applications do not need to use this constructor. Instead, the + spawn() function passes a yield context as an argument to + the coroutine function. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context/overload2.html b/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context/overload2.html new file mode 100644 index 0000000..aba617c --- /dev/null +++ b/include/asio/doc/asio/reference/basic_yield_context/basic_yield_context/overload2.html @@ -0,0 +1,49 @@ + + + +basic_yield_context::basic_yield_context (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a yield context from another yield context type. +

+
template<
+    typename OtherHandler>
+basic_yield_context(
+    const basic_yield_context< OtherHandler > & other);
+
+

+ Requires that OtherHandler be convertible to Handler. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_yield_context/callee_type.html b/include/asio/doc/asio/reference/basic_yield_context/callee_type.html new file mode 100644 index 0000000..5489144 --- /dev/null +++ b/include/asio/doc/asio/reference/basic_yield_context/callee_type.html @@ -0,0 +1,64 @@ + + + +basic_yield_context::callee_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + coroutine callee type, used by the implementation. +

+
typedef implementation_defined callee_type;
+
+

+ When using Boost.Coroutine v1, this type is: +

+
typename coroutine<void()>
+
+

+ When using Boost.Coroutine v2 (unidirectional coroutines), this type is: +

+
push_coroutine<void>
+
+
+ + Requirements +
+

+ Header: asio/spawn.hpp +

+

+ Convenience header: None +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_yield_context/caller_type.html b/include/asio/doc/asio/reference/basic_yield_context/caller_type.html new file mode 100644 index 0000000..0861ebb --- /dev/null +++ b/include/asio/doc/asio/reference/basic_yield_context/caller_type.html @@ -0,0 +1,64 @@ + + + +basic_yield_context::caller_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + coroutine caller type, used by the implementation. +

+
typedef implementation_defined caller_type;
+
+

+ When using Boost.Coroutine v1, this type is: +

+
typename coroutine<void()>::caller_type
+
+

+ When using Boost.Coroutine v2 (unidirectional coroutines), this type is: +

+
pull_coroutine<void>
+
+
+ + Requirements +
+

+ Header: asio/spawn.hpp +

+

+ Convenience header: None +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/basic_yield_context/operator_lb__rb_.html b/include/asio/doc/asio/reference/basic_yield_context/operator_lb__rb_.html new file mode 100644 index 0000000..2c2260d --- /dev/null +++ b/include/asio/doc/asio/reference/basic_yield_context/operator_lb__rb_.html @@ -0,0 +1,65 @@ + + + +basic_yield_context::operator[] + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Return + a yield context that sets the specified error_code. +

+
basic_yield_context operator[](
+    asio::error_code & ec) const;
+
+

+ By default, when a yield context is used with an asynchronous operation, + a non-success error_code + is converted to system_error + and thrown. This operator may be used to specify an error_code + object that should instead be set with the asynchronous operation's result. + For example: +

+
template <typename Handler>
+void my_coroutine(basic_yield_context<Handler> yield)
+{
+  ...
+  std::size_t n = my_socket.async_read_some(buffer, yield[ec]);
+  if (ec)
+  {
+    // An error occurred.
+  }
+  ...
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/bind_executor.html b/include/asio/doc/asio/reference/bind_executor.html new file mode 100644 index 0000000..b632175 --- /dev/null +++ b/include/asio/doc/asio/reference/bind_executor.html @@ -0,0 +1,73 @@ + + + +bind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Associate an object of type T + with an executor of type Executor. +

+
template<
+    typename Executor,
+    typename T>
+executor_binder< typename decay< T >::type, Executor > bind_executor(
+    const Executor & ex,
+    T && t,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+

+ Associate an object of type T with an execution context's executor. +

+
template<
+    typename ExecutionContext,
+    typename T>
+executor_binder< typename decay< T >::type, typename ExecutionContext::executor_type > bind_executor(
+    ExecutionContext & ctx,
+    T && t,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/bind_executor/overload1.html b/include/asio/doc/asio/reference/bind_executor/overload1.html new file mode 100644 index 0000000..8446f6d --- /dev/null +++ b/include/asio/doc/asio/reference/bind_executor/overload1.html @@ -0,0 +1,49 @@ + + + +bind_executor (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Associate an object of type T with an executor of type Executor. +

+
template<
+    typename Executor,
+    typename T>
+executor_binder< typename decay< T >::type, Executor > bind_executor(
+    const Executor & ex,
+    T && t,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/bind_executor/overload2.html b/include/asio/doc/asio/reference/bind_executor/overload2.html new file mode 100644 index 0000000..77bb867 --- /dev/null +++ b/include/asio/doc/asio/reference/bind_executor/overload2.html @@ -0,0 +1,50 @@ + + + +bind_executor (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Associate an object of type T with an execution context's + executor. +

+
template<
+    typename ExecutionContext,
+    typename T>
+executor_binder< typename decay< T >::type, typename ExecutionContext::executor_type > bind_executor(
+    ExecutionContext & ctx,
+    T && t,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer.html b/include/asio/doc/asio/reference/buffer.html new file mode 100644 index 0000000..a4f12c8 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer.html @@ -0,0 +1,522 @@ + + + +buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+buffer +

+

+ +The asio::buffer function is used + to create a buffer object to represent raw memory, an array of POD elements, + a vector of POD elements, or a std::string. +

+

+ Create a new modifiable buffer from an existing buffer. +

+
mutable_buffer buffer(
+    const mutable_buffer & b);
+  » more...
+
+mutable_buffer buffer(
+    const mutable_buffer & b,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new non-modifiable buffer from an existing buffer. +

+
const_buffer buffer(
+    const const_buffer & b);
+  » more...
+
+const_buffer buffer(
+    const const_buffer & b,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new modifiable buffer that represents the given memory range. +

+
mutable_buffer buffer(
+    void * data,
+    std::size_t size_in_bytes);
+  » more...
+
+

+ Create a new non-modifiable buffer that represents the given memory range. +

+
const_buffer buffer(
+    const void * data,
+    std::size_t size_in_bytes);
+  » more...
+
+

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    PodType (&data)[N]);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    PodType (&data)[N],
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const PodType (&data)[N]);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const PodType (&data)[N],
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    boost::array< PodType, N > & data);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    boost::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    boost::array< const PodType, N > & data);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    boost::array< const PodType, N > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const boost::array< PodType, N > & data);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const boost::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    std::array< PodType, N > & data);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    std::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    std::array< const PodType, N > & data);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    std::array< const PodType, N > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const std::array< PodType, N > & data);
+  » more...
+
+template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const std::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new modifiable buffer that represents the given POD vector. +

+
template<
+    typename PodType,
+    typename Allocator>
+mutable_buffer buffer(
+    std::vector< PodType, Allocator > & data);
+  » more...
+
+template<
+    typename PodType,
+    typename Allocator>
+mutable_buffer buffer(
+    std::vector< PodType, Allocator > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new non-modifiable buffer that represents the given POD vector. +

+
template<
+    typename PodType,
+    typename Allocator>
+const_buffer buffer(
+    const std::vector< PodType, Allocator > & data);
+  » more...
+
+template<
+    typename PodType,
+    typename Allocator>
+const_buffer buffer(
+    const std::vector< PodType, Allocator > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+mutable_buffer buffer(
+    std::basic_string< Elem, Traits, Allocator > & data);
+  » more...
+
+template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+mutable_buffer buffer(
+    std::basic_string< Elem, Traits, Allocator > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new non-modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+const_buffer buffer(
+    const std::basic_string< Elem, Traits, Allocator > & data);
+  » more...
+
+template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+const_buffer buffer(
+    const std::basic_string< Elem, Traits, Allocator > & data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ Create a new modifiable buffer that represents the given string_view. +

+
template<
+    typename Elem,
+    typename Traits>
+const_buffer buffer(
+    basic_string_view< Elem, Traits > data);
+  » more...
+
+

+ Create a new non-modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits>
+const_buffer buffer(
+    basic_string_view< Elem, Traits > data,
+    std::size_t max_size_in_bytes);
+  » more...
+
+

+ A buffer object represents a contiguous region of memory as a 2-tuple consisting + of a pointer and size in bytes. A tuple of the form {void*, size_t} + specifies a mutable (modifiable) region of memory. Similarly, a tuple of + the form {const void*, size_t} specifies a const (non-modifiable) + region of memory. These two forms correspond to the classes mutable_buffer + and const_buffer, + respectively. To mirror C++'s conversion rules, a mutable_buffer + is implicitly convertible to a const_buffer, + and the opposite conversion is not permitted. +

+

+ The simplest use case involves reading or writing a single buffer of a specified + size: +

+
sock.send(asio::buffer(data, size));
+
+

+ In the above example, the return value of asio::buffer meets + the requirements of the ConstBufferSequence concept so that it may be directly + passed to the socket's write function. A buffer created for modifiable memory + also meets the requirements of the MutableBufferSequence concept. +

+

+ An individual buffer may be created from a builtin array, std::vector, std::array + or boost::array of POD elements. This helps prevent buffer overruns by automatically + determining the size of the buffer: +

+
char d1[128];
+size_t bytes_transferred = sock.receive(asio::buffer(d1));
+
+std::vector<char> d2(128);
+bytes_transferred = sock.receive(asio::buffer(d2));
+
+std::array<char, 128> d3;
+bytes_transferred = sock.receive(asio::buffer(d3));
+
+boost::array<char, 128> d4;
+bytes_transferred = sock.receive(asio::buffer(d4));
+
+

+ In all three cases above, the buffers created are exactly 128 bytes long. + Note that a vector is never automatically resized when + creating or using a buffer. The buffer size is determined using the vector's + size() member function, and not its capacity. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() and + size() member functions: +

+
asio::mutable_buffer b1 = ...;
+std::size_t s1 = b1.size();
+unsigned char* p1 = static_cast<unsigned char*>(b1.data());
+
+asio::const_buffer b2 = ...;
+std::size_t s2 = b2.size();
+const void* p2 = b2.data();
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+

+ For convenience, a buffer_size + function is provided that works with both buffers and buffer sequences (that + is, types meeting the ConstBufferSequence or MutableBufferSequence type requirements). + In this case, the function returns the total size of all buffers in the sequence. +

+
+ + Buffer + Copying +
+

+ The buffer_copy + function may be used to copy raw bytes between individual buffers and buffer + sequences. +

+

+ In particular, when used with the buffer_size + function, the buffer_copy + function can be used to linearise a sequence of buffers. For example: +

+
vector<const_buffer> buffers = ...;
+
+vector<unsigned char> data(asio::buffer_size(buffers));
+asio::buffer_copy(asio::buffer(data), buffers);
+
+

+ Note that buffer_copy + is implemented in terms of memcpy, and consequently it cannot + be used to copy between overlapping memory regions. +

+
+ + Buffer + Invalidation +
+

+ A buffer object does not have any ownership of the memory it refers to. It + is the responsibility of the application to ensure the memory region remains + valid until it is no longer required for an I/O operation. When the memory + is no longer available, the buffer is said to have been invalidated. +

+

+ For the asio::buffer overloads that accept an argument of type + std::vector, the buffer objects returned are invalidated by any vector operation + that also invalidates all references, pointers and iterators referring to + the elements in the sequence (C++ Std, 23.2.4) +

+

+ For the asio::buffer overloads that accept an argument of type + std::basic_string, the buffer objects returned are invalidated according + to the rules defined for invalidation of references, pointers and iterators + referring to elements of the sequence (C++ Std, 21.3). +

+
+ + Buffer + Arithmetic +
+

+ Buffer objects may be manipulated using simple arithmetic in a safe way which + helps prevent buffer overruns. Consider an array initialised as follows: +

+
boost::array<char, 6> a = { 'a', 'b', 'c', 'd', 'e' };
+
+

+ A buffer object b1 created using: +

+
b1 = asio::buffer(a);
+
+

+ represents the entire array, { 'a', 'b', 'c', 'd', 'e' }. An + optional second argument to the asio::buffer function may be + used to limit the size, in bytes, of the buffer: +

+
b2 = asio::buffer(a, 3);
+
+

+ such that b2 represents the data { 'a', 'b', 'c' }. + Even if the size argument exceeds the actual size of the array, the size + of the buffer object created will be limited to the array size. +

+

+ An offset may be applied to an existing buffer to create a new one: +

+
b3 = b1 + 2;
+
+

+ where b3 will set to represent { 'c', 'd', 'e' }. + If the offset exceeds the size of the existing buffer, the newly created + buffer will be empty. +

+

+ Both an offset and size may be specified to create a buffer that corresponds + to a specific range of bytes within an existing buffer: +

+
b4 = asio::buffer(b1 + 1, 3);
+
+

+ so that b4 will refer to the bytes { 'b', 'c', 'd' }. +

+
+ + Buffers and + Scatter-Gather I/O +
+

+ To read or write using multiple buffers (i.e. scatter-gather I/O), multiple + buffer objects may be assigned into a container that supports the MutableBufferSequence + (for read) or ConstBufferSequence (for write) concepts: +

+
char d1[128];
+std::vector<char> d2(128);
+boost::array<char, 128> d3;
+
+boost::array<mutable_buffer, 3> bufs1 = {
+  asio::buffer(d1),
+  asio::buffer(d2),
+  asio::buffer(d3) };
+bytes_transferred = sock.receive(bufs1);
+
+std::vector<const_buffer> bufs2;
+bufs2.push_back(asio::buffer(d1));
+bufs2.push_back(asio::buffer(d2));
+bufs2.push_back(asio::buffer(d3));
+bytes_transferred = sock.send(bufs2);
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload1.html b/include/asio/doc/asio/reference/buffer/overload1.html new file mode 100644 index 0000000..91885bf --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload1.html @@ -0,0 +1,51 @@ + + + +buffer (1 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer from an existing buffer. +

+
mutable_buffer buffer(
+    const mutable_buffer & b);
+
+
+ + Return + Value +
+

+ mutable_buffer(b). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload10.html b/include/asio/doc/asio/reference/buffer/overload10.html new file mode 100644 index 0000000..cd60d30 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload10.html @@ -0,0 +1,61 @@ + + + +buffer (10 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const PodType (&data)[N],
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    static_cast<const void*>(data),
+    min(N * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload11.html b/include/asio/doc/asio/reference/buffer/overload11.html new file mode 100644 index 0000000..98800eb --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload11.html @@ -0,0 +1,60 @@ + + + +buffer (11 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    boost::array< PodType, N > & data);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.data(),
+    data.size() * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload12.html b/include/asio/doc/asio/reference/buffer/overload12.html new file mode 100644 index 0000000..d8ddb0c --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload12.html @@ -0,0 +1,61 @@ + + + +buffer (12 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    boost::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.data(),
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload13.html b/include/asio/doc/asio/reference/buffer/overload13.html new file mode 100644 index 0000000..d3ee47d --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload13.html @@ -0,0 +1,60 @@ + + + +buffer (13 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    boost::array< const PodType, N > & data);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    data.size() * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload14.html b/include/asio/doc/asio/reference/buffer/overload14.html new file mode 100644 index 0000000..18579d1 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload14.html @@ -0,0 +1,61 @@ + + + +buffer (14 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    boost::array< const PodType, N > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload15.html b/include/asio/doc/asio/reference/buffer/overload15.html new file mode 100644 index 0000000..50b33a3 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload15.html @@ -0,0 +1,60 @@ + + + +buffer (15 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const boost::array< PodType, N > & data);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    data.size() * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload16.html b/include/asio/doc/asio/reference/buffer/overload16.html new file mode 100644 index 0000000..a5651ec --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload16.html @@ -0,0 +1,61 @@ + + + +buffer (16 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const boost::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload17.html b/include/asio/doc/asio/reference/buffer/overload17.html new file mode 100644 index 0000000..0750b0f --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload17.html @@ -0,0 +1,60 @@ + + + +buffer (17 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    std::array< PodType, N > & data);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.data(),
+    data.size() * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload18.html b/include/asio/doc/asio/reference/buffer/overload18.html new file mode 100644 index 0000000..fe3b8bc --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload18.html @@ -0,0 +1,61 @@ + + + +buffer (18 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    std::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.data(),
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload19.html b/include/asio/doc/asio/reference/buffer/overload19.html new file mode 100644 index 0000000..b6cee7c --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload19.html @@ -0,0 +1,60 @@ + + + +buffer (19 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    std::array< const PodType, N > & data);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    data.size() * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload2.html b/include/asio/doc/asio/reference/buffer/overload2.html new file mode 100644 index 0000000..6530287 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload2.html @@ -0,0 +1,57 @@ + + + +buffer (2 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer from an existing buffer. +

+
mutable_buffer buffer(
+    const mutable_buffer & b,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    b.data(),
+    min(b.size(), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload20.html b/include/asio/doc/asio/reference/buffer/overload20.html new file mode 100644 index 0000000..92f809a --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload20.html @@ -0,0 +1,61 @@ + + + +buffer (20 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    std::array< const PodType, N > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload21.html b/include/asio/doc/asio/reference/buffer/overload21.html new file mode 100644 index 0000000..0ffbce3 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload21.html @@ -0,0 +1,60 @@ + + + +buffer (21 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const std::array< PodType, N > & data);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    data.size() * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload22.html b/include/asio/doc/asio/reference/buffer/overload22.html new file mode 100644 index 0000000..d2ee69c --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload22.html @@ -0,0 +1,61 @@ + + + +buffer (22 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const std::array< PodType, N > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload23.html b/include/asio/doc/asio/reference/buffer/overload23.html new file mode 100644 index 0000000..bf41210 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload23.html @@ -0,0 +1,68 @@ + + + +buffer (23 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD vector. +

+
template<
+    typename PodType,
+    typename Allocator>
+mutable_buffer buffer(
+    std::vector< PodType, Allocator > & data);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.size() ? &data[0] : 0,
+    data.size() * sizeof(PodType));
+
+
+ + Remarks +
+

+ The buffer is invalidated by any vector operation that would also invalidate + iterators. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload24.html b/include/asio/doc/asio/reference/buffer/overload24.html new file mode 100644 index 0000000..6e791f2 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload24.html @@ -0,0 +1,69 @@ + + + +buffer (24 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD vector. +

+
template<
+    typename PodType,
+    typename Allocator>
+mutable_buffer buffer(
+    std::vector< PodType, Allocator > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.size() ? &data[0] : 0,
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + Remarks +
+

+ The buffer is invalidated by any vector operation that would also invalidate + iterators. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload25.html b/include/asio/doc/asio/reference/buffer/overload25.html new file mode 100644 index 0000000..7ccdaaf --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload25.html @@ -0,0 +1,68 @@ + + + +buffer (25 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD vector. +

+
template<
+    typename PodType,
+    typename Allocator>
+const_buffer buffer(
+    const std::vector< PodType, Allocator > & data);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.size() ? &data[0] : 0,
+    data.size() * sizeof(PodType));
+
+
+ + Remarks +
+

+ The buffer is invalidated by any vector operation that would also invalidate + iterators. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload26.html b/include/asio/doc/asio/reference/buffer/overload26.html new file mode 100644 index 0000000..0c1403d --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload26.html @@ -0,0 +1,69 @@ + + + +buffer (26 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD vector. +

+
template<
+    typename PodType,
+    typename Allocator>
+const_buffer buffer(
+    const std::vector< PodType, Allocator > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.size() ? &data[0] : 0,
+    min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+ + Remarks +
+

+ The buffer is invalidated by any vector operation that would also invalidate + iterators. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload27.html b/include/asio/doc/asio/reference/buffer/overload27.html new file mode 100644 index 0000000..539382c --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload27.html @@ -0,0 +1,64 @@ + + + +buffer (27 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+mutable_buffer buffer(
+    std::basic_string< Elem, Traits, Allocator > & data);
+
+
+ + Return + Value +
+

+ mutable_buffer(data.size() ? &data[0] : 0, data.size() * sizeof(Elem)). +

+
+ + Remarks +
+

+ The buffer is invalidated by any non-const operation called on the given + string object. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload28.html b/include/asio/doc/asio/reference/buffer/overload28.html new file mode 100644 index 0000000..6740927 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload28.html @@ -0,0 +1,70 @@ + + + +buffer (28 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+mutable_buffer buffer(
+    std::basic_string< Elem, Traits, Allocator > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.size() ? &data[0] : 0,
+    min(data.size() * sizeof(Elem), max_size_in_bytes));
+
+
+ + Remarks +
+

+ The buffer is invalidated by any non-const operation called on the given + string object. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload29.html b/include/asio/doc/asio/reference/buffer/overload29.html new file mode 100644 index 0000000..2a67167 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload29.html @@ -0,0 +1,64 @@ + + + +buffer (29 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+const_buffer buffer(
+    const std::basic_string< Elem, Traits, Allocator > & data);
+
+
+ + Return + Value +
+

+ const_buffer(data.data(), data.size() * sizeof(Elem)). +

+
+ + Remarks +
+

+ The buffer is invalidated by any non-const operation called on the given + string object. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload3.html b/include/asio/doc/asio/reference/buffer/overload3.html new file mode 100644 index 0000000..133f318 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload3.html @@ -0,0 +1,51 @@ + + + +buffer (3 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer from an existing buffer. +

+
const_buffer buffer(
+    const const_buffer & b);
+
+
+ + Return + Value +
+

+ const_buffer(b). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload30.html b/include/asio/doc/asio/reference/buffer/overload30.html new file mode 100644 index 0000000..5e35627 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload30.html @@ -0,0 +1,70 @@ + + + +buffer (30 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+const_buffer buffer(
+    const std::basic_string< Elem, Traits, Allocator > & data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    data.data(),
+    min(data.size() * sizeof(Elem), max_size_in_bytes));
+
+
+ + Remarks +
+

+ The buffer is invalidated by any non-const operation called on the given + string object. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload31.html b/include/asio/doc/asio/reference/buffer/overload31.html new file mode 100644 index 0000000..2697b76 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload31.html @@ -0,0 +1,55 @@ + + + +buffer (31 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given string_view. +

+
template<
+    typename Elem,
+    typename Traits>
+const_buffer buffer(
+    basic_string_view< Elem, Traits > data);
+
+
+ + Return + Value +
+

+ mutable_buffer(data.size() ? &data[0] : 0, data.size() * sizeof(Elem)). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload32.html b/include/asio/doc/asio/reference/buffer/overload32.html new file mode 100644 index 0000000..caeaf7c --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload32.html @@ -0,0 +1,61 @@ + + + +buffer (32 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits>
+const_buffer buffer(
+    basic_string_view< Elem, Traits > data,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    data.size() ? &data[0] : 0,
+    min(data.size() * sizeof(Elem), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload4.html b/include/asio/doc/asio/reference/buffer/overload4.html new file mode 100644 index 0000000..57d0d8e --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload4.html @@ -0,0 +1,57 @@ + + + +buffer (4 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer from an existing buffer. +

+
const_buffer buffer(
+    const const_buffer & b,
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    b.data(),
+    min(b.size(), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload5.html b/include/asio/doc/asio/reference/buffer/overload5.html new file mode 100644 index 0000000..c2232dc --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload5.html @@ -0,0 +1,52 @@ + + + +buffer (5 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given memory range. +

+
mutable_buffer buffer(
+    void * data,
+    std::size_t size_in_bytes);
+
+
+ + Return + Value +
+

+ mutable_buffer(data, size_in_bytes). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload6.html b/include/asio/doc/asio/reference/buffer/overload6.html new file mode 100644 index 0000000..781b561 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload6.html @@ -0,0 +1,52 @@ + + + +buffer (6 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given memory range. +

+
const_buffer buffer(
+    const void * data,
+    std::size_t size_in_bytes);
+
+
+ + Return + Value +
+

+ const_buffer(data, size_in_bytes). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload7.html b/include/asio/doc/asio/reference/buffer/overload7.html new file mode 100644 index 0000000..90ab73a --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload7.html @@ -0,0 +1,59 @@ + + + +buffer (7 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    PodType (&data)[N]);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    static_cast<void*>(data),
+    N * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload8.html b/include/asio/doc/asio/reference/buffer/overload8.html new file mode 100644 index 0000000..fdbba20 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload8.html @@ -0,0 +1,60 @@ + + + +buffer (8 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+mutable_buffer buffer(
+    PodType (&data)[N],
+    std::size_t max_size_in_bytes);
+
+
+ + Return + Value +
+

+ A mutable_buffer + value equivalent to: +

+
mutable_buffer(
+    static_cast<void*>(data),
+    min(N * sizeof(PodType), max_size_in_bytes));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer/overload9.html b/include/asio/doc/asio/reference/buffer/overload9.html new file mode 100644 index 0000000..4ce3916 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer/overload9.html @@ -0,0 +1,59 @@ + + + +buffer (9 of 32 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that represents the given POD array. +

+
template<
+    typename PodType,
+    std::size_t N>
+const_buffer buffer(
+    const PodType (&data)[N]);
+
+
+ + Return + Value +
+

+ A const_buffer + value equivalent to: +

+
const_buffer(
+    static_cast<const void*>(data),
+    N * sizeof(PodType));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_cast.html b/include/asio/doc/asio/reference/buffer_cast.html new file mode 100644 index 0000000..c44922d --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_cast.html @@ -0,0 +1,88 @@ + + + +buffer_cast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use the data() + member function.) The asio::buffer_cast function is used to + obtain a pointer to the underlying memory region associated with a buffer. +

+

+ Cast a non-modifiable buffer to a specified pointer to POD type. +

+
template<
+    typename PointerToPodType>
+PointerToPodType buffer_cast(
+    const mutable_buffer & b);
+  » more...
+
+template<
+    typename PointerToPodType>
+PointerToPodType buffer_cast(
+    const const_buffer & b);
+  » more...
+
+
+ + Examples: +
+

+ To access the memory of a non-modifiable buffer, use: +

+
asio::const_buffer b1 = ...;
+const unsigned char* p1 = asio::buffer_cast<const unsigned char*>(b1);
+
+

+ To access the memory of a modifiable buffer, use: +

+
asio::mutable_buffer b2 = ...;
+unsigned char* p2 = asio::buffer_cast<unsigned char*>(b2);
+
+

+ The asio::buffer_cast function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_cast/overload1.html b/include/asio/doc/asio/reference/buffer_cast/overload1.html new file mode 100644 index 0000000..d44c659 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_cast/overload1.html @@ -0,0 +1,46 @@ + + + +buffer_cast (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cast a non-modifiable buffer to a specified pointer to POD type. +

+
template<
+    typename PointerToPodType>
+PointerToPodType buffer_cast(
+    const mutable_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_cast/overload2.html b/include/asio/doc/asio/reference/buffer_cast/overload2.html new file mode 100644 index 0000000..287b8be --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_cast/overload2.html @@ -0,0 +1,46 @@ + + + +buffer_cast (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cast a non-modifiable buffer to a specified pointer to POD type. +

+
template<
+    typename PointerToPodType>
+PointerToPodType buffer_cast(
+    const const_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_copy.html b/include/asio/doc/asio/reference/buffer_copy.html new file mode 100644 index 0000000..c3838bc --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_copy.html @@ -0,0 +1,112 @@ + + + +buffer_copy + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The asio::buffer_copy function + is used to copy bytes from a source buffer (or buffer sequence) to a target + buffer (or buffer sequence). +

+

+ Copies bytes from a source buffer sequence to a target buffer sequence. +

+
template<
+    typename MutableBufferSequence,
+    typename ConstBufferSequence>
+std::size_t buffer_copy(
+    const MutableBufferSequence & target,
+    const ConstBufferSequence & source);
+  » more...
+
+

+ Copies a limited number of bytes from a source buffer sequence to a target + buffer sequence. +

+
template<
+    typename MutableBufferSequence,
+    typename ConstBufferSequence>
+std::size_t buffer_copy(
+    const MutableBufferSequence & target,
+    const ConstBufferSequence & source,
+    std::size_t max_bytes_to_copy);
+  » more...
+
+

+ The buffer_copy function is available in two forms: +

+
    +
  • + A 2-argument form: buffer_copy(target, source) +
  • +
  • + A 3-argument form: buffer_copy(target, source, max_bytes_to_copy) +
  • +
+

+ Both forms return the number of bytes actually copied. The number of bytes + copied is the lesser of: +

+
    +
  • + buffer_size(target) +
  • +
  • + buffer_size(source) +
  • +
  • + If specified, max_bytes_to_copy. +
  • +
+

+ This prevents buffer overflow, regardless of the buffer sizes used in the + copy operation. +

+

+ Note that buffer_copy + is implemented in terms of memcpy, and consequently it cannot + be used to copy between overlapping memory regions. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_copy/overload1.html b/include/asio/doc/asio/reference/buffer_copy/overload1.html new file mode 100644 index 0000000..fa46848 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_copy/overload1.html @@ -0,0 +1,94 @@ + + + +buffer_copy (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copies bytes from a source buffer sequence to a target buffer sequence. +

+
template<
+    typename MutableBufferSequence,
+    typename ConstBufferSequence>
+std::size_t buffer_copy(
+    const MutableBufferSequence & target,
+    const ConstBufferSequence & source);
+
+
+ + Parameters +
+
+

+
+
target
+

+ A modifiable buffer sequence representing the memory regions to which + the bytes will be copied. +

+
source
+

+ A non-modifiable buffer sequence representing the memory regions + from which the bytes will be copied. +

+
+
+
+ + Return + Value +
+

+ The number of bytes copied. +

+
+ + Remarks +
+

+ The number of bytes copied is the lesser of: +

+
    +
  • + buffer_size(target) +
  • +
  • + buffer_size(source) +
  • +
+

+ This function is implemented in terms of memcpy, and consequently + it cannot be used to copy between overlapping memory regions. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_copy/overload2.html b/include/asio/doc/asio/reference/buffer_copy/overload2.html new file mode 100644 index 0000000..720b45a --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_copy/overload2.html @@ -0,0 +1,103 @@ + + + +buffer_copy (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copies a limited number of bytes from a source buffer sequence to a target + buffer sequence. +

+
template<
+    typename MutableBufferSequence,
+    typename ConstBufferSequence>
+std::size_t buffer_copy(
+    const MutableBufferSequence & target,
+    const ConstBufferSequence & source,
+    std::size_t max_bytes_to_copy);
+
+
+ + Parameters +
+
+

+
+
target
+

+ A modifiable buffer sequence representing the memory regions to which + the bytes will be copied. +

+
source
+

+ A non-modifiable buffer sequence representing the memory regions + from which the bytes will be copied. +

+
max_bytes_to_copy
+

+ The maximum number of bytes to be copied. +

+
+
+
+ + Return + Value +
+

+ The number of bytes copied. +

+
+ + Remarks +
+

+ The number of bytes copied is the lesser of: +

+
    +
  • + buffer_size(target) +
  • +
  • + buffer_size(source) +
  • +
  • + max_bytes_to_copy +
  • +
+

+ This function is implemented in terms of memcpy, and consequently + it cannot be used to copy between overlapping memory regions. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_begin.html b/include/asio/doc/asio/reference/buffer_sequence_begin.html new file mode 100644 index 0000000..45ead62 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_begin.html @@ -0,0 +1,83 @@ + + + +buffer_sequence_begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The asio::buffer_sequence_begin + function returns an iterator pointing to the first element in a buffer sequence. +

+

+ Get an iterator to the first element in a buffer sequence. +

+
template<
+    typename MutableBuffer>
+const mutable_buffer * buffer_sequence_begin(
+    const MutableBuffer & b,
+    typename enable_if< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ConstBuffer>
+const const_buffer * buffer_sequence_begin(
+    const ConstBuffer & b,
+    typename enable_if< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type *  = 0);
+  » more...
+
+template<
+    typename C>
+auto buffer_sequence_begin(
+    C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+  » more...
+
+template<
+    typename C>
+auto buffer_sequence_begin(
+    const C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_begin/overload1.html b/include/asio/doc/asio/reference/buffer_sequence_begin/overload1.html new file mode 100644 index 0000000..fd169c6 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_begin/overload1.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_begin (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to the first element in a buffer sequence. +

+
template<
+    typename MutableBuffer>
+const mutable_buffer * buffer_sequence_begin(
+    const MutableBuffer & b,
+    typename enable_if< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_begin/overload2.html b/include/asio/doc/asio/reference/buffer_sequence_begin/overload2.html new file mode 100644 index 0000000..fe28460 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_begin/overload2.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_begin (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to the first element in a buffer sequence. +

+
template<
+    typename ConstBuffer>
+const const_buffer * buffer_sequence_begin(
+    const ConstBuffer & b,
+    typename enable_if< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_begin/overload3.html b/include/asio/doc/asio/reference/buffer_sequence_begin/overload3.html new file mode 100644 index 0000000..1757e23 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_begin/overload3.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_begin (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to the first element in a buffer sequence. +

+
template<
+    typename C>
+auto buffer_sequence_begin(
+    C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_begin/overload4.html b/include/asio/doc/asio/reference/buffer_sequence_begin/overload4.html new file mode 100644 index 0000000..314cb6a --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_begin/overload4.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_begin (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to the first element in a buffer sequence. +

+
template<
+    typename C>
+auto buffer_sequence_begin(
+    const C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_end.html b/include/asio/doc/asio/reference/buffer_sequence_end.html new file mode 100644 index 0000000..acf86b6 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_end.html @@ -0,0 +1,84 @@ + + + +buffer_sequence_end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The asio::buffer_sequence_end + function returns an iterator pointing to one past the end element in a buffer + sequence. +

+

+ Get an iterator to one past the end element in a buffer sequence. +

+
template<
+    typename MutableBuffer>
+const mutable_buffer * buffer_sequence_end(
+    const MutableBuffer & b,
+    typename enable_if< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ConstBuffer>
+const const_buffer * buffer_sequence_end(
+    const ConstBuffer & b,
+    typename enable_if< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type *  = 0);
+  » more...
+
+template<
+    typename C>
+auto buffer_sequence_end(
+    C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+  » more...
+
+template<
+    typename C>
+auto buffer_sequence_end(
+    const C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_end/overload1.html b/include/asio/doc/asio/reference/buffer_sequence_end/overload1.html new file mode 100644 index 0000000..5318728 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_end/overload1.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_end (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to one past the end element in a buffer sequence. +

+
template<
+    typename MutableBuffer>
+const mutable_buffer * buffer_sequence_end(
+    const MutableBuffer & b,
+    typename enable_if< is_convertible< const MutableBuffer *, const mutable_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_end/overload2.html b/include/asio/doc/asio/reference/buffer_sequence_end/overload2.html new file mode 100644 index 0000000..b38c1d3 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_end/overload2.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_end (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to one past the end element in a buffer sequence. +

+
template<
+    typename ConstBuffer>
+const const_buffer * buffer_sequence_end(
+    const ConstBuffer & b,
+    typename enable_if< is_convertible< const ConstBuffer *, const const_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_end/overload3.html b/include/asio/doc/asio/reference/buffer_sequence_end/overload3.html new file mode 100644 index 0000000..4ea247a --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_end/overload3.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_end (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to one past the end element in a buffer sequence. +

+
template<
+    typename C>
+auto buffer_sequence_end(
+    C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_sequence_end/overload4.html b/include/asio/doc/asio/reference/buffer_sequence_end/overload4.html new file mode 100644 index 0000000..2cf4027 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_sequence_end/overload4.html @@ -0,0 +1,47 @@ + + + +buffer_sequence_end (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get an iterator to one past the end element in a buffer sequence. +

+
template<
+    typename C>
+auto buffer_sequence_end(
+    const C & c,
+    typename enable_if< !is_convertible< const C *, const mutable_buffer * >::value &&!is_convertible< const C *, const const_buffer * >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffer_size.html b/include/asio/doc/asio/reference/buffer_size.html new file mode 100644 index 0000000..4952a00 --- /dev/null +++ b/include/asio/doc/asio/reference/buffer_size.html @@ -0,0 +1,76 @@ + + + +buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the total number of bytes in a buffer + sequence. +

+
template<
+    typename BufferSequence>
+std::size_t buffer_size(
+    const BufferSequence & b);
+
+

+ The buffer_size function determines the total size of all buffers + in the buffer sequence, as if computed as follows: +

+
size_t total_size = 0;
+auto i = asio::buffer_sequence_begin(buffers);
+auto end = asio::buffer_sequence_end(buffers);
+for (; i != end; ++i)
+{
+  const_buffer b(*i);
+  total_size += b.size();
+}
+return total_size;
+
+

+ The BufferSequence template parameter may meet either of the + ConstBufferSequence or MutableBufferSequence type + requirements. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream.html b/include/asio/doc/asio/reference/buffered_read_stream.html new file mode 100644 index 0000000..1a20ff1 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream.html @@ -0,0 +1,362 @@ + + + +buffered_read_stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adds buffering to the read-related operations of a stream. +

+
template<
+    typename Stream>
+class buffered_read_stream :
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ The type of the lowest layer. +

+
+

+ next_layer_type +

+
+

+ The type of the next layer. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_fill +

+
+

+ Start an asynchronous fill. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. The buffer into which the data will + be read must be valid for the lifetime of the asynchronous operation. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. The data being written must be valid + for the lifetime of the asynchronous operation. +

+
+

+ buffered_read_stream [constructor] +

+
+

+ Construct, passing the specified argument to initialise the next + layer. +

+
+

+ close +

+
+

+ Close the stream. +

+
+

+ fill +

+
+

+ Fill the buffer with some data. Returns the number of bytes placed + in the buffer as a result of the operation. Throws an exception + on failure.
—
Fill the buffer with some data. Returns + the number of bytes placed in the buffer as a result of the operation, + or 0 if an error occurred. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ in_avail +

+
+

+ Determine the amount of data that may be read without blocking. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ next_layer +

+
+

+ Get a reference to the next layer. +

+
+

+ peek +

+
+

+ Peek at the incoming data on the stream. Returns the number of + bytes read. Throws an exception on failure.
—
Peek + at the incoming data on the stream. Returns the number of bytes + read, or 0 if an error occurred. +

+
+

+ read_some +

+
+

+ Read some data from the stream. Returns the number of bytes read. + Throws an exception on failure.
—
Read some data from + the stream. Returns the number of bytes read or 0 if an error occurred. +

+
+

+ write_some +

+
+

+ Write the given data to the stream. Returns the number of bytes + written. Throws an exception on failure.
—
Write the + given data to the stream. Returns the number of bytes written, + or 0 if an error occurred. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ default_buffer_size [static] +

+
+

+ The default buffer size. +

+
+

+ The buffered_read_stream + class template can be used to add buffering to the synchronous and asynchronous + read operations of a stream. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/buffered_read_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/async_fill.html b/include/asio/doc/asio/reference/buffered_read_stream/async_fill.html new file mode 100644 index 0000000..a719c3c --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/async_fill.html @@ -0,0 +1,47 @@ + + + +buffered_read_stream::async_fill + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous fill. +

+
template<
+    typename ReadHandler = DEFAULT>
+DEDUCED async_fill(
+    ReadHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/async_read_some.html b/include/asio/doc/asio/reference/buffered_read_stream/async_read_some.html new file mode 100644 index 0000000..442d517 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/async_read_some.html @@ -0,0 +1,50 @@ + + + +buffered_read_stream::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. The buffer into which the data will be read must + be valid for the lifetime of the asynchronous operation. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/async_write_some.html b/include/asio/doc/asio/reference/buffered_read_stream/async_write_some.html new file mode 100644 index 0000000..64ca1dd --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/async_write_some.html @@ -0,0 +1,50 @@ + + + +buffered_read_stream::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. The data being written must be valid for the lifetime + of the asynchronous operation. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream.html b/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream.html new file mode 100644 index 0000000..86326e3 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream.html @@ -0,0 +1,55 @@ + + + +buffered_read_stream::buffered_read_stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct, + passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+explicit buffered_read_stream(
+    Arg & a);
+  » more...
+
+template<
+    typename Arg>
+buffered_read_stream(
+    Arg & a,
+    std::size_t buffer_size);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream/overload1.html new file mode 100644 index 0000000..9231716 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream/overload1.html @@ -0,0 +1,46 @@ + + + +buffered_read_stream::buffered_read_stream (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct, passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+buffered_read_stream(
+    Arg & a);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream/overload2.html new file mode 100644 index 0000000..c6c0a55 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/buffered_read_stream/overload2.html @@ -0,0 +1,47 @@ + + + +buffered_read_stream::buffered_read_stream (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct, passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+buffered_read_stream(
+    Arg & a,
+    std::size_t buffer_size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/close.html b/include/asio/doc/asio/reference/buffered_read_stream/close.html new file mode 100644 index 0000000..aa07315 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/close.html @@ -0,0 +1,49 @@ + + + +buffered_read_stream::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the stream. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/close/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/close/overload1.html new file mode 100644 index 0000000..f7b3e7a --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/close/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_read_stream::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the stream. +

+
void close();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/close/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/close/overload2.html new file mode 100644 index 0000000..7bacdf2 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/close/overload2.html @@ -0,0 +1,44 @@ + + + +buffered_read_stream::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the stream. +

+
void close(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/default_buffer_size.html b/include/asio/doc/asio/reference/buffered_read_stream/default_buffer_size.html new file mode 100644 index 0000000..c950a38 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/default_buffer_size.html @@ -0,0 +1,44 @@ + + + +buffered_read_stream::default_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + default buffer size. +

+
static const std::size_t default_buffer_size = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/executor_type.html b/include/asio/doc/asio/reference/buffered_read_stream/executor_type.html new file mode 100644 index 0000000..d00aaa1 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/executor_type.html @@ -0,0 +1,54 @@ + + + +buffered_read_stream::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef lowest_layer_type::executor_type executor_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_read_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/fill.html b/include/asio/doc/asio/reference/buffered_read_stream/fill.html new file mode 100644 index 0000000..33fce4a --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/fill.html @@ -0,0 +1,54 @@ + + + +buffered_read_stream::fill + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Fill the + buffer with some data. Returns the number of bytes placed in the buffer + as a result of the operation. Throws an exception on failure. +

+
std::size_t fill();
+  » more...
+
+

+ Fill the buffer with some data. Returns the number of bytes placed in the + buffer as a result of the operation, or 0 if an error occurred. +

+
std::size_t fill(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/fill/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/fill/overload1.html new file mode 100644 index 0000000..8bd9ca6 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/fill/overload1.html @@ -0,0 +1,44 @@ + + + +buffered_read_stream::fill (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Fill the buffer with some data. Returns the number of bytes placed in + the buffer as a result of the operation. Throws an exception on failure. +

+
std::size_t fill();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/fill/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/fill/overload2.html new file mode 100644 index 0000000..cde6d16 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/fill/overload2.html @@ -0,0 +1,45 @@ + + + +buffered_read_stream::fill (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Fill the buffer with some data. Returns the number of bytes placed in + the buffer as a result of the operation, or 0 if an error occurred. +

+
std::size_t fill(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/get_executor.html b/include/asio/doc/asio/reference/buffered_read_stream/get_executor.html new file mode 100644 index 0000000..135f9dd --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/get_executor.html @@ -0,0 +1,44 @@ + + + +buffered_read_stream::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/in_avail.html b/include/asio/doc/asio/reference/buffered_read_stream/in_avail.html new file mode 100644 index 0000000..6675100 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/in_avail.html @@ -0,0 +1,49 @@ + + + +buffered_read_stream::in_avail + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the amount of data that may be read without blocking. +

+
std::size_t in_avail();
+  » more...
+
+std::size_t in_avail(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/in_avail/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/in_avail/overload1.html new file mode 100644 index 0000000..dee5500 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/in_avail/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_read_stream::in_avail (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the amount of data that may be read without blocking. +

+
std::size_t in_avail();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/in_avail/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/in_avail/overload2.html new file mode 100644 index 0000000..b1fc631 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/in_avail/overload2.html @@ -0,0 +1,44 @@ + + + +buffered_read_stream::in_avail (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the amount of data that may be read without blocking. +

+
std::size_t in_avail(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer.html b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer.html new file mode 100644 index 0000000..7ecf889 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer.html @@ -0,0 +1,51 @@ + + + +buffered_read_stream::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer/overload1.html new file mode 100644 index 0000000..98f0e34 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_read_stream::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer/overload2.html new file mode 100644 index 0000000..dac327e --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer/overload2.html @@ -0,0 +1,43 @@ + + + +buffered_read_stream::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer_type.html b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer_type.html new file mode 100644 index 0000000..e3e8291 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/lowest_layer_type.html @@ -0,0 +1,54 @@ + + + +buffered_read_stream::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the lowest layer. +

+
typedef next_layer_type::lowest_layer_type lowest_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_read_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/next_layer.html b/include/asio/doc/asio/reference/buffered_read_stream/next_layer.html new file mode 100644 index 0000000..9a6eb15 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/next_layer.html @@ -0,0 +1,44 @@ + + + +buffered_read_stream::next_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the next layer. +

+
next_layer_type & next_layer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/next_layer_type.html b/include/asio/doc/asio/reference/buffered_read_stream/next_layer_type.html new file mode 100644 index 0000000..6a194f4 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/next_layer_type.html @@ -0,0 +1,54 @@ + + + +buffered_read_stream::next_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the next layer. +

+
typedef remove_reference< Stream >::type next_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_read_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/peek.html b/include/asio/doc/asio/reference/buffered_read_stream/peek.html new file mode 100644 index 0000000..91f7ba7 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/peek.html @@ -0,0 +1,60 @@ + + + +buffered_read_stream::peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Peek at + the incoming data on the stream. Returns the number of bytes read. Throws + an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers);
+  » more...
+
+

+ Peek at the incoming data on the stream. Returns the number of bytes read, + or 0 if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/peek/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/peek/overload1.html new file mode 100644 index 0000000..1bba45e --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/peek/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_read_stream::peek (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Peek at the incoming data on the stream. Returns the number of bytes + read. Throws an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/peek/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/peek/overload2.html new file mode 100644 index 0000000..ba0edb9 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/peek/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_read_stream::peek (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Peek at the incoming data on the stream. Returns the number of bytes + read, or 0 if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/read_some.html b/include/asio/doc/asio/reference/buffered_read_stream/read_some.html new file mode 100644 index 0000000..8560a64 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/read_some.html @@ -0,0 +1,60 @@ + + + +buffered_read_stream::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read + some data from the stream. Returns the number of bytes read. Throws an + exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+

+ Read some data from the stream. Returns the number of bytes read or 0 if + an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/read_some/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/read_some/overload1.html new file mode 100644 index 0000000..17390f7 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/read_some/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_read_stream::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. Returns the number of bytes read. Throws + an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/read_some/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/read_some/overload2.html new file mode 100644 index 0000000..84a623d --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/read_some/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_read_stream::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. Returns the number of bytes read or 0 + if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/write_some.html b/include/asio/doc/asio/reference/buffered_read_stream/write_some.html new file mode 100644 index 0000000..bd065d5 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/write_some.html @@ -0,0 +1,60 @@ + + + +buffered_read_stream::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + the given data to the stream. Returns the number of bytes written. Throws + an exception on failure. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+

+ Write the given data to the stream. Returns the number of bytes written, + or 0 if an error occurred. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/write_some/overload1.html b/include/asio/doc/asio/reference/buffered_read_stream/write_some/overload1.html new file mode 100644 index 0000000..33a6f11 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/write_some/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_read_stream::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write the given data to the stream. Returns the number of bytes written. + Throws an exception on failure. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_read_stream/write_some/overload2.html b/include/asio/doc/asio/reference/buffered_read_stream/write_some/overload2.html new file mode 100644 index 0000000..593e838 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_read_stream/write_some/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_read_stream::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write the given data to the stream. Returns the number of bytes written, + or 0 if an error occurred. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream.html b/include/asio/doc/asio/reference/buffered_stream.html new file mode 100644 index 0000000..555bc70 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream.html @@ -0,0 +1,357 @@ + + + +buffered_stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adds buffering to the read- and write-related operations of a stream. +

+
template<
+    typename Stream>
+class buffered_stream :
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ The type of the lowest layer. +

+
+

+ next_layer_type +

+
+

+ The type of the next layer. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_fill +

+
+

+ Start an asynchronous fill. +

+
+

+ async_flush +

+
+

+ Start an asynchronous flush. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. The buffer into which the data will + be read must be valid for the lifetime of the asynchronous operation. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. The data being written must be valid + for the lifetime of the asynchronous operation. +

+
+

+ buffered_stream [constructor] +

+
+

+ Construct, passing the specified argument to initialise the next + layer. +

+
+

+ close +

+
+

+ Close the stream. +

+
+

+ fill +

+
+

+ Fill the buffer with some data. Returns the number of bytes placed + in the buffer as a result of the operation. Throws an exception + on failure.
—
Fill the buffer with some data. Returns + the number of bytes placed in the buffer as a result of the operation, + or 0 if an error occurred. +

+
+

+ flush +

+
+

+ Flush all data from the buffer to the next layer. Returns the number + of bytes written to the next layer on the last write operation. + Throws an exception on failure.
—
Flush all data from + the buffer to the next layer. Returns the number of bytes written + to the next layer on the last write operation, or 0 if an error + occurred. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ in_avail +

+
+

+ Determine the amount of data that may be read without blocking. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ next_layer +

+
+

+ Get a reference to the next layer. +

+
+

+ peek +

+
+

+ Peek at the incoming data on the stream. Returns the number of + bytes read. Throws an exception on failure.
—
Peek + at the incoming data on the stream. Returns the number of bytes + read, or 0 if an error occurred. +

+
+

+ read_some +

+
+

+ Read some data from the stream. Returns the number of bytes read. + Throws an exception on failure.
—
Read some data from + the stream. Returns the number of bytes read or 0 if an error occurred. +

+
+

+ write_some +

+
+

+ Write the given data to the stream. Returns the number of bytes + written. Throws an exception on failure.
—
Write the + given data to the stream. Returns the number of bytes written, + or 0 if an error occurred. +

+
+

+ The buffered_stream + class template can be used to add buffering to the synchronous and asynchronous + read and write operations of a stream. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/buffered_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/async_fill.html b/include/asio/doc/asio/reference/buffered_stream/async_fill.html new file mode 100644 index 0000000..547d312 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/async_fill.html @@ -0,0 +1,47 @@ + + + +buffered_stream::async_fill + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous fill. +

+
template<
+    typename ReadHandler = DEFAULT>
+DEDUCED async_fill(
+    ReadHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/async_flush.html b/include/asio/doc/asio/reference/buffered_stream/async_flush.html new file mode 100644 index 0000000..398e934 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/async_flush.html @@ -0,0 +1,47 @@ + + + +buffered_stream::async_flush + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous flush. +

+
template<
+    typename WriteHandler = DEFAULT>
+DEDUCED async_flush(
+    WriteHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/async_read_some.html b/include/asio/doc/asio/reference/buffered_stream/async_read_some.html new file mode 100644 index 0000000..21e7e6d --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/async_read_some.html @@ -0,0 +1,50 @@ + + + +buffered_stream::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. The buffer into which the data will be read must + be valid for the lifetime of the asynchronous operation. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/async_write_some.html b/include/asio/doc/asio/reference/buffered_stream/async_write_some.html new file mode 100644 index 0000000..8aa1254 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/async_write_some.html @@ -0,0 +1,50 @@ + + + +buffered_stream::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. The data being written must be valid for the lifetime + of the asynchronous operation. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/buffered_stream.html b/include/asio/doc/asio/reference/buffered_stream/buffered_stream.html new file mode 100644 index 0000000..c18012a --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/buffered_stream.html @@ -0,0 +1,56 @@ + + + +buffered_stream::buffered_stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct, + passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+explicit buffered_stream(
+    Arg & a);
+  » more...
+
+template<
+    typename Arg>
+explicit buffered_stream(
+    Arg & a,
+    std::size_t read_buffer_size,
+    std::size_t write_buffer_size);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/buffered_stream/overload1.html b/include/asio/doc/asio/reference/buffered_stream/buffered_stream/overload1.html new file mode 100644 index 0000000..0c7b7e2 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/buffered_stream/overload1.html @@ -0,0 +1,46 @@ + + + +buffered_stream::buffered_stream (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct, passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+buffered_stream(
+    Arg & a);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/buffered_stream/overload2.html b/include/asio/doc/asio/reference/buffered_stream/buffered_stream/overload2.html new file mode 100644 index 0000000..29e9849 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/buffered_stream/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_stream::buffered_stream (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct, passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+buffered_stream(
+    Arg & a,
+    std::size_t read_buffer_size,
+    std::size_t write_buffer_size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/close.html b/include/asio/doc/asio/reference/buffered_stream/close.html new file mode 100644 index 0000000..6f2ea2b --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/close.html @@ -0,0 +1,48 @@ + + + +buffered_stream::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close the stream. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/close/overload1.html b/include/asio/doc/asio/reference/buffered_stream/close/overload1.html new file mode 100644 index 0000000..4373c93 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/close/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_stream::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the stream. +

+
void close();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/close/overload2.html b/include/asio/doc/asio/reference/buffered_stream/close/overload2.html new file mode 100644 index 0000000..7b50db2 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/close/overload2.html @@ -0,0 +1,44 @@ + + + +buffered_stream::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the stream. +

+
void close(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/executor_type.html b/include/asio/doc/asio/reference/buffered_stream/executor_type.html new file mode 100644 index 0000000..1f2e67f --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/executor_type.html @@ -0,0 +1,54 @@ + + + +buffered_stream::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef lowest_layer_type::executor_type executor_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/fill.html b/include/asio/doc/asio/reference/buffered_stream/fill.html new file mode 100644 index 0000000..68475fa --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/fill.html @@ -0,0 +1,54 @@ + + + +buffered_stream::fill + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Fill the buffer with + some data. Returns the number of bytes placed in the buffer as a result + of the operation. Throws an exception on failure. +

+
std::size_t fill();
+  » more...
+
+

+ Fill the buffer with some data. Returns the number of bytes placed in the + buffer as a result of the operation, or 0 if an error occurred. +

+
std::size_t fill(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/fill/overload1.html b/include/asio/doc/asio/reference/buffered_stream/fill/overload1.html new file mode 100644 index 0000000..ffccf98 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/fill/overload1.html @@ -0,0 +1,44 @@ + + + +buffered_stream::fill (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Fill the buffer with some data. Returns the number of bytes placed in + the buffer as a result of the operation. Throws an exception on failure. +

+
std::size_t fill();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/fill/overload2.html b/include/asio/doc/asio/reference/buffered_stream/fill/overload2.html new file mode 100644 index 0000000..2d2551c --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/fill/overload2.html @@ -0,0 +1,45 @@ + + + +buffered_stream::fill (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Fill the buffer with some data. Returns the number of bytes placed in + the buffer as a result of the operation, or 0 if an error occurred. +

+
std::size_t fill(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/flush.html b/include/asio/doc/asio/reference/buffered_stream/flush.html new file mode 100644 index 0000000..0c22431 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/flush.html @@ -0,0 +1,55 @@ + + + +buffered_stream::flush + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Flush all data + from the buffer to the next layer. Returns the number of bytes written + to the next layer on the last write operation. Throws an exception on failure. +

+
std::size_t flush();
+  » more...
+
+

+ Flush all data from the buffer to the next layer. Returns the number of + bytes written to the next layer on the last write operation, or 0 if an + error occurred. +

+
std::size_t flush(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/flush/overload1.html b/include/asio/doc/asio/reference/buffered_stream/flush/overload1.html new file mode 100644 index 0000000..cd39491 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/flush/overload1.html @@ -0,0 +1,45 @@ + + + +buffered_stream::flush (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Flush all data from the buffer to the next layer. Returns the number + of bytes written to the next layer on the last write operation. Throws + an exception on failure. +

+
std::size_t flush();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/flush/overload2.html b/include/asio/doc/asio/reference/buffered_stream/flush/overload2.html new file mode 100644 index 0000000..8ab4477 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/flush/overload2.html @@ -0,0 +1,46 @@ + + + +buffered_stream::flush (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Flush all data from the buffer to the next layer. Returns the number + of bytes written to the next layer on the last write operation, or 0 + if an error occurred. +

+
std::size_t flush(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/get_executor.html b/include/asio/doc/asio/reference/buffered_stream/get_executor.html new file mode 100644 index 0000000..892052e --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/get_executor.html @@ -0,0 +1,44 @@ + + + +buffered_stream::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/in_avail.html b/include/asio/doc/asio/reference/buffered_stream/in_avail.html new file mode 100644 index 0000000..b4842ad --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/in_avail.html @@ -0,0 +1,49 @@ + + + +buffered_stream::in_avail + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the amount of data that may be read without blocking. +

+
std::size_t in_avail();
+  » more...
+
+std::size_t in_avail(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/in_avail/overload1.html b/include/asio/doc/asio/reference/buffered_stream/in_avail/overload1.html new file mode 100644 index 0000000..c364c5d --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/in_avail/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_stream::in_avail (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the amount of data that may be read without blocking. +

+
std::size_t in_avail();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/in_avail/overload2.html b/include/asio/doc/asio/reference/buffered_stream/in_avail/overload2.html new file mode 100644 index 0000000..b7ab20f --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/in_avail/overload2.html @@ -0,0 +1,44 @@ + + + +buffered_stream::in_avail (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the amount of data that may be read without blocking. +

+
std::size_t in_avail(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/lowest_layer.html b/include/asio/doc/asio/reference/buffered_stream/lowest_layer.html new file mode 100644 index 0000000..b58a7af --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/lowest_layer.html @@ -0,0 +1,51 @@ + + + +buffered_stream::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/lowest_layer/overload1.html b/include/asio/doc/asio/reference/buffered_stream/lowest_layer/overload1.html new file mode 100644 index 0000000..dc3c08e --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/lowest_layer/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_stream::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/lowest_layer/overload2.html b/include/asio/doc/asio/reference/buffered_stream/lowest_layer/overload2.html new file mode 100644 index 0000000..13f0d87 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/lowest_layer/overload2.html @@ -0,0 +1,43 @@ + + + +buffered_stream::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/lowest_layer_type.html b/include/asio/doc/asio/reference/buffered_stream/lowest_layer_type.html new file mode 100644 index 0000000..16a82b4 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/lowest_layer_type.html @@ -0,0 +1,54 @@ + + + +buffered_stream::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the lowest layer. +

+
typedef next_layer_type::lowest_layer_type lowest_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/next_layer.html b/include/asio/doc/asio/reference/buffered_stream/next_layer.html new file mode 100644 index 0000000..c82b0b0 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/next_layer.html @@ -0,0 +1,44 @@ + + + +buffered_stream::next_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a + reference to the next layer. +

+
next_layer_type & next_layer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/next_layer_type.html b/include/asio/doc/asio/reference/buffered_stream/next_layer_type.html new file mode 100644 index 0000000..2433b37 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/next_layer_type.html @@ -0,0 +1,54 @@ + + + +buffered_stream::next_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the next layer. +

+
typedef remove_reference< Stream >::type next_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/peek.html b/include/asio/doc/asio/reference/buffered_stream/peek.html new file mode 100644 index 0000000..029c323 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/peek.html @@ -0,0 +1,60 @@ + + + +buffered_stream::peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Peek at the incoming + data on the stream. Returns the number of bytes read. Throws an exception + on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers);
+  » more...
+
+

+ Peek at the incoming data on the stream. Returns the number of bytes read, + or 0 if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/peek/overload1.html b/include/asio/doc/asio/reference/buffered_stream/peek/overload1.html new file mode 100644 index 0000000..8696677 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/peek/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_stream::peek (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Peek at the incoming data on the stream. Returns the number of bytes + read. Throws an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/peek/overload2.html b/include/asio/doc/asio/reference/buffered_stream/peek/overload2.html new file mode 100644 index 0000000..451a580 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/peek/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_stream::peek (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Peek at the incoming data on the stream. Returns the number of bytes + read, or 0 if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/read_some.html b/include/asio/doc/asio/reference/buffered_stream/read_some.html new file mode 100644 index 0000000..c913485 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/read_some.html @@ -0,0 +1,60 @@ + + + +buffered_stream::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read some + data from the stream. Returns the number of bytes read. Throws an exception + on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+

+ Read some data from the stream. Returns the number of bytes read or 0 if + an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/read_some/overload1.html b/include/asio/doc/asio/reference/buffered_stream/read_some/overload1.html new file mode 100644 index 0000000..c00c16a --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/read_some/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_stream::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. Returns the number of bytes read. Throws + an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/read_some/overload2.html b/include/asio/doc/asio/reference/buffered_stream/read_some/overload2.html new file mode 100644 index 0000000..c0c6695 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/read_some/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_stream::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. Returns the number of bytes read or 0 + if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/write_some.html b/include/asio/doc/asio/reference/buffered_stream/write_some.html new file mode 100644 index 0000000..01bdfca --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/write_some.html @@ -0,0 +1,60 @@ + + + +buffered_stream::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + the given data to the stream. Returns the number of bytes written. Throws + an exception on failure. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+

+ Write the given data to the stream. Returns the number of bytes written, + or 0 if an error occurred. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/write_some/overload1.html b/include/asio/doc/asio/reference/buffered_stream/write_some/overload1.html new file mode 100644 index 0000000..3bdfd45 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/write_some/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_stream::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write the given data to the stream. Returns the number of bytes written. + Throws an exception on failure. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_stream/write_some/overload2.html b/include/asio/doc/asio/reference/buffered_stream/write_some/overload2.html new file mode 100644 index 0000000..af238e2 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_stream/write_some/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_stream::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write the given data to the stream. Returns the number of bytes written, + or 0 if an error occurred. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream.html b/include/asio/doc/asio/reference/buffered_write_stream.html new file mode 100644 index 0000000..38d37c4 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream.html @@ -0,0 +1,363 @@ + + + +buffered_write_stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adds buffering to the write-related operations of a stream. +

+
template<
+    typename Stream>
+class buffered_write_stream :
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ The type of the lowest layer. +

+
+

+ next_layer_type +

+
+

+ The type of the next layer. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_flush +

+
+

+ Start an asynchronous flush. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. The buffer into which the data will + be read must be valid for the lifetime of the asynchronous operation. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. The data being written must be valid + for the lifetime of the asynchronous operation. +

+
+

+ buffered_write_stream [constructor] +

+
+

+ Construct, passing the specified argument to initialise the next + layer. +

+
+

+ close +

+
+

+ Close the stream. +

+
+

+ flush +

+
+

+ Flush all data from the buffer to the next layer. Returns the number + of bytes written to the next layer on the last write operation. + Throws an exception on failure.
—
Flush all data from + the buffer to the next layer. Returns the number of bytes written + to the next layer on the last write operation, or 0 if an error + occurred. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ in_avail +

+
+

+ Determine the amount of data that may be read without blocking. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ next_layer +

+
+

+ Get a reference to the next layer. +

+
+

+ peek +

+
+

+ Peek at the incoming data on the stream. Returns the number of + bytes read. Throws an exception on failure.
—
Peek + at the incoming data on the stream. Returns the number of bytes + read, or 0 if an error occurred. +

+
+

+ read_some +

+
+

+ Read some data from the stream. Returns the number of bytes read. + Throws an exception on failure.
—
Read some data from + the stream. Returns the number of bytes read or 0 if an error occurred. +

+
+

+ write_some +

+
+

+ Write the given data to the stream. Returns the number of bytes + written. Throws an exception on failure.
—
Write the + given data to the stream. Returns the number of bytes written, + or 0 if an error occurred and the error handler did not throw. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ default_buffer_size [static] +

+
+

+ The default buffer size. +

+
+

+ The buffered_write_stream + class template can be used to add buffering to the synchronous and asynchronous + write operations of a stream. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/buffered_write_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/async_flush.html b/include/asio/doc/asio/reference/buffered_write_stream/async_flush.html new file mode 100644 index 0000000..6e00694 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/async_flush.html @@ -0,0 +1,47 @@ + + + +buffered_write_stream::async_flush + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous flush. +

+
template<
+    typename WriteHandler = DEFAULT>
+DEDUCED async_flush(
+    WriteHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/async_read_some.html b/include/asio/doc/asio/reference/buffered_write_stream/async_read_some.html new file mode 100644 index 0000000..069fb65 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/async_read_some.html @@ -0,0 +1,50 @@ + + + +buffered_write_stream::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. The buffer into which the data will be read must + be valid for the lifetime of the asynchronous operation. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/async_write_some.html b/include/asio/doc/asio/reference/buffered_write_stream/async_write_some.html new file mode 100644 index 0000000..7f3243d --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/async_write_some.html @@ -0,0 +1,50 @@ + + + +buffered_write_stream::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. The data being written must be valid for the lifetime + of the asynchronous operation. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream.html b/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream.html new file mode 100644 index 0000000..3ea8c14 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream.html @@ -0,0 +1,55 @@ + + + +buffered_write_stream::buffered_write_stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct, + passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+explicit buffered_write_stream(
+    Arg & a);
+  » more...
+
+template<
+    typename Arg>
+buffered_write_stream(
+    Arg & a,
+    std::size_t buffer_size);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream/overload1.html new file mode 100644 index 0000000..587d33c --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream/overload1.html @@ -0,0 +1,46 @@ + + + +buffered_write_stream::buffered_write_stream (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct, passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+buffered_write_stream(
+    Arg & a);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream/overload2.html new file mode 100644 index 0000000..78a3550 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/buffered_write_stream/overload2.html @@ -0,0 +1,47 @@ + + + +buffered_write_stream::buffered_write_stream (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct, passing the specified argument to initialise the next layer. +

+
template<
+    typename Arg>
+buffered_write_stream(
+    Arg & a,
+    std::size_t buffer_size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/close.html b/include/asio/doc/asio/reference/buffered_write_stream/close.html new file mode 100644 index 0000000..da65d35 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/close.html @@ -0,0 +1,49 @@ + + + +buffered_write_stream::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the stream. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/close/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/close/overload1.html new file mode 100644 index 0000000..17be159 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/close/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_write_stream::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the stream. +

+
void close();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/close/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/close/overload2.html new file mode 100644 index 0000000..0c0ac42 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/close/overload2.html @@ -0,0 +1,44 @@ + + + +buffered_write_stream::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the stream. +

+
void close(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/default_buffer_size.html b/include/asio/doc/asio/reference/buffered_write_stream/default_buffer_size.html new file mode 100644 index 0000000..82e2f4b --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/default_buffer_size.html @@ -0,0 +1,44 @@ + + + +buffered_write_stream::default_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + default buffer size. +

+
static const std::size_t default_buffer_size = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/executor_type.html b/include/asio/doc/asio/reference/buffered_write_stream/executor_type.html new file mode 100644 index 0000000..b558893 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/executor_type.html @@ -0,0 +1,54 @@ + + + +buffered_write_stream::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef lowest_layer_type::executor_type executor_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_write_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/flush.html b/include/asio/doc/asio/reference/buffered_write_stream/flush.html new file mode 100644 index 0000000..62da88f --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/flush.html @@ -0,0 +1,56 @@ + + + +buffered_write_stream::flush + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Flush + all data from the buffer to the next layer. Returns the number of bytes + written to the next layer on the last write operation. Throws an exception + on failure. +

+
std::size_t flush();
+  » more...
+
+

+ Flush all data from the buffer to the next layer. Returns the number of + bytes written to the next layer on the last write operation, or 0 if an + error occurred. +

+
std::size_t flush(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/flush/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/flush/overload1.html new file mode 100644 index 0000000..610039a --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/flush/overload1.html @@ -0,0 +1,45 @@ + + + +buffered_write_stream::flush (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Flush all data from the buffer to the next layer. Returns the number + of bytes written to the next layer on the last write operation. Throws + an exception on failure. +

+
std::size_t flush();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/flush/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/flush/overload2.html new file mode 100644 index 0000000..b52efdd --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/flush/overload2.html @@ -0,0 +1,46 @@ + + + +buffered_write_stream::flush (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Flush all data from the buffer to the next layer. Returns the number + of bytes written to the next layer on the last write operation, or 0 + if an error occurred. +

+
std::size_t flush(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/get_executor.html b/include/asio/doc/asio/reference/buffered_write_stream/get_executor.html new file mode 100644 index 0000000..8983da4 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/get_executor.html @@ -0,0 +1,44 @@ + + + +buffered_write_stream::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/in_avail.html b/include/asio/doc/asio/reference/buffered_write_stream/in_avail.html new file mode 100644 index 0000000..0976e3f --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/in_avail.html @@ -0,0 +1,49 @@ + + + +buffered_write_stream::in_avail + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the amount of data that may be read without blocking. +

+
std::size_t in_avail();
+  » more...
+
+std::size_t in_avail(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/in_avail/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/in_avail/overload1.html new file mode 100644 index 0000000..b116a1f --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/in_avail/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_write_stream::in_avail (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the amount of data that may be read without blocking. +

+
std::size_t in_avail();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/in_avail/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/in_avail/overload2.html new file mode 100644 index 0000000..a82a8bd --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/in_avail/overload2.html @@ -0,0 +1,44 @@ + + + +buffered_write_stream::in_avail (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Determine the amount of data that may be read without blocking. +

+
std::size_t in_avail(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer.html b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer.html new file mode 100644 index 0000000..51ba873 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer.html @@ -0,0 +1,51 @@ + + + +buffered_write_stream::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer/overload1.html new file mode 100644 index 0000000..7101fe0 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer/overload1.html @@ -0,0 +1,43 @@ + + + +buffered_write_stream::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer/overload2.html new file mode 100644 index 0000000..85ecb38 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer/overload2.html @@ -0,0 +1,43 @@ + + + +buffered_write_stream::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer_type.html b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer_type.html new file mode 100644 index 0000000..b06d2d8 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/lowest_layer_type.html @@ -0,0 +1,54 @@ + + + +buffered_write_stream::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the lowest layer. +

+
typedef next_layer_type::lowest_layer_type lowest_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_write_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/next_layer.html b/include/asio/doc/asio/reference/buffered_write_stream/next_layer.html new file mode 100644 index 0000000..8d7efc9 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/next_layer.html @@ -0,0 +1,44 @@ + + + +buffered_write_stream::next_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the next layer. +

+
next_layer_type & next_layer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/next_layer_type.html b/include/asio/doc/asio/reference/buffered_write_stream/next_layer_type.html new file mode 100644 index 0000000..f64facb --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/next_layer_type.html @@ -0,0 +1,54 @@ + + + +buffered_write_stream::next_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the next layer. +

+
typedef remove_reference< Stream >::type next_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/buffered_write_stream.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/peek.html b/include/asio/doc/asio/reference/buffered_write_stream/peek.html new file mode 100644 index 0000000..42304ba --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/peek.html @@ -0,0 +1,60 @@ + + + +buffered_write_stream::peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Peek + at the incoming data on the stream. Returns the number of bytes read. Throws + an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers);
+  » more...
+
+

+ Peek at the incoming data on the stream. Returns the number of bytes read, + or 0 if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/peek/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/peek/overload1.html new file mode 100644 index 0000000..98b440e --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/peek/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_write_stream::peek (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Peek at the incoming data on the stream. Returns the number of bytes + read. Throws an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/peek/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/peek/overload2.html new file mode 100644 index 0000000..7f1d46c --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/peek/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_write_stream::peek (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Peek at the incoming data on the stream. Returns the number of bytes + read, or 0 if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t peek(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/read_some.html b/include/asio/doc/asio/reference/buffered_write_stream/read_some.html new file mode 100644 index 0000000..94c7d58 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/read_some.html @@ -0,0 +1,60 @@ + + + +buffered_write_stream::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read + some data from the stream. Returns the number of bytes read. Throws an + exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+

+ Read some data from the stream. Returns the number of bytes read or 0 if + an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/read_some/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/read_some/overload1.html new file mode 100644 index 0000000..e811e0d --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/read_some/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_write_stream::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. Returns the number of bytes read. Throws + an exception on failure. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/read_some/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/read_some/overload2.html new file mode 100644 index 0000000..288fa98 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/read_some/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_write_stream::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. Returns the number of bytes read or 0 + if an error occurred. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/write_some.html b/include/asio/doc/asio/reference/buffered_write_stream/write_some.html new file mode 100644 index 0000000..cf848f5 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/write_some.html @@ -0,0 +1,60 @@ + + + +buffered_write_stream::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + the given data to the stream. Returns the number of bytes written. Throws + an exception on failure. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+

+ Write the given data to the stream. Returns the number of bytes written, + or 0 if an error occurred and the error handler did not throw. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/write_some/overload1.html b/include/asio/doc/asio/reference/buffered_write_stream/write_some/overload1.html new file mode 100644 index 0000000..5990837 --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/write_some/overload1.html @@ -0,0 +1,47 @@ + + + +buffered_write_stream::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write the given data to the stream. Returns the number of bytes written. + Throws an exception on failure. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffered_write_stream/write_some/overload2.html b/include/asio/doc/asio/reference/buffered_write_stream/write_some/overload2.html new file mode 100644 index 0000000..fd17afd --- /dev/null +++ b/include/asio/doc/asio/reference/buffered_write_stream/write_some/overload2.html @@ -0,0 +1,48 @@ + + + +buffered_write_stream::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write the given data to the stream. Returns the number of bytes written, + or 0 if an error occurred and the error handler did not throw. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_begin.html b/include/asio/doc/asio/reference/buffers_begin.html new file mode 100644 index 0000000..7a08444 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_begin.html @@ -0,0 +1,57 @@ + + + +buffers_begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an iterator representing + the beginning of the buffers' data. +

+
template<
+    typename BufferSequence>
+buffers_iterator< BufferSequence > buffers_begin(
+    const BufferSequence & buffers);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_end.html b/include/asio/doc/asio/reference/buffers_end.html new file mode 100644 index 0000000..54169f5 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_end.html @@ -0,0 +1,57 @@ + + + +buffers_end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an iterator representing the + end of the buffers' data. +

+
template<
+    typename BufferSequence>
+buffers_iterator< BufferSequence > buffers_end(
+    const BufferSequence & buffers);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator.html b/include/asio/doc/asio/reference/buffers_iterator.html new file mode 100644 index 0000000..551baa1 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator.html @@ -0,0 +1,406 @@ + + + +buffers_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A random access iterator over the bytes in a buffer sequence. +

+
template<
+    typename BufferSequence,
+    typename ByteType = char>
+class buffers_iterator
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ The type used for the distance between two iterators. +

+
+

+ iterator_category +

+
+

+ The iterator category. +

+
+

+ pointer +

+
+

+ The type of the result of applying operator->() to the iterator. +

+
+

+ reference +

+
+

+ The type of the result of applying operator*() to the iterator. +

+
+

+ value_type +

+
+

+ The type of the value pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ begin [static] +

+
+

+ Construct an iterator representing the beginning of the buffers' + data. +

+
+

+ buffers_iterator [constructor] +

+
+

+ Default constructor. Creates an iterator in an undefined state. +

+
+

+ end + [static] +

+
+

+ Construct an iterator representing the end of the buffers' data. +

+
+

+ operator * +

+
+

+ Dereference an iterator. +

+
+

+ operator++ +

+
+

+ Increment operator (prefix).
—
Increment operator (postfix). +

+
+

+ operator+= +

+
+

+ Addition operator. +

+
+

+ operator-- +

+
+

+ Decrement operator (prefix).
—
Decrement operator (postfix). +

+
+

+ operator-= +

+
+

+ Subtraction operator. +

+
+

+ operator-> +

+
+

+ Dereference an iterator. +

+
+

+ operator[] +

+
+

+ Access an individual element. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Test two iterators for inequality. +

+
+

+ operator+ +

+
+

+ Addition operator. +

+
+

+ operator- +

+
+

+ Subtraction operator. +

+
+

+ operator< +

+
+

+ Compare two iterators. +

+
+

+ operator<= +

+
+

+ Compare two iterators. +

+
+

+ operator== +

+
+

+ Test two iterators for equality. +

+
+

+ operator> +

+
+

+ Compare two iterators. +

+
+

+ operator>= +

+
+

+ Compare two iterators. +

+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/begin.html b/include/asio/doc/asio/reference/buffers_iterator/begin.html new file mode 100644 index 0000000..45e3b5a --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/begin.html @@ -0,0 +1,45 @@ + + + +buffers_iterator::begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an + iterator representing the beginning of the buffers' data. +

+
static buffers_iterator begin(
+    const BufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/buffers_iterator.html b/include/asio/doc/asio/reference/buffers_iterator/buffers_iterator.html new file mode 100644 index 0000000..94999c5 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/buffers_iterator.html @@ -0,0 +1,44 @@ + + + +buffers_iterator::buffers_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. Creates an iterator in an undefined state. +

+
buffers_iterator();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/difference_type.html b/include/asio/doc/asio/reference/buffers_iterator/difference_type.html new file mode 100644 index 0000000..4b85ae6 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/difference_type.html @@ -0,0 +1,54 @@ + + + +buffers_iterator::difference_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used for the distance between two iterators. +

+
typedef std::ptrdiff_t difference_type;
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/end.html b/include/asio/doc/asio/reference/buffers_iterator/end.html new file mode 100644 index 0000000..7d3ec34 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/end.html @@ -0,0 +1,45 @@ + + + +buffers_iterator::end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an iterator + representing the end of the buffers' data. +

+
static buffers_iterator end(
+    const BufferSequence & buffers);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/iterator_category.html b/include/asio/doc/asio/reference/buffers_iterator/iterator_category.html new file mode 100644 index 0000000..9c0f03d --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/iterator_category.html @@ -0,0 +1,54 @@ + + + +buffers_iterator::iterator_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + iterator category. +

+
typedef std::random_access_iterator_tag iterator_category;
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator__star_.html b/include/asio/doc/asio/reference/buffers_iterator/operator__star_.html new file mode 100644 index 0000000..1f118e0 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator__star_.html @@ -0,0 +1,45 @@ + + + +buffers_iterator::operator * + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference + an iterator. +

+
reference operator *() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_arrow_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_arrow_.html new file mode 100644 index 0000000..c643736 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_arrow_.html @@ -0,0 +1,44 @@ + + + +buffers_iterator::operator-> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference + an iterator. +

+
pointer operator->() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_eq__eq_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_eq__eq_.html new file mode 100644 index 0000000..82b1e0e --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +buffers_iterator::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + two iterators for equality. +

+
friend bool operator==(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_gt_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_gt_.html new file mode 100644 index 0000000..2d996b9 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_gt_.html @@ -0,0 +1,56 @@ + + + +buffers_iterator::operator> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two iterators. +

+
friend bool operator>(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_gt__eq_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_gt__eq_.html new file mode 100644 index 0000000..dfefb8b --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_gt__eq_.html @@ -0,0 +1,56 @@ + + + +buffers_iterator::operator>= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two iterators. +

+
friend bool operator>=(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_lb__rb_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_lb__rb_.html new file mode 100644 index 0000000..66d1144 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_lb__rb_.html @@ -0,0 +1,45 @@ + + + +buffers_iterator::operator[] + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Access + an individual element. +

+
reference operator[](
+    std::ptrdiff_t difference) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_lt_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_lt_.html new file mode 100644 index 0000000..4005646 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_lt_.html @@ -0,0 +1,56 @@ + + + +buffers_iterator::operator< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two iterators. +

+
friend bool operator<(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_lt__eq_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_lt__eq_.html new file mode 100644 index 0000000..f5f45ca --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_lt__eq_.html @@ -0,0 +1,56 @@ + + + +buffers_iterator::operator<= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two iterators. +

+
friend bool operator<=(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_minus_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_minus_.html new file mode 100644 index 0000000..7cc4ff4 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_minus_.html @@ -0,0 +1,52 @@ + + + +buffers_iterator::operator- + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Subtraction + operator. +

+
friend buffers_iterator operator-(
+    const buffers_iterator & iter,
+    std::ptrdiff_t difference);
+  » more...
+
+friend std::ptrdiff_t operator-(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_minus_/overload1.html b/include/asio/doc/asio/reference/buffers_iterator/operator_minus_/overload1.html new file mode 100644 index 0000000..1aee7bb --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_minus_/overload1.html @@ -0,0 +1,55 @@ + + + +buffers_iterator::operator- (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Subtraction operator. +

+
friend buffers_iterator operator-(
+    const buffers_iterator & iter,
+    std::ptrdiff_t difference);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_minus_/overload2.html b/include/asio/doc/asio/reference/buffers_iterator/operator_minus_/overload2.html new file mode 100644 index 0000000..d9d2b5c --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_minus_/overload2.html @@ -0,0 +1,55 @@ + + + +buffers_iterator::operator- (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Subtraction operator. +

+
friend std::ptrdiff_t operator-(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_minus__eq_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__eq_.html new file mode 100644 index 0000000..6860ee2 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__eq_.html @@ -0,0 +1,45 @@ + + + +buffers_iterator::operator-= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Subtraction + operator. +

+
buffers_iterator & operator-=(
+    std::ptrdiff_t difference);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_.html new file mode 100644 index 0000000..f1173e6 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_.html @@ -0,0 +1,52 @@ + + + +buffers_iterator::operator-- + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Decrement + operator (prefix). +

+
buffers_iterator & operator--();
+  » more...
+
+

+ Decrement operator (postfix). +

+
buffers_iterator operator--(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_/overload1.html b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_/overload1.html new file mode 100644 index 0000000..cb1905d --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_/overload1.html @@ -0,0 +1,43 @@ + + + +buffers_iterator::operator-- (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Decrement operator (prefix). +

+
buffers_iterator & operator--();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_/overload2.html b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_/overload2.html new file mode 100644 index 0000000..935c18d --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_minus__minus_/overload2.html @@ -0,0 +1,44 @@ + + + +buffers_iterator::operator-- (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Decrement operator (postfix). +

+
buffers_iterator operator--(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_not__eq_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_not__eq_.html new file mode 100644 index 0000000..3cb2a02 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +buffers_iterator::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + two iterators for inequality. +

+
friend bool operator!=(
+    const buffers_iterator & a,
+    const buffers_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_plus_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_plus_.html new file mode 100644 index 0000000..16cd171 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_plus_.html @@ -0,0 +1,52 @@ + + + +buffers_iterator::operator+ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Addition + operator. +

+
friend buffers_iterator operator+(
+    const buffers_iterator & iter,
+    std::ptrdiff_t difference);
+  » more...
+
+friend buffers_iterator operator+(
+    std::ptrdiff_t difference,
+    const buffers_iterator & iter);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_plus_/overload1.html b/include/asio/doc/asio/reference/buffers_iterator/operator_plus_/overload1.html new file mode 100644 index 0000000..519ae2d --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_plus_/overload1.html @@ -0,0 +1,55 @@ + + + +buffers_iterator::operator+ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Addition operator. +

+
friend buffers_iterator operator+(
+    const buffers_iterator & iter,
+    std::ptrdiff_t difference);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_plus_/overload2.html b/include/asio/doc/asio/reference/buffers_iterator/operator_plus_/overload2.html new file mode 100644 index 0000000..86bbd43 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_plus_/overload2.html @@ -0,0 +1,55 @@ + + + +buffers_iterator::operator+ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Addition operator. +

+
friend buffers_iterator operator+(
+    std::ptrdiff_t difference,
+    const buffers_iterator & iter);
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_plus__eq_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__eq_.html new file mode 100644 index 0000000..b67157b --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__eq_.html @@ -0,0 +1,45 @@ + + + +buffers_iterator::operator+= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Addition + operator. +

+
buffers_iterator & operator+=(
+    std::ptrdiff_t difference);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_.html b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_.html new file mode 100644 index 0000000..c2592c2 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_.html @@ -0,0 +1,52 @@ + + + +buffers_iterator::operator++ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Increment + operator (prefix). +

+
buffers_iterator & operator++();
+  » more...
+
+

+ Increment operator (postfix). +

+
buffers_iterator operator++(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_/overload1.html b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_/overload1.html new file mode 100644 index 0000000..908e9a7 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_/overload1.html @@ -0,0 +1,43 @@ + + + +buffers_iterator::operator++ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Increment operator (prefix). +

+
buffers_iterator & operator++();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_/overload2.html b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_/overload2.html new file mode 100644 index 0000000..5da8f77 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/operator_plus__plus_/overload2.html @@ -0,0 +1,44 @@ + + + +buffers_iterator::operator++ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Increment operator (postfix). +

+
buffers_iterator operator++(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/pointer.html b/include/asio/doc/asio/reference/buffers_iterator/pointer.html new file mode 100644 index 0000000..5f753cb --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/pointer.html @@ -0,0 +1,59 @@ + + + +buffers_iterator::pointer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + of the result of applying operator->() to the iterator. +

+
typedef const_or_non_const_ByteType * pointer;
+
+

+ If the buffer sequence stores buffer objects that are convertible to mutable_buffer, + this is a pointer to a non-const ByteType. Otherwise, a pointer to a const + ByteType. +

+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/reference.html b/include/asio/doc/asio/reference/buffers_iterator/reference.html new file mode 100644 index 0000000..c29ec04 --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/reference.html @@ -0,0 +1,59 @@ + + + +buffers_iterator::reference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + of the result of applying operator*() to the iterator. +

+
typedef const_or_non_const_ByteType & reference;
+
+

+ If the buffer sequence stores buffer objects that are convertible to mutable_buffer, + this is a reference to a non-const ByteType. Otherwise, a reference to + a const ByteType. +

+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/buffers_iterator/value_type.html b/include/asio/doc/asio/reference/buffers_iterator/value_type.html new file mode 100644 index 0000000..d8144da --- /dev/null +++ b/include/asio/doc/asio/reference/buffers_iterator/value_type.html @@ -0,0 +1,54 @@ + + + +buffers_iterator::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the value pointed to by the iterator. +

+
typedef ByteType value_type;
+
+
+ + Requirements +
+

+ Header: asio/buffers_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/can_prefer.html b/include/asio/doc/asio/reference/can_prefer.html new file mode 100644 index 0000000..9b401da --- /dev/null +++ b/include/asio/doc/asio/reference/can_prefer.html @@ -0,0 +1,61 @@ + + + +can_prefer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a prefer expression is + well-formed. +

+
template<
+    typename T,
+    typename... Properties>
+struct can_prefer
+
+

+ Class template can_prefer is a trait that is derived from true_type + if the expression asio::prefer(std::declval<T>(), std::declval<Properties>()...) + is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/prefer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/can_query.html b/include/asio/doc/asio/reference/can_query.html new file mode 100644 index 0000000..e0f922a --- /dev/null +++ b/include/asio/doc/asio/reference/can_query.html @@ -0,0 +1,60 @@ + + + +can_query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a query expression is well-formed. +

+
template<
+    typename T,
+    typename Property>
+struct can_query
+
+

+ Class template can_query is a trait that is derived from true_type + if the expression asio::query(std::declval<T>(), std::declval<Property>()) + is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/can_require.html b/include/asio/doc/asio/reference/can_require.html new file mode 100644 index 0000000..13665d2 --- /dev/null +++ b/include/asio/doc/asio/reference/can_require.html @@ -0,0 +1,61 @@ + + + +can_require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a require expression is + well-formed. +

+
template<
+    typename T,
+    typename... Properties>
+struct can_require
+
+

+ Class template can_require is a trait that is derived from + true_type if the expression asio::require(std::declval<T>(), + std::declval<Properties>()...) is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/require.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/can_require_concept.html b/include/asio/doc/asio/reference/can_require_concept.html new file mode 100644 index 0000000..48c500a --- /dev/null +++ b/include/asio/doc/asio/reference/can_require_concept.html @@ -0,0 +1,61 @@ + + + +can_require_concept + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a require_concept expression + is well-formed. +

+
template<
+    typename T,
+    typename Property>
+struct can_require_concept
+
+

+ Class template can_require_concept is a trait that is derived + from true_type if the expression asio::require_concept(std::declval<T>(), + std::declval<Property>()) is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/require_concept.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/co_spawn.html b/include/asio/doc/asio/reference/co_spawn.html new file mode 100644 index 0000000..b808b07 --- /dev/null +++ b/include/asio/doc/asio/reference/co_spawn.html @@ -0,0 +1,119 @@ + + + +co_spawn + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Spawn a new coroutined-based thread of execution. +

+
template<
+    typename Executor,
+    typename T,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    const Executor & ex,
+    awaitable< T, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Executor,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    const Executor & ex,
+    awaitable< void, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename T,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    ExecutionContext & ctx,
+    awaitable< T, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    ExecutionContext & ctx,
+    awaitable< void, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Executor,
+    typename F,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    const Executor & ex,
+    F && f,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename F,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    ExecutionContext & ctx,
+    F && f,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/co_spawn.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/co_spawn/overload1.html b/include/asio/doc/asio/reference/co_spawn/overload1.html new file mode 100644 index 0000000..49c09ad --- /dev/null +++ b/include/asio/doc/asio/reference/co_spawn/overload1.html @@ -0,0 +1,121 @@ + + + +co_spawn (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Spawn a new coroutined-based thread of execution. +

+
template<
+    typename Executor,
+    typename T,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    const Executor & ex,
+    awaitable< T, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type *  = 0);
+
+
+ + Parameters +
+
+

+
+
ex
+

+ The executor that will be used to schedule the new thread of execution. +

+
a
+

+ The awaitable + object that is the result of calling the coroutine's entry point + function. +

+
token
+
+

+ The completion token that will handle the notification that the thread + of execution has completed. The function signature of the completion + handler must be: +

+
void handler(std::exception_ptr, T);
+
+

+

+
+
+
+
+ + Example +
+
asio::awaitable<std::size_t> echo(tcp::socket socket)
+{
+  std::size_t bytes_transferred = 0;
+
+  try
+  {
+    char data[1024];
+    for (;;)
+    {
+      std::size_t n = co_await socket.async_read_some(
+          asio::buffer(data), asio::use_awaitable);
+
+      co_await asio::async_write(socket,
+          asio::buffer(data, n), asio::use_awaitable);
+
+      bytes_transferred += n;
+    }
+  }
+  catch (const std::exception&)
+  {
+  }
+
+  co_return bytes_transferred;
+}
+
+// ...
+
+asio::co_spawn(my_executor,
+  echo(std::move(my_tcp_socket)),
+  [](std::exception_ptr e, std::size_t n)
+  {
+    std::cout << "transferred " << n << "\n";
+  });
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/co_spawn/overload2.html b/include/asio/doc/asio/reference/co_spawn/overload2.html new file mode 100644 index 0000000..a06bbc3 --- /dev/null +++ b/include/asio/doc/asio/reference/co_spawn/overload2.html @@ -0,0 +1,112 @@ + + + +co_spawn (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Spawn a new coroutined-based thread of execution. +

+
template<
+    typename Executor,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    const Executor & ex,
+    awaitable< void, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< (is_executor< Executor >::value||execution::is_executor< Executor >::value)&&is_convertible< Executor, AwaitableExecutor >::value >::type *  = 0);
+
+
+ + Parameters +
+
+

+
+
ex
+

+ The executor that will be used to schedule the new thread of execution. +

+
a
+

+ The awaitable + object that is the result of calling the coroutine's entry point + function. +

+
token
+
+

+ The completion token that will handle the notification that the thread + of execution has completed. The function signature of the completion + handler must be: +

+
void handler(std::exception_ptr);
+
+

+

+
+
+
+
+ + Example +
+
asio::awaitable<void> echo(tcp::socket socket)
+{
+  try
+  {
+    char data[1024];
+    for (;;)
+    {
+      std::size_t n = co_await socket.async_read_some(
+          asio::buffer(data), asio::use_awaitable);
+
+      co_await asio::async_write(socket,
+          asio::buffer(data, n), asio::use_awaitable);
+    }
+  }
+  catch (const std::exception& e)
+  {
+    std::cerr << "Exception: " << e.what() << "\n";
+  }
+}
+
+// ...
+
+asio::co_spawn(my_executor,
+  echo(std::move(my_tcp_socket)),
+  asio::detached);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/co_spawn/overload3.html b/include/asio/doc/asio/reference/co_spawn/overload3.html new file mode 100644 index 0000000..4832a31 --- /dev/null +++ b/include/asio/doc/asio/reference/co_spawn/overload3.html @@ -0,0 +1,122 @@ + + + +co_spawn (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Spawn a new coroutined-based thread of execution. +

+
template<
+    typename ExecutionContext,
+    typename T,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    ExecutionContext & ctx,
+    awaitable< T, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type *  = 0);
+
+
+ + Parameters +
+
+

+
+
ctx
+

+ An execution context that will provide the executor to be used to + schedule the new thread of execution. +

+
a
+

+ The awaitable + object that is the result of calling the coroutine's entry point + function. +

+
token
+
+

+ The completion token that will handle the notification that the thread + of execution has completed. The function signature of the completion + handler must be: +

+
void handler(std::exception_ptr);
+
+

+

+
+
+
+
+ + Example +
+
asio::awaitable<std::size_t> echo(tcp::socket socket)
+{
+  std::size_t bytes_transferred = 0;
+
+  try
+  {
+    char data[1024];
+    for (;;)
+    {
+      std::size_t n = co_await socket.async_read_some(
+          asio::buffer(data), asio::use_awaitable);
+
+      co_await asio::async_write(socket,
+          asio::buffer(data, n), asio::use_awaitable);
+
+      bytes_transferred += n;
+    }
+  }
+  catch (const std::exception&)
+  {
+  }
+
+  co_return bytes_transferred;
+}
+
+// ...
+
+asio::co_spawn(my_io_context,
+  echo(std::move(my_tcp_socket)),
+  [](std::exception_ptr e, std::size_t n)
+  {
+    std::cout << "transferred " << n << "\n";
+  });
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/co_spawn/overload4.html b/include/asio/doc/asio/reference/co_spawn/overload4.html new file mode 100644 index 0000000..0261b3e --- /dev/null +++ b/include/asio/doc/asio/reference/co_spawn/overload4.html @@ -0,0 +1,113 @@ + + + +co_spawn (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Spawn a new coroutined-based thread of execution. +

+
template<
+    typename ExecutionContext,
+    typename AwaitableExecutor,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    ExecutionContext & ctx,
+    awaitable< void, AwaitableExecutor > a,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value &&is_convertible< typename ExecutionContext::executor_type, AwaitableExecutor >::value >::type *  = 0);
+
+
+ + Parameters +
+
+

+
+
ctx
+

+ An execution context that will provide the executor to be used to + schedule the new thread of execution. +

+
a
+

+ The awaitable + object that is the result of calling the coroutine's entry point + function. +

+
token
+
+

+ The completion token that will handle the notification that the thread + of execution has completed. The function signature of the completion + handler must be: +

+
void handler(std::exception_ptr);
+
+

+

+
+
+
+
+ + Example +
+
asio::awaitable<void> echo(tcp::socket socket)
+{
+  try
+  {
+    char data[1024];
+    for (;;)
+    {
+      std::size_t n = co_await socket.async_read_some(
+          asio::buffer(data), asio::use_awaitable);
+
+      co_await asio::async_write(socket,
+          asio::buffer(data, n), asio::use_awaitable);
+    }
+  }
+  catch (const std::exception& e)
+  {
+    std::cerr << "Exception: " << e.what() << "\n";
+  }
+}
+
+// ...
+
+asio::co_spawn(my_io_context,
+  echo(std::move(my_tcp_socket)),
+  asio::detached);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/co_spawn/overload5.html b/include/asio/doc/asio/reference/co_spawn/overload5.html new file mode 100644 index 0000000..e299cde --- /dev/null +++ b/include/asio/doc/asio/reference/co_spawn/overload5.html @@ -0,0 +1,135 @@ + + + +co_spawn (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Spawn a new coroutined-based thread of execution. +

+
template<
+    typename Executor,
+    typename F,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    const Executor & ex,
+    F && f,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+
+
+ + Parameters +
+
+

+
+
ex
+

+ The executor that will be used to schedule the new thread of execution. +

+
f
+

+ A nullary function object with a return type of the form asio::awaitable<R,E> + that will be used as the coroutine's entry point. +

+
token
+

+ The completion token that will handle the notification that the thread + of execution has completed. If R is void, + the function signature of the completion handler must be: +

+
+
+
void handler(std::exception_ptr);
+
+

+ Otherwise, the function signature of the completion handler must be: +

+
void handler(std::exception_ptr, R);
+
+
+ + Example +
+
asio::awaitable<std::size_t> echo(tcp::socket socket)
+{
+  std::size_t bytes_transferred = 0;
+
+  try
+  {
+    char data[1024];
+    for (;;)
+    {
+      std::size_t n = co_await socket.async_read_some(
+          asio::buffer(data), asio::use_awaitable);
+
+      co_await asio::async_write(socket,
+          asio::buffer(data, n), asio::use_awaitable);
+
+      bytes_transferred += n;
+    }
+  }
+  catch (const std::exception&)
+  {
+  }
+
+  co_return bytes_transferred;
+}
+
+// ...
+
+asio::co_spawn(my_executor,
+  [socket = std::move(my_tcp_socket)]() mutable
+    -> asio::awaitable<void>
+  {
+    try
+    {
+      char data[1024];
+      for (;;)
+      {
+        std::size_t n = co_await socket.async_read_some(
+            asio::buffer(data), asio::use_awaitable);
+
+        co_await asio::async_write(socket,
+            asio::buffer(data, n), asio::use_awaitable);
+      }
+    }
+    catch (const std::exception& e)
+    {
+      std::cerr << "Exception: " << e.what() << "\n";
+    }
+  }, asio::detached);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/co_spawn/overload6.html b/include/asio/doc/asio/reference/co_spawn/overload6.html new file mode 100644 index 0000000..475766e --- /dev/null +++ b/include/asio/doc/asio/reference/co_spawn/overload6.html @@ -0,0 +1,136 @@ + + + +co_spawn (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Spawn a new coroutined-based thread of execution. +

+
template<
+    typename ExecutionContext,
+    typename F,
+    typename CompletionToken = DEFAULT>
+DEDUCED co_spawn(
+    ExecutionContext & ctx,
+    F && f,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + Parameters +
+
+

+
+
ctx
+

+ An execution context that will provide the executor to be used to + schedule the new thread of execution. +

+
f
+

+ A nullary function object with a return type of the form asio::awaitable<R,E> + that will be used as the coroutine's entry point. +

+
token
+

+ The completion token that will handle the notification that the thread + of execution has completed. If R is void, + the function signature of the completion handler must be: +

+
+
+
void handler(std::exception_ptr);
+
+

+ Otherwise, the function signature of the completion handler must be: +

+
void handler(std::exception_ptr, R);
+
+
+ + Example +
+
asio::awaitable<std::size_t> echo(tcp::socket socket)
+{
+  std::size_t bytes_transferred = 0;
+
+  try
+  {
+    char data[1024];
+    for (;;)
+    {
+      std::size_t n = co_await socket.async_read_some(
+          asio::buffer(data), asio::use_awaitable);
+
+      co_await asio::async_write(socket,
+          asio::buffer(data, n), asio::use_awaitable);
+
+      bytes_transferred += n;
+    }
+  }
+  catch (const std::exception&)
+  {
+  }
+
+  co_return bytes_transferred;
+}
+
+// ...
+
+asio::co_spawn(my_io_context,
+  [socket = std::move(my_tcp_socket)]() mutable
+    -> asio::awaitable<void>
+  {
+    try
+    {
+      char data[1024];
+      for (;;)
+      {
+        std::size_t n = co_await socket.async_read_some(
+            asio::buffer(data), asio::use_awaitable);
+
+        co_await asio::async_write(socket,
+            asio::buffer(data, n), asio::use_awaitable);
+      }
+    }
+    catch (const std::exception& e)
+    {
+      std::cerr << "Exception: " << e.what() << "\n";
+    }
+  }, asio::detached);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect.html b/include/asio/doc/asio/reference/connect.html new file mode 100644 index 0000000..8917afb --- /dev/null +++ b/include/asio/doc/asio/reference/connect.html @@ -0,0 +1,208 @@ + + + +connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The connect function is a composed + operation that establishes a socket connection by trying each endpoint in + a sequence. +

+

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    asio::error_code & ec,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+  » more...
+
+

+ (Deprecated: Use range overload.) Establishes a socket connection by trying + each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    asio::error_code & ec,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+  » more...
+
+

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename ConnectCondition>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    ConnectCondition connect_condition,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename ConnectCondition>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    ConnectCondition connect_condition,
+    asio::error_code & ec,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+  » more...
+
+

+ (Deprecated: Use range overload.) Establishes a socket connection by trying + each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    ConnectCondition connect_condition,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    ConnectCondition connect_condition,
+    asio::error_code & ec,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+  » more...
+
+

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    ConnectCondition connect_condition);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    ConnectCondition connect_condition,
+    asio::error_code & ec);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/connect.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload1.html b/include/asio/doc/asio/reference/connect/overload1.html new file mode 100644 index 0000000..d2a727d --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload1.html @@ -0,0 +1,106 @@ + + + +connect (1 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
endpoints
+

+ A sequence of endpoints. +

+
+
+
+ + Return + Value +
+

+ The successfully connected endpoint. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the sequence is empty, the associated error_code + is asio::error::not_found. Otherwise, contains the error + from the last connection attempt. +

+
+
+
+ + Example +
+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::socket s(my_context);
+asio::connect(s, r.resolve(q));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload10.html b/include/asio/doc/asio/reference/connect/overload10.html new file mode 100644 index 0000000..41be884 --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload10.html @@ -0,0 +1,121 @@ + + + +connect (10 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use range overload.) Establishes a socket connection by trying + each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    ConnectCondition connect_condition,
+    asio::error_code & ec,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
ec
+

+ Set to indicate what error occurred, if any. If the sequence is empty, + set to asio::error::not_found. Otherwise, contains the + error from the last connection attempt. +

+
+
+
+ + Return + Value +
+

+ On success, an iterator denoting the successfully connected endpoint. Otherwise, + the end iterator. +

+
+ + Remarks +
+

+ This overload assumes that a default constructed object of type Iterator + represents the end of the sequence. This is a valid assumption for iterator + types such as asio::ip::tcp::resolver::iterator. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload11.html b/include/asio/doc/asio/reference/connect/overload11.html new file mode 100644 index 0000000..4eb4ab8 --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload11.html @@ -0,0 +1,153 @@ + + + +connect (11 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    ConnectCondition connect_condition);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
end
+

+ An iterator pointing to the end of a sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
+
+
+ + Return + Value +
+

+ An iterator denoting the successfully connected endpoint. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the sequence is empty, the associated error_code + is asio::error::not_found. Otherwise, contains the error + from the last connection attempt. +

+
+
+
+ + Example +
+

+ The following connect condition function object can be used to output information + about the individual connection attempts: +

+
struct my_connect_condition
+{
+  bool operator()(
+      const asio::error_code& ec,
+      const::tcp::endpoint& next)
+  {
+    if (ec) std::cout << "Error: " << ec.message() << std::endl;
+    std::cout << "Trying: " << next << std::endl;
+    return true;
+  }
+};
+
+

+ It would be used with the asio::connect function as follows: +

+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::resolver::results_type e = r.resolve(q);
+tcp::socket s(my_context);
+tcp::resolver::results_type::iterator i = asio::connect(
+    s, e.begin(), e.end(), my_connect_condition());
+std::cout << "Connected to: " << i->endpoint() << std::endl;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload12.html b/include/asio/doc/asio/reference/connect/overload12.html new file mode 100644 index 0000000..67cdd0c --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload12.html @@ -0,0 +1,154 @@ + + + +connect (12 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    ConnectCondition connect_condition,
+    asio::error_code & ec);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
end
+

+ An iterator pointing to the end of a sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
ec
+

+ Set to indicate what error occurred, if any. If the sequence is empty, + set to asio::error::not_found. Otherwise, contains the + error from the last connection attempt. +

+
+
+
+ + Return + Value +
+

+ On success, an iterator denoting the successfully connected endpoint. Otherwise, + the end iterator. +

+
+ + Example +
+

+ The following connect condition function object can be used to output information + about the individual connection attempts: +

+
struct my_connect_condition
+{
+  bool operator()(
+      const asio::error_code& ec,
+      const::tcp::endpoint& next)
+  {
+    if (ec) std::cout << "Error: " << ec.message() << std::endl;
+    std::cout << "Trying: " << next << std::endl;
+    return true;
+  }
+};
+
+

+ It would be used with the asio::connect function as follows: +

+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::resolver::results_type e = r.resolve(q);
+tcp::socket s(my_context);
+asio::error_code ec;
+tcp::resolver::results_type::iterator i = asio::connect(
+    s, e.begin(), e.end(), my_connect_condition());
+if (ec)
+{
+  // An error occurred.
+}
+else
+{
+  std::cout << "Connected to: " << i->endpoint() << std::endl;
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload2.html b/include/asio/doc/asio/reference/connect/overload2.html new file mode 100644 index 0000000..a3bda20 --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload2.html @@ -0,0 +1,104 @@ + + + +connect (2 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    asio::error_code & ec,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
endpoints
+

+ A sequence of endpoints. +

+
ec
+

+ Set to indicate what error occurred, if any. If the sequence is empty, + set to asio::error::not_found. Otherwise, contains the + error from the last connection attempt. +

+
+
+
+ + Return + Value +
+

+ On success, the successfully connected endpoint. Otherwise, a default-constructed + endpoint. +

+
+ + Example +
+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::socket s(my_context);
+asio::error_code ec;
+asio::connect(s, r.resolve(q), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload3.html b/include/asio/doc/asio/reference/connect/overload3.html new file mode 100644 index 0000000..4224a4a --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload3.html @@ -0,0 +1,108 @@ + + + +connect (3 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use range overload.) Establishes a socket connection by trying + each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
+
+
+ + Return + Value +
+

+ On success, an iterator denoting the successfully connected endpoint. Otherwise, + the end iterator. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the sequence is empty, the associated error_code + is asio::error::not_found. Otherwise, contains the error + from the last connection attempt. +

+
+
+
+ + Remarks +
+

+ This overload assumes that a default constructed object of type Iterator + represents the end of the sequence. This is a valid assumption for iterator + types such as asio::ip::tcp::resolver::iterator. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload4.html b/include/asio/doc/asio/reference/connect/overload4.html new file mode 100644 index 0000000..85be4ee --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload4.html @@ -0,0 +1,100 @@ + + + +connect (4 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use range overload.) Establishes a socket connection by trying + each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    asio::error_code & ec,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
ec
+

+ Set to indicate what error occurred, if any. If the sequence is empty, + set to asio::error::not_found. Otherwise, contains the + error from the last connection attempt. +

+
+
+
+ + Return + Value +
+

+ On success, an iterator denoting the successfully connected endpoint. Otherwise, + the end iterator. +

+
+ + Remarks +
+

+ This overload assumes that a default constructed object of type Iterator + represents the end of the sequence. This is a valid assumption for iterator + types such as asio::ip::tcp::resolver::iterator. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload5.html b/include/asio/doc/asio/reference/connect/overload5.html new file mode 100644 index 0000000..41c62cc --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload5.html @@ -0,0 +1,111 @@ + + + +connect (5 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
end
+

+ An iterator pointing to the end of a sequence of endpoints. +

+
+
+
+ + Return + Value +
+

+ An iterator denoting the successfully connected endpoint. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the sequence is empty, the associated error_code + is asio::error::not_found. Otherwise, contains the error + from the last connection attempt. +

+
+
+
+ + Example +
+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::resolver::results_type e = r.resolve(q);
+tcp::socket s(my_context);
+asio::connect(s, e.begin(), e.end());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload6.html b/include/asio/doc/asio/reference/connect/overload6.html new file mode 100644 index 0000000..50fe6ab --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload6.html @@ -0,0 +1,109 @@ + + + +connect (6 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    Iterator end,
+    asio::error_code & ec);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
end
+

+ An iterator pointing to the end of a sequence of endpoints. +

+
ec
+

+ Set to indicate what error occurred, if any. If the sequence is empty, + set to asio::error::not_found. Otherwise, contains the + error from the last connection attempt. +

+
+
+
+ + Return + Value +
+

+ On success, an iterator denoting the successfully connected endpoint. Otherwise, + the end iterator. +

+
+ + Example +
+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::resolver::results_type e = r.resolve(q);
+tcp::socket s(my_context);
+asio::error_code ec;
+asio::connect(s, e.begin(), e.end(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload7.html b/include/asio/doc/asio/reference/connect/overload7.html new file mode 100644 index 0000000..75846bb --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload7.html @@ -0,0 +1,148 @@ + + + +connect (7 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename ConnectCondition>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    ConnectCondition connect_condition,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
endpoints
+

+ A sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
+
+
+ + Return + Value +
+

+ The successfully connected endpoint. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the sequence is empty, the associated error_code + is asio::error::not_found. Otherwise, contains the error + from the last connection attempt. +

+
+
+
+ + Example +
+

+ The following connect condition function object can be used to output information + about the individual connection attempts: +

+
struct my_connect_condition
+{
+  bool operator()(
+      const asio::error_code& ec,
+      const::tcp::endpoint& next)
+  {
+    if (ec) std::cout << "Error: " << ec.message() << std::endl;
+    std::cout << "Trying: " << next << std::endl;
+    return true;
+  }
+};
+
+

+ It would be used with the asio::connect function as follows: +

+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::socket s(my_context);
+tcp::endpoint e = asio::connect(s,
+    r.resolve(q), my_connect_condition());
+std::cout << "Connected to: " << e << std::endl;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload8.html b/include/asio/doc/asio/reference/connect/overload8.html new file mode 100644 index 0000000..eaee045 --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload8.html @@ -0,0 +1,149 @@ + + + +connect (8 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Establishes a socket connection by trying each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename EndpointSequence,
+    typename ConnectCondition>
+Protocol::endpoint connect(
+    basic_socket< Protocol, Executor > & s,
+    const EndpointSequence & endpoints,
+    ConnectCondition connect_condition,
+    asio::error_code & ec,
+    typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
endpoints
+

+ A sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
ec
+

+ Set to indicate what error occurred, if any. If the sequence is empty, + set to asio::error::not_found. Otherwise, contains the + error from the last connection attempt. +

+
+
+
+ + Return + Value +
+

+ On success, the successfully connected endpoint. Otherwise, a default-constructed + endpoint. +

+
+ + Example +
+

+ The following connect condition function object can be used to output information + about the individual connection attempts: +

+
struct my_connect_condition
+{
+  bool operator()(
+      const asio::error_code& ec,
+      const::tcp::endpoint& next)
+  {
+    if (ec) std::cout << "Error: " << ec.message() << std::endl;
+    std::cout << "Trying: " << next << std::endl;
+    return true;
+  }
+};
+
+

+ It would be used with the asio::connect function as follows: +

+
tcp::resolver r(my_context);
+tcp::resolver::query q("host", "service");
+tcp::socket s(my_context);
+asio::error_code ec;
+tcp::endpoint e = asio::connect(s,
+    r.resolve(q), my_connect_condition(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+else
+{
+  std::cout << "Connected to: " << e << std::endl;
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/connect/overload9.html b/include/asio/doc/asio/reference/connect/overload9.html new file mode 100644 index 0000000..7932e93 --- /dev/null +++ b/include/asio/doc/asio/reference/connect/overload9.html @@ -0,0 +1,129 @@ + + + +connect (9 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use range overload.) Establishes a socket connection by trying + each endpoint in a sequence. +

+
template<
+    typename Protocol,
+    typename Executor,
+    typename Iterator,
+    typename ConnectCondition>
+Iterator connect(
+    basic_socket< Protocol, Executor > & s,
+    Iterator begin,
+    ConnectCondition connect_condition,
+    typename enable_if<!is_endpoint_sequence< Iterator >::value >::type *  = 0);
+
+

+ This function attempts to connect a socket to one of a sequence of endpoints. + It does this by repeated calls to the socket's connect member + function, once for each endpoint in the sequence, until a connection is + successfully established. +

+
+ + Parameters +
+
+

+
+
s
+

+ The socket to be connected. If the socket is already open, it will + be closed. +

+
begin
+

+ An iterator pointing to the start of a sequence of endpoints. +

+
connect_condition
+
+

+ A function object that is called prior to each connection attempt. + The signature of the function object must be: +

+
bool connect_condition(
+    const asio::error_code& ec,
+    const typename Protocol::endpoint& next);
+
+

+ The ec parameter contains the result from the most recent + connect operation. Before the first connection attempt, ec + is always set to indicate success. The next parameter + is the next endpoint to be tried. The function object should return + true if the next endpoint should be tried, and false if it should + be skipped. +

+
+
+
+
+ + Return + Value +
+

+ On success, an iterator denoting the successfully connected endpoint. Otherwise, + the end iterator. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the sequence is empty, the associated error_code + is asio::error::not_found. Otherwise, contains the error + from the last connection attempt. +

+
+
+
+ + Remarks +
+

+ This overload assumes that a default constructed object of type Iterator + represents the end of the sequence. This is a valid assumption for iterator + types such as asio::ip::tcp::resolver::iterator. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer.html b/include/asio/doc/asio/reference/const_buffer.html new file mode 100644 index 0000000..c9a47d1 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer.html @@ -0,0 +1,185 @@ + + + +const_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Holds a buffer that cannot be modified. +

+
class const_buffer
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range.
—
Construct a non-modifiable + buffer from a modifiable one. +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new non-modifiable buffer that is offset from the start + of another. +

+
+

+ The const_buffer + class provides a safe representation of a buffer that cannot be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() and + size() member functions: +

+
asio::const_buffer b1 = ...;
+std::size_t s1 = b1.size();
+const unsigned char* p1 = static_cast<const unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/const_buffer.html b/include/asio/doc/asio/reference/const_buffer/const_buffer.html new file mode 100644 index 0000000..c7d9fc7 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/const_buffer.html @@ -0,0 +1,60 @@ + + + +const_buffer::const_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an empty buffer. +

+
const_buffer();
+  » more...
+
+

+ Construct a buffer to represent a given memory range. +

+
const_buffer(
+    const void * data,
+    std::size_t size);
+  » more...
+
+

+ Construct a non-modifiable buffer from a modifiable one. +

+
const_buffer(
+    const mutable_buffer & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/const_buffer/overload1.html b/include/asio/doc/asio/reference/const_buffer/const_buffer/overload1.html new file mode 100644 index 0000000..66b0c43 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/const_buffer/overload1.html @@ -0,0 +1,43 @@ + + + +const_buffer::const_buffer (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an empty buffer. +

+
const_buffer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/const_buffer/overload2.html b/include/asio/doc/asio/reference/const_buffer/const_buffer/overload2.html new file mode 100644 index 0000000..a896ef9 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/const_buffer/overload2.html @@ -0,0 +1,45 @@ + + + +const_buffer::const_buffer (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a buffer to represent a given memory range. +

+
const_buffer(
+    const void * data,
+    std::size_t size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/const_buffer/overload3.html b/include/asio/doc/asio/reference/const_buffer/const_buffer/overload3.html new file mode 100644 index 0000000..8b7b6a6 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/const_buffer/overload3.html @@ -0,0 +1,44 @@ + + + +const_buffer::const_buffer (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a non-modifiable buffer from a modifiable one. +

+
const_buffer(
+    const mutable_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/data.html b/include/asio/doc/asio/reference/const_buffer/data.html new file mode 100644 index 0000000..39f6b34 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/data.html @@ -0,0 +1,44 @@ + + + +const_buffer::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a pointer to the beginning + of the memory range. +

+
const void * data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/operator_plus_.html b/include/asio/doc/asio/reference/const_buffer/operator_plus_.html new file mode 100644 index 0000000..678b721 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/operator_plus_.html @@ -0,0 +1,52 @@ + + + +const_buffer::operator+ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create a + new non-modifiable buffer that is offset from the start of another. +

+
const_buffer operator+(
+    const const_buffer & b,
+    std::size_t n);
+  » more...
+
+const_buffer operator+(
+    std::size_t n,
+    const const_buffer & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/operator_plus_/overload1.html b/include/asio/doc/asio/reference/const_buffer/operator_plus_/overload1.html new file mode 100644 index 0000000..b9fc8b1 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/operator_plus_/overload1.html @@ -0,0 +1,45 @@ + + + +const_buffer::operator+ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that is offset from the start of another. +

+
const_buffer operator+(
+    const const_buffer & b,
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/operator_plus_/overload2.html b/include/asio/doc/asio/reference/const_buffer/operator_plus_/overload2.html new file mode 100644 index 0000000..49db182 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/operator_plus_/overload2.html @@ -0,0 +1,45 @@ + + + +const_buffer::operator+ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new non-modifiable buffer that is offset from the start of another. +

+
const_buffer operator+(
+    std::size_t n,
+    const const_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/operator_plus__eq_.html b/include/asio/doc/asio/reference/const_buffer/operator_plus__eq_.html new file mode 100644 index 0000000..7568632 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/operator_plus__eq_.html @@ -0,0 +1,45 @@ + + + +const_buffer::operator+= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move + the start of the buffer by the specified number of bytes. +

+
const_buffer & operator+=(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffer/size.html b/include/asio/doc/asio/reference/const_buffer/size.html new file mode 100644 index 0000000..fbde50f --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffer/size.html @@ -0,0 +1,44 @@ + + + +const_buffer::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the size of the memory + range. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1.html b/include/asio/doc/asio/reference/const_buffers_1.html new file mode 100644 index 0000000..df3f3af --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1.html @@ -0,0 +1,237 @@ + + + +const_buffers_1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use const_buffer.) + Adapts a single non-modifiable buffer so that it meets the requirements of + the ConstBufferSequence concept. +

+
class const_buffers_1 :
+  public const_buffer
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_iterator +

+
+

+ A random-access iterator type that may be used to read elements. +

+
+

+ value_type +

+
+

+ The type for each element in the list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ begin +

+
+

+ Get a random-access iterator to the first element. +

+
+

+ const_buffers_1 [constructor] +

+
+

+ Construct to represent a given memory range.
—
Construct + to represent a single non-modifiable buffer. +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ end +

+
+

+ Get a random-access iterator for one past the last element. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new non-modifiable buffer that is offset from the start + of another. +

+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/begin.html b/include/asio/doc/asio/reference/const_buffers_1/begin.html new file mode 100644 index 0000000..cc24c84 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/begin.html @@ -0,0 +1,44 @@ + + + +const_buffers_1::begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a random-access + iterator to the first element. +

+
const_iterator begin() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1.html b/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1.html new file mode 100644 index 0000000..29cc507 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1.html @@ -0,0 +1,54 @@ + + + +const_buffers_1::const_buffers_1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + to represent a given memory range. +

+
const_buffers_1(
+    const void * data,
+    std::size_t size);
+  » more...
+
+

+ Construct to represent a single non-modifiable buffer. +

+
explicit const_buffers_1(
+    const const_buffer & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1/overload1.html b/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1/overload1.html new file mode 100644 index 0000000..3adbaf2 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1/overload1.html @@ -0,0 +1,45 @@ + + + +const_buffers_1::const_buffers_1 (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct to represent a given memory range. +

+
const_buffers_1(
+    const void * data,
+    std::size_t size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1/overload2.html b/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1/overload2.html new file mode 100644 index 0000000..1f53667 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/const_buffers_1/overload2.html @@ -0,0 +1,44 @@ + + + +const_buffers_1::const_buffers_1 (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct to represent a single non-modifiable buffer. +

+
const_buffers_1(
+    const const_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/const_iterator.html b/include/asio/doc/asio/reference/const_buffers_1/const_iterator.html new file mode 100644 index 0000000..ff5906e --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/const_iterator.html @@ -0,0 +1,54 @@ + + + +const_buffers_1::const_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + random-access iterator type that may be used to read elements. +

+
typedef const const_buffer * const_iterator;
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/data.html b/include/asio/doc/asio/reference/const_buffers_1/data.html new file mode 100644 index 0000000..c073499 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/data.html @@ -0,0 +1,47 @@ + + + +const_buffers_1::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from const_buffer. +

+

+ +Get a pointer to + the beginning of the memory range. +

+
const void * data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/end.html b/include/asio/doc/asio/reference/const_buffers_1/end.html new file mode 100644 index 0000000..c3b2b80 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/end.html @@ -0,0 +1,44 @@ + + + +const_buffers_1::end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a random-access + iterator for one past the last element. +

+
const_iterator end() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/operator_plus_.html b/include/asio/doc/asio/reference/const_buffers_1/operator_plus_.html new file mode 100644 index 0000000..ae317c4 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/operator_plus_.html @@ -0,0 +1,52 @@ + + + +const_buffers_1::operator+ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + a new non-modifiable buffer that is offset from the start of another. +

+
const_buffer operator+(
+    const const_buffer & b,
+    std::size_t n);
+  » more...
+
+const_buffer operator+(
+    std::size_t n,
+    const const_buffer & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/operator_plus_/overload1.html b/include/asio/doc/asio/reference/const_buffers_1/operator_plus_/overload1.html new file mode 100644 index 0000000..34956e0 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/operator_plus_/overload1.html @@ -0,0 +1,48 @@ + + + +const_buffers_1::operator+ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from const_buffer. +

+

+ Create a new non-modifiable buffer that is offset from the start of another. +

+
const_buffer operator+(
+    const const_buffer & b,
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/operator_plus_/overload2.html b/include/asio/doc/asio/reference/const_buffers_1/operator_plus_/overload2.html new file mode 100644 index 0000000..8410fa5 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/operator_plus_/overload2.html @@ -0,0 +1,48 @@ + + + +const_buffers_1::operator+ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from const_buffer. +

+

+ Create a new non-modifiable buffer that is offset from the start of another. +

+
const_buffer operator+(
+    std::size_t n,
+    const const_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/operator_plus__eq_.html b/include/asio/doc/asio/reference/const_buffers_1/operator_plus__eq_.html new file mode 100644 index 0000000..4362d87 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/operator_plus__eq_.html @@ -0,0 +1,48 @@ + + + +const_buffers_1::operator+= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from const_buffer. +

+

+ +Move + the start of the buffer by the specified number of bytes. +

+
const_buffer & operator+=(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/size.html b/include/asio/doc/asio/reference/const_buffers_1/size.html new file mode 100644 index 0000000..f617cbb --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/size.html @@ -0,0 +1,47 @@ + + + +const_buffers_1::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from const_buffer. +

+

+ +Get the size of the + memory range. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/const_buffers_1/value_type.html b/include/asio/doc/asio/reference/const_buffers_1/value_type.html new file mode 100644 index 0000000..1acd157 --- /dev/null +++ b/include/asio/doc/asio/reference/const_buffers_1/value_type.html @@ -0,0 +1,187 @@ + + + +const_buffers_1::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + for each element in the list of buffers. +

+
typedef const_buffer value_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range.
—
Construct a non-modifiable + buffer from a modifiable one. +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new non-modifiable buffer that is offset from the start + of another. +

+
+

+ The const_buffer + class provides a safe representation of a buffer that cannot be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() + and size() member functions: +

+
asio::const_buffer b1 = ...;
+std::size_t s1 = b1.size();
+const unsigned char* p1 = static_cast<const unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/coroutine.html b/include/asio/doc/asio/reference/coroutine.html new file mode 100644 index 0000000..b6cb407 --- /dev/null +++ b/include/asio/doc/asio/reference/coroutine.html @@ -0,0 +1,429 @@ + + + +coroutine + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides support for implementing stackless coroutines. +

+
class coroutine
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ coroutine + [constructor] +

+
+

+ Constructs a coroutine in its initial state. +

+
+

+ is_child +

+
+

+ Returns true if the coroutine is the child of a fork. +

+
+

+ is_complete +

+
+

+ Returns true if the coroutine has reached its terminal state. +

+
+

+ is_parent +

+
+

+ Returns true if the coroutine is the parent of a fork. +

+
+

+ The coroutine class may be used to implement stackless coroutines. + The class itself is used to store the current state of the coroutine. +

+

+ Coroutines are copy-constructible and assignable, and the space overhead + is a single int. They can be used as a base class: +

+
class session : coroutine
+{
+  ...
+};
+
+

+ or as a data member: +

+
class session
+{
+  ...
+  coroutine coro_;
+};
+
+

+ or even bound in as a function argument using lambdas or bind(). + The important thing is that as the application maintains a copy of the object + for as long as the coroutine must be kept alive. +

+
+ + Pseudo-keywords +
+

+ A coroutine is used in conjunction with certain "pseudo-keywords", + which are implemented as macros. These macros are defined by a header file: +

+
#include <asio/yield.hpp>
+
+

+ and may conversely be undefined as follows: +

+
#include <asio/unyield.hpp>
+
+

+ reenter +

+

+ The reenter macro is used to define the body of a coroutine. + It takes a single argument: a pointer or reference to a coroutine object. + For example, if the base class is a coroutine object you may write: +

+
reenter (this)
+{
+  ... coroutine body ...
+}
+
+

+ and if a data member or other variable you can write: +

+
reenter (coro_)
+{
+  ... coroutine body ...
+}
+
+

+ When reenter is executed at runtime, control jumps to the location + of the last yield or fork. +

+

+ The coroutine body may also be a single statement, such as: +

+
reenter (this) for (;;)
+{
+  ...
+}
+
+

+ Limitation: The reenter macro + is implemented using a switch. This means that you must take care when using + local variables within the coroutine body. The local variable is not allowed + in a position where reentering the coroutine could bypass the variable definition. +

+

+ yield statement +

+

+ This form of the yield keyword is often used with asynchronous + operations: +

+
yield socket_->async_read_some(buffer(*buffer_), *this);
+
+

+ This divides into four logical steps: +

+
    +
  • + yield saves the current state of the coroutine. +
  • +
  • + The statement initiates the asynchronous operation. +
  • +
  • + The resume point is defined immediately following the statement. +
  • +
  • + Control is transferred to the end of the coroutine body. +
  • +
+

+ When the asynchronous operation completes, the function object is invoked + and reenter causes control to transfer to the resume point. + It is important to remember to carry the coroutine state forward with the + asynchronous operation. In the above snippet, the current class is a function + object object with a coroutine object as base class or data member. +

+

+ The statement may also be a compound statement, and this permits us to define + local variables with limited scope: +

+
yield
+{
+  mutable_buffers_1 b = buffer(*buffer_);
+  socket_->async_read_some(b, *this);
+}
+
+

+ yield return expression ; +

+

+ This form of yield is often used in generators or coroutine-based + parsers. For example, the function object: +

+
struct interleave : coroutine
+{
+  istream& is1;
+  istream& is2;
+  char operator()(char c)
+  {
+    reenter (this) for (;;)
+    {
+      yield return is1.get();
+      yield return is2.get();
+    }
+  }
+};
+
+

+ defines a trivial coroutine that interleaves the characters from two input + streams. +

+

+ This type of yield divides into three logical steps: +

+
    +
  • + yield saves the current state of the coroutine. +
  • +
  • + The resume point is defined immediately following the semicolon. +
  • +
  • + The value of the expression is returned from the function. +
  • +
+

+ yield ; +

+

+ This form of yield is equivalent to the following steps: +

+
    +
  • + yield saves the current state of the coroutine. +
  • +
  • + The resume point is defined immediately following the semicolon. +
  • +
  • + Control is transferred to the end of the coroutine body. +
  • +
+

+ This form might be applied when coroutines are used for cooperative threading + and scheduling is explicitly managed. For example: +

+
struct task : coroutine
+{
+  ...
+  void operator()()
+  {
+    reenter (this)
+    {
+      while (... not finished ...)
+      {
+        ... do something ...
+        yield;
+        ... do some more ...
+        yield;
+      }
+    }
+  }
+  ...
+};
+...
+task t1, t2;
+for (;;)
+{
+  t1();
+  t2();
+}
+
+

+ yield break ; +

+

+ The final form of yield is used to explicitly terminate the + coroutine. This form is comprised of two steps: +

+
    +
  • + yield sets the coroutine state to indicate termination. +
  • +
  • + Control is transferred to the end of the coroutine body. +
  • +
+

+ Once terminated, calls to is_complete() return true and the + coroutine cannot be reentered. +

+

+ Note that a coroutine may also be implicitly terminated if the coroutine + body is exited without a yield, e.g. by return, throw or by running to the + end of the body. +

+

+ fork statement +

+

+ The fork pseudo-keyword is used when "forking" a coroutine, + i.e. splitting it into two (or more) copies. One use of fork + is in a server, where a new coroutine is created to handle each client connection: +

+
reenter (this)
+{
+  do
+  {
+    socket_.reset(new tcp::socket(my_context_));
+    yield acceptor->async_accept(*socket_, *this);
+    fork server(*this)();
+  } while (is_parent());
+  ... client-specific handling follows ...
+}
+
+

+ The logical steps involved in a fork are: +

+
    +
  • + fork saves the current state of the coroutine. +
  • +
  • + The statement creates a copy of the coroutine and either executes it + immediately or schedules it for later execution. +
  • +
  • + The resume point is defined immediately following the semicolon. +
  • +
  • + For the "parent", control immediately continues from the next + line. +
  • +
+

+ The functions is_parent() and is_child() can be + used to differentiate between parent and child. You would use these functions + to alter subsequent control flow. +

+

+ Note that fork doesn't do the actual forking by itself. It is + the application's responsibility to create a clone of the coroutine and call + it. The clone can be called immediately, as above, or scheduled for delayed + execution using something like post. +

+
+ + Alternate + macro names +
+

+ If preferred, an application can use macro names that follow a more typical + naming convention, rather than the pseudo-keywords. These are: +

+
    +
  • + ASIO_CORO_REENTER instead of reenter +
  • +
  • + ASIO_CORO_YIELD instead of yield +
  • +
  • + ASIO_CORO_FORK instead of fork +
  • +
+
+ + Requirements +
+

+ Header: asio/coroutine.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/coroutine/coroutine.html b/include/asio/doc/asio/reference/coroutine/coroutine.html new file mode 100644 index 0000000..9e63921 --- /dev/null +++ b/include/asio/doc/asio/reference/coroutine/coroutine.html @@ -0,0 +1,44 @@ + + + +coroutine::coroutine + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructs a coroutine + in its initial state. +

+
coroutine();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/coroutine/is_child.html b/include/asio/doc/asio/reference/coroutine/is_child.html new file mode 100644 index 0000000..1285aae --- /dev/null +++ b/include/asio/doc/asio/reference/coroutine/is_child.html @@ -0,0 +1,44 @@ + + + +coroutine::is_child + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Returns true if the coroutine + is the child of a fork. +

+
bool is_child() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/coroutine/is_complete.html b/include/asio/doc/asio/reference/coroutine/is_complete.html new file mode 100644 index 0000000..76dd211 --- /dev/null +++ b/include/asio/doc/asio/reference/coroutine/is_complete.html @@ -0,0 +1,44 @@ + + + +coroutine::is_complete + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Returns true if + the coroutine has reached its terminal state. +

+
bool is_complete() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/coroutine/is_parent.html b/include/asio/doc/asio/reference/coroutine/is_parent.html new file mode 100644 index 0000000..0faf05d --- /dev/null +++ b/include/asio/doc/asio/reference/coroutine/is_parent.html @@ -0,0 +1,44 @@ + + + +coroutine::is_parent + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Returns true if the + coroutine is the parent of a fork. +

+
bool is_parent() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/deadline_timer.html b/include/asio/doc/asio/reference/deadline_timer.html new file mode 100644 index 0000000..d7a3c1f --- /dev/null +++ b/include/asio/doc/asio/reference/deadline_timer.html @@ -0,0 +1,394 @@ + + + +deadline_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for the typical usage + of timer. Uses a UTC clock. +

+
typedef basic_deadline_timer< boost::posix_time::ptime > deadline_timer;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ duration_type +

+
+

+ The duration type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_type +

+
+

+ The time type. +

+
+

+ traits_type +

+
+

+ The time traits type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_deadline_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a particular + expiry time relative to now.
—
Move-construct a basic_deadline_timer + from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +

+
+

+ expires_at +

+
+

+ Get the timer's expiry time as an absolute time.
—
+ Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ Get the timer's expiry time relative to now.
—
Set + the timer's expiry time relative to now. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_deadline_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_deadline_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_deadline_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A deadline timer is always in one of two states: "expired" or "not + expired". If the wait() or async_wait() function + is called on an expired timer, the wait operation will complete immediately. +

+

+ Most applications will use the deadline_timer + typedef. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait: +

+
// Construct a timer without setting an expiry time.
+asio::deadline_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_from_now(boost::posix_time::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait: +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::deadline_timer timer(my_context,
+    boost::posix_time::time_from_string("2005-12-07 23:59:59.000"));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active deadline_timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the action + associated with the timer is performed only once, use something like this: + used: +

+
void on_some_event()
+{
+  if (my_timer.expires_from_now(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_deadline_timer::expires_from_now() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+
+ + Requirements +
+

+ Header: asio/deadline_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/default_completion_token.html b/include/asio/doc/asio/reference/default_completion_token.html new file mode 100644 index 0000000..e659c8b --- /dev/null +++ b/include/asio/doc/asio/reference/default_completion_token.html @@ -0,0 +1,98 @@ + + + +default_completion_token + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Traits type used to determine the default completion token type associated + with a type (such as an executor). +

+
template<
+    typename T>
+struct default_completion_token
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ If T has a nested type default_completion_token_type, T::default_completion_token_type. + Otherwise the typedef type is not defined. +

+
+

+ A program may specialise this traits type if the T template + parameter in the specialisation is a user-defined type. +

+

+ Specialisations of this trait may provide a nested typedef type, + which is a default-constructible completion token type. +

+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/default_completion_token/type.html b/include/asio/doc/asio/reference/default_completion_token/type.html new file mode 100644 index 0000000..1170d19 --- /dev/null +++ b/include/asio/doc/asio/reference/default_completion_token/type.html @@ -0,0 +1,56 @@ + + + +default_completion_token::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +If + T has a nested type default_completion_token_type, + T::default_completion_token_type. Otherwise the typedef type + is not defined. +

+
typedef see_below type;
+
+
+ + Requirements +
+

+ Header: asio/async_result.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/defer.html b/include/asio/doc/asio/reference/defer.html new file mode 100644 index 0000000..70ee749 --- /dev/null +++ b/include/asio/doc/asio/reference/defer.html @@ -0,0 +1,76 @@ + + + +defer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+defer +

+

+ +Submits a completion token or function object for + execution. +

+
template<
+    typename CompletionToken>
+DEDUCED defer(
+    CompletionToken && token);
+  » more...
+
+template<
+    typename Executor,
+    typename CompletionToken = DEFAULT>
+DEDUCED defer(
+    const Executor & ex,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename CompletionToken = DEFAULT>
+DEDUCED defer(
+    ExecutionContext & ctx,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/defer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/defer/overload1.html b/include/asio/doc/asio/reference/defer/overload1.html new file mode 100644 index 0000000..f223c4b --- /dev/null +++ b/include/asio/doc/asio/reference/defer/overload1.html @@ -0,0 +1,84 @@ + + + +defer (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename CompletionToken>
+DEDUCED defer(
+    CompletionToken && token);
+
+

+ This function submits an object for execution using the object's associated + executor. The function object is queued for execution, and is never called + from the current thread prior to returning from defer(). +

+

+ The use of defer(), rather than post + , indicates the caller's preference that the executor defer the queueing + of the function object. This may allow the executor to optimise queueing + for cases when the function object represents a continuation of the current + call context. +

+

+ This function has the following effects: +

+
    +
  • + Constructs a function object handler of type Handler, + initialized with handler(forward<CompletionToken>(token)). +
  • +
  • + Constructs an object result of type async_result<Handler>, + initializing the object as result(handler). +
  • +
  • + Obtains the handler's associated executor object ex by + performing get_associated_executor(handler). +
  • +
  • + Obtains the handler's associated allocator object alloc + by performing get_associated_allocator(handler). +
  • +
  • + Performs ex.defer(std::move(handler), alloc). +
  • +
  • + Returns result.get(). +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/defer/overload2.html b/include/asio/doc/asio/reference/defer/overload2.html new file mode 100644 index 0000000..3a30cbc --- /dev/null +++ b/include/asio/doc/asio/reference/defer/overload2.html @@ -0,0 +1,95 @@ + + + +defer (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename Executor,
+    typename CompletionToken = DEFAULT>
+DEDUCED defer(
+    const Executor & ex,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+
+

+ This function submits an object for execution using the specified executor. + The function object is queued for execution, and is never called from the + current thread prior to returning from defer(). +

+

+ The use of defer(), rather than post + , indicates the caller's preference that the executor defer the queueing + of the function object. This may allow the executor to optimise queueing + for cases when the function object represents a continuation of the current + call context. +

+

+ This function has the following effects: +

+
    +
  • + Constructs a function object handler of type Handler, + initialized with handler(forward<CompletionToken>(token)). +
  • +
  • + Constructs an object result of type async_result<Handler>, + initializing the object as result(handler). +
  • +
  • + Obtains the handler's associated executor object ex1 by + performing get_associated_executor(handler). +
  • +
  • + Creates a work object w by performing make_work(ex1). +
  • +
  • + Obtains the handler's associated allocator object alloc + by performing get_associated_allocator(handler). +
  • +
  • + Constructs a function object f with a function call operator + that performs ex1.dispatch(std::move(handler), alloc) + followed by w.reset(). +
  • +
  • + Performs Executor(ex).defer(std::move(f), alloc). +
  • +
  • + Returns result.get(). +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/defer/overload3.html b/include/asio/doc/asio/reference/defer/overload3.html new file mode 100644 index 0000000..de4c279 --- /dev/null +++ b/include/asio/doc/asio/reference/defer/overload3.html @@ -0,0 +1,56 @@ + + + +defer (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename ExecutionContext,
+    typename CompletionToken = DEFAULT>
+DEDUCED defer(
+    ExecutionContext & ctx,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + Return + Value +
+

+ defer(ctx.get_executor(), forward<CompletionToken>(token)). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached.html b/include/asio/doc/asio/reference/detached.html new file mode 100644 index 0000000..f6b6175 --- /dev/null +++ b/include/asio/doc/asio/reference/detached.html @@ -0,0 +1,57 @@ + + + +detached + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value, similar to std::nothrow. +

+
constexpr detached_t detached;
+
+

+ See the documentation for detached_t + for a usage example. +

+
+ + Requirements +
+

+ Header: asio/detached.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t.html b/include/asio/doc/asio/reference/detached_t.html new file mode 100644 index 0000000..17a929d --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t.html @@ -0,0 +1,147 @@ + + + +detached_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Class used to specify that an asynchronous operation is detached. +

+
class detached_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_with_default +

+
+

+ Adapts an executor to add the detached_t completion token as the + default. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ as_default_on [static] +

+
+

+ Function helper to adapt an I/O object to use detached_t as its + default completion token type. +

+
+

+ detached_t [constructor] +

+
+

+ Constructor. +

+
+

+ The detached_t + class is used to indicate that an asynchronous operation is detached. That + is, there is no completion handler waiting for the operation's result. A + detached_t + object may be passed as a handler to an asynchronous operation, typically + using the special value asio::detached. For example: +

+
my_socket.async_send(my_buffer, asio::detached);
+
+
+ + Requirements +
+

+ Header: asio/detached.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t/as_default_on.html b/include/asio/doc/asio/reference/detached_t/as_default_on.html new file mode 100644 index 0000000..e8f44ac --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t/as_default_on.html @@ -0,0 +1,48 @@ + + + +detached_t::as_default_on + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Function + helper to adapt an I/O object to use detached_t as its default + completion token type. +

+
template<
+    typename T>
+static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on(
+    T && object);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t/detached_t.html b/include/asio/doc/asio/reference/detached_t/detached_t.html new file mode 100644 index 0000000..7338ba2 --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t/detached_t.html @@ -0,0 +1,43 @@ + + + +detached_t::detached_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
constexpr detached_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t__executor_with_default.html b/include/asio/doc/asio/reference/detached_t__executor_with_default.html new file mode 100644 index 0000000..13f01e0 --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t__executor_with_default.html @@ -0,0 +1,126 @@ + + + +detached_t::executor_with_default + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adapts an executor to add the detached_t completion token as + the default. +

+
template<
+    typename InnerExecutor>
+struct executor_with_default
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ default_completion_token_type +

+
+

+ Specify detached_t as the default completion token type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_with_default [constructor] +

+
+

+ Construct the adapted executor from the inner executor type.
+ —
Convert the specified executor to the inner executor type, + then use that to construct the adapted executor. +

+
+
+ + Requirements +
+

+ Header: asio/detached.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t__executor_with_default/default_completion_token_type.html b/include/asio/doc/asio/reference/detached_t__executor_with_default/default_completion_token_type.html new file mode 100644 index 0000000..e3455f5 --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t__executor_with_default/default_completion_token_type.html @@ -0,0 +1,149 @@ + + + +detached_t::executor_with_default::default_completion_token_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Specify + detached_t as the default completion token type. +

+
typedef detached_t default_completion_token_type;
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_with_default +

+
+

+ Adapts an executor to add the detached_t completion token as + the default. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ as_default_on [static] +

+
+

+ Function helper to adapt an I/O object to use detached_t as its + default completion token type. +

+
+

+ detached_t [constructor] +

+
+

+ Constructor. +

+
+

+ The detached_t + class is used to indicate that an asynchronous operation is detached. That + is, there is no completion handler waiting for the operation's result. + A detached_t + object may be passed as a handler to an asynchronous operation, typically + using the special value asio::detached. For example: +

+
my_socket.async_send(my_buffer, asio::detached);
+
+
+ + Requirements +
+

+ Header: asio/detached.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default.html b/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default.html new file mode 100644 index 0000000..1cbe352 --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default.html @@ -0,0 +1,57 @@ + + + +detached_t::executor_with_default::executor_with_default + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + the adapted executor from the inner executor type. +

+
executor_with_default(
+    const InnerExecutor & ex);
+  » more...
+
+

+ Convert the specified executor to the inner executor type, then use that + to construct the adapted executor. +

+
template<
+    typename OtherExecutor>
+executor_with_default(
+    const OtherExecutor & ex,
+    typename enable_if< is_convertible< OtherExecutor, InnerExecutor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default/overload1.html b/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default/overload1.html new file mode 100644 index 0000000..ec5d35f --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default/overload1.html @@ -0,0 +1,44 @@ + + + +detached_t::executor_with_default::executor_with_default (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct the adapted executor from the inner executor type. +

+
executor_with_default(
+    const InnerExecutor & ex);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default/overload2.html b/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default/overload2.html new file mode 100644 index 0000000..0005a9f --- /dev/null +++ b/include/asio/doc/asio/reference/detached_t__executor_with_default/executor_with_default/overload2.html @@ -0,0 +1,48 @@ + + + +detached_t::executor_with_default::executor_with_default (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Convert the specified executor to the inner executor type, then use that + to construct the adapted executor. +

+
template<
+    typename OtherExecutor>
+executor_with_default(
+    const OtherExecutor & ex,
+    typename enable_if< is_convertible< OtherExecutor, InnerExecutor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dispatch.html b/include/asio/doc/asio/reference/dispatch.html new file mode 100644 index 0000000..7846f88 --- /dev/null +++ b/include/asio/doc/asio/reference/dispatch.html @@ -0,0 +1,76 @@ + + + +dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Submits a completion token or function object + for execution. +

+
template<
+    typename CompletionToken>
+DEDUCED dispatch(
+    CompletionToken && token);
+  » more...
+
+template<
+    typename Executor,
+    typename CompletionToken = DEFAULT>
+DEDUCED dispatch(
+    const Executor & ex,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename CompletionToken = DEFAULT>
+DEDUCED dispatch(
+    ExecutionContext & ctx,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/dispatch.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dispatch/overload1.html b/include/asio/doc/asio/reference/dispatch/overload1.html new file mode 100644 index 0000000..4732b2d --- /dev/null +++ b/include/asio/doc/asio/reference/dispatch/overload1.html @@ -0,0 +1,79 @@ + + + +dispatch (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename CompletionToken>
+DEDUCED dispatch(
+    CompletionToken && token);
+
+

+ This function submits an object for execution using the object's associated + executor. The function object may be called from the current thread prior + to returning from dispatch(). Otherwise, it is queued for + execution. +

+

+ This function has the following effects: +

+
    +
  • + Constructs a function object handler of type Handler, + initialized with handler(forward<CompletionToken>(token)). +
  • +
  • + Constructs an object result of type async_result<Handler>, + initializing the object as result(handler). +
  • +
  • + Obtains the handler's associated executor object ex by + performing get_associated_executor(handler). +
  • +
  • + Obtains the handler's associated allocator object alloc + by performing get_associated_allocator(handler). +
  • +
  • + Performs ex.dispatch(std::move(handler), alloc). +
  • +
  • + Returns result.get(). +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dispatch/overload2.html b/include/asio/doc/asio/reference/dispatch/overload2.html new file mode 100644 index 0000000..6145c3d --- /dev/null +++ b/include/asio/doc/asio/reference/dispatch/overload2.html @@ -0,0 +1,89 @@ + + + +dispatch (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename Executor,
+    typename CompletionToken = DEFAULT>
+DEDUCED dispatch(
+    const Executor & ex,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+
+

+ This function submits an object for execution using the specified executor. + The function object may be called from the current thread prior to returning + from dispatch(). Otherwise, it is queued for execution. +

+

+ This function has the following effects: +

+
    +
  • + Constructs a function object handler of type Handler, + initialized with handler(forward<CompletionToken>(token)). +
  • +
  • + Constructs an object result of type async_result<Handler>, + initializing the object as result(handler). +
  • +
  • + Obtains the handler's associated executor object ex1 by + performing get_associated_executor(handler). +
  • +
  • + Creates a work object w by performing make_work(ex1). +
  • +
  • + Obtains the handler's associated allocator object alloc + by performing get_associated_allocator(handler). +
  • +
  • + Constructs a function object f with a function call operator + that performs ex1.dispatch(std::move(handler), alloc) + followed by w.reset(). +
  • +
  • + Performs Executor(ex).dispatch(std::move(f), alloc). +
  • +
  • + Returns result.get(). +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dispatch/overload3.html b/include/asio/doc/asio/reference/dispatch/overload3.html new file mode 100644 index 0000000..df681dc --- /dev/null +++ b/include/asio/doc/asio/reference/dispatch/overload3.html @@ -0,0 +1,57 @@ + + + +dispatch (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename ExecutionContext,
+    typename CompletionToken = DEFAULT>
+DEDUCED dispatch(
+    ExecutionContext & ctx,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + Return + Value +
+

+ dispatch(ctx.get_executor(), forward<CompletionToken>(token)). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_buffer.html b/include/asio/doc/asio/reference/dynamic_buffer.html new file mode 100644 index 0000000..21cfb32 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_buffer.html @@ -0,0 +1,91 @@ + + + +dynamic_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The asio::dynamic_buffer + function is used to create a dynamically resized buffer from a std::basic_string + or std::vector. +

+

+ Create a new dynamic buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+dynamic_string_buffer< Elem, Traits, Allocator > dynamic_buffer(
+    std::basic_string< Elem, Traits, Allocator > & data);
+  » more...
+
+template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+dynamic_string_buffer< Elem, Traits, Allocator > dynamic_buffer(
+    std::basic_string< Elem, Traits, Allocator > & data,
+    std::size_t max_size);
+  » more...
+
+

+ Create a new dynamic buffer that represents the given vector. +

+
template<
+    typename Elem,
+    typename Allocator>
+dynamic_vector_buffer< Elem, Allocator > dynamic_buffer(
+    std::vector< Elem, Allocator > & data);
+  » more...
+
+template<
+    typename Elem,
+    typename Allocator>
+dynamic_vector_buffer< Elem, Allocator > dynamic_buffer(
+    std::vector< Elem, Allocator > & data,
+    std::size_t max_size);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_buffer/overload1.html b/include/asio/doc/asio/reference/dynamic_buffer/overload1.html new file mode 100644 index 0000000..1d1d5f7 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_buffer/overload1.html @@ -0,0 +1,55 @@ + + + +dynamic_buffer (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new dynamic buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+dynamic_string_buffer< Elem, Traits, Allocator > dynamic_buffer(
+    std::basic_string< Elem, Traits, Allocator > & data);
+
+
+ + Return Value +
+

+ dynamic_string_buffer<Elem, Traits, Allocator>(data). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_buffer/overload2.html b/include/asio/doc/asio/reference/dynamic_buffer/overload2.html new file mode 100644 index 0000000..07e2f34 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_buffer/overload2.html @@ -0,0 +1,56 @@ + + + +dynamic_buffer (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new dynamic buffer that represents the given string. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+dynamic_string_buffer< Elem, Traits, Allocator > dynamic_buffer(
+    std::basic_string< Elem, Traits, Allocator > & data,
+    std::size_t max_size);
+
+
+ + Return Value +
+

+ dynamic_string_buffer<Elem, Traits, Allocator>(data, max_size). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_buffer/overload3.html b/include/asio/doc/asio/reference/dynamic_buffer/overload3.html new file mode 100644 index 0000000..c2d11e8 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_buffer/overload3.html @@ -0,0 +1,54 @@ + + + +dynamic_buffer (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new dynamic buffer that represents the given vector. +

+
template<
+    typename Elem,
+    typename Allocator>
+dynamic_vector_buffer< Elem, Allocator > dynamic_buffer(
+    std::vector< Elem, Allocator > & data);
+
+
+ + Return Value +
+

+ dynamic_vector_buffer<Elem, Allocator>(data). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_buffer/overload4.html b/include/asio/doc/asio/reference/dynamic_buffer/overload4.html new file mode 100644 index 0000000..cbc948b --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_buffer/overload4.html @@ -0,0 +1,55 @@ + + + +dynamic_buffer (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new dynamic buffer that represents the given vector. +

+
template<
+    typename Elem,
+    typename Allocator>
+dynamic_vector_buffer< Elem, Allocator > dynamic_buffer(
+    std::vector< Elem, Allocator > & data,
+    std::size_t max_size);
+
+
+ + Return Value +
+

+ dynamic_vector_buffer<Elem, Allocator>(data, max_size). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer.html b/include/asio/doc/asio/reference/dynamic_string_buffer.html new file mode 100644 index 0000000..4a71796 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer.html @@ -0,0 +1,265 @@ + + + +dynamic_string_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adapt a basic_string to the DynamicBuffer requirements. +

+
template<
+    typename Elem,
+    typename Traits,
+    typename Allocator>
+class dynamic_string_buffer
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffers_type +

+
+

+ The type used to represent a sequence of constant buffers that + refers to the underlying memory. +

+
+

+ mutable_buffers_type +

+
+

+ The type used to represent a sequence of mutable buffers that refers + to the underlying memory. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ capacity +

+
+

+ Get the maximum size that the buffer may grow to without triggering + reallocation. +

+
+

+ commit +

+
+

+ DynamicBuffer_v1: Move bytes from the output sequence to the input + sequence. +

+
+

+ consume +

+
+

+ DynamicBuffer_v1: Remove characters from the input sequence. DynamicBuffer_v2: + Consume the specified number of bytes from the beginning of the + underlying memory. +

+
+

+ data +

+
+

+ DynamicBuffer_v1: Get a list of buffers that represents the input + sequence.
—
DynamicBuffer_v2: Get a sequence of buffers + that represents the underlying memory. +

+
+

+ dynamic_string_buffer [constructor] +

+
+

+ Construct a dynamic buffer from a string.
—
DynamicBuffer_v2: + Copy construct a dynamic buffer.
—
Move construct a + dynamic buffer. +

+
+

+ grow +

+
+

+ DynamicBuffer_v2: Grow the underlying memory by the specified number + of bytes. +

+
+

+ max_size +

+
+

+ Get the maximum size of the dynamic buffer. +

+
+

+ prepare +

+
+

+ DynamicBuffer_v1: Get a list of buffers that represents the output + sequence, with the given size. +

+
+

+ shrink +

+
+

+ DynamicBuffer_v2: Shrink the underlying memory by the specified + number of bytes. +

+
+

+ size +

+
+

+ DynamicBuffer_v1: Get the size of the input sequence. DynamicBuffer_v2: + Get the current size of the underlying memory. +

+
+

+ Requires that sizeof(Elem) == 1. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/capacity.html b/include/asio/doc/asio/reference/dynamic_string_buffer/capacity.html new file mode 100644 index 0000000..5199b3c --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/capacity.html @@ -0,0 +1,53 @@ + + + +dynamic_string_buffer::capacity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the maximum size that the buffer may grow to without triggering reallocation. +

+
std::size_t capacity() const;
+
+
+ + Return + Value +
+

+ The current capacity of the underlying string if less than max_size(). + Otherwise returns max_size(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/commit.html b/include/asio/doc/asio/reference/dynamic_string_buffer/commit.html new file mode 100644 index 0000000..3fd1f3a --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/commit.html @@ -0,0 +1,72 @@ + + + +dynamic_string_buffer::commit + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Move bytes from the output sequence + to the input sequence. +

+
void commit(
+    std::size_t n);
+
+
+ + Parameters +
+
+

+
+
n
+

+ The number of bytes to append from the start of the output sequence + to the end of the input sequence. The remainder of the output sequence + is discarded. +

+
+
+

+ Requires a preceding call prepare(x) where x >= n, + and no intervening operations that modify the input or output sequence. +

+
+ + Remarks +
+

+ If n is greater than the size of the output sequence, the + entire output sequence is moved to the input sequence and no error is issued. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/const_buffers_type.html b/include/asio/doc/asio/reference/dynamic_string_buffer/const_buffers_type.html new file mode 100644 index 0000000..3e44388 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/const_buffers_type.html @@ -0,0 +1,188 @@ + + + +dynamic_string_buffer::const_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent a sequence of constant buffers that refers to the + underlying memory. +

+
typedef const_buffer const_buffers_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range.
—
Construct a non-modifiable + buffer from a modifiable one. +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new non-modifiable buffer that is offset from the start + of another. +

+
+

+ The const_buffer + class provides a safe representation of a buffer that cannot be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() + and size() member functions: +

+
asio::const_buffer b1 = ...;
+std::size_t s1 = b1.size();
+const unsigned char* p1 = static_cast<const unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/consume.html b/include/asio/doc/asio/reference/dynamic_string_buffer/consume.html new file mode 100644 index 0000000..1d34b72 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/consume.html @@ -0,0 +1,63 @@ + + + +dynamic_string_buffer::consume + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Remove characters from the input + sequence. DynamicBuffer_v2: Consume the + specified number of bytes from the beginning of the underlying memory. +

+
void consume(
+    std::size_t n);
+
+

+ DynamicBuffer_v1: Removes n + characters from the beginning of the input sequence. +

+
+ + Remarks +
+

+ If n is greater than the size of the input sequence, the entire + input sequence is consumed and no error is issued. +

+

+ DynamicBuffer_v2: Erases n + bytes from the beginning of the string. If n is greater than + the current size of the string, the string is emptied. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/data.html b/include/asio/doc/asio/reference/dynamic_string_buffer/data.html new file mode 100644 index 0000000..6059b3e --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/data.html @@ -0,0 +1,59 @@ + + + +dynamic_string_buffer::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Get a list of buffers that represents + the input sequence. +

+
const_buffers_type data() const;
+  » more...
+
+

+ DynamicBuffer_v2: Get a sequence of buffers + that represents the underlying memory. +

+
mutable_buffers_type data(
+    std::size_t pos,
+    std::size_t n);
+  » more...
+
+const_buffers_type data(
+    std::size_t pos,
+    std::size_t n) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload1.html b/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload1.html new file mode 100644 index 0000000..787eb4d --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload1.html @@ -0,0 +1,62 @@ + + + +dynamic_string_buffer::data (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v1: Get a list of buffers + that represents the input sequence. +

+
const_buffers_type data() const;
+
+
+ + Return + Value +
+

+ An object of type const_buffers_type that satisfies ConstBufferSequence + requirements, representing the basic_string memory in the input sequence. +

+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_string_buffer + or basic_string member function that resizes or erases the + string. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload2.html b/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload2.html new file mode 100644 index 0000000..347ffb9 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload2.html @@ -0,0 +1,83 @@ + + + +dynamic_string_buffer::data (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v2: Get a sequence of + buffers that represents the underlying memory. +

+
mutable_buffers_type data(
+    std::size_t pos,
+    std::size_t n);
+
+
+ + Parameters +
+
+

+
+
pos
+

+ Position of the first byte to represent in the buffer sequence +

+
n
+

+ The number of bytes to return in the buffer sequence. If the underlying + memory is shorter, the buffer sequence represents as many bytes + as are available. +

+
+
+
+ + Return + Value +
+

+ An object of type mutable_buffers_type that satisfies MutableBufferSequence + requirements, representing the basic_string memory. +

+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_string_buffer + or basic_string member function that resizes or erases the + string. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload3.html b/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload3.html new file mode 100644 index 0000000..c668cb2 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/data/overload3.html @@ -0,0 +1,74 @@ + + + +dynamic_string_buffer::data (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v2: Get a sequence of + buffers that represents the underlying memory. +

+
const_buffers_type data(
+    std::size_t pos,
+    std::size_t n) const;
+
+
+ + Parameters +
+
+

+
+
pos
+

+ Position of the first byte to represent in the buffer sequence +

+
n
+

+ The number of bytes to return in the buffer sequence. If the underlying + memory is shorter, the buffer sequence represents as many bytes + as are available. +

+
+
+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_string_buffer + or basic_string member function that resizes or erases the + string. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer.html b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer.html new file mode 100644 index 0000000..f5068b3 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer.html @@ -0,0 +1,62 @@ + + + +dynamic_string_buffer::dynamic_string_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a dynamic buffer from a string. +

+
explicit dynamic_string_buffer(
+    std::basic_string< Elem, Traits, Allocator > & s,
+    std::size_t maximum_size = (std::numeric_limits< std::size_t >::max)());
+  » more...
+
+

+ DynamicBuffer_v2: Copy construct a dynamic + buffer. +

+
dynamic_string_buffer(
+    const dynamic_string_buffer & other);
+  » more...
+
+

+ Move construct a dynamic buffer. +

+
dynamic_string_buffer(
+    dynamic_string_buffer && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload1.html b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload1.html new file mode 100644 index 0000000..c2fe003 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload1.html @@ -0,0 +1,78 @@ + + + +dynamic_string_buffer::dynamic_string_buffer (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a dynamic buffer from a string. +

+
dynamic_string_buffer(
+    std::basic_string< Elem, Traits, Allocator > & s,
+    std::size_t maximum_size = (std::numeric_limits< std::size_t >::max)());
+
+
+ + Parameters +
+
+

+
+
s
+

+ The string to be used as backing storage for the dynamic buffer. + The object stores a reference to the string and the user is responsible + for ensuring that the string object remains valid while the dynamic_string_buffer + object, and copies of the object, are in use. +

+
+
+

+ DynamicBuffer_v1: Any existing data + in the string is treated as the dynamic buffer's input sequence. +

+
+ + Parameters +
+
+

+
+
maximum_size
+

+ Specifies a maximum size for the buffer, in bytes. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload2.html b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload2.html new file mode 100644 index 0000000..5493f37 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload2.html @@ -0,0 +1,45 @@ + + + +dynamic_string_buffer::dynamic_string_buffer (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v2: Copy construct a dynamic + buffer. +

+
dynamic_string_buffer(
+    const dynamic_string_buffer & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload3.html b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload3.html new file mode 100644 index 0000000..10b5e56 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload3.html @@ -0,0 +1,44 @@ + + + +dynamic_string_buffer::dynamic_string_buffer (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move construct a dynamic buffer. +

+
dynamic_string_buffer(
+    dynamic_string_buffer && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/grow.html b/include/asio/doc/asio/reference/dynamic_string_buffer/grow.html new file mode 100644 index 0000000..809af47 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/grow.html @@ -0,0 +1,62 @@ + + + +dynamic_string_buffer::grow + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v2: Grow the underlying memory by + the specified number of bytes. +

+
void grow(
+    std::size_t n);
+
+

+ Resizes the string to accommodate an additional n bytes at + the end. +

+
+ + Exceptions +
+
+

+
+
std::length_error
+

+ If size() + n > max_size(). +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/max_size.html b/include/asio/doc/asio/reference/dynamic_string_buffer/max_size.html new file mode 100644 index 0000000..f9e6ad1 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/max_size.html @@ -0,0 +1,52 @@ + + + +dynamic_string_buffer::max_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the maximum size of the dynamic buffer. +

+
std::size_t max_size() const;
+
+
+ + Return + Value +
+

+ The allowed maximum size of the underlying memory. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/mutable_buffers_type.html b/include/asio/doc/asio/reference/dynamic_string_buffer/mutable_buffers_type.html new file mode 100644 index 0000000..ee14a85 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/mutable_buffers_type.html @@ -0,0 +1,187 @@ + + + +dynamic_string_buffer::mutable_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent a sequence of mutable buffers that refers to the + underlying memory. +

+
typedef mutable_buffer mutable_buffers_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ mutable_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new modifiable buffer that is offset from the start + of another. +

+
+

+ The mutable_buffer + class provides a safe representation of a buffer that can be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() + and size() member functions: +

+
asio::mutable_buffer b1 = ...;
+std::size_t s1 = b1.size();
+unsigned char* p1 = static_cast<unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/prepare.html b/include/asio/doc/asio/reference/dynamic_string_buffer/prepare.html new file mode 100644 index 0000000..cd2264b --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/prepare.html @@ -0,0 +1,81 @@ + + + +dynamic_string_buffer::prepare + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Get a list of buffers that represents + the output sequence, with the given size. +

+
mutable_buffers_type prepare(
+    std::size_t n);
+
+

+ Ensures that the output sequence can accommodate n bytes, + resizing the basic_string object as necessary. +

+
+ + Return + Value +
+

+ An object of type mutable_buffers_type that satisfies MutableBufferSequence + requirements, representing basic_string memory at the start of the output + sequence of size n. +

+
+ + Exceptions +
+
+

+
+
std::length_error
+

+ If size() + n > max_size(). +

+
+
+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_string_buffer + or basic_string member function that modifies the input sequence + or output sequence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/shrink.html b/include/asio/doc/asio/reference/dynamic_string_buffer/shrink.html new file mode 100644 index 0000000..b841262 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/shrink.html @@ -0,0 +1,50 @@ + + + +dynamic_string_buffer::shrink + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v2: Shrink the underlying memory by + the specified number of bytes. +

+
void shrink(
+    std::size_t n);
+
+

+ Erases n bytes from the end of the string by resizing the + basic_string object. If n is greater than the current size + of the string, the string is emptied. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_string_buffer/size.html b/include/asio/doc/asio/reference/dynamic_string_buffer/size.html new file mode 100644 index 0000000..819bbc3 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_string_buffer/size.html @@ -0,0 +1,56 @@ + + + +dynamic_string_buffer::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Get the size of the input sequence. + DynamicBuffer_v2: Get the current size + of the underlying memory. +

+
std::size_t size() const;
+
+
+ + Return + Value +
+

+ DynamicBuffer_v1 The current size of the + input sequence. DynamicBuffer_v2: The + current size of the underlying string if less than max_size(). + Otherwise returns max_size(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer.html b/include/asio/doc/asio/reference/dynamic_vector_buffer.html new file mode 100644 index 0000000..6e6ffa5 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer.html @@ -0,0 +1,264 @@ + + + +dynamic_vector_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adapt a vector to the DynamicBuffer requirements. +

+
template<
+    typename Elem,
+    typename Allocator>
+class dynamic_vector_buffer
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffers_type +

+
+

+ The type used to represent a sequence of constant buffers that + refers to the underlying memory. +

+
+

+ mutable_buffers_type +

+
+

+ The type used to represent a sequence of mutable buffers that refers + to the underlying memory. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ capacity +

+
+

+ Get the maximum size that the buffer may grow to without triggering + reallocation. +

+
+

+ commit +

+
+

+ DynamicBuffer_v1: Move bytes from the output sequence to the input + sequence. +

+
+

+ consume +

+
+

+ DynamicBuffer_v1: Remove characters from the input sequence. DynamicBuffer_v2: + Consume the specified number of bytes from the beginning of the + underlying memory. +

+
+

+ data +

+
+

+ DynamicBuffer_v1: Get a list of buffers that represents the input + sequence.
—
DynamicBuffer_v2: Get a sequence of buffers + that represents the underlying memory. +

+
+

+ dynamic_vector_buffer [constructor] +

+
+

+ Construct a dynamic buffer from a vector.
—
DynamicBuffer_v2: + Copy construct a dynamic buffer.
—
Move construct a + dynamic buffer. +

+
+

+ grow +

+
+

+ DynamicBuffer_v2: Grow the underlying memory by the specified number + of bytes. +

+
+

+ max_size +

+
+

+ Get the maximum size of the dynamic buffer. +

+
+

+ prepare +

+
+

+ DynamicBuffer_v1: Get a list of buffers that represents the output + sequence, with the given size. +

+
+

+ shrink +

+
+

+ DynamicBuffer_v2: Shrink the underlying memory by the specified + number of bytes. +

+
+

+ size +

+
+

+ DynamicBuffer_v1: Get the size of the input sequence. DynamicBuffer_v2: + Get the current size of the underlying memory. +

+
+

+ Requires that sizeof(Elem) == 1. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/capacity.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/capacity.html new file mode 100644 index 0000000..fde6b08 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/capacity.html @@ -0,0 +1,54 @@ + + + +dynamic_vector_buffer::capacity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the maximum size that the buffer may grow to without triggering reallocation. +

+
std::size_t capacity() const;
+
+
+ + Return + Value +
+

+ DynamicBuffer_v1: The current total capacity + of the buffer, i.e. for both the input sequence and output sequence. DynamicBuffer_v2: The current capacity of the underlying + vector if less than max_size(). Otherwise returns max_size(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/commit.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/commit.html new file mode 100644 index 0000000..d9584c1 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/commit.html @@ -0,0 +1,72 @@ + + + +dynamic_vector_buffer::commit + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Move bytes from the output sequence + to the input sequence. +

+
void commit(
+    std::size_t n);
+
+
+ + Parameters +
+
+

+
+
n
+

+ The number of bytes to append from the start of the output sequence + to the end of the input sequence. The remainder of the output sequence + is discarded. +

+
+
+

+ Requires a preceding call prepare(x) where x >= n, + and no intervening operations that modify the input or output sequence. +

+
+ + Remarks +
+

+ If n is greater than the size of the output sequence, the + entire output sequence is moved to the input sequence and no error is issued. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/const_buffers_type.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/const_buffers_type.html new file mode 100644 index 0000000..72d439f --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/const_buffers_type.html @@ -0,0 +1,188 @@ + + + +dynamic_vector_buffer::const_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent a sequence of constant buffers that refers to the + underlying memory. +

+
typedef const_buffer const_buffers_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range.
—
Construct a non-modifiable + buffer from a modifiable one. +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new non-modifiable buffer that is offset from the start + of another. +

+
+

+ The const_buffer + class provides a safe representation of a buffer that cannot be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() + and size() member functions: +

+
asio::const_buffer b1 = ...;
+std::size_t s1 = b1.size();
+const unsigned char* p1 = static_cast<const unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/consume.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/consume.html new file mode 100644 index 0000000..6508d05 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/consume.html @@ -0,0 +1,63 @@ + + + +dynamic_vector_buffer::consume + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Remove characters from the input + sequence. DynamicBuffer_v2: Consume the + specified number of bytes from the beginning of the underlying memory. +

+
void consume(
+    std::size_t n);
+
+

+ DynamicBuffer_v1: Removes n + characters from the beginning of the input sequence. +

+
+ + Remarks +
+

+ If n is greater than the size of the input sequence, the entire + input sequence is consumed and no error is issued. +

+

+ DynamicBuffer_v2: Erases n + bytes from the beginning of the vector. If n is greater than + the current size of the vector, the vector is emptied. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/data.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/data.html new file mode 100644 index 0000000..957ab56 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/data.html @@ -0,0 +1,59 @@ + + + +dynamic_vector_buffer::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Get a list of buffers that represents + the input sequence. +

+
const_buffers_type data() const;
+  » more...
+
+

+ DynamicBuffer_v2: Get a sequence of buffers + that represents the underlying memory. +

+
mutable_buffers_type data(
+    std::size_t pos,
+    std::size_t n);
+  » more...
+
+const_buffers_type data(
+    std::size_t pos,
+    std::size_t n) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload1.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload1.html new file mode 100644 index 0000000..fb55de2 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload1.html @@ -0,0 +1,62 @@ + + + +dynamic_vector_buffer::data (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v1: Get a list of buffers + that represents the input sequence. +

+
const_buffers_type data() const;
+
+
+ + Return + Value +
+

+ An object of type const_buffers_type that satisfies ConstBufferSequence + requirements, representing the vector memory in the input sequence. +

+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_vector_buffer + or vector member function that modifies the input sequence + or output sequence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload2.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload2.html new file mode 100644 index 0000000..7daca16 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload2.html @@ -0,0 +1,82 @@ + + + +dynamic_vector_buffer::data (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v2: Get a sequence of + buffers that represents the underlying memory. +

+
mutable_buffers_type data(
+    std::size_t pos,
+    std::size_t n);
+
+
+ + Parameters +
+
+

+
+
pos
+

+ Position of the first byte to represent in the buffer sequence +

+
n
+

+ The number of bytes to return in the buffer sequence. If the underlying + memory is shorter, the buffer sequence represents as many bytes + as are available. +

+
+
+
+ + Return + Value +
+

+ An object of type mutable_buffers_type that satisfies MutableBufferSequence + requirements, representing the vector memory. +

+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_vector_buffer + or vector member function that resizes or erases the vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload3.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload3.html new file mode 100644 index 0000000..c72dfa7 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/data/overload3.html @@ -0,0 +1,73 @@ + + + +dynamic_vector_buffer::data (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v2: Get a sequence of + buffers that represents the underlying memory. +

+
const_buffers_type data(
+    std::size_t pos,
+    std::size_t n) const;
+
+
+ + Parameters +
+
+

+
+
pos
+

+ Position of the first byte to represent in the buffer sequence +

+
n
+

+ The number of bytes to return in the buffer sequence. If the underlying + memory is shorter, the buffer sequence represents as many bytes + as are available. +

+
+
+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_vector_buffer + or vector member function that resizes or erases the vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer.html new file mode 100644 index 0000000..34dc0c8 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer.html @@ -0,0 +1,62 @@ + + + +dynamic_vector_buffer::dynamic_vector_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a dynamic buffer from a vector. +

+
explicit dynamic_vector_buffer(
+    std::vector< Elem, Allocator > & v,
+    std::size_t maximum_size = (std::numeric_limits< std::size_t >::max)());
+  » more...
+
+

+ DynamicBuffer_v2: Copy construct a dynamic + buffer. +

+
dynamic_vector_buffer(
+    const dynamic_vector_buffer & other);
+  » more...
+
+

+ Move construct a dynamic buffer. +

+
dynamic_vector_buffer(
+    dynamic_vector_buffer && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload1.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload1.html new file mode 100644 index 0000000..9717be9 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload1.html @@ -0,0 +1,65 @@ + + + +dynamic_vector_buffer::dynamic_vector_buffer (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a dynamic buffer from a vector. +

+
dynamic_vector_buffer(
+    std::vector< Elem, Allocator > & v,
+    std::size_t maximum_size = (std::numeric_limits< std::size_t >::max)());
+
+
+ + Parameters +
+
+

+
+
v
+

+ The vector to be used as backing storage for the dynamic buffer. + The object stores a reference to the vector and the user is responsible + for ensuring that the vector object remains valid while the dynamic_vector_buffer + object, and copies of the object, are in use. +

+
maximum_size
+

+ Specifies a maximum size for the buffer, in bytes. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload2.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload2.html new file mode 100644 index 0000000..570a320 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload2.html @@ -0,0 +1,45 @@ + + + +dynamic_vector_buffer::dynamic_vector_buffer (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ DynamicBuffer_v2: Copy construct a dynamic + buffer. +

+
dynamic_vector_buffer(
+    const dynamic_vector_buffer & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload3.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload3.html new file mode 100644 index 0000000..f371865 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload3.html @@ -0,0 +1,44 @@ + + + +dynamic_vector_buffer::dynamic_vector_buffer (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move construct a dynamic buffer. +

+
dynamic_vector_buffer(
+    dynamic_vector_buffer && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/grow.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/grow.html new file mode 100644 index 0000000..2dfe161 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/grow.html @@ -0,0 +1,62 @@ + + + +dynamic_vector_buffer::grow + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v2: Grow the underlying memory by + the specified number of bytes. +

+
void grow(
+    std::size_t n);
+
+

+ Resizes the vector to accommodate an additional n bytes at + the end. +

+
+ + Exceptions +
+
+

+
+
std::length_error
+

+ If size() + n > max_size(). +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/max_size.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/max_size.html new file mode 100644 index 0000000..fa4a6cc --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/max_size.html @@ -0,0 +1,54 @@ + + + +dynamic_vector_buffer::max_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the maximum size of the dynamic buffer. +

+
std::size_t max_size() const;
+
+
+ + Return + Value +
+

+ DynamicBuffer_v1: The allowed maximum + of the sum of the sizes of the input sequence and output sequence. DynamicBuffer_v2: The allowed maximum size of the + underlying memory. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/mutable_buffers_type.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/mutable_buffers_type.html new file mode 100644 index 0000000..cf8289c --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/mutable_buffers_type.html @@ -0,0 +1,187 @@ + + + +dynamic_vector_buffer::mutable_buffers_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used to represent a sequence of mutable buffers that refers to the + underlying memory. +

+
typedef mutable_buffer mutable_buffers_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ mutable_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new modifiable buffer that is offset from the start + of another. +

+
+

+ The mutable_buffer + class provides a safe representation of a buffer that can be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() + and size() member functions: +

+
asio::mutable_buffer b1 = ...;
+std::size_t s1 = b1.size();
+unsigned char* p1 = static_cast<unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/prepare.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/prepare.html new file mode 100644 index 0000000..400bf32 --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/prepare.html @@ -0,0 +1,81 @@ + + + +dynamic_vector_buffer::prepare + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Get a list of buffers that represents + the output sequence, with the given size. +

+
mutable_buffers_type prepare(
+    std::size_t n);
+
+

+ Ensures that the output sequence can accommodate n bytes, + resizing the vector object as necessary. +

+
+ + Return + Value +
+

+ An object of type mutable_buffers_type that satisfies MutableBufferSequence + requirements, representing vector memory at the start of the output sequence + of size n. +

+
+ + Exceptions +
+
+

+
+
std::length_error
+

+ If size() + n > max_size(). +

+
+
+
+ + Remarks +
+

+ The returned object is invalidated by any dynamic_vector_buffer + or vector member function that modifies the input sequence + or output sequence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/shrink.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/shrink.html new file mode 100644 index 0000000..e8ec20f --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/shrink.html @@ -0,0 +1,50 @@ + + + +dynamic_vector_buffer::shrink + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v2: Shrink the underlying memory by + the specified number of bytes. +

+
void shrink(
+    std::size_t n);
+
+

+ Erases n bytes from the end of the vector by resizing the + vector object. If n is greater than the current size of the + vector, the vector is emptied. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/dynamic_vector_buffer/size.html b/include/asio/doc/asio/reference/dynamic_vector_buffer/size.html new file mode 100644 index 0000000..139101c --- /dev/null +++ b/include/asio/doc/asio/reference/dynamic_vector_buffer/size.html @@ -0,0 +1,56 @@ + + + +dynamic_vector_buffer::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +DynamicBuffer_v1: Get the size of the input sequence. + DynamicBuffer_v2: Get the current size + of the underlying memory. +

+
std::size_t size() const;
+
+
+ + Return + Value +
+

+ DynamicBuffer_v1 The current size of the + input sequence. DynamicBuffer_v2: The + current size of the underlying vector if less than max_size(). + Otherwise returns max_size(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__addrinfo_category.html b/include/asio/doc/asio/reference/error__addrinfo_category.html new file mode 100644 index 0000000..dc0df95 --- /dev/null +++ b/include/asio/doc/asio/reference/error__addrinfo_category.html @@ -0,0 +1,52 @@ + + + +error::addrinfo_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static const asio::error_category & addrinfo_category = asio::error::get_addrinfo_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__addrinfo_errors.html b/include/asio/doc/asio/reference/error__addrinfo_errors.html new file mode 100644 index 0000000..90cbb6e --- /dev/null +++ b/include/asio/doc/asio/reference/error__addrinfo_errors.html @@ -0,0 +1,73 @@ + + + +error::addrinfo_errors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum addrinfo_errors
+
+

+ + +

+
+ + Values +
+
+

+
+
service_not_found
+

+ The service is not supported for the given socket type. +

+
socket_type_not_supported
+

+ The socket type is not supported. +

+
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__basic_errors.html b/include/asio/doc/asio/reference/error__basic_errors.html new file mode 100644 index 0000000..3822d14 --- /dev/null +++ b/include/asio/doc/asio/reference/error__basic_errors.html @@ -0,0 +1,234 @@ + + + +error::basic_errors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum basic_errors
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
+ + Values +
+
+

+
+
access_denied
+

+ Permission denied. +

+
address_family_not_supported
+

+ Address family not supported by protocol. +

+
address_in_use
+

+ Address already in use. +

+
already_connected
+

+ Transport endpoint is already connected. +

+
already_started
+

+ Operation already in progress. +

+
broken_pipe
+

+ Broken pipe. +

+
connection_aborted
+

+ A connection has been aborted. +

+
connection_refused
+

+ Connection refused. +

+
connection_reset
+

+ Connection reset by peer. +

+
bad_descriptor
+

+ Bad file descriptor. +

+
fault
+

+ Bad address. +

+
host_unreachable
+

+ No route to host. +

+
in_progress
+

+ Operation now in progress. +

+
interrupted
+

+ Interrupted system call. +

+
invalid_argument
+

+ Invalid argument. +

+
message_size
+

+ Message too long. +

+
name_too_long
+

+ The name was too long. +

+
network_down
+

+ Network is down. +

+
network_reset
+

+ Network dropped connection on reset. +

+
network_unreachable
+

+ Network is unreachable. +

+
no_descriptors
+

+ Too many open files. +

+
no_buffer_space
+

+ No buffer space available. +

+
no_memory
+

+ Cannot allocate memory. +

+
no_permission
+

+ Operation not permitted. +

+
no_protocol_option
+

+ Protocol not available. +

+
no_such_device
+

+ No such device. +

+
not_connected
+

+ Transport endpoint is not connected. +

+
not_socket
+

+ Socket operation on non-socket. +

+
operation_aborted
+

+ Operation cancelled. +

+
operation_not_supported
+

+ Operation not supported. +

+
shut_down
+

+ Cannot send after transport endpoint shutdown. +

+
timed_out
+

+ Connection timed out. +

+
try_again
+

+ Resource temporarily unavailable. +

+
would_block
+

+ The socket is marked non-blocking and the requested operation would + block. +

+
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__get_addrinfo_category.html b/include/asio/doc/asio/reference/error__get_addrinfo_category.html new file mode 100644 index 0000000..2428a79 --- /dev/null +++ b/include/asio/doc/asio/reference/error__get_addrinfo_category.html @@ -0,0 +1,52 @@ + + + +error::get_addrinfo_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const asio::error_category & get_addrinfo_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__get_misc_category.html b/include/asio/doc/asio/reference/error__get_misc_category.html new file mode 100644 index 0000000..8cea32e --- /dev/null +++ b/include/asio/doc/asio/reference/error__get_misc_category.html @@ -0,0 +1,52 @@ + + + +error::get_misc_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const asio::error_category & get_misc_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__get_netdb_category.html b/include/asio/doc/asio/reference/error__get_netdb_category.html new file mode 100644 index 0000000..ea7b508 --- /dev/null +++ b/include/asio/doc/asio/reference/error__get_netdb_category.html @@ -0,0 +1,52 @@ + + + +error::get_netdb_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const asio::error_category & get_netdb_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__get_ssl_category.html b/include/asio/doc/asio/reference/error__get_ssl_category.html new file mode 100644 index 0000000..7cf2e6d --- /dev/null +++ b/include/asio/doc/asio/reference/error__get_ssl_category.html @@ -0,0 +1,52 @@ + + + +error::get_ssl_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const asio::error_category & get_ssl_category();
+
+
+ + Requirements +
+

+ Header: asio/ssl/error.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__get_system_category.html b/include/asio/doc/asio/reference/error__get_system_category.html new file mode 100644 index 0000000..b2cba86 --- /dev/null +++ b/include/asio/doc/asio/reference/error__get_system_category.html @@ -0,0 +1,52 @@ + + + +error::get_system_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const asio::error_category & get_system_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__make_error_code.html b/include/asio/doc/asio/reference/error__make_error_code.html new file mode 100644 index 0000000..ef30a51 --- /dev/null +++ b/include/asio/doc/asio/reference/error__make_error_code.html @@ -0,0 +1,74 @@ + + + +error::make_error_code + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ + asio::error_code +

+
[link asio.reference.error__make_error_code.overload1 make_error_code]
+

+ ( basic_errors e); +

+
[''''&raquo;''' [link asio.reference.error__make_error_code.overload1 more...]]
+

+

+
asio::error_code make_error_code(
+    netdb_errors e);
+  » more...
+
+asio::error_code make_error_code(
+    addrinfo_errors e);
+  » more...
+
+asio::error_code make_error_code(
+    misc_errors e);
+  » more...
+
+asio::error_code make_error_code(
+    ssl_errors e);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__make_error_code/overload1.html b/include/asio/doc/asio/reference/error__make_error_code/overload1.html new file mode 100644 index 0000000..bb6ccb4 --- /dev/null +++ b/include/asio/doc/asio/reference/error__make_error_code/overload1.html @@ -0,0 +1,41 @@ + + + +error::make_error_code (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
asio::error_code make_error_code(
+    basic_errors e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__make_error_code/overload2.html b/include/asio/doc/asio/reference/error__make_error_code/overload2.html new file mode 100644 index 0000000..fcec73c --- /dev/null +++ b/include/asio/doc/asio/reference/error__make_error_code/overload2.html @@ -0,0 +1,41 @@ + + + +error::make_error_code (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
asio::error_code make_error_code(
+    netdb_errors e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__make_error_code/overload3.html b/include/asio/doc/asio/reference/error__make_error_code/overload3.html new file mode 100644 index 0000000..1d7f71a --- /dev/null +++ b/include/asio/doc/asio/reference/error__make_error_code/overload3.html @@ -0,0 +1,41 @@ + + + +error::make_error_code (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
asio::error_code make_error_code(
+    addrinfo_errors e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__make_error_code/overload4.html b/include/asio/doc/asio/reference/error__make_error_code/overload4.html new file mode 100644 index 0000000..bb56f9d --- /dev/null +++ b/include/asio/doc/asio/reference/error__make_error_code/overload4.html @@ -0,0 +1,41 @@ + + + +error::make_error_code (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
asio::error_code make_error_code(
+    misc_errors e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__make_error_code/overload5.html b/include/asio/doc/asio/reference/error__make_error_code/overload5.html new file mode 100644 index 0000000..0e7b754 --- /dev/null +++ b/include/asio/doc/asio/reference/error__make_error_code/overload5.html @@ -0,0 +1,41 @@ + + + +error::make_error_code (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
asio::error_code make_error_code(
+    ssl_errors e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__misc_category.html b/include/asio/doc/asio/reference/error__misc_category.html new file mode 100644 index 0000000..0b2fba7 --- /dev/null +++ b/include/asio/doc/asio/reference/error__misc_category.html @@ -0,0 +1,52 @@ + + + +error::misc_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static const asio::error_category & misc_category = asio::error::get_misc_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__misc_errors.html b/include/asio/doc/asio/reference/error__misc_errors.html new file mode 100644 index 0000000..dff5140 --- /dev/null +++ b/include/asio/doc/asio/reference/error__misc_errors.html @@ -0,0 +1,83 @@ + + + +error::misc_errors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum misc_errors
+
+

+ + + + +

+
+ + Values +
+
+

+
+
already_open
+

+ Already open. +

+
eof
+

+ End of file or stream. +

+
not_found
+

+ Element not found. +

+
fd_set_failure
+

+ The descriptor cannot fit into the select system call's fd_set. +

+
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__netdb_category.html b/include/asio/doc/asio/reference/error__netdb_category.html new file mode 100644 index 0000000..d2cc144 --- /dev/null +++ b/include/asio/doc/asio/reference/error__netdb_category.html @@ -0,0 +1,52 @@ + + + +error::netdb_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static const asio::error_category & netdb_category = asio::error::get_netdb_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__netdb_errors.html b/include/asio/doc/asio/reference/error__netdb_errors.html new file mode 100644 index 0000000..01201a1 --- /dev/null +++ b/include/asio/doc/asio/reference/error__netdb_errors.html @@ -0,0 +1,83 @@ + + + +error::netdb_errors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum netdb_errors
+
+

+ + + + +

+
+ + Values +
+
+

+
+
host_not_found
+

+ Host not found (authoritative). +

+
host_not_found_try_again
+

+ Host not found (non-authoritative). +

+
no_data
+

+ The query is valid but does not have associated address data. +

+
no_recovery
+

+ A non-recoverable error occurred. +

+
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__ssl_category.html b/include/asio/doc/asio/reference/error__ssl_category.html new file mode 100644 index 0000000..c0c9459 --- /dev/null +++ b/include/asio/doc/asio/reference/error__ssl_category.html @@ -0,0 +1,52 @@ + + + +error::ssl_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static const asio::error_category & ssl_category = asio::error::get_ssl_category();
+
+
+ + Requirements +
+

+ Header: asio/ssl/error.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__ssl_errors.html b/include/asio/doc/asio/reference/error__ssl_errors.html new file mode 100644 index 0000000..54cfb99 --- /dev/null +++ b/include/asio/doc/asio/reference/error__ssl_errors.html @@ -0,0 +1,52 @@ + + + +error::ssl_errors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum ssl_errors
+
+
+ + Requirements +
+

+ Header: asio/ssl/error.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error__system_category.html b/include/asio/doc/asio/reference/error__system_category.html new file mode 100644 index 0000000..2efedff --- /dev/null +++ b/include/asio/doc/asio/reference/error__system_category.html @@ -0,0 +1,52 @@ + + + +error::system_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static const asio::error_category & system_category = asio::error::get_system_category();
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_category.html b/include/asio/doc/asio/reference/error_category.html new file mode 100644 index 0000000..9f9f107 --- /dev/null +++ b/include/asio/doc/asio/reference/error_category.html @@ -0,0 +1,138 @@ + + + +error_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Base class for all error categories. +

+
class error_category :
+  noncopyable
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ message +

+
+

+ Returns a string describing the error denoted by value. +

+
+

+ name +

+
+

+ Returns a string naming the error gategory. +

+
+

+ operator!= +

+
+

+ Inequality operator to compare two error categories. +

+
+

+ operator== +

+
+

+ Equality operator to compare two error categories. +

+
+

+ ~error_category [destructor] +

+
+

+ Destructor. +

+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_category/_error_category.html b/include/asio/doc/asio/reference/error_category/_error_category.html new file mode 100644 index 0000000..d1811ad --- /dev/null +++ b/include/asio/doc/asio/reference/error_category/_error_category.html @@ -0,0 +1,43 @@ + + + +error_category::~error_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
virtual ~error_category();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_category/message.html b/include/asio/doc/asio/reference/error_category/message.html new file mode 100644 index 0000000..9ec5793 --- /dev/null +++ b/include/asio/doc/asio/reference/error_category/message.html @@ -0,0 +1,45 @@ + + + +error_category::message + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Returns a string + describing the error denoted by value. +

+
std::string message(
+    int value) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_category/name.html b/include/asio/doc/asio/reference/error_category/name.html new file mode 100644 index 0000000..09dac42 --- /dev/null +++ b/include/asio/doc/asio/reference/error_category/name.html @@ -0,0 +1,44 @@ + + + +error_category::name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Returns a string naming + the error gategory. +

+
const char * name() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_category/operator_eq__eq_.html b/include/asio/doc/asio/reference/error_category/operator_eq__eq_.html new file mode 100644 index 0000000..b82cf01 --- /dev/null +++ b/include/asio/doc/asio/reference/error_category/operator_eq__eq_.html @@ -0,0 +1,45 @@ + + + +error_category::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Equality + operator to compare two error categories. +

+
bool operator==(
+    const error_category & rhs) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_category/operator_not__eq_.html b/include/asio/doc/asio/reference/error_category/operator_not__eq_.html new file mode 100644 index 0000000..7af5522 --- /dev/null +++ b/include/asio/doc/asio/reference/error_category/operator_not__eq_.html @@ -0,0 +1,45 @@ + + + +error_category::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inequality + operator to compare two error categories. +

+
bool operator!=(
+    const error_category & rhs) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code.html b/include/asio/doc/asio/reference/error_code.html new file mode 100644 index 0000000..6234eca --- /dev/null +++ b/include/asio/doc/asio/reference/error_code.html @@ -0,0 +1,273 @@ + + + +error_code + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Class to represent an error code value. +

+
class error_code
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ unspecified_bool_type_t +

+
+
+

+ unspecified_bool_type +

+
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign a new error value. +

+
+

+ category +

+
+

+ Get the error category. +

+
+

+ clear +

+
+

+ Clear the error value to the default. +

+
+

+ error_code [constructor] +

+
+

+ Default constructor.
—
Construct with specific error + code and category.
—
Construct from an error code enum. +

+
+

+ message +

+
+

+ Get the message associated with the error. +

+
+

+ operator unspecified_bool_type +

+
+

+ Operator returns non-null if there is a non-success error code. +

+
+

+ operator! +

+
+

+ Operator to test if the error represents success. +

+
+

+ unspecified_bool_true [static] +

+
+
+

+ value +

+
+

+ Get the error value. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Inequality operator to compare two error objects. +

+
+

+ operator== +

+
+

+ Equality operator to compare two error objects. +

+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/assign.html b/include/asio/doc/asio/reference/error_code/assign.html new file mode 100644 index 0000000..b1c7c73 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/assign.html @@ -0,0 +1,45 @@ + + + +error_code::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign a new error value. +

+
void assign(
+    int v,
+    const error_category & c);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/category.html b/include/asio/doc/asio/reference/error_code/category.html new file mode 100644 index 0000000..c5fa415 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/category.html @@ -0,0 +1,43 @@ + + + +error_code::category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the error category. +

+
const error_category & category() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/clear.html b/include/asio/doc/asio/reference/error_code/clear.html new file mode 100644 index 0000000..7914bae --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/clear.html @@ -0,0 +1,44 @@ + + + +error_code::clear + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Clear the error value to + the default. +

+
void clear();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/error_code.html b/include/asio/doc/asio/reference/error_code/error_code.html new file mode 100644 index 0000000..90de164 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/error_code.html @@ -0,0 +1,61 @@ + + + +error_code::error_code + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default constructor. +

+
error_code();
+  » more...
+
+

+ Construct with specific error code and category. +

+
error_code(
+    int v,
+    const error_category & c);
+  » more...
+
+

+ Construct from an error code enum. +

+
template<
+    typename ErrorEnum>
+error_code(
+    ErrorEnum e);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/error_code/overload1.html b/include/asio/doc/asio/reference/error_code/error_code/overload1.html new file mode 100644 index 0000000..9d8c781 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/error_code/overload1.html @@ -0,0 +1,43 @@ + + + +error_code::error_code (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
error_code();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/error_code/overload2.html b/include/asio/doc/asio/reference/error_code/error_code/overload2.html new file mode 100644 index 0000000..1d687c1 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/error_code/overload2.html @@ -0,0 +1,45 @@ + + + +error_code::error_code (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with specific error code and category. +

+
error_code(
+    int v,
+    const error_category & c);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/error_code/overload3.html b/include/asio/doc/asio/reference/error_code/error_code/overload3.html new file mode 100644 index 0000000..710b555 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/error_code/overload3.html @@ -0,0 +1,46 @@ + + + +error_code::error_code (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from an error code enum. +

+
template<
+    typename ErrorEnum>
+error_code(
+    ErrorEnum e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/message.html b/include/asio/doc/asio/reference/error_code/message.html new file mode 100644 index 0000000..d878edb --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/message.html @@ -0,0 +1,44 @@ + + + +error_code::message + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the message associated + with the error. +

+
std::string message() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/operator_eq__eq_.html b/include/asio/doc/asio/reference/error_code/operator_eq__eq_.html new file mode 100644 index 0000000..3d885f8 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +error_code::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Equality + operator to compare two error objects. +

+
friend bool operator==(
+    const error_code & e1,
+    const error_code & e2);
+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/operator_not_.html b/include/asio/doc/asio/reference/error_code/operator_not_.html new file mode 100644 index 0000000..85420c5 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/operator_not_.html @@ -0,0 +1,44 @@ + + + +error_code::operator! + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Operator to test + if the error represents success. +

+
bool operator!() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/operator_not__eq_.html b/include/asio/doc/asio/reference/error_code/operator_not__eq_.html new file mode 100644 index 0000000..96a2188 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +error_code::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inequality + operator to compare two error objects. +

+
friend bool operator!=(
+    const error_code & e1,
+    const error_code & e2);
+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/operator_unspecified_bool_type.html b/include/asio/doc/asio/reference/error_code/operator_unspecified_bool_type.html new file mode 100644 index 0000000..253ac37 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/operator_unspecified_bool_type.html @@ -0,0 +1,45 @@ + + + +error_code::operator unspecified_bool_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Operator + returns non-null if there is a non-success error code. +

+
operator unspecified_bool_type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/unspecified_bool_true.html b/include/asio/doc/asio/reference/error_code/unspecified_bool_true.html new file mode 100644 index 0000000..80e3fb8 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/unspecified_bool_true.html @@ -0,0 +1,43 @@ + + + +error_code::unspecified_bool_true + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static void unspecified_bool_true(
+    unspecified_bool_type_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/unspecified_bool_type.html b/include/asio/doc/asio/reference/error_code/unspecified_bool_type.html new file mode 100644 index 0000000..e1a59ed --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/unspecified_bool_type.html @@ -0,0 +1,52 @@ + + + +error_code::unspecified_bool_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
typedef void(*) unspecified_bool_type;
+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code/value.html b/include/asio/doc/asio/reference/error_code/value.html new file mode 100644 index 0000000..58eaf95 --- /dev/null +++ b/include/asio/doc/asio/reference/error_code/value.html @@ -0,0 +1,43 @@ + + + +error_code::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the error value. +

+
int value() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/error_code__unspecified_bool_type_t.html b/include/asio/doc/asio/reference/error_code__unspecified_bool_type_t.html new file mode 100644 index 0000000..59321dd --- /dev/null +++ b/include/asio/doc/asio/reference/error_code__unspecified_bool_type_t.html @@ -0,0 +1,49 @@ + + + +error_code::unspecified_bool_type_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
struct unspecified_bool_type_t
+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__allocator.html b/include/asio/doc/asio/reference/execution__allocator.html new file mode 100644 index 0000000..bf70093 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__allocator.html @@ -0,0 +1,55 @@ + + + +execution::allocator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value used + for accessing the execution::allocator_t + property. +

+
constexpr allocator_t< void > allocator;
+
+
+ + Requirements +
+

+ Header: asio/execution/allocator.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__allocator_t.html b/include/asio/doc/asio/reference/execution__allocator_t.html new file mode 100644 index 0000000..d06d985 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__allocator_t.html @@ -0,0 +1,164 @@ + + + +execution::allocator_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property to describe which allocator an executor will use to allocate the + memory required to store a submitted function object. +

+
template<
+    typename ProtoAllocator>
+struct allocator_t
+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ allocator_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value +

+
+

+ Obtain the allocator stored in the allocator_t property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The allocator_t property applies to executors, senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The allocator_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The allocator_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/allocator.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__allocator_t/allocator_t.html b/include/asio/doc/asio/reference/execution__allocator_t/allocator_t.html new file mode 100644 index 0000000..a013d10 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__allocator_t/allocator_t.html @@ -0,0 +1,44 @@ + + + +execution::allocator_t::allocator_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr allocator_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__allocator_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__allocator_t/is_applicable_property_v.html new file mode 100644 index 0000000..b790505 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__allocator_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::allocator_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::allocator_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__allocator_t/is_preferable.html b/include/asio/doc/asio/reference/execution__allocator_t/is_preferable.html new file mode 100644 index 0000000..8b3d6df --- /dev/null +++ b/include/asio/doc/asio/reference/execution__allocator_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::allocator_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::allocator_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__allocator_t/is_requirable.html b/include/asio/doc/asio/reference/execution__allocator_t/is_requirable.html new file mode 100644 index 0000000..51f94d4 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__allocator_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::allocator_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::allocator_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__allocator_t/value.html b/include/asio/doc/asio/reference/execution__allocator_t/value.html new file mode 100644 index 0000000..1e66dfa --- /dev/null +++ b/include/asio/doc/asio/reference/execution__allocator_t/value.html @@ -0,0 +1,48 @@ + + + +execution::allocator_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the allocator stored in the execution::allocator_t + property object. +

+
constexpr ProtoAllocator value() const;
+
+

+ Present only if ProtoAllocator is non-void. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor.html b/include/asio/doc/asio/reference/execution__any_executor.html new file mode 100644 index 0000000..4bfa577 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor.html @@ -0,0 +1,279 @@ + + + +execution::any_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Polymorphic executor wrapper. +

+
template<
+    typename... SupportableProperties>
+class any_executor
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ any_executor [constructor] +

+
+

+ Default constructor.
—
Construct in an empty state. + Equivalent effects to default constructor.
—
Copy constructor. +
—
Move constructor.
—
Construct to point + to the same target as another any_executor.
—
Construct + a polymorphic wrapper for the specified executor. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ execute +

+
+

+ Execute the function on the target executor. +

+
+

+ operator bool +

+
+

+ Determine whether the wrapper has a target executor. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator.
+ —
Assignment operator that sets the polymorphic wrapper to + the empty state.
—
Assignment operator to create a + polymorphic wrapper for the specified executor. +

+
+

+ prefer +

+
+

+ Obtain a polymorphic wrapper with the specified property. +

+
+

+ query +

+
+

+ Obtain the value associated with the specified property. +

+
+

+ require +

+
+

+ Obtain a polymorphic wrapper with the specified property. +

+
+

+ swap +

+
+

+ Swap targets with another polymorphic wrapper. +

+
+

+ target +

+
+

+ Get a pointer to the target executor. +

+
+

+ target_type +

+
+

+ Get the type of the target executor. +

+
+

+ ~any_executor [destructor] +

+
+

+ Destructor. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Inequality operator. +

+
+

+ operator== +

+
+

+ Equality operator. +

+
+
+ + Requirements +
+

+ Header: asio/execution/any_executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/_any_executor.html b/include/asio/doc/asio/reference/execution__any_executor/_any_executor.html new file mode 100644 index 0000000..a5e5da5 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/_any_executor.html @@ -0,0 +1,43 @@ + + + +execution::any_executor::~any_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~any_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/any_executor.html b/include/asio/doc/asio/reference/execution__any_executor/any_executor.html new file mode 100644 index 0000000..a3eb27a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/any_executor.html @@ -0,0 +1,84 @@ + + + +execution::any_executor::any_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
any_executor();
+  » more...
+
+

+ Construct in an empty state. Equivalent effects to default constructor. +

+
any_executor(
+    nullptr_t );
+  » more...
+
+

+ Copy constructor. +

+
any_executor(
+    const any_executor & e);
+  » more...
+
+

+ Move constructor. +

+
any_executor(
+    any_executor && e);
+  » more...
+
+

+ Construct to point to the same target as another execution::any_executor. +

+
template<
+    class... OtherSupportableProperties>
+any_executor(
+    any_executor< OtherSupportableProperties...> e);
+  » more...
+
+

+ Construct a polymorphic wrapper for the specified executor. +

+
template<
+    typename Executor>
+any_executor(
+    Executor e);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload1.html b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload1.html new file mode 100644 index 0000000..b5fbe2b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload1.html @@ -0,0 +1,43 @@ + + + +execution::any_executor::any_executor (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
any_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload2.html b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload2.html new file mode 100644 index 0000000..0957fd7 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload2.html @@ -0,0 +1,44 @@ + + + +execution::any_executor::any_executor (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct in an empty state. Equivalent effects to default constructor. +

+
any_executor(
+    nullptr_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload3.html b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload3.html new file mode 100644 index 0000000..c2f9ea2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload3.html @@ -0,0 +1,44 @@ + + + +execution::any_executor::any_executor (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
any_executor(
+    const any_executor & e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload4.html b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload4.html new file mode 100644 index 0000000..6e145cb --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload4.html @@ -0,0 +1,44 @@ + + + +execution::any_executor::any_executor (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
any_executor(
+    any_executor && e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload5.html b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload5.html new file mode 100644 index 0000000..8719dea --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload5.html @@ -0,0 +1,46 @@ + + + +execution::any_executor::any_executor (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct to point to the same target as another execution::any_executor. +

+
template<
+    class... OtherSupportableProperties>
+any_executor(
+    any_executor< OtherSupportableProperties...> e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload6.html b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload6.html new file mode 100644 index 0000000..b97d42f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/any_executor/overload6.html @@ -0,0 +1,46 @@ + + + +execution::any_executor::any_executor (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a polymorphic wrapper for the specified executor. +

+
template<
+    typename Executor>
+any_executor(
+    Executor e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/context.html b/include/asio/doc/asio/reference/execution__any_executor/context.html new file mode 100644 index 0000000..e3331a0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/context.html @@ -0,0 +1,50 @@ + + + +execution::any_executor::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the underlying execution context. +

+
automatically_determined context() const;
+
+

+ This function is provided for backward compatibility. It is automatically + defined when the SupportableProperties... list includes a + property of type execution::context_as<U>, for some + type U. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/execute.html b/include/asio/doc/asio/reference/execution__any_executor/execute.html new file mode 100644 index 0000000..48424c6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/execute.html @@ -0,0 +1,61 @@ + + + +execution::any_executor::execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Execute + the function on the target executor. +

+
template<
+    typename Function>
+void execute(
+    Function && f) const;
+
+

+ Do not call this function directly. It is intended for use with the execution::execute + customisation point. +

+

+ For example: +

+
execution::any_executor<> ex = ...;
+execution::execute(ex, my_function_object);
+
+

+ Throws bad_executor + if the polymorphic wrapper has no target. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_bool.html b/include/asio/doc/asio/reference/execution__any_executor/operator_bool.html new file mode 100644 index 0000000..2ae78c0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_bool.html @@ -0,0 +1,54 @@ + + + +execution::any_executor::operator bool + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the wrapper has a target executor. +

+
operator bool() const;
+
+
+ + Return + Value +
+

+ true if the polymorphic wrapper has a target executor, otherwise + false. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq_.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_.html new file mode 100644 index 0000000..632902e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_.html @@ -0,0 +1,69 @@ + + + +execution::any_executor::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment + operator. +

+
any_executor & operator=(
+    const any_executor & e);
+  » more...
+
+

+ Move assignment operator. +

+
any_executor & operator=(
+    any_executor && e);
+  » more...
+
+

+ Assignment operator that sets the polymorphic wrapper to the empty state. +

+
any_executor & operator=(
+    nullptr_t );
+  » more...
+
+

+ Assignment operator to create a polymorphic wrapper for the specified executor. +

+
template<
+    typename Executor>
+any_executor & operator=(
+    Executor e);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload1.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload1.html new file mode 100644 index 0000000..6851763 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +execution::any_executor::operator= (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator. +

+
any_executor & operator=(
+    const any_executor & e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload2.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload2.html new file mode 100644 index 0000000..7459ec6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload2.html @@ -0,0 +1,44 @@ + + + +execution::any_executor::operator= (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move assignment operator. +

+
any_executor & operator=(
+    any_executor && e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload3.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload3.html new file mode 100644 index 0000000..66b2275 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload3.html @@ -0,0 +1,44 @@ + + + +execution::any_executor::operator= (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator that sets the polymorphic wrapper to the empty state. +

+
any_executor & operator=(
+    nullptr_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload4.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload4.html new file mode 100644 index 0000000..98aa94c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq_/overload4.html @@ -0,0 +1,47 @@ + + + +execution::any_executor::operator= (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator to create a polymorphic wrapper for the specified + executor. +

+
template<
+    typename Executor>
+any_executor & operator=(
+    Executor e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_.html new file mode 100644 index 0000000..2c9a672 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_.html @@ -0,0 +1,57 @@ + + + +execution::any_executor::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Equality + operator. +

+
bool operator==(
+    const any_executor< SupportableProperties...> & a,
+    const any_executor< SupportableProperties...> & b);
+  » more...
+
+bool operator==(
+    const any_executor< SupportableProperties...> & a,
+    nullptr_t );
+  » more...
+
+bool operator==(
+    nullptr_t ,
+    const any_executor< SupportableProperties...> & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload1.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload1.html new file mode 100644 index 0000000..c02b82b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload1.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::operator== (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Equality operator. +

+
bool operator==(
+    const any_executor< SupportableProperties...> & a,
+    const any_executor< SupportableProperties...> & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload2.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload2.html new file mode 100644 index 0000000..b9c55c8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload2.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::operator== (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Equality operator. +

+
bool operator==(
+    const any_executor< SupportableProperties...> & a,
+    nullptr_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload3.html b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload3.html new file mode 100644 index 0000000..29a48ed --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_eq__eq_/overload3.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::operator== (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Equality operator. +

+
bool operator==(
+    nullptr_t ,
+    const any_executor< SupportableProperties...> & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_.html b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_.html new file mode 100644 index 0000000..ff2e810 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_.html @@ -0,0 +1,57 @@ + + + +execution::any_executor::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inequality + operator. +

+
bool operator!=(
+    const any_executor< SupportableProperties...> & a,
+    const any_executor< SupportableProperties...> & b);
+  » more...
+
+bool operator!=(
+    const any_executor< SupportableProperties...> & a,
+    nullptr_t );
+  » more...
+
+bool operator!=(
+    nullptr_t ,
+    const any_executor< SupportableProperties...> & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload1.html b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload1.html new file mode 100644 index 0000000..2159576 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload1.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::operator!= (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inequality operator. +

+
bool operator!=(
+    const any_executor< SupportableProperties...> & a,
+    const any_executor< SupportableProperties...> & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload2.html b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload2.html new file mode 100644 index 0000000..fdda3d6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload2.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::operator!= (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inequality operator. +

+
bool operator!=(
+    const any_executor< SupportableProperties...> & a,
+    nullptr_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload3.html b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload3.html new file mode 100644 index 0000000..83c729b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/operator_not__eq_/overload3.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::operator!= (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inequality operator. +

+
bool operator!=(
+    nullptr_t ,
+    const any_executor< SupportableProperties...> & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/prefer.html b/include/asio/doc/asio/reference/execution__any_executor/prefer.html new file mode 100644 index 0000000..7d36947 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/prefer.html @@ -0,0 +1,57 @@ + + + +execution::any_executor::prefer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + a polymorphic wrapper with the specified property. +

+
template<
+    typename Property>
+any_executor prefer(
+    Property ) const;
+
+

+ Do not call this function directly. It is intended for use with the prefer customisation + point. +

+

+ For example: +

+
execution::any_executor<execution::blocking_t::possibly_t> ex = ...;
+auto ex2 = asio::prefer(ex, execution::blocking.possibly);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/query.html b/include/asio/doc/asio/reference/execution__any_executor/query.html new file mode 100644 index 0000000..15efbc1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/query.html @@ -0,0 +1,57 @@ + + + +execution::any_executor::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the value associated with the specified property. +

+
template<
+    typename Property>
+Property::polymorphic_query_result_type query(
+    Property ) const;
+
+

+ Do not call this function directly. It is intended for use with the query customisation + point. +

+

+ For example: +

+
execution::any_executor<execution::occupancy_t> ex = ...;
+size_t n = asio::query(ex, execution::occupancy);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/require.html b/include/asio/doc/asio/reference/execution__any_executor/require.html new file mode 100644 index 0000000..eeb81c1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/require.html @@ -0,0 +1,57 @@ + + + +execution::any_executor::require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + a polymorphic wrapper with the specified property. +

+
template<
+    typename Property>
+any_executor require(
+    Property ) const;
+
+

+ Do not call this function directly. It is intended for use with the require and prefer customisation + points. +

+

+ For example: +

+
execution::any_executor<execution::blocking_t::possibly_t> ex = ...;
+auto ex2 = asio::requre(ex, execution::blocking.possibly);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/swap.html b/include/asio/doc/asio/reference/execution__any_executor/swap.html new file mode 100644 index 0000000..2f96ec6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/swap.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::swap + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Swap + targets with another polymorphic wrapper. +

+
void swap(
+    any_executor & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/target.html b/include/asio/doc/asio/reference/execution__any_executor/target.html new file mode 100644 index 0000000..6014d29 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/target.html @@ -0,0 +1,52 @@ + + + +execution::any_executor::target + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a pointer to the target executor. +

+
template<
+    typename Executor>
+Executor * target();
+  » more...
+
+template<
+    typename Executor>
+const Executor * target() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/target/overload1.html b/include/asio/doc/asio/reference/execution__any_executor/target/overload1.html new file mode 100644 index 0000000..1398a20 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/target/overload1.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::target (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a pointer to the target executor. +

+
template<
+    typename Executor>
+Executor * target();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/target/overload2.html b/include/asio/doc/asio/reference/execution__any_executor/target/overload2.html new file mode 100644 index 0000000..8d6ae6d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/target/overload2.html @@ -0,0 +1,45 @@ + + + +execution::any_executor::target (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a pointer to the target executor. +

+
template<
+    typename Executor>
+const Executor * target() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__any_executor/target_type.html b/include/asio/doc/asio/reference/execution__any_executor/target_type.html new file mode 100644 index 0000000..0f76770 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__any_executor/target_type.html @@ -0,0 +1,44 @@ + + + +execution::any_executor::target_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the type of the target executor. +

+
const type_info & target_type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bad_executor.html b/include/asio/doc/asio/reference/execution__bad_executor.html new file mode 100644 index 0000000..dd5cc2c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bad_executor.html @@ -0,0 +1,102 @@ + + + +execution::bad_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Exception thrown when trying to access an empty polymorphic executor. +

+
class bad_executor :
+  public std::exception
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bad_executor [constructor] +

+
+

+ Constructor. +

+
+

+ what +

+
+

+ Obtain message associated with exception. +

+
+
+ + Requirements +
+

+ Header: asio/execution/bad_executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bad_executor/bad_executor.html b/include/asio/doc/asio/reference/execution__bad_executor/bad_executor.html new file mode 100644 index 0000000..739e11f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bad_executor/bad_executor.html @@ -0,0 +1,43 @@ + + + +execution::bad_executor::bad_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
bad_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bad_executor/what.html b/include/asio/doc/asio/reference/execution__bad_executor/what.html new file mode 100644 index 0000000..3aeafb6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bad_executor/what.html @@ -0,0 +1,44 @@ + + + +execution::bad_executor::what + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + message associated with exception. +

+
virtual const char * what() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking.html b/include/asio/doc/asio/reference/execution__blocking.html new file mode 100644 index 0000000..54a90c4 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking.html @@ -0,0 +1,55 @@ + + + +execution::blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value used + for accessing the execution::blocking_t + property. +

+
constexpr blocking_t blocking;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation.html b/include/asio/doc/asio/reference/execution__blocking_adaptation.html new file mode 100644 index 0000000..746650f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation.html @@ -0,0 +1,55 @@ + + + +execution::blocking_adaptation + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::blocking_adaptation_t + property. +

+
constexpr blocking_adaptation_t blocking_adaptation;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t.html new file mode 100644 index 0000000..7c1b9e9 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t.html @@ -0,0 +1,287 @@ + + + +execution::blocking_adaptation_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property to describe whether automatic adaptation of an executor is allowed + in order to apply the execution::blocking_adaptation_t::allowed_t + property. +

+
struct blocking_adaptation_t
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ allowed_t +

+
+

+ A sub-property that indicates that automatic adaptation is allowed. +

+
+

+ disallowed_t +

+
+

+ A sub-property that indicates that automatic adaptation is not + allowed. +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ blocking_adaptation_t [constructor] +

+
+

+ Default constructor.
—
Construct from a sub-property + value. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ allowed [static] +

+
+

+ A special value used for accessing the blocking_adaptation_t::allowed_t + property. +

+
+

+ disallowed [static] +

+
+

+ A special value used for accessing the blocking_adaptation_t::disallowed_t + property. +

+
+

+ is_applicable_property_v [static] +

+
+

+ The blocking_adaptation_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The top-level blocking_adaptation_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The top-level blocking_adaptation_t property cannot be required. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare property values for inequality. +

+
+

+ operator== +

+
+

+ Compare property values for equality. +

+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/allowed.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/allowed.html new file mode 100644 index 0000000..ba3a8b1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/allowed.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::allowed + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::blocking_adaptation_t::allowed_t + property. +

+
static constexpr allowed_t allowed;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t.html new file mode 100644 index 0000000..f4046f1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t.html @@ -0,0 +1,56 @@ + + + +execution::blocking_adaptation_t::blocking_adaptation_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr blocking_adaptation_t();
+  » more...
+
+

+ Construct from a sub-property value. +

+
constexpr blocking_adaptation_t(
+    disallowed_t );
+  » more...
+
+constexpr blocking_adaptation_t(
+    allowed_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload1.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload1.html new file mode 100644 index 0000000..486cabb --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload1.html @@ -0,0 +1,43 @@ + + + +execution::blocking_adaptation_t::blocking_adaptation_t (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr blocking_adaptation_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload2.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload2.html new file mode 100644 index 0000000..c4eead5 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload2.html @@ -0,0 +1,44 @@ + + + +execution::blocking_adaptation_t::blocking_adaptation_t (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr blocking_adaptation_t(
+    disallowed_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload3.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload3.html new file mode 100644 index 0000000..ecedb7d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload3.html @@ -0,0 +1,44 @@ + + + +execution::blocking_adaptation_t::blocking_adaptation_t (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr blocking_adaptation_t(
+    allowed_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/disallowed.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/disallowed.html new file mode 100644 index 0000000..d2ea6c8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/disallowed.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::disallowed + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::blocking_adaptation_t::disallowed_t + property. +

+
static constexpr disallowed_t disallowed;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_applicable_property_v.html new file mode 100644 index 0000000..e647a71 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::blocking_adaptation_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_adaptation_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_preferable.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_preferable.html new file mode 100644 index 0000000..6ca8e9d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::blocking_adaptation_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_requirable.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_requirable.html new file mode 100644 index 0000000..cf2abe0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::blocking_adaptation_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/operator_eq__eq_.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/operator_eq__eq_.html new file mode 100644 index 0000000..ef11937 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +execution::blocking_adaptation_t::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for equality. +

+
friend constexpr bool operator==(
+    const blocking_adaptation_t & a,
+    const blocking_adaptation_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/operator_not__eq_.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/operator_not__eq_.html new file mode 100644 index 0000000..094c02b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +execution::blocking_adaptation_t::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for inequality. +

+
friend constexpr bool operator!=(
+    const blocking_adaptation_t & a,
+    const blocking_adaptation_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..cad36ef --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::blocking_adaptation_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef blocking_adaptation_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t.html new file mode 100644 index 0000000..70054c6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t.html @@ -0,0 +1,197 @@ + + + +execution::blocking_adaptation_t::allowed_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that automatic adaptation is allowed. +

+
struct allowed_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ allowed_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The blocking_adaptation_t::allowed_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The blocking_adaptation_t::allowed_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The blocking_adaptation_t::allowed_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/allowed_t.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/allowed_t.html new file mode 100644 index 0000000..181f17b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/allowed_t.html @@ -0,0 +1,44 @@ + + + +execution::blocking_adaptation_t::allowed_t::allowed_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr allowed_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_applicable_property_v.html new file mode 100644 index 0000000..410b8e1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::blocking_adaptation_t::allowed_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_adaptation_t::allowed_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_preferable.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_preferable.html new file mode 100644 index 0000000..aa079fe --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::allowed_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_adaptation_t::allowed_t + property can be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_requirable.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_requirable.html new file mode 100644 index 0000000..f7d12ea --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::allowed_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_adaptation_t::allowed_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..1aee017 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::blocking_adaptation_t::allowed_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef blocking_adaptation_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/value.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/value.html new file mode 100644 index 0000000..b7b0b31 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__allowed_t/value.html @@ -0,0 +1,52 @@ + + + +execution::blocking_adaptation_t::allowed_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr blocking_adaptation_t value();
+
+
+ + Return + Value +
+

+ allowed_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t.html new file mode 100644 index 0000000..81214cd --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t.html @@ -0,0 +1,197 @@ + + + +execution::blocking_adaptation_t::disallowed_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that automatic adaptation is not allowed. +

+
struct disallowed_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ disallowed_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The blocking_adaptation_t::disallowed_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The blocking_adaptation_t::disallowed_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The blocking_adaptation_t::disallowed_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/disallowed_t.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/disallowed_t.html new file mode 100644 index 0000000..6efcbac --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/disallowed_t.html @@ -0,0 +1,44 @@ + + + +execution::blocking_adaptation_t::disallowed_t::disallowed_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr disallowed_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_applicable_property_v.html new file mode 100644 index 0000000..93bc289 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::blocking_adaptation_t::disallowed_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_adaptation_t::disallowed_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_preferable.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_preferable.html new file mode 100644 index 0000000..dfdfdea --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::disallowed_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_adaptation_t::disallowed_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_requirable.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_requirable.html new file mode 100644 index 0000000..ab2aba7 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_adaptation_t::disallowed_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_adaptation_t::disallowed_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..407ed78 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::blocking_adaptation_t::disallowed_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef blocking_adaptation_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking_adaptation.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/value.html b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/value.html new file mode 100644 index 0000000..7a3b91d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_adaptation_t__disallowed_t/value.html @@ -0,0 +1,52 @@ + + + +execution::blocking_adaptation_t::disallowed_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr blocking_adaptation_t value();
+
+
+ + Return + Value +
+

+ disallowed_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t.html b/include/asio/doc/asio/reference/execution__blocking_t.html new file mode 100644 index 0000000..9c4302e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t.html @@ -0,0 +1,311 @@ + + + +execution::blocking_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property to describe what guarantees an executor makes about the blocking + behaviour of their execution functions. +

+
struct blocking_t
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ always_t +

+
+

+ A sub-property that indicates that invocation of an executor's + execution function shall block until completion of all invocations + of the submitted function object. +

+
+

+ never_t +

+
+

+ A sub-property that indicates that invocation of an executor's + execution function shall not block pending completion of the invocations + of the submitted function object. +

+
+

+ possibly_t +

+
+

+ A sub-property that indicates that invocation of an executor's + execution function may block pending completion of one or more + invocations of the submitted function object. +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ blocking_t [constructor] +

+
+

+ Default constructor.
—
Construct from a sub-property + value. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ always [static] +

+
+

+ A special value used for accessing the blocking_t::always_t property. +

+
+

+ is_applicable_property_v [static] +

+
+

+ The blocking_t property applies to executors, senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The top-level blocking_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The top-level blocking_t property cannot be required. +

+
+

+ never [static] +

+
+

+ A special value used for accessing the blocking_t::never_t property. +

+
+

+ possibly [static] +

+
+

+ A special value used for accessing the blocking_t::possibly_t property. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare property values for inequality. +

+
+

+ operator== +

+
+

+ Compare property values for equality. +

+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/always.html b/include/asio/doc/asio/reference/execution__blocking_t/always.html new file mode 100644 index 0000000..1256dfe --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/always.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::always + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::blocking_t::always_t + property. +

+
static constexpr always_t always;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/blocking_t.html b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t.html new file mode 100644 index 0000000..30a7bd8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t.html @@ -0,0 +1,60 @@ + + + +execution::blocking_t::blocking_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr blocking_t();
+  » more...
+
+

+ Construct from a sub-property value. +

+
constexpr blocking_t(
+    possibly_t );
+  » more...
+
+constexpr blocking_t(
+    always_t );
+  » more...
+
+constexpr blocking_t(
+    never_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload1.html b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload1.html new file mode 100644 index 0000000..71b0ce1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload1.html @@ -0,0 +1,43 @@ + + + +execution::blocking_t::blocking_t (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr blocking_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload2.html b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload2.html new file mode 100644 index 0000000..ced4315 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload2.html @@ -0,0 +1,44 @@ + + + +execution::blocking_t::blocking_t (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr blocking_t(
+    possibly_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload3.html b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload3.html new file mode 100644 index 0000000..92de15e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload3.html @@ -0,0 +1,44 @@ + + + +execution::blocking_t::blocking_t (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr blocking_t(
+    always_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload4.html b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload4.html new file mode 100644 index 0000000..df92536 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/blocking_t/overload4.html @@ -0,0 +1,44 @@ + + + +execution::blocking_t::blocking_t (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr blocking_t(
+    never_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__blocking_t/is_applicable_property_v.html new file mode 100644 index 0000000..68e1b99 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::blocking_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/is_preferable.html b/include/asio/doc/asio/reference/execution__blocking_t/is_preferable.html new file mode 100644 index 0000000..b755c81 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::blocking_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/is_requirable.html b/include/asio/doc/asio/reference/execution__blocking_t/is_requirable.html new file mode 100644 index 0000000..149fe93 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::blocking_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/never.html b/include/asio/doc/asio/reference/execution__blocking_t/never.html new file mode 100644 index 0000000..bd9bc50 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/never.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::never + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special + value used for accessing the execution::blocking_t::never_t + property. +

+
static constexpr never_t never;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/operator_eq__eq_.html b/include/asio/doc/asio/reference/execution__blocking_t/operator_eq__eq_.html new file mode 100644 index 0000000..7cc89c2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +execution::blocking_t::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for equality. +

+
friend constexpr bool operator==(
+    const blocking_t & a,
+    const blocking_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/operator_not__eq_.html b/include/asio/doc/asio/reference/execution__blocking_t/operator_not__eq_.html new file mode 100644 index 0000000..a5c05ed --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +execution::blocking_t::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for inequality. +

+
friend constexpr bool operator!=(
+    const blocking_t & a,
+    const blocking_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__blocking_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..29ec170 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::blocking_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef blocking_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t/possibly.html b/include/asio/doc/asio/reference/execution__blocking_t/possibly.html new file mode 100644 index 0000000..6ca7106 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t/possibly.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::possibly + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::blocking_t::possibly_t + property. +

+
static constexpr possibly_t possibly;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__always_t.html b/include/asio/doc/asio/reference/execution__blocking_t__always_t.html new file mode 100644 index 0000000..f103180 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__always_t.html @@ -0,0 +1,199 @@ + + + +execution::blocking_t::always_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that invocation of an executor's execution + function shall block until completion of all invocations of the submitted + function object. +

+
struct always_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ always_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The blocking_t::always_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The blocking_t::always_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The blocking_t::always_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__always_t/always_t.html b/include/asio/doc/asio/reference/execution__blocking_t__always_t/always_t.html new file mode 100644 index 0000000..3b98335 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__always_t/always_t.html @@ -0,0 +1,44 @@ + + + +execution::blocking_t::always_t::always_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr always_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_applicable_property_v.html new file mode 100644 index 0000000..90fd3df --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::blocking_t::always_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::always_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_preferable.html b/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_preferable.html new file mode 100644 index 0000000..d4db56c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::always_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::always_t + property can be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_requirable.html b/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_requirable.html new file mode 100644 index 0000000..b4bbc97 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__always_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::always_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::always_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__always_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__blocking_t__always_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..1183568 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__always_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::blocking_t::always_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef blocking_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__always_t/value.html b/include/asio/doc/asio/reference/execution__blocking_t__always_t/value.html new file mode 100644 index 0000000..ec9f77f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__always_t/value.html @@ -0,0 +1,52 @@ + + + +execution::blocking_t::always_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr blocking_t value();
+
+
+ + Return + Value +
+

+ always_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__never_t.html b/include/asio/doc/asio/reference/execution__blocking_t__never_t.html new file mode 100644 index 0000000..7c1a124 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__never_t.html @@ -0,0 +1,199 @@ + + + +execution::blocking_t::never_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that invocation of an executor's execution + function shall not block pending completion of the invocations of the submitted + function object. +

+
struct never_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ never_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The blocking_t::never_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The blocking_t::never_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The blocking_t::never_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_applicable_property_v.html new file mode 100644 index 0000000..3d0e61f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::blocking_t::never_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::never_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_preferable.html b/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_preferable.html new file mode 100644 index 0000000..181ce8e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::never_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::never_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_requirable.html b/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_requirable.html new file mode 100644 index 0000000..5566888 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__never_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::never_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::never_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__never_t/never_t.html b/include/asio/doc/asio/reference/execution__blocking_t__never_t/never_t.html new file mode 100644 index 0000000..1b61cb8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__never_t/never_t.html @@ -0,0 +1,44 @@ + + + +execution::blocking_t::never_t::never_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr never_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__never_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__blocking_t__never_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..e9a6da0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__never_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::blocking_t::never_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef blocking_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__never_t/value.html b/include/asio/doc/asio/reference/execution__blocking_t__never_t/value.html new file mode 100644 index 0000000..e081e0f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__never_t/value.html @@ -0,0 +1,52 @@ + + + +execution::blocking_t::never_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr blocking_t value();
+
+
+ + Return + Value +
+

+ never_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__possibly_t.html b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t.html new file mode 100644 index 0000000..a5d6d5b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t.html @@ -0,0 +1,199 @@ + + + +execution::blocking_t::possibly_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that invocation of an executor's execution + function may block pending completion of one or more invocations of the submitted + function object. +

+
struct possibly_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ possibly_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The blocking_t::possibly_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The blocking_t::possibly_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The blocking_t::possibly_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_applicable_property_v.html new file mode 100644 index 0000000..70988b4 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::blocking_t::possibly_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::possibly_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_preferable.html b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_preferable.html new file mode 100644 index 0000000..e4abb23 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::possibly_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::possibly_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_requirable.html b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_requirable.html new file mode 100644 index 0000000..056352f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::blocking_t::possibly_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::blocking_t::possibly_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..32bfe32 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::blocking_t::possibly_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef blocking_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/blocking.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/possibly_t.html b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/possibly_t.html new file mode 100644 index 0000000..a6bea62 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/possibly_t.html @@ -0,0 +1,44 @@ + + + +execution::blocking_t::possibly_t::possibly_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr possibly_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/value.html b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/value.html new file mode 100644 index 0000000..9f574c2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__blocking_t__possibly_t/value.html @@ -0,0 +1,52 @@ + + + +execution::blocking_t::possibly_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr blocking_t value();
+
+
+ + Return + Value +
+

+ possibly_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_execute.html b/include/asio/doc/asio/reference/execution__bulk_execute.html new file mode 100644 index 0000000..f8da445 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_execute.html @@ -0,0 +1,107 @@ + + + +execution::bulk_execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation + point that creates a bulk sender. +

+
constexpr unspecified bulk_execute = unspecified;
+
+

+ The name execution::bulk_execute denotes a customisation point + object. If is_convertible_v<N, size_t> is true, then the + expression execution::bulk_execute(S, F, N) for some subexpressions + S, F, and N is expression-equivalent + to: +

+
    +
  • + S.bulk_execute(F, N), if that expression is valid. If the + function selected does not execute N invocations of the + function object F on the executor S in bulk + with forward progress guarantee asio::query(S, execution::bulk_guarantee), + and the result of that function does not model sender<void>, + the program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, bulk_execute(S, F, N), if that expression is + valid, with overload resolution performed in a context that includes + the declaration void bulk_execute(); and that does not include + a declaration of execution::bulk_execute. If the function + selected by overload resolution does not execute N invocations + of the function object F on the executor S + in bulk with forward progress guarantee asio::query(E, execution::bulk_guarantee), + and the result of that function does not model sender<void>, + the program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, if the types F and executor_index_t<remove_cvref_t<S>> + model invocable and if asio::query(S, execution::bulk_guarantee) + equals execution::bulk_guarantee.unsequenced, then +
  • +
  • + Evaluates DECAY_COPY(std::forward<decltype(F)>(F)) + on the calling thread to create a function object cf. [Note: + Additional copies of cf may subsequently be created. --end + note.] +
  • +
  • + For each value of i in N, cf(i) + (or copy of cf)) will be invoked at most once by an execution + agent that is unique for each value of i. +
  • +
  • + May block pending completion of one or more invocations of cf. +
  • +
  • + Synchronizes with (C++Std [intro.multithread]) the invocations of cf. +
  • +
  • + Otherwise, execution::bulk_execute(S, F, N) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution/bulk_execute.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee.html b/include/asio/doc/asio/reference/execution__bulk_guarantee.html new file mode 100644 index 0000000..4d25a23 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee.html @@ -0,0 +1,55 @@ + + + +execution::bulk_guarantee + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special + value used for accessing the execution::bulk_guarantee_t + property. +

+
constexpr bulk_guarantee_t bulk_guarantee;
+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t.html new file mode 100644 index 0000000..3977313 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t.html @@ -0,0 +1,312 @@ + + + +execution::bulk_guarantee_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property to communicate the forward progress and ordering guarantees of + execution agents associated with the bulk execution. +

+
struct bulk_guarantee_t
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ parallel_t +

+
+

+ A sub-property that indicates that execution agents within the + same bulk execution may be parallelised. +

+
+

+ sequenced_t +

+
+

+ A sub-property that indicates that execution agents within the + same bulk execution may not be parallelised and vectorised. +

+
+

+ unsequenced_t +

+
+

+ A sub-property that indicates that execution agents within the + same bulk execution may be parallelised and vectorised. +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bulk_guarantee_t [constructor] +

+
+

+ Default constructor.
—
Construct from a sub-property + value. +

+
+
+ + Data Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The bulk_guarantee_t property applies to executors, senders, and + schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The top-level bulk_guarantee_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The top-level bulk_guarantee_t property cannot be required. +

+
+

+ parallel [static] +

+
+

+ A special value used for accessing the bulk_guarantee_t::parallel_t + property. +

+
+

+ sequenced [static] +

+
+

+ A special value used for accessing the bulk_guarantee_t::sequenced_t + property. +

+
+

+ unsequenced [static] +

+
+

+ A special value used for accessing the bulk_guarantee_t::unsequenced_t + property. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare property values for inequality. +

+
+

+ operator== +

+
+

+ Compare property values for equality. +

+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t.html new file mode 100644 index 0000000..7e4af1f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t.html @@ -0,0 +1,60 @@ + + + +execution::bulk_guarantee_t::bulk_guarantee_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr bulk_guarantee_t();
+  » more...
+
+

+ Construct from a sub-property value. +

+
constexpr bulk_guarantee_t(
+    unsequenced_t );
+  » more...
+
+constexpr bulk_guarantee_t(
+    sequenced_t );
+  » more...
+
+constexpr bulk_guarantee_t(
+    parallel_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload1.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload1.html new file mode 100644 index 0000000..e1db794 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload1.html @@ -0,0 +1,43 @@ + + + +execution::bulk_guarantee_t::bulk_guarantee_t (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr bulk_guarantee_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload2.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload2.html new file mode 100644 index 0000000..f37a814 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload2.html @@ -0,0 +1,44 @@ + + + +execution::bulk_guarantee_t::bulk_guarantee_t (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr bulk_guarantee_t(
+    unsequenced_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload3.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload3.html new file mode 100644 index 0000000..e59650e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload3.html @@ -0,0 +1,44 @@ + + + +execution::bulk_guarantee_t::bulk_guarantee_t (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr bulk_guarantee_t(
+    sequenced_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload4.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload4.html new file mode 100644 index 0000000..a493ed9 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload4.html @@ -0,0 +1,44 @@ + + + +execution::bulk_guarantee_t::bulk_guarantee_t (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr bulk_guarantee_t(
+    parallel_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_applicable_property_v.html new file mode 100644 index 0000000..135a458 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::bulk_guarantee_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_preferable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_preferable.html new file mode 100644 index 0000000..ed7d2c8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::bulk_guarantee_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_requirable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_requirable.html new file mode 100644 index 0000000..97abf89 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::bulk_guarantee_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/operator_eq__eq_.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/operator_eq__eq_.html new file mode 100644 index 0000000..f06446d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +execution::bulk_guarantee_t::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for equality. +

+
friend constexpr bool operator==(
+    const bulk_guarantee_t & a,
+    const bulk_guarantee_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/operator_not__eq_.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/operator_not__eq_.html new file mode 100644 index 0000000..80d7d3f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +execution::bulk_guarantee_t::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for inequality. +

+
friend constexpr bool operator!=(
+    const bulk_guarantee_t & a,
+    const bulk_guarantee_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/parallel.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/parallel.html new file mode 100644 index 0000000..7ca441e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/parallel.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::parallel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::bulk_guarantee_t::parallel_t + property. +

+
static constexpr parallel_t parallel;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..563e0dc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::bulk_guarantee_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef bulk_guarantee_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/sequenced.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/sequenced.html new file mode 100644 index 0000000..71c8b73 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/sequenced.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::sequenced + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::bulk_guarantee_t::sequenced_t + property. +

+
static constexpr sequenced_t sequenced;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t/unsequenced.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/unsequenced.html new file mode 100644 index 0000000..b80321c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t/unsequenced.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::unsequenced + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::bulk_guarantee_t::unsequenced_t + property. +

+
static constexpr unsequenced_t unsequenced;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t.html new file mode 100644 index 0000000..b2f9fb1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t.html @@ -0,0 +1,198 @@ + + + +execution::bulk_guarantee_t::parallel_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that execution agents within the same bulk + execution may be parallelised. +

+
struct parallel_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ parallel_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The bulk_guarantee_t::parallel_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The bulk_guarantee_t::parallel_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The bulk_guarantee_t::parallel_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_applicable_property_v.html new file mode 100644 index 0000000..03c2a81 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::bulk_guarantee_t::parallel_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::parallel_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_preferable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_preferable.html new file mode 100644 index 0000000..29e222d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::parallel_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::parallel_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_requirable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_requirable.html new file mode 100644 index 0000000..37038ee --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::parallel_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::parallel_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/parallel_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/parallel_t.html new file mode 100644 index 0000000..49a0c4b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/parallel_t.html @@ -0,0 +1,44 @@ + + + +execution::bulk_guarantee_t::parallel_t::parallel_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr parallel_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..020b2aa --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::bulk_guarantee_t::parallel_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef bulk_guarantee_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/value.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/value.html new file mode 100644 index 0000000..249a952 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__parallel_t/value.html @@ -0,0 +1,52 @@ + + + +execution::bulk_guarantee_t::parallel_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr bulk_guarantee_t value();
+
+
+ + Return + Value +
+

+ parallel_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t.html new file mode 100644 index 0000000..79c8180 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t.html @@ -0,0 +1,198 @@ + + + +execution::bulk_guarantee_t::sequenced_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that execution agents within the same bulk + execution may not be parallelised and vectorised. +

+
struct sequenced_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ sequenced_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The bulk_guarantee_t::sequenced_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The bulk_guarantee_t::sequenced_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The bulk_guarantee_t::sequenced_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_applicable_property_v.html new file mode 100644 index 0000000..70c6309 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::bulk_guarantee_t::sequenced_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::sequenced_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_preferable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_preferable.html new file mode 100644 index 0000000..fecdb48 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::sequenced_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::sequenced_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_requirable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_requirable.html new file mode 100644 index 0000000..6cf007d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::sequenced_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::sequenced_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..4635757 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::bulk_guarantee_t::sequenced_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef bulk_guarantee_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/sequenced_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/sequenced_t.html new file mode 100644 index 0000000..4d01614 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/sequenced_t.html @@ -0,0 +1,44 @@ + + + +execution::bulk_guarantee_t::sequenced_t::sequenced_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr sequenced_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/value.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/value.html new file mode 100644 index 0000000..afc774f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__sequenced_t/value.html @@ -0,0 +1,52 @@ + + + +execution::bulk_guarantee_t::sequenced_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr bulk_guarantee_t value();
+
+
+ + Return + Value +
+

+ sequenced_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t.html new file mode 100644 index 0000000..19c7702 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t.html @@ -0,0 +1,198 @@ + + + +execution::bulk_guarantee_t::unsequenced_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that execution agents within the same bulk + execution may be parallelised and vectorised. +

+
struct unsequenced_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ unsequenced_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The bulk_guarantee_t::unsequenced_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The bulk_guarantee_t::unsequenced_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The bulk_guarantee_t::unsequenced_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_applicable_property_v.html new file mode 100644 index 0000000..c4fe3a9 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::bulk_guarantee_t::unsequenced_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::unsequenced_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_preferable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_preferable.html new file mode 100644 index 0000000..f8760d8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::unsequenced_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::unsequenced_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_requirable.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_requirable.html new file mode 100644 index 0000000..157143d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::bulk_guarantee_t::unsequenced_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::bulk_guarantee_t::unsequenced_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..7bb4e64 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::bulk_guarantee_t::unsequenced_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef bulk_guarantee_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/bulk_guarantee.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/unsequenced_t.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/unsequenced_t.html new file mode 100644 index 0000000..251efc5 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/unsequenced_t.html @@ -0,0 +1,44 @@ + + + +execution::bulk_guarantee_t::unsequenced_t::unsequenced_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr unsequenced_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/value.html b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/value.html new file mode 100644 index 0000000..80a894a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__bulk_guarantee_t__unsequenced_t/value.html @@ -0,0 +1,52 @@ + + + +execution::bulk_guarantee_t::unsequenced_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr bulk_guarantee_t value();
+
+
+ + Return + Value +
+

+ unsequenced_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_bulk_execute.html b/include/asio/doc/asio/reference/execution__can_bulk_execute.html new file mode 100644 index 0000000..5b926bd --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_bulk_execute.html @@ -0,0 +1,63 @@ + + + +execution::can_bulk_execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a bulk_execute expression + is well-formed. +

+
template<
+    typename S,
+    typename F,
+    typename N>
+struct can_bulk_execute
+
+

+ Class template can_bulk_execute is a trait that is derived from + true_type if the expression execution::bulk_execute(std::declval<S>(), + std::declval<F>(), std::declval<N>) is well formed; otherwise + false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/bulk_execute.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_connect.html b/include/asio/doc/asio/reference/execution__can_connect.html new file mode 100644 index 0000000..548c362 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_connect.html @@ -0,0 +1,61 @@ + + + +execution::can_connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a connect expression is + well-formed. +

+
template<
+    typename S,
+    typename R>
+struct can_connect
+
+

+ Class template can_connect is a trait that is derived from + true_type if the expression execution::connect(std::declval<S>(), + std::declval<R>()) is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/connect.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_execute.html b/include/asio/doc/asio/reference/execution__can_execute.html new file mode 100644 index 0000000..970d805 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_execute.html @@ -0,0 +1,61 @@ + + + +execution::can_execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a execute expression is + well-formed. +

+
template<
+    typename T,
+    typename F>
+struct can_execute
+
+

+ Class template can_execute is a trait that is derived from + true_type if the expression execution::execute(std::declval<T>(), + std::declval<F>()) is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/execute.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_schedule.html b/include/asio/doc/asio/reference/execution__can_schedule.html new file mode 100644 index 0000000..2b8d7ff --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_schedule.html @@ -0,0 +1,60 @@ + + + +execution::can_schedule + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a schedule expression is + well-formed. +

+
template<
+    typename S>
+struct can_schedule
+
+

+ Class template can_schedule is a trait that is derived from + true_type if the expression execution::schedule(std::declval<S>()) + is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/schedule.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_set_done.html b/include/asio/doc/asio/reference/execution__can_set_done.html new file mode 100644 index 0000000..3209902 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_set_done.html @@ -0,0 +1,60 @@ + + + +execution::can_set_done + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a set_done expression is + well-formed. +

+
template<
+    typename R>
+struct can_set_done
+
+

+ Class template can_set_done is a trait that is derived from + true_type if the expression execution::set_done(std::declval<R>(), + std::declval<E>()) is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/set_done.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_set_error.html b/include/asio/doc/asio/reference/execution__can_set_error.html new file mode 100644 index 0000000..b5c405b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_set_error.html @@ -0,0 +1,61 @@ + + + +execution::can_set_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a set_error expression + is well-formed. +

+
template<
+    typename R,
+    typename E>
+struct can_set_error
+
+

+ Class template can_set_error is a trait that is derived from + true_type if the expression execution::set_error(std::declval<R>(), + std::declval<E>()) is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/set_error.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_set_value.html b/include/asio/doc/asio/reference/execution__can_set_value.html new file mode 100644 index 0000000..d1cccf8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_set_value.html @@ -0,0 +1,61 @@ + + + +execution::can_set_value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a set_value expression + is well-formed. +

+
template<
+    typename R,
+    typename... Vs>
+struct can_set_value
+
+

+ Class template can_set_value is a trait that is derived from + true_type if the expression execution::set_value(std::declval<R>(), + std::declval<Vs>()...) is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/set_value.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_start.html b/include/asio/doc/asio/reference/execution__can_start.html new file mode 100644 index 0000000..79ea2b3 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_start.html @@ -0,0 +1,59 @@ + + + +execution::can_start + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a start expression is well-formed. +

+
template<
+    typename R>
+struct can_start
+
+

+ Class template can_start is a trait that is derived from true_type + if the expression execution::start(std::declval<R>(), std::declval<E>()) + is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/start.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__can_submit.html b/include/asio/doc/asio/reference/execution__can_submit.html new file mode 100644 index 0000000..414aac1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__can_submit.html @@ -0,0 +1,61 @@ + + + +execution::can_submit + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a submit expression is + well-formed. +

+
template<
+    typename S,
+    typename R>
+struct can_submit
+
+

+ Class template can_submit is a trait that is derived from true_type + if the expression execution::submit(std::declval<R>(), std::declval<E>()) + is well formed; otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/submit.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__connect.html b/include/asio/doc/asio/reference/execution__connect.html new file mode 100644 index 0000000..a59a8e5 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__connect.html @@ -0,0 +1,123 @@ + + + +execution::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point + that connects a sender to a receiver. +

+
constexpr unspecified connect = unspecified;
+
+

+ The name execution::connect denotes a customisation point object. + For some subexpressions s and r, let S + be a type such that decltype((s)) is S and let + R be a type such that decltype((r)) is R. + The expression execution::connect(s, r) is expression-equivalent + to: +

+
    +
  • + s.connect(r), if that expression is valid, if its type satisfies + operation_state, and if S satisfies sender. +
  • +
  • + Otherwise, connect(s, r), if that expression is valid, if + its type satisfies operation_state, and if S + satisfies sender, with overload resolution performed in + a context that includes the declaration void connect(); + and that does not include a declaration of execution::connect. +
  • +
  • + Otherwise, as_operation{s, r}, if r is not + an instance of as_receiver<F, S> for some type F, + and if receiver_of<R> && executor_of<remove_cvref_t<S>, + as_invocable<remove_cvref_t<R>, S>> is true, + where as_operation is an implementation-defined class equivalent + to +
  • +
+
template <class S, class R>
+ struct as_operation
+ {
+   remove_cvref_t<S> e_;
+   remove_cvref_t<R> r_;
+   void start() noexcept try {
+     execution::execute(std::move(e_),
+         as_invocable<remove_cvref_t<R>, S>{r_});
+   } catch(...) {
+     execution::set_error(std::move(r_), current_exception());
+   }
+ };
+
+

+ and as_invocable is a class template equivalent to the following: +

+
template<class R>
+ struct as_invocable
+ {
+   R* r_;
+   explicit as_invocable(R& r) noexcept
+     : r_(std::addressof(r)) {}
+   as_invocable(as_invocable && other) noexcept
+     : r_(std::exchange(other.r_, nullptr)) {}
+   ~as_invocable() {
+     if(r_)
+       execution::set_done(std::move(*r_));
+   }
+   void operator()() & noexcept try {
+     execution::set_value(std::move(*r_));
+     r_ = nullptr;
+   } catch(...) {
+     execution::set_error(std::move(*r_), current_exception());
+     r_ = nullptr;
+   }
+ };
+
+
  • + Otherwise, execution::connect(s, r) is ill-formed. +
+
+ + Requirements +
+

+ Header: asio/execution/connect.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__connect_result.html b/include/asio/doc/asio/reference/execution__connect_result.html new file mode 100644 index 0000000..d4544c2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__connect_result.html @@ -0,0 +1,89 @@ + + + +execution::connect_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait to determine the result of a connect expression. +

+
template<
+    typename S,
+    typename R>
+struct connect_result
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ The type of the connect expression. +

+
+
+ + Requirements +
+

+ Header: asio/execution/connect.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__connect_result/type.html b/include/asio/doc/asio/reference/execution__connect_result/type.html new file mode 100644 index 0000000..402d6e4 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__connect_result/type.html @@ -0,0 +1,58 @@ + + + +execution::connect_result::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the connect expression. +

+
typedef automatically_determined type;
+
+

+ The type of the expression execution::connect(std::declval<S>(), + std::declval<R>()). +

+
+ + Requirements +
+

+ Header: asio/execution/connect.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context.html b/include/asio/doc/asio/reference/execution__context.html new file mode 100644 index 0000000..11555bf --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context.html @@ -0,0 +1,55 @@ + + + +execution::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value used for + accessing the execution::context_t + property. +

+
constexpr context_t context;
+
+
+ + Requirements +
+

+ Header: asio/execution/context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_as.html b/include/asio/doc/asio/reference/execution__context_as.html new file mode 100644 index 0000000..082922d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_as.html @@ -0,0 +1,56 @@ + + + +execution::context_as + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value + used for accessing the execution::context_as_t + property. +

+
template <typename U>
+constexpr context_as_t context_as;
+
+
+ + Requirements +
+

+ Header: asio/execution/context_as.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_as_t.html b/include/asio/doc/asio/reference/execution__context_as_t.html new file mode 100644 index 0000000..f1d6ad6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_as_t.html @@ -0,0 +1,150 @@ + + + +execution::context_as_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property that is used to obtain the execution context that is associated + with an executor. +

+
template<
+    typename U>
+struct context_as_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The context_as_t property applies to executors, senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The context_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The context_t property cannot be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/context_as.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_as_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__context_as_t/is_applicable_property_v.html new file mode 100644 index 0000000..ed10cce --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_as_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::context_as_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_as_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_as_t/is_preferable.html b/include/asio/doc/asio/reference/execution__context_as_t/is_preferable.html new file mode 100644 index 0000000..a358f2a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_as_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::context_as_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_as_t/is_requirable.html b/include/asio/doc/asio/reference/execution__context_as_t/is_requirable.html new file mode 100644 index 0000000..30015f9 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_as_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::context_as_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_as_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__context_as_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..7675efc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_as_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::context_as_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef T polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/context_as.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_t.html b/include/asio/doc/asio/reference/execution__context_t.html new file mode 100644 index 0000000..2800af9 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_t.html @@ -0,0 +1,148 @@ + + + +execution::context_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property that is used to obtain the execution context that is associated + with an executor. +

+
struct context_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The context_t property applies to executors, senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The context_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The context_t property cannot be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__context_t/is_applicable_property_v.html new file mode 100644 index 0000000..1d6bd99 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::context_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_t/is_preferable.html b/include/asio/doc/asio/reference/execution__context_t/is_preferable.html new file mode 100644 index 0000000..28b1c58 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::context_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_t/is_requirable.html b/include/asio/doc/asio/reference/execution__context_t/is_requirable.html new file mode 100644 index 0000000..8cae39c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::context_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__context_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__context_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..e2be369 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__context_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::context_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef std::any polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__execute.html b/include/asio/doc/asio/reference/execution__execute.html new file mode 100644 index 0000000..2393428 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__execute.html @@ -0,0 +1,82 @@ + + + +execution::execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point + that executes a function on an executor. +

+
constexpr unspecified execute = unspecified;
+
+

+ The name execution::execute denotes a customisation point object. +

+

+ For some subexpressions e and f, let E + be a type such that decltype((e)) is E and let + F be a type such that decltype((f)) is F. + The expression execution::execute(e, f) is ill-formed if F + does not model invocable, or if E does not model + either executor or sender. Otherwise, it is expression-equivalent + to: +

+
    +
  • + e.execute(f), if that expression is valid. If the function + selected does not execute the function object f on the executor + e, the program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, execute(e, f), if that expression is valid, with + overload resolution performed in a context that includes the declaration + void execute(); and that does not include a declaration + of execution::execute. If the function selected by overload + resolution does not execute the function object f on the + executor e, the program is ill-formed with no diagnostic + required. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution/execute.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__executor_index.html b/include/asio/doc/asio/reference/execution__executor_index.html new file mode 100644 index 0000000..7d74e04 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__executor_index.html @@ -0,0 +1,95 @@ + + + +execution::executor_index + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::executor_index + trait detects the type used by an executor to represent an index within a + bulk operation. +

+
template<
+    typename T>
+struct executor_index
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ T::index_type if T::index_type is valid, otherwise executor_shape_t<T>. +

+
+

+ Class template executor_index is a type trait with a nested + type alias type whose type is T::index_type if + T::index_type is valid, otherwise executor_shape_t<T>. +

+
+ + Requirements +
+

+ Header: asio/execution/executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__executor_index/type.html b/include/asio/doc/asio/reference/execution__executor_index/type.html new file mode 100644 index 0000000..ddd31cf --- /dev/null +++ b/include/asio/doc/asio/reference/execution__executor_index/type.html @@ -0,0 +1,54 @@ + + + +execution::executor_index::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +T::index_type + if T::index_type is valid, otherwise executor_shape_t<T>. +

+
typedef automatically_determined type;
+
+
+ + Requirements +
+

+ Header: asio/execution/executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__executor_shape.html b/include/asio/doc/asio/reference/execution__executor_shape.html new file mode 100644 index 0000000..97ccf7a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__executor_shape.html @@ -0,0 +1,95 @@ + + + +execution::executor_shape + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::executor_shape + trait detects the type used by an executor to represent the shape of a bulk + operation. +

+
template<
+    typename T>
+struct executor_shape
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ T::shape_type if T::shape_type is valid, otherwise std::size_t. +

+
+

+ Class template executor_shape is a type trait with a nested + type alias type whose type is T::shape_type if + T::shape_type is valid, otherwise std::size_t. +

+
+ + Requirements +
+

+ Header: asio/execution/executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__executor_shape/type.html b/include/asio/doc/asio/reference/execution__executor_shape/type.html new file mode 100644 index 0000000..d028275 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__executor_shape/type.html @@ -0,0 +1,54 @@ + + + +execution::executor_shape::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +T::shape_type + if T::shape_type is valid, otherwise std::size_t. +

+
typedef automatically_determined type;
+
+
+ + Requirements +
+

+ Header: asio/execution/executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__invocable_archetype.html b/include/asio/doc/asio/reference/execution__invocable_archetype.html new file mode 100644 index 0000000..3a9229d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__invocable_archetype.html @@ -0,0 +1,88 @@ + + + +execution::invocable_archetype + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An archetypal function object used for determining adherence to the execution::executor + concept. +

+
struct invocable_archetype
+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator() +

+
+

+ Function call operator. +

+
+
+ + Requirements +
+

+ Header: asio/execution/invocable_archetype.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__invocable_archetype/operator_lp__rp_.html b/include/asio/doc/asio/reference/execution__invocable_archetype/operator_lp__rp_.html new file mode 100644 index 0000000..6f46251 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__invocable_archetype/operator_lp__rp_.html @@ -0,0 +1,47 @@ + + + +execution::invocable_archetype::operator() + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Function + call operator. +

+
template<
+    typename... Args>
+void operator()(
+    Args && ...);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_executor.html b/include/asio/doc/asio/reference/execution__is_executor.html new file mode 100644 index 0000000..9649e85 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_executor.html @@ -0,0 +1,60 @@ + + + +execution::is_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_executor + trait detects whether a type T satisfies the execution::executor concept. +

+
template<
+    typename T>
+struct is_executor
+
+

+ Class template is_executor is a UnaryTypeTrait that is derived + from true_type if the type T meets the concept + definition for an executor, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_executor_of.html b/include/asio/doc/asio/reference/execution__is_executor_of.html new file mode 100644 index 0000000..8881226 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_executor_of.html @@ -0,0 +1,63 @@ + + + +execution::is_executor_of + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_executor_of + trait detects whether a type T satisfies the execution::executor_of concept + for some set of value arguments. +

+
template<
+    typename T,
+    typename F>
+struct is_executor_of
+
+

+ Class template is_executor_of is a type trait that is derived + from true_type if the type T meets the concept + definition for an executor that is invocable with a function object of type + F, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/executor.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_nothrow_receiver_of.html b/include/asio/doc/asio/reference/execution__is_nothrow_receiver_of.html new file mode 100644 index 0000000..ea10596 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_nothrow_receiver_of.html @@ -0,0 +1,64 @@ + + + +execution::is_nothrow_receiver_of + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_nothrow_receiver_of + trait detects whether a type T satisfies the execution::receiver_of concept + for some set of value arguments, with a noexcept set_value operation. +

+
template<
+    typename T,
+    typename... Vs>
+struct is_nothrow_receiver_of
+
+

+ Class template is_nothrow_receiver_of is a type trait that is + derived from true_type if the type T meets the + concept definition for a receiver for value arguments Vs, and + the expression execution::set_value(declval<T>(), declval<Ts>()...) + is noexcept, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/receiver.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_operation_state.html b/include/asio/doc/asio/reference/execution__is_operation_state.html new file mode 100644 index 0000000..c18bfb7 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_operation_state.html @@ -0,0 +1,60 @@ + + + +execution::is_operation_state + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_operation_state + trait detects whether a type T satisfies the execution::operation_state concept. +

+
template<
+    typename T>
+struct is_operation_state
+
+

+ Class template is_operation_state is a type trait that is derived + from true_type if the type T meets the concept + definition for an operation_state, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/operation_state.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_receiver.html b/include/asio/doc/asio/reference/execution__is_receiver.html new file mode 100644 index 0000000..8e57690 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_receiver.html @@ -0,0 +1,61 @@ + + + +execution::is_receiver + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_receiver + trait detects whether a type T satisfies the execution::receiver concept. +

+
template<
+    typename T,
+    typename E = std::exception_ptr>
+struct is_receiver
+
+

+ Class template is_receiver is a type trait that is derived from + true_type if the type T meets the concept definition + for a receiver for error type E, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/receiver.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_receiver_of.html b/include/asio/doc/asio/reference/execution__is_receiver_of.html new file mode 100644 index 0000000..fc0aba0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_receiver_of.html @@ -0,0 +1,63 @@ + + + +execution::is_receiver_of + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_receiver_of + trait detects whether a type T satisfies the execution::receiver_of concept + for some set of value arguments. +

+
template<
+    typename T,
+    typename... Vs>
+struct is_receiver_of
+
+

+ Class template is_receiver_of is a type trait that is derived + from true_type if the type T meets the concept + definition for a receiver for value arguments Vs, otherwise + false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/receiver.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_scheduler.html b/include/asio/doc/asio/reference/execution__is_scheduler.html new file mode 100644 index 0000000..062eb7d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_scheduler.html @@ -0,0 +1,60 @@ + + + +execution::is_scheduler + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_scheduler + trait detects whether a type T satisfies the execution::scheduler concept. +

+
template<
+    typename T>
+struct is_scheduler
+
+

+ Class template is_scheduler is a type trait that is derived + from true_type if the type T meets the concept + definition for a scheduler for error type E, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/scheduler.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_sender.html b/include/asio/doc/asio/reference/execution__is_sender.html new file mode 100644 index 0000000..8035f87 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_sender.html @@ -0,0 +1,60 @@ + + + +execution::is_sender + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_sender + trait detects whether a type T satisfies the execution::sender concept. +

+
template<
+    typename T>
+struct is_sender
+
+

+ Class template is_sender is a type trait that is derived from + true_type if the type T meets the concept definition + for a sender, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/execution/sender.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_sender_to.html b/include/asio/doc/asio/reference/execution__is_sender_to.html new file mode 100644 index 0000000..c5a8446 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_sender_to.html @@ -0,0 +1,62 @@ + + + +execution::is_sender_to + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_sender_to + trait detects whether a type T satisfies the execution::sender_to concept + for some receiver. +

+
template<
+    typename T,
+    typename R>
+struct is_sender_to
+
+

+ Class template is_sender_to is a type trait that is derived + from true_type if the type T meets the concept + definition for a sender for some receiver type R, otherwise false. +

+
+ + Requirements +
+

+ Header: asio/execution/sender.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__is_typed_sender.html b/include/asio/doc/asio/reference/execution__is_typed_sender.html new file mode 100644 index 0000000..d9c475f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__is_typed_sender.html @@ -0,0 +1,60 @@ + + + +execution::is_typed_sender + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The execution::is_typed_sender + trait detects whether a type T satisfies the execution::typed_sender concept. +

+
template<
+    typename T>
+struct is_typed_sender
+
+

+ Class template is_typed_sender is a type trait that is derived + from true_type if the type T meets the concept + definition for a typed sender, otherwise false. +

+
+ + Requirements +
+

+ Header: asio/execution/sender.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping.html b/include/asio/doc/asio/reference/execution__mapping.html new file mode 100644 index 0000000..78ba9d4 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping.html @@ -0,0 +1,55 @@ + + + +execution::mapping + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value used for + accessing the execution::mapping_t + property. +

+
constexpr mapping_t mapping;
+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t.html b/include/asio/doc/asio/reference/execution__mapping_t.html new file mode 100644 index 0000000..d0b29da --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t.html @@ -0,0 +1,309 @@ + + + +execution::mapping_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property to describe what guarantees an executor makes about the mapping + of execution agents on to threads of execution. +

+
struct mapping_t
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ new_thread_t +

+
+

+ A sub-property that indicates that execution agents are mapped + on to new threads of execution. +

+
+

+ other_t +

+
+

+ A sub-property that indicates that the mapping of execution agents + is implementation-defined. +

+
+

+ thread_t +

+
+

+ A sub-property that indicates that execution agents are mapped + on to threads of execution. +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ mapping_t [constructor] +

+
+

+ Default constructor.
—
Construct from a sub-property + value. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The mapping_t property applies to executors, senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The top-level mapping_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The top-level mapping_t property cannot be required. +

+
+

+ new_thread [static] +

+
+

+ A special value used for accessing the mapping_t::new_thread_t + property. +

+
+

+ other [static] +

+
+

+ A special value used for accessing the mapping_t::other_t property. +

+
+

+ thread [static] +

+
+

+ A special value used for accessing the mapping_t::thread_t property. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare property values for inequality. +

+
+

+ operator== +

+
+

+ Compare property values for equality. +

+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__mapping_t/is_applicable_property_v.html new file mode 100644 index 0000000..aecef25 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::mapping_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/is_preferable.html b/include/asio/doc/asio/reference/execution__mapping_t/is_preferable.html new file mode 100644 index 0000000..59f75c2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::mapping_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/is_requirable.html b/include/asio/doc/asio/reference/execution__mapping_t/is_requirable.html new file mode 100644 index 0000000..c84e87c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::mapping_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/mapping_t.html b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t.html new file mode 100644 index 0000000..bb207a0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t.html @@ -0,0 +1,60 @@ + + + +execution::mapping_t::mapping_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr mapping_t();
+  » more...
+
+

+ Construct from a sub-property value. +

+
constexpr mapping_t(
+    thread_t );
+  » more...
+
+constexpr mapping_t(
+    new_thread_t );
+  » more...
+
+constexpr mapping_t(
+    other_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload1.html b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload1.html new file mode 100644 index 0000000..e968bcc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload1.html @@ -0,0 +1,43 @@ + + + +execution::mapping_t::mapping_t (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr mapping_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload2.html b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload2.html new file mode 100644 index 0000000..9043ad4 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload2.html @@ -0,0 +1,44 @@ + + + +execution::mapping_t::mapping_t (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr mapping_t(
+    thread_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload3.html b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload3.html new file mode 100644 index 0000000..c0e74b2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload3.html @@ -0,0 +1,44 @@ + + + +execution::mapping_t::mapping_t (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr mapping_t(
+    new_thread_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload4.html b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload4.html new file mode 100644 index 0000000..5ff290c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/mapping_t/overload4.html @@ -0,0 +1,44 @@ + + + +execution::mapping_t::mapping_t (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr mapping_t(
+    other_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/new_thread.html b/include/asio/doc/asio/reference/execution__mapping_t/new_thread.html new file mode 100644 index 0000000..e1c71a2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/new_thread.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::new_thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::mapping_t::new_thread_t + property. +

+
static constexpr new_thread_t new_thread;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/operator_eq__eq_.html b/include/asio/doc/asio/reference/execution__mapping_t/operator_eq__eq_.html new file mode 100644 index 0000000..69082c6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +execution::mapping_t::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for equality. +

+
friend constexpr bool operator==(
+    const mapping_t & a,
+    const mapping_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/operator_not__eq_.html b/include/asio/doc/asio/reference/execution__mapping_t/operator_not__eq_.html new file mode 100644 index 0000000..5dc7ec1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +execution::mapping_t::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for inequality. +

+
friend constexpr bool operator!=(
+    const mapping_t & a,
+    const mapping_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/other.html b/include/asio/doc/asio/reference/execution__mapping_t/other.html new file mode 100644 index 0000000..a4fd259 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/other.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special + value used for accessing the execution::mapping_t::other_t + property. +

+
static constexpr other_t other;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__mapping_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..daca715 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::mapping_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef mapping_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t/thread.html b/include/asio/doc/asio/reference/execution__mapping_t/thread.html new file mode 100644 index 0000000..91d2f42 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t/thread.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special + value used for accessing the execution::mapping_t::thread_t + property. +

+
static constexpr thread_t thread;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t.html b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t.html new file mode 100644 index 0000000..8945f08 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t.html @@ -0,0 +1,198 @@ + + + +execution::mapping_t::new_thread_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that execution agents are mapped on to new + threads of execution. +

+
struct new_thread_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ new_thread_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The mapping_t::new_thread_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The mapping_t::new_thread_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The mapping_t::new_thread_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_applicable_property_v.html new file mode 100644 index 0000000..e39ef50 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::mapping_t::new_thread_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::new_thread_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_preferable.html b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_preferable.html new file mode 100644 index 0000000..06f009a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::new_thread_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::new_thread_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_requirable.html b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_requirable.html new file mode 100644 index 0000000..2d45a82 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::new_thread_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::new_thread_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/new_thread_t.html b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/new_thread_t.html new file mode 100644 index 0000000..8f66442 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/new_thread_t.html @@ -0,0 +1,44 @@ + + + +execution::mapping_t::new_thread_t::new_thread_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr new_thread_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..9cb66dd --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::mapping_t::new_thread_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef mapping_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/value.html b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/value.html new file mode 100644 index 0000000..6536320 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__new_thread_t/value.html @@ -0,0 +1,52 @@ + + + +execution::mapping_t::new_thread_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr mapping_t value();
+
+
+ + Return + Value +
+

+ new_thread_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__other_t.html b/include/asio/doc/asio/reference/execution__mapping_t__other_t.html new file mode 100644 index 0000000..0295169 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__other_t.html @@ -0,0 +1,197 @@ + + + +execution::mapping_t::other_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that the mapping of execution agents is implementation-defined. +

+
struct other_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The mapping_t::other_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The mapping_t::other_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The mapping_t::other_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_applicable_property_v.html new file mode 100644 index 0000000..d809314 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::mapping_t::other_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::other_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_preferable.html b/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_preferable.html new file mode 100644 index 0000000..64f270a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::other_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::other_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_requirable.html b/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_requirable.html new file mode 100644 index 0000000..48f210a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__other_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::other_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::other_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__other_t/other_t.html b/include/asio/doc/asio/reference/execution__mapping_t__other_t/other_t.html new file mode 100644 index 0000000..dae4c6d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__other_t/other_t.html @@ -0,0 +1,44 @@ + + + +execution::mapping_t::other_t::other_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr other_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__other_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__mapping_t__other_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..d985d89 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__other_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::mapping_t::other_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef mapping_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__other_t/value.html b/include/asio/doc/asio/reference/execution__mapping_t__other_t/value.html new file mode 100644 index 0000000..d66343d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__other_t/value.html @@ -0,0 +1,52 @@ + + + +execution::mapping_t::other_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr mapping_t value();
+
+
+ + Return + Value +
+

+ other_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__thread_t.html b/include/asio/doc/asio/reference/execution__mapping_t__thread_t.html new file mode 100644 index 0000000..b09290a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__thread_t.html @@ -0,0 +1,198 @@ + + + +execution::mapping_t::thread_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that execution agents are mapped on to threads + of execution. +

+
struct thread_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ thread_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The mapping_t::thread_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The mapping_t::thread_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The mapping_t::thread_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_applicable_property_v.html new file mode 100644 index 0000000..c13a7cd --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::mapping_t::thread_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::thread_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_preferable.html b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_preferable.html new file mode 100644 index 0000000..86fccf0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::thread_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::thread_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_requirable.html b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_requirable.html new file mode 100644 index 0000000..5a5fa1b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::mapping_t::thread_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::mapping_t::thread_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__thread_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..acca0dd --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::mapping_t::thread_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef mapping_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/mapping.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__thread_t/thread_t.html b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/thread_t.html new file mode 100644 index 0000000..28f1a9b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/thread_t.html @@ -0,0 +1,44 @@ + + + +execution::mapping_t::thread_t::thread_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr thread_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__mapping_t__thread_t/value.html b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/value.html new file mode 100644 index 0000000..f992036 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__mapping_t__thread_t/value.html @@ -0,0 +1,52 @@ + + + +execution::mapping_t::thread_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr mapping_t value();
+
+
+ + Return + Value +
+

+ thread_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__occupancy.html b/include/asio/doc/asio/reference/execution__occupancy.html new file mode 100644 index 0000000..044ccfc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__occupancy.html @@ -0,0 +1,55 @@ + + + +execution::occupancy + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value used + for accessing the execution::occupancy_t + property. +

+
constexpr occupancy_t occupancy;
+
+
+ + Requirements +
+

+ Header: asio/execution/occupancy.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__occupancy_t.html b/include/asio/doc/asio/reference/execution__occupancy_t.html new file mode 100644 index 0000000..fd85509 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__occupancy_t.html @@ -0,0 +1,148 @@ + + + +execution::occupancy_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property that gives an estimate of the number of execution agents that + should occupy the associated execution context. +

+
struct occupancy_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The occupancy_t property applies to executors, senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The occupancy_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The occupancy_t property cannot be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/occupancy.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__occupancy_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__occupancy_t/is_applicable_property_v.html new file mode 100644 index 0000000..dbdbb32 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__occupancy_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::occupancy_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::occupancy_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__occupancy_t/is_preferable.html b/include/asio/doc/asio/reference/execution__occupancy_t/is_preferable.html new file mode 100644 index 0000000..dd3afd4 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__occupancy_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::occupancy_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::occupancy_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__occupancy_t/is_requirable.html b/include/asio/doc/asio/reference/execution__occupancy_t/is_requirable.html new file mode 100644 index 0000000..a7fa702 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__occupancy_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::occupancy_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::occupancy_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__occupancy_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__occupancy_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..325d8ae --- /dev/null +++ b/include/asio/doc/asio/reference/execution__occupancy_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::occupancy_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef std::size_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/occupancy.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work.html b/include/asio/doc/asio/reference/execution__outstanding_work.html new file mode 100644 index 0000000..78b93c1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work.html @@ -0,0 +1,55 @@ + + + +execution::outstanding_work + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special + value used for accessing the execution::outstanding_work_t + property. +

+
constexpr outstanding_work_t outstanding_work;
+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t.html b/include/asio/doc/asio/reference/execution__outstanding_work_t.html new file mode 100644 index 0000000..f6a0636 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t.html @@ -0,0 +1,286 @@ + + + +execution::outstanding_work_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property to describe whether task submission is likely in the future. +

+
struct outstanding_work_t
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ tracked_t +

+
+

+ A sub-property that indicates that the executor represents likely + future submission of a function object. +

+
+

+ untracked_t +

+
+

+ A sub-property that indicates that the executor does not represent + likely future submission of a function object. +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ outstanding_work_t [constructor] +

+
+

+ Default constructor.
—
Construct from a sub-property + value. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The outstanding_work_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The top-level outstanding_work_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The top-level outstanding_work_t property cannot be required. +

+
+

+ tracked [static] +

+
+

+ A special value used for accessing the outstanding_work_t::tracked_t + property. +

+
+

+ untracked [static] +

+
+

+ A special value used for accessing the outstanding_work_t::untracked_t + property. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare property values for inequality. +

+
+

+ operator== +

+
+

+ Compare property values for equality. +

+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/is_applicable_property_v.html new file mode 100644 index 0000000..55211ce --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::outstanding_work_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::outstanding_work_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/is_preferable.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/is_preferable.html new file mode 100644 index 0000000..dc2b269 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::outstanding_work_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/is_requirable.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/is_requirable.html new file mode 100644 index 0000000..ffbd72f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::outstanding_work_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/operator_eq__eq_.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/operator_eq__eq_.html new file mode 100644 index 0000000..8d4e031 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +execution::outstanding_work_t::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for equality. +

+
friend constexpr bool operator==(
+    const outstanding_work_t & a,
+    const outstanding_work_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/operator_not__eq_.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/operator_not__eq_.html new file mode 100644 index 0000000..da15b61 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +execution::outstanding_work_t::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for inequality. +

+
friend constexpr bool operator!=(
+    const outstanding_work_t & a,
+    const outstanding_work_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t.html new file mode 100644 index 0000000..c12ab6e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t.html @@ -0,0 +1,56 @@ + + + +execution::outstanding_work_t::outstanding_work_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr outstanding_work_t();
+  » more...
+
+

+ Construct from a sub-property value. +

+
constexpr outstanding_work_t(
+    untracked_t );
+  » more...
+
+constexpr outstanding_work_t(
+    tracked_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload1.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload1.html new file mode 100644 index 0000000..7998dac --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload1.html @@ -0,0 +1,43 @@ + + + +execution::outstanding_work_t::outstanding_work_t (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr outstanding_work_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload2.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload2.html new file mode 100644 index 0000000..6255a4a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload2.html @@ -0,0 +1,44 @@ + + + +execution::outstanding_work_t::outstanding_work_t (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr outstanding_work_t(
+    untracked_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload3.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload3.html new file mode 100644 index 0000000..9a2a1dc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/outstanding_work_t/overload3.html @@ -0,0 +1,44 @@ + + + +execution::outstanding_work_t::outstanding_work_t (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr outstanding_work_t(
+    tracked_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..f7fde63 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::outstanding_work_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef outstanding_work_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/tracked.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/tracked.html new file mode 100644 index 0000000..bc45dcc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/tracked.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::tracked + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::outstanding_work_t::tracked_t + property. +

+
static constexpr tracked_t tracked;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t/untracked.html b/include/asio/doc/asio/reference/execution__outstanding_work_t/untracked.html new file mode 100644 index 0000000..e7d965d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t/untracked.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::untracked + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::outstanding_work_t::untracked_t + property. +

+
static constexpr untracked_t untracked;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t.html new file mode 100644 index 0000000..9f30e6c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t.html @@ -0,0 +1,198 @@ + + + +execution::outstanding_work_t::tracked_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that the executor represents likely future + submission of a function object. +

+
struct tracked_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ tracked_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The outstanding_work_t::untracked_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The outstanding_work_t::tracked_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The outstanding_work_t::tracked_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_applicable_property_v.html new file mode 100644 index 0000000..518702e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::outstanding_work_t::tracked_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::outstanding_work_t::untracked_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_preferable.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_preferable.html new file mode 100644 index 0000000..b509c9e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::tracked_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::outstanding_work_t::tracked_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_requirable.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_requirable.html new file mode 100644 index 0000000..566c14b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::tracked_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::outstanding_work_t::tracked_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..501e806 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::outstanding_work_t::tracked_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef outstanding_work_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/tracked_t.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/tracked_t.html new file mode 100644 index 0000000..a0edddc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/tracked_t.html @@ -0,0 +1,44 @@ + + + +execution::outstanding_work_t::tracked_t::tracked_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr tracked_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/value.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/value.html new file mode 100644 index 0000000..22e4711 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__tracked_t/value.html @@ -0,0 +1,52 @@ + + + +execution::outstanding_work_t::tracked_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr outstanding_work_t value();
+
+
+ + Return + Value +
+

+ tracked_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t.html new file mode 100644 index 0000000..f822650 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t.html @@ -0,0 +1,198 @@ + + + +execution::outstanding_work_t::untracked_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that the executor does not represent likely + future submission of a function object. +

+
struct untracked_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ untracked_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The outstanding_work_t::untracked_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The outstanding_work_t::untracked_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The outstanding_work_t::untracked_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_applicable_property_v.html new file mode 100644 index 0000000..7527fbf --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::outstanding_work_t::untracked_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::outstanding_work_t::untracked_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_preferable.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_preferable.html new file mode 100644 index 0000000..96d01ce --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::untracked_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::outstanding_work_t::untracked_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_requirable.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_requirable.html new file mode 100644 index 0000000..f9cda5f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::outstanding_work_t::untracked_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::outstanding_work_t::untracked_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..dee4d56 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::outstanding_work_t::untracked_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef outstanding_work_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/outstanding_work.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/untracked_t.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/untracked_t.html new file mode 100644 index 0000000..1b94ca0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/untracked_t.html @@ -0,0 +1,44 @@ + + + +execution::outstanding_work_t::untracked_t::untracked_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr untracked_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/value.html b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/value.html new file mode 100644 index 0000000..3fec686 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__outstanding_work_t__untracked_t/value.html @@ -0,0 +1,52 @@ + + + +execution::outstanding_work_t::untracked_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr outstanding_work_t value();
+
+
+ + Return + Value +
+

+ untracked_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__prefer_only.html b/include/asio/doc/asio/reference/execution__prefer_only.html new file mode 100644 index 0000000..88c4532 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__prefer_only.html @@ -0,0 +1,152 @@ + + + +execution::prefer_only + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property adapter that is used with the polymorphic executor wrapper to + mark properties as preferable, but not requirable. +

+
template<
+    typename Property>
+struct prefer_only
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The prefer_only adapter applies to the same types as the nested + property. +

+
+

+ is_preferable [static] +

+
+

+ The context_t property can be preferred, it the underlying property + can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The context_t property cannot be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/prefer_only.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__prefer_only/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__prefer_only/is_applicable_property_v.html new file mode 100644 index 0000000..f10b0b1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__prefer_only/is_applicable_property_v.html @@ -0,0 +1,46 @@ + + + +execution::prefer_only::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::prefer_only + adapter applies to the same types as the nested property. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =is_applicable_property<T, Property>::value;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__prefer_only/is_preferable.html b/include/asio/doc/asio/reference/execution__prefer_only/is_preferable.html new file mode 100644 index 0000000..209346e --- /dev/null +++ b/include/asio/doc/asio/reference/execution__prefer_only/is_preferable.html @@ -0,0 +1,49 @@ + + + +execution::prefer_only::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_t + property can be preferred, it the underlying property can be preferred. +

+
static constexpr bool is_preferable = automatically_determined;
+
+

+ true if Property::is_preferable is true, + otherwise false. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__prefer_only/is_requirable.html b/include/asio/doc/asio/reference/execution__prefer_only/is_requirable.html new file mode 100644 index 0000000..7b8e8fe --- /dev/null +++ b/include/asio/doc/asio/reference/execution__prefer_only/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::prefer_only::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::context_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__prefer_only/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__prefer_only/polymorphic_query_result_type.html new file mode 100644 index 0000000..75387f2 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__prefer_only/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::prefer_only::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef Property::polymorphic_query_result_type polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/prefer_only.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__receiver_invocation_error.html b/include/asio/doc/asio/reference/execution__receiver_invocation_error.html new file mode 100644 index 0000000..8430937 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__receiver_invocation_error.html @@ -0,0 +1,88 @@ + + + +execution::receiver_invocation_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Exception reported via set_error when an exception escapes from + set_value. +

+
class receiver_invocation_error
+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ receiver_invocation_error [constructor] +

+
+

+ Constructor. +

+
+
+ + Requirements +
+

+ Header: asio/execution/receiver_invocation_error.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__receiver_invocation_error/receiver_invocation_error.html b/include/asio/doc/asio/reference/execution__receiver_invocation_error/receiver_invocation_error.html new file mode 100644 index 0000000..c2d9077 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__receiver_invocation_error/receiver_invocation_error.html @@ -0,0 +1,43 @@ + + + +execution::receiver_invocation_error::receiver_invocation_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
receiver_invocation_error();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship.html b/include/asio/doc/asio/reference/execution__relationship.html new file mode 100644 index 0000000..fa36bac --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship.html @@ -0,0 +1,55 @@ + + + +execution::relationship + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value + used for accessing the execution::relationship_t + property. +

+
constexpr relationship_t relationship;
+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t.html b/include/asio/doc/asio/reference/execution__relationship_t.html new file mode 100644 index 0000000..074ae4a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t.html @@ -0,0 +1,285 @@ + + + +execution::relationship_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A property to describe whether submitted tasks represent continuations of + the calling context. +

+
struct relationship_t
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ continuation_t +

+
+

+ A sub-property that indicates that the executor represents a continuation + of the calling context. +

+
+

+ fork_t +

+
+

+ A sub-property that indicates that the executor does not represent + a continuation of the calling context. +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ relationship_t [constructor] +

+
+

+ Default constructor.
—
Construct from a sub-property + value. +

+
+
+ + Data Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ continuation [static] +

+
+

+ A special value used for accessing the relationship_t::continuation_t + property. +

+
+

+ fork [static] +

+
+

+ A special value used for accessing the relationship_t::fork_t property. +

+
+

+ is_applicable_property_v [static] +

+
+

+ The relationship_t property applies to executors, senders, and + schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The top-level relationship_t property cannot be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The top-level relationship_t property cannot be required. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare property values for inequality. +

+
+

+ operator== +

+
+

+ Compare property values for equality. +

+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/continuation.html b/include/asio/doc/asio/reference/execution__relationship_t/continuation.html new file mode 100644 index 0000000..73cb376 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/continuation.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::continuation + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::relationship_t::continuation_t + property. +

+
static constexpr continuation_t continuation;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/fork.html b/include/asio/doc/asio/reference/execution__relationship_t/fork.html new file mode 100644 index 0000000..b34e0b7 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/fork.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::fork + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + special value used for accessing the execution::relationship_t::fork_t + property. +

+
static constexpr fork_t fork;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__relationship_t/is_applicable_property_v.html new file mode 100644 index 0000000..523d41a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::relationship_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::relationship_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+  is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/is_preferable.html b/include/asio/doc/asio/reference/execution__relationship_t/is_preferable.html new file mode 100644 index 0000000..a3b6489 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::relationship_t + property cannot be preferred. +

+
static constexpr bool is_preferable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/is_requirable.html b/include/asio/doc/asio/reference/execution__relationship_t/is_requirable.html new file mode 100644 index 0000000..cea912a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + top-level execution::relationship_t + property cannot be required. +

+
static constexpr bool is_requirable = false;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/operator_eq__eq_.html b/include/asio/doc/asio/reference/execution__relationship_t/operator_eq__eq_.html new file mode 100644 index 0000000..1f55edc --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +execution::relationship_t::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for equality. +

+
friend constexpr bool operator==(
+    const relationship_t & a,
+    const relationship_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/operator_not__eq_.html b/include/asio/doc/asio/reference/execution__relationship_t/operator_not__eq_.html new file mode 100644 index 0000000..628d7f8 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +execution::relationship_t::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + property values for inequality. +

+
friend constexpr bool operator!=(
+    const relationship_t & a,
+    const relationship_t & b);
+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__relationship_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..0153f44 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::relationship_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef relationship_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/relationship_t.html b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t.html new file mode 100644 index 0000000..22475bf --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t.html @@ -0,0 +1,56 @@ + + + +execution::relationship_t::relationship_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr relationship_t();
+  » more...
+
+

+ Construct from a sub-property value. +

+
constexpr relationship_t(
+    fork_t );
+  » more...
+
+constexpr relationship_t(
+    continuation_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload1.html b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload1.html new file mode 100644 index 0000000..67ef68a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload1.html @@ -0,0 +1,43 @@ + + + +execution::relationship_t::relationship_t (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr relationship_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload2.html b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload2.html new file mode 100644 index 0000000..81ee9b7 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload2.html @@ -0,0 +1,44 @@ + + + +execution::relationship_t::relationship_t (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr relationship_t(
+    fork_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload3.html b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload3.html new file mode 100644 index 0000000..e2a76cb --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t/relationship_t/overload3.html @@ -0,0 +1,44 @@ + + + +execution::relationship_t::relationship_t (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from a sub-property value. +

+
constexpr relationship_t(
+    continuation_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__continuation_t.html b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t.html new file mode 100644 index 0000000..2137a20 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t.html @@ -0,0 +1,198 @@ + + + +execution::relationship_t::continuation_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that the executor represents a continuation + of the calling context. +

+
struct continuation_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ continuation_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The relationship_t::continuation_t property applies to executors, + senders, and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The relationship_t::continuation_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The relationship_t::continuation_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/continuation_t.html b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/continuation_t.html new file mode 100644 index 0000000..7fd4234 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/continuation_t.html @@ -0,0 +1,44 @@ + + + +execution::relationship_t::continuation_t::continuation_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr continuation_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_applicable_property_v.html new file mode 100644 index 0000000..f4f41ec --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::relationship_t::continuation_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::relationship_t::continuation_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_preferable.html b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_preferable.html new file mode 100644 index 0000000..57cf476 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::continuation_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::relationship_t::continuation_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_requirable.html b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_requirable.html new file mode 100644 index 0000000..efe0a54 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::continuation_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::relationship_t::continuation_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..840c65a --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::relationship_t::continuation_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef relationship_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/value.html b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/value.html new file mode 100644 index 0000000..197659d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__continuation_t/value.html @@ -0,0 +1,52 @@ + + + +execution::relationship_t::continuation_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr relationship_t value();
+
+
+ + Return + Value +
+

+ continuation_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__fork_t.html b/include/asio/doc/asio/reference/execution__relationship_t__fork_t.html new file mode 100644 index 0000000..9071dfa --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__fork_t.html @@ -0,0 +1,198 @@ + + + +execution::relationship_t::fork_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A sub-property that indicates that the executor does not represent a continuation + of the calling context. +

+
struct fork_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ polymorphic_query_result_type +

+
+

+ The type returned by queries against an any_executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ fork_t [constructor] +

+
+

+ Default constructor. +

+
+

+ value [static] +

+
+

+ Get the value associated with a property object. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ is_applicable_property_v [static] +

+
+

+ The relationship_t::fork_t property applies to executors, senders, + and schedulers. +

+
+

+ is_preferable [static] +

+
+

+ The relationship_t::fork_t property can be preferred. +

+
+

+ is_requirable [static] +

+
+

+ The relationship_t::fork_t property can be required. +

+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__fork_t/fork_t.html b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/fork_t.html new file mode 100644 index 0000000..c2ff684 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/fork_t.html @@ -0,0 +1,44 @@ + + + +execution::relationship_t::fork_t::fork_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr fork_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_applicable_property_v.html b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_applicable_property_v.html new file mode 100644 index 0000000..6d5f0da --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_applicable_property_v.html @@ -0,0 +1,47 @@ + + + +execution::relationship_t::fork_t::is_applicable_property_v + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::relationship_t::fork_t + property applies to executors, senders, and schedulers. +

+
template <typename T>
+static constexpr bool is_applicable_property_v =
+    is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_preferable.html b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_preferable.html new file mode 100644 index 0000000..e100c3b --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_preferable.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::fork_t::is_preferable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::relationship_t::fork_t + property can be preferred. +

+
static constexpr bool is_preferable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_requirable.html b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_requirable.html new file mode 100644 index 0000000..7be625d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/is_requirable.html @@ -0,0 +1,45 @@ + + + +execution::relationship_t::fork_t::is_requirable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + execution::relationship_t::fork_t + property can be required. +

+
static constexpr bool is_requirable = true;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__fork_t/polymorphic_query_result_type.html b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/polymorphic_query_result_type.html new file mode 100644 index 0000000..505c989 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/polymorphic_query_result_type.html @@ -0,0 +1,54 @@ + + + +execution::relationship_t::fork_t::polymorphic_query_result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type returned by queries against an any_executor. +

+
typedef relationship_t polymorphic_query_result_type;
+
+
+ + Requirements +
+

+ Header: asio/execution/relationship.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__relationship_t__fork_t/value.html b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/value.html new file mode 100644 index 0000000..2e57cb9 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__relationship_t__fork_t/value.html @@ -0,0 +1,52 @@ + + + +execution::relationship_t::fork_t::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the value associated with a property object. +

+
static constexpr relationship_t value();
+
+
+ + Return + Value +
+

+ fork_t(); +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__schedule.html b/include/asio/doc/asio/reference/execution__schedule.html new file mode 100644 index 0000000..3fc6a37 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__schedule.html @@ -0,0 +1,78 @@ + + + +execution::schedule + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point + that is used to obtain a sender from a scheduler. +

+
constexpr unspecified schedule = unspecified;
+
+

+ The name execution::schedule denotes a customisation point object. + For some subexpression s, let S be a type such + that decltype((s)) is S. The expression execution::schedule(s) + is expression-equivalent to: +

+
    +
  • + s.schedule(), if that expression is valid and its type models + sender. +
  • +
  • + Otherwise, schedule(s), if that expression is valid and + its type models sender with overload resolution performed + in a context that includes the declaration void schedule(); + and that does not include a declaration of execution::schedule. +
  • +
  • + Otherwise, S if S satisfies executor. +
  • +
  • + Otherwise, execution::schedule(s) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution/schedule.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__sender_base.html b/include/asio/doc/asio/reference/execution__sender_base.html new file mode 100644 index 0000000..21c4bad --- /dev/null +++ b/include/asio/doc/asio/reference/execution__sender_base.html @@ -0,0 +1,54 @@ + + + +execution::sender_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Base class used + for tagging senders. +

+
typedef unspecified sender_base;
+
+
+ + Requirements +
+

+ Header: asio/execution/sender.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__sender_traits.html b/include/asio/doc/asio/reference/execution__sender_traits.html new file mode 100644 index 0000000..3ec699f --- /dev/null +++ b/include/asio/doc/asio/reference/execution__sender_traits.html @@ -0,0 +1,54 @@ + + + +execution::sender_traits + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Traits for senders. +

+
template<
+    typename S>
+struct sender_traits
+
+
+ + Requirements +
+

+ Header: asio/execution/sender.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__set_done.html b/include/asio/doc/asio/reference/execution__set_done.html new file mode 100644 index 0000000..ee7d69c --- /dev/null +++ b/include/asio/doc/asio/reference/execution__set_done.html @@ -0,0 +1,77 @@ + + + +execution::set_done + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point + that delivers a done notification to a receiver. +

+
constexpr unspecified set_done = unspecified;
+
+

+ The name execution::set_done denotes a customisation point object. + The expression execution::set_done(R) for some subexpression + R is expression-equivalent to: +

+
    +
  • + R.set_done(), if that expression is valid. If the function + selected does not signal the receiver R's done channel, + the program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, set_done(R), if that expression is valid, with + overload resolution performed in a context that includes the declaration + void set_done(); and that does not include a declaration + of execution::set_done. If the function selected by overload + resolution does not signal the receiver R's done channel, + the program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, execution::set_done(R) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution/set_done.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__set_error.html b/include/asio/doc/asio/reference/execution__set_error.html new file mode 100644 index 0000000..e75e464 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__set_error.html @@ -0,0 +1,77 @@ + + + +execution::set_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point + that delivers an error notification to a receiver. +

+
constexpr unspecified set_error = unspecified;
+
+

+ The name execution::set_error denotes a customisation point + object. The expression execution::set_error(R, E) for some subexpressions + R and E are expression-equivalent to: +

+
    +
  • + R.set_error(E), if that expression is valid. If the function + selected does not send the error E to the receiver R's + error channel, the program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, set_error(R, E), if that expression is valid, + with overload resolution performed in a context that includes the declaration + void set_error(); and that does not include a declaration + of execution::set_error. If the function selected by overload + resolution does not send the error E to the receiver R's + error channel, the program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, execution::set_error(R, E) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution/set_error.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__set_value.html b/include/asio/doc/asio/reference/execution__set_value.html new file mode 100644 index 0000000..63f4196 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__set_value.html @@ -0,0 +1,80 @@ + + + +execution::set_value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point + that delivers a value to a receiver. +

+
constexpr unspecified set_value = unspecified;
+
+

+ The name execution::set_value denotes a customisation point + object. The expression execution::set_value(R, Vs...) for some + subexpressions R and Vs... is expression-equivalent + to: +

+
    +
  • + R.set_value(Vs...), if that expression is valid. If the + function selected does not send the value(s) Vs... to the + receiver R's value channel, the program is ill-formed with + no diagnostic required. +
  • +
  • + Otherwise, set_value(R, Vs...), if that expression is valid, + with overload resolution performed in a context that includes the declaration + void set_value(); and that does not include a declaration + of execution::set_value. If the function selected by overload + resolution does not send the value(s) Vs... to the receiver + R's value channel, the program is ill-formed with no diagnostic + required. +
  • +
  • + Otherwise, execution::set_value(R, Vs...) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution/set_value.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__start.html b/include/asio/doc/asio/reference/execution__start.html new file mode 100644 index 0000000..eabb68d --- /dev/null +++ b/include/asio/doc/asio/reference/execution__start.html @@ -0,0 +1,72 @@ + + + +execution::start + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point that + notifies an operation state object to start its associated operation. +

+
constexpr unspecified start = unspecified;
+
+

+ The name execution::start denotes a customisation point object. + The expression execution::start(R) for some subexpression R + is expression-equivalent to: +

+
    +
  • + R.start(), if that expression is valid. +
  • +
  • + Otherwise, start(R), if that expression is valid, with overload + resolution performed in a context that includes the declaration void + start(); and that does not include a declaration of execution::start. +
  • +
  • + Otherwise, execution::start(R) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution/start.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution__submit.html b/include/asio/doc/asio/reference/execution__submit.html new file mode 100644 index 0000000..c749380 --- /dev/null +++ b/include/asio/doc/asio/reference/execution__submit.html @@ -0,0 +1,114 @@ + + + +execution::submit + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point that + submits a sender to a receiver. +

+
constexpr unspecified submit = unspecified;
+
+

+ The name execution::submit denotes a customisation point object. + For some subexpressions s and r, let S + be a type such that decltype((s)) is S and let + R be a type such that decltype((r)) is R. + The expression execution::submit(s, r) is ill-formed if sender_to<S, + R> is not true. Otherwise, it is expression-equivalent + to: +

+
    +
  • + s.submit(r), if that expression is valid and S + models sender. If the function selected does not submit + the receiver object r via the sender s, the + program is ill-formed with no diagnostic required. +
  • +
  • + Otherwise, submit(s, r), if that expression is valid and + S models sender, with overload resolution performed + in a context that includes the declaration void submit(); + and that does not include a declaration of execution::submit. + If the function selected by overload resolution does not submit the receiver + object r via the sender s, the program is ill-formed + with no diagnostic required. +
  • +
  • + Otherwise, execution::start((new submit_receiver<S, R>{s,r})->state_), + where submit_receiver is an implementation-defined class + template equivalent to: +
  • +
+
template<class S, class R>
+  struct submit_receiver {
+    struct wrap {
+      submit_receiver * p_;
+      template<class...As>
+        requires receiver_of<R, As...>
+      void set_value(As&&... as) &&
+        noexcept(is_nothrow_receiver_of_v<R, As...>) {
+        execution::set_value(std::move(p_->r_), (As&&) as...);
+        delete p_;
+      }
+      template<class E>
+        requires receiver<R, E>
+      void set_error(E&& e) && noexcept {
+        execution::set_error(std::move(p_->r_), (E&&) e);
+        delete p_;
+      }
+      void set_done() && noexcept {
+        execution::set_done(std::move(p_->r_));
+        delete p_;
+      }
+    };
+    remove_cvref_t<R> r_;
+    connect_result_t<S, wrap> state_;
+    submit_receiver(S&& s, R&& r)
+      : r_((R&&) r)
+      , state_(execution::connect((S&&) s, wrap{this})) {}
+  };
+
+
+ + Requirements +
+

+ Header: asio/execution/submit.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context.html b/include/asio/doc/asio/reference/execution_context.html new file mode 100644 index 0000000..fa296a0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context.html @@ -0,0 +1,385 @@ + + + +execution_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A context for function object execution. +

+
class execution_context :
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ id +

+
+

+ Class used to uniquely identify a service. +

+
+

+ service +

+
+

+ Base class for all io_context services. +

+
+

+ fork_event +

+
+

+ Fork-related event notifications. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ execution_context [constructor] +

+
+

+ Constructor. +

+
+

+ notify_fork +

+
+

+ Notify the execution_context of a fork-related event. +

+
+

+ ~execution_context [destructor] +

+
+

+ Destructor. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ destroy +

+
+

+ Destroys all services in the context. +

+
+

+ shutdown +

+
+

+ Shuts down all services in the context. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add_service +

+
+

+ (Deprecated: Use make_service().) Add a service object to the execution_context. +

+
+

+ has_service +

+
+

+ Determine if an execution_context contains a specified service + type. +

+
+

+ make_service +

+
+

+ Creates a service object and adds it to the execution_context. +

+
+

+ use_service +

+
+

+ Obtain the service object corresponding to the given type. +

+
+

+ An execution context represents a place where function objects will be executed. + An io_context is an example of an execution context. +

+
+ + The + execution_context class and services +
+

+ Class execution_context + implements an extensible, type-safe, polymorphic set of services, indexed + by service type. +

+

+ Services exist to manage the resources that are shared across an execution + context. For example, timers may be implemented in terms of a single timer + queue, and this queue would be stored in a service. +

+

+ Access to the services of an execution_context + is via three function templates, use_service(), add_service() + and has_service(). +

+

+ In a call to use_service<Service>(), the type argument + chooses a service, making available all members of the named type. If Service + is not present in an execution_context, + an object of type Service is created and added to the execution_context. + A C++ program can check if an execution_context + implements a particular service with the function template has_service<Service>(). +

+

+ Service objects may be explicitly added to an execution_context + using the function template add_service<Service>(). If + the Service is already present, the service_already_exists + exception is thrown. If the owner of the service is not the same object as + the execution_context + parameter, the invalid_service_owner + exception is thrown. +

+

+ Once a service reference is obtained from an execution_context + object by calling use_service(), that reference remains usable + as long as the owning execution_context + object exists. +

+

+ All service implementations have execution_context::service + as a public base class. Custom services may be implemented by deriving from + this class and then added to an execution_context + using the facilities described above. +

+
+ + The + execution_context as a base class +
+

+ Class execution_context + may be used only as a base class for concrete execution context types. The + io_context is an example of such a derived type. +

+

+ On destruction, a class that is derived from execution_context + must perform execution_context::shutdown() followed by execution_context::destroy(). +

+

+ This destruction sequence permits programs to simplify their resource management + by using shared_ptr<>. Where an object's lifetime is tied + to the lifetime of a connection (or some other sequence of asynchronous operations), + a shared_ptr to the object would be bound into the handlers + for all asynchronous operations associated with it. This works as follows: +

+
    +
  • + When a single connection ends, all associated asynchronous operations + complete. The corresponding handler objects are destroyed, and all shared_ptr + references to the objects are destroyed. +
  • +
  • + To shut down the whole program, the io_context + function stop() is called to terminate any run() calls as soon as possible. + The io_context + destructor calls shutdown() and destroy() to + destroy all pending handlers, causing all shared_ptr references + to all connection objects to be destroyed. +
  • +
+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/_execution_context.html b/include/asio/doc/asio/reference/execution_context/_execution_context.html new file mode 100644 index 0000000..99514e6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/_execution_context.html @@ -0,0 +1,43 @@ + + + +execution_context::~execution_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~execution_context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/add_service.html b/include/asio/doc/asio/reference/execution_context/add_service.html new file mode 100644 index 0000000..3b768fc --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/add_service.html @@ -0,0 +1,108 @@ + + + +execution_context::add_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use make_service().) Add a service object to the execution_context. +

+
template<
+    typename Service>
+friend void add_service(
+    execution_context & e,
+    Service * svc);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
svc
+
+

+ The service object. On success, ownership of the service object is + transferred to the execution_context. + When the execution_context + object is destroyed, it will destroy the service object by performing: +

+
delete static_cast<execution_context::service*>(svc)
+
+

+

+
+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
asio::invalid_service_owner
+

+ Thrown if the service's owning execution_context + is not the execution_context + object specified by the e parameter. +

+
+
+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/destroy.html b/include/asio/doc/asio/reference/execution_context/destroy.html new file mode 100644 index 0000000..20630c1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/destroy.html @@ -0,0 +1,52 @@ + + + +execution_context::destroy + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + all services in the context. +

+
void destroy();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order * of the beginning of service object lifetime, + performs delete static_cast<execution_context::service*>(svc). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/execution_context.html b/include/asio/doc/asio/reference/execution_context/execution_context.html new file mode 100644 index 0000000..9d82d50 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/execution_context.html @@ -0,0 +1,43 @@ + + + +execution_context::execution_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
execution_context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/fork_event.html b/include/asio/doc/asio/reference/execution_context/fork_event.html new file mode 100644 index 0000000..0d27a1b --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/fork_event.html @@ -0,0 +1,70 @@ + + + +execution_context::fork_event + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Fork-related + event notifications. +

+
enum fork_event
+
+

+ + + +

+
+ + Values +
+
+

+
+
fork_prepare
+

+ Notify the context that the process is about to fork. +

+
fork_parent
+

+ Notify the context that the process has forked and is the parent. +

+
fork_child
+

+ Notify the context that the process has forked and is the child. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/has_service.html b/include/asio/doc/asio/reference/execution_context/has_service.html new file mode 100644 index 0000000..1aa02d6 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/has_service.html @@ -0,0 +1,85 @@ + + + +execution_context::has_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + if an execution_context + contains a specified service type. +

+
template<
+    typename Service>
+friend bool has_service(
+    execution_context & e);
+
+

+ This function is used to determine whether the execution_context + contains a service object corresponding to the given service type. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ A boolean indicating whether the execution_context + contains the service. +

+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/make_service.html b/include/asio/doc/asio/reference/execution_context/make_service.html new file mode 100644 index 0000000..3aed86e --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/make_service.html @@ -0,0 +1,94 @@ + + + +execution_context::make_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Creates + a service object and adds it to the execution_context. +

+
template<
+    typename Service,
+    typename... Args>
+friend Service & make_service(
+    execution_context & e,
+    Args &&... args);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
args
+

+ Zero or more arguments to be passed to the service constructor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
+
+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/notify_fork.html b/include/asio/doc/asio/reference/execution_context/notify_fork.html new file mode 100644 index 0000000..2310662 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/notify_fork.html @@ -0,0 +1,119 @@ + + + +execution_context::notify_fork + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Notify + the execution_context + of a fork-related event. +

+
void notify_fork(
+    fork_event event);
+
+

+ This function is used to inform the execution_context + that the process is about to fork, or has just forked. This allows the + execution_context, + and the services it contains, to perform any necessary housekeeping to + ensure correct operation following a fork. +

+

+ This function must not be called while any other execution_context + function, or any function associated with the execution_context's derived + class, is being called in another thread. It is, however, safe to call + this function from within a completion handler, provided no other thread + is accessing the execution_context + or its derived class. +

+
+ + Parameters +
+
+

+
+
event
+

+ A fork-related event. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the notification fails the execution_context + object should no longer be used and should be destroyed. +

+
+
+
+ + Example +
+

+ The following code illustrates how to incorporate the notify_fork() + function: +

+
my_execution_context.notify_fork(execution_context::fork_prepare);
+if (fork() == 0)
+{
+  // This is the child process.
+  my_execution_context.notify_fork(execution_context::fork_child);
+}
+else
+{
+  // This is the parent process.
+  my_execution_context.notify_fork(execution_context::fork_parent);
+}
+
+
+ + Remarks +
+

+ For each service object svc in the execution_context + set, performs svc->notify_fork();. When processing the + fork_prepare event, services are visited in reverse order of the beginning + of service object lifetime. Otherwise, services are visited in order of + the beginning of service object lifetime. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/shutdown.html b/include/asio/doc/asio/reference/execution_context/shutdown.html new file mode 100644 index 0000000..a0bf528 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/shutdown.html @@ -0,0 +1,52 @@ + + + +execution_context::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Shuts + down all services in the context. +

+
void shutdown();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order of the beginning of service object lifetime, + performs svc->shutdown(). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/use_service.html b/include/asio/doc/asio/reference/execution_context/use_service.html new file mode 100644 index 0000000..f5f2c88 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/use_service.html @@ -0,0 +1,54 @@ + + + +execution_context::use_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+  » more...
+
+template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/use_service/overload1.html b/include/asio/doc/asio/reference/execution_context/use_service/overload1.html new file mode 100644 index 0000000..e3017b1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/use_service/overload1.html @@ -0,0 +1,85 @@ + + + +execution_context::use_service (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+
+

+ This function is used to locate a service object that corresponds to + the given service type. If there is no existing implementation of the + service, then the execution_context + will create a new instance of the service. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ The service interface implementing the specified service type. Ownership + of the service interface is not transferred to the caller. +

+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context/use_service/overload2.html b/include/asio/doc/asio/reference/execution_context/use_service/overload2.html new file mode 100644 index 0000000..266c197 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context/use_service/overload2.html @@ -0,0 +1,93 @@ + + + +execution_context::use_service (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+
+

+ This function is used to locate a service object that corresponds to + the given service type. If there is no existing implementation of the + service, then the io_context + will create a new instance of the service. +

+
+ + Parameters +
+
+

+
+
ioc
+

+ The io_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ The service interface implementing the specified service type. Ownership + of the service interface is not transferred to the caller. +

+
+ + Remarks +
+

+ This overload is preserved for backwards compatibility with services + that inherit from io_context::service. +

+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__id.html b/include/asio/doc/asio/reference/execution_context__id.html new file mode 100644 index 0000000..1fff5e7 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__id.html @@ -0,0 +1,87 @@ + + + +execution_context::id + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Class used to uniquely identify a service. +

+
class id :
+  noncopyable
+
+
+ + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ id [constructor] +

+
+

+ Constructor. +

+
+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__id/id.html b/include/asio/doc/asio/reference/execution_context__id/id.html new file mode 100644 index 0000000..0979e45 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__id/id.html @@ -0,0 +1,43 @@ + + + +execution_context::id::id + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
id();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__service.html b/include/asio/doc/asio/reference/execution_context__service.html new file mode 100644 index 0000000..5d5516c --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__service.html @@ -0,0 +1,188 @@ + + + +execution_context::service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Base class for all io_context + services. +

+
class service :
+  noncopyable
+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ context +

+
+

+ Get the context object that owns the service. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ service [constructor] +

+
+

+ Constructor. +

+
+

+ ~service [destructor] +

+
+

+ Destructor. +

+
+
+ + Private + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ notify_fork +

+
+

+ Handle notification of a fork-related event to perform any necessary + housekeeping. +

+
+

+ shutdown +

+
+

+ Destroy all user-defined handler objects owned by the service. +

+
+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__service/_service.html b/include/asio/doc/asio/reference/execution_context__service/_service.html new file mode 100644 index 0000000..6f2a936 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__service/_service.html @@ -0,0 +1,43 @@ + + + +execution_context::service::~service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
virtual ~service();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__service/context.html b/include/asio/doc/asio/reference/execution_context__service/context.html new file mode 100644 index 0000000..3085ee0 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__service/context.html @@ -0,0 +1,44 @@ + + + +execution_context::service::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the context object that owns the service. +

+
execution_context & context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__service/notify_fork.html b/include/asio/doc/asio/reference/execution_context__service/notify_fork.html new file mode 100644 index 0000000..2aa4377 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__service/notify_fork.html @@ -0,0 +1,49 @@ + + + +execution_context::service::notify_fork + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Handle + notification of a fork-related event to perform any necessary housekeeping. +

+
virtual void notify_fork(
+    execution_context::fork_event event);
+
+

+ This function is not a pure virtual so that services only have to implement + it if necessary. The default implementation does nothing. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__service/service.html b/include/asio/doc/asio/reference/execution_context__service/service.html new file mode 100644 index 0000000..ee7b2e1 --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__service/service.html @@ -0,0 +1,58 @@ + + + +execution_context::service::service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
service(
+    execution_context & owner);
+
+
+ + Parameters +
+
+

+
+
owner
+

+ The execution_context + object that owns the service. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/execution_context__service/shutdown.html b/include/asio/doc/asio/reference/execution_context__service/shutdown.html new file mode 100644 index 0000000..2f21ffb --- /dev/null +++ b/include/asio/doc/asio/reference/execution_context__service/shutdown.html @@ -0,0 +1,44 @@ + + + +execution_context::service::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroy + all user-defined handler objects owned by the service. +

+
void shutdown();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor.html b/include/asio/doc/asio/reference/executor.html new file mode 100644 index 0000000..54dd5a0 --- /dev/null +++ b/include/asio/doc/asio/reference/executor.html @@ -0,0 +1,331 @@ + + + +executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Polymorphic wrapper for executors. +

+
class executor
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ unspecified_bool_type_t +

+
+
+

+ unspecified_bool_type +

+
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the executor to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the executor to invoke the given function object. +

+
+

+ executor + [constructor] +

+
+

+ Default constructor.
—
Construct from nullptr.
+ —
Copy constructor.
—
Move constructor.
+ —
Construct a polymorphic wrapper for the specified executor. +
—
Allocator-aware constructor to create a polymorphic + wrapper for the specified executor. +

+
+

+ on_work_finished +

+
+

+ Inform the executor that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the executor that it has some outstanding work to do. +

+
+

+ operator unspecified_bool_type +

+
+

+ Operator to test if the executor contains a valid target. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
+

+

+
—
Assignment operator for nullptr_t.
—
+ Assignment operator to create a polymorphic wrapper for the specified + executor. +

+
+

+ post +

+
+

+ Request the executor to invoke the given function object. +

+
+

+ target +

+
+

+ Obtain a pointer to the target executor object. +

+
+

+ target_type +

+
+

+ Obtain type information for the target executor object. +

+
+

+ unspecified_bool_true [static] +

+
+
+

+ ~executor + [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+
+ + Requirements +
+

+ Header: asio/executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/_executor.html b/include/asio/doc/asio/reference/executor/_executor.html new file mode 100644 index 0000000..55f1701 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/_executor.html @@ -0,0 +1,43 @@ + + + +executor::~executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/context.html b/include/asio/doc/asio/reference/executor/context.html new file mode 100644 index 0000000..ee785bb --- /dev/null +++ b/include/asio/doc/asio/reference/executor/context.html @@ -0,0 +1,44 @@ + + + +executor::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the underlying execution + context. +

+
execution_context & context() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/defer.html b/include/asio/doc/asio/reference/executor/defer.html new file mode 100644 index 0000000..493966d --- /dev/null +++ b/include/asio/doc/asio/reference/executor/defer.html @@ -0,0 +1,80 @@ + + + +executor::defer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the executor to invoke + the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void defer(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object is executed according to the rules of the target + executor object. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/dispatch.html b/include/asio/doc/asio/reference/executor/dispatch.html new file mode 100644 index 0000000..1a90b85 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/dispatch.html @@ -0,0 +1,80 @@ + + + +executor::dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the executor to + invoke the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void dispatch(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object is executed according to the rules of the target + executor object. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/executor.html b/include/asio/doc/asio/reference/executor/executor.html new file mode 100644 index 0000000..9e02deb --- /dev/null +++ b/include/asio/doc/asio/reference/executor/executor.html @@ -0,0 +1,87 @@ + + + +executor::executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default constructor. +

+
executor();
+  » more...
+
+

+ Construct from nullptr. +

+
executor(
+    nullptr_t );
+  » more...
+
+

+ Copy constructor. +

+
executor(
+    const executor & other);
+  » more...
+
+

+ Move constructor. +

+
executor(
+    executor && other);
+  » more...
+
+

+ Construct a polymorphic wrapper for the specified executor. +

+
template<
+    typename Executor>
+executor(
+    Executor e);
+  » more...
+
+

+ Allocator-aware constructor to create a polymorphic wrapper for the specified + executor. +

+
template<
+    typename Executor,
+    typename Allocator>
+executor(
+    allocator_arg_t ,
+    const Allocator & a,
+    Executor e);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/executor/overload1.html b/include/asio/doc/asio/reference/executor/executor/overload1.html new file mode 100644 index 0000000..299665d --- /dev/null +++ b/include/asio/doc/asio/reference/executor/executor/overload1.html @@ -0,0 +1,43 @@ + + + +executor::executor (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/executor/overload2.html b/include/asio/doc/asio/reference/executor/executor/overload2.html new file mode 100644 index 0000000..d2f0eeb --- /dev/null +++ b/include/asio/doc/asio/reference/executor/executor/overload2.html @@ -0,0 +1,44 @@ + + + +executor::executor (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct from nullptr. +

+
executor(
+    nullptr_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/executor/overload3.html b/include/asio/doc/asio/reference/executor/executor/overload3.html new file mode 100644 index 0000000..e66220b --- /dev/null +++ b/include/asio/doc/asio/reference/executor/executor/overload3.html @@ -0,0 +1,44 @@ + + + +executor::executor (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
executor(
+    const executor & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/executor/overload4.html b/include/asio/doc/asio/reference/executor/executor/overload4.html new file mode 100644 index 0000000..9ba4fac --- /dev/null +++ b/include/asio/doc/asio/reference/executor/executor/overload4.html @@ -0,0 +1,44 @@ + + + +executor::executor (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
executor(
+    executor && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/executor/overload5.html b/include/asio/doc/asio/reference/executor/executor/overload5.html new file mode 100644 index 0000000..feb5c2d --- /dev/null +++ b/include/asio/doc/asio/reference/executor/executor/overload5.html @@ -0,0 +1,46 @@ + + + +executor::executor (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a polymorphic wrapper for the specified executor. +

+
template<
+    typename Executor>
+executor(
+    Executor e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/executor/overload6.html b/include/asio/doc/asio/reference/executor/executor/overload6.html new file mode 100644 index 0000000..b16fa6b --- /dev/null +++ b/include/asio/doc/asio/reference/executor/executor/overload6.html @@ -0,0 +1,50 @@ + + + +executor::executor (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Allocator-aware constructor to create a polymorphic wrapper for the specified + executor. +

+
template<
+    typename Executor,
+    typename Allocator>
+executor(
+    allocator_arg_t ,
+    const Allocator & a,
+    Executor e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/on_work_finished.html b/include/asio/doc/asio/reference/executor/on_work_finished.html new file mode 100644 index 0000000..a4aa2cc --- /dev/null +++ b/include/asio/doc/asio/reference/executor/on_work_finished.html @@ -0,0 +1,44 @@ + + + +executor::on_work_finished + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the executor that some work is no longer outstanding. +

+
void on_work_finished() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/on_work_started.html b/include/asio/doc/asio/reference/executor/on_work_started.html new file mode 100644 index 0000000..982e59c --- /dev/null +++ b/include/asio/doc/asio/reference/executor/on_work_started.html @@ -0,0 +1,44 @@ + + + +executor::on_work_started + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform the + executor that it has some outstanding work to do. +

+
void on_work_started() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_eq_.html b/include/asio/doc/asio/reference/executor/operator_eq_.html new file mode 100644 index 0000000..4a217b3 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_eq_.html @@ -0,0 +1,67 @@ + + + +executor::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment operator. +

+
executor & operator=(
+    const executor & other);
+  » more...
+
+
+
+executor & operator=(
+    executor && other);
+  » more...
+
+

+ Assignment operator for nullptr_t. +

+
executor & operator=(
+    nullptr_t );
+  » more...
+
+

+ Assignment operator to create a polymorphic wrapper for the specified executor. +

+
template<
+    typename Executor>
+executor & operator=(
+    Executor && e);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_eq_/overload1.html b/include/asio/doc/asio/reference/executor/operator_eq_/overload1.html new file mode 100644 index 0000000..540a72d --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +executor::operator= (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator. +

+
executor & operator=(
+    const executor & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_eq_/overload2.html b/include/asio/doc/asio/reference/executor/operator_eq_/overload2.html new file mode 100644 index 0000000..e013217 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_eq_/overload2.html @@ -0,0 +1,41 @@ + + + +executor::operator= (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
executor & operator=(
+    executor && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_eq_/overload3.html b/include/asio/doc/asio/reference/executor/operator_eq_/overload3.html new file mode 100644 index 0000000..f1eab83 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_eq_/overload3.html @@ -0,0 +1,44 @@ + + + +executor::operator= (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator for nullptr_t. +

+
executor & operator=(
+    nullptr_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_eq_/overload4.html b/include/asio/doc/asio/reference/executor/operator_eq_/overload4.html new file mode 100644 index 0000000..ca493a2 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_eq_/overload4.html @@ -0,0 +1,47 @@ + + + +executor::operator= (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator to create a polymorphic wrapper for the specified + executor. +

+
template<
+    typename Executor>
+executor & operator=(
+    Executor && e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_eq__eq_.html b/include/asio/doc/asio/reference/executor/operator_eq__eq_.html new file mode 100644 index 0000000..0608c79 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +executor::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two executors + for equality. +

+
friend bool operator==(
+    const executor & a,
+    const executor & b);
+
+
+ + Requirements +
+

+ Header: asio/executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_not__eq_.html b/include/asio/doc/asio/reference/executor/operator_not__eq_.html new file mode 100644 index 0000000..09de8e1 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +executor::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two + executors for inequality. +

+
friend bool operator!=(
+    const executor & a,
+    const executor & b);
+
+
+ + Requirements +
+

+ Header: asio/executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/operator_unspecified_bool_type.html b/include/asio/doc/asio/reference/executor/operator_unspecified_bool_type.html new file mode 100644 index 0000000..de37895 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/operator_unspecified_bool_type.html @@ -0,0 +1,45 @@ + + + +executor::operator unspecified_bool_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Operator + to test if the executor contains a valid target. +

+
operator unspecified_bool_type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/post.html b/include/asio/doc/asio/reference/executor/post.html new file mode 100644 index 0000000..b4d5c36 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/post.html @@ -0,0 +1,80 @@ + + + +executor::post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the executor to invoke + the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void post(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object is executed according to the rules of the target + executor object. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/target.html b/include/asio/doc/asio/reference/executor/target.html new file mode 100644 index 0000000..21c9efc --- /dev/null +++ b/include/asio/doc/asio/reference/executor/target.html @@ -0,0 +1,52 @@ + + + +executor::target + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain a pointer to the target + executor object. +

+
template<
+    typename Executor>
+Executor * target();
+  » more...
+
+template<
+    typename Executor>
+const Executor * target() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/target/overload1.html b/include/asio/doc/asio/reference/executor/target/overload1.html new file mode 100644 index 0000000..81e5045 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/target/overload1.html @@ -0,0 +1,54 @@ + + + +executor::target (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain a pointer to the target executor object. +

+
template<
+    typename Executor>
+Executor * target();
+
+
+ + Return + Value +
+

+ If target_type() == typeid(T), a pointer to the stored executor + target; otherwise, a null pointer. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/target/overload2.html b/include/asio/doc/asio/reference/executor/target/overload2.html new file mode 100644 index 0000000..dc7065d --- /dev/null +++ b/include/asio/doc/asio/reference/executor/target/overload2.html @@ -0,0 +1,54 @@ + + + +executor::target (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain a pointer to the target executor object. +

+
template<
+    typename Executor>
+const Executor * target() const;
+
+
+ + Return + Value +
+

+ If target_type() == typeid(T), a pointer to the stored executor + target; otherwise, a null pointer. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/target_type.html b/include/asio/doc/asio/reference/executor/target_type.html new file mode 100644 index 0000000..7a8f096 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/target_type.html @@ -0,0 +1,53 @@ + + + +executor::target_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain type information + for the target executor object. +

+
const std::type_info & target_type() const;
+
+
+ + Return + Value +
+

+ If *this has a target type of type T, typeid(T); + otherwise, typeid(void). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/unspecified_bool_true.html b/include/asio/doc/asio/reference/executor/unspecified_bool_true.html new file mode 100644 index 0000000..8dfbfb8 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/unspecified_bool_true.html @@ -0,0 +1,43 @@ + + + +executor::unspecified_bool_true + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static void unspecified_bool_true(
+    unspecified_bool_type_t );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor/unspecified_bool_type.html b/include/asio/doc/asio/reference/executor/unspecified_bool_type.html new file mode 100644 index 0000000..101a270 --- /dev/null +++ b/include/asio/doc/asio/reference/executor/unspecified_bool_type.html @@ -0,0 +1,52 @@ + + + +executor::unspecified_bool_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
typedef void(*) unspecified_bool_type;
+
+
+ + Requirements +
+

+ Header: asio/executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor__unspecified_bool_type_t.html b/include/asio/doc/asio/reference/executor__unspecified_bool_type_t.html new file mode 100644 index 0000000..9c087f3 --- /dev/null +++ b/include/asio/doc/asio/reference/executor__unspecified_bool_type_t.html @@ -0,0 +1,49 @@ + + + +executor::unspecified_bool_type_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
struct unspecified_bool_type_t
+
+
+ + Requirements +
+

+ Header: asio/executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_arg.html b/include/asio/doc/asio/reference/executor_arg.html new file mode 100644 index 0000000..8208641 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_arg.html @@ -0,0 +1,59 @@ + + + +executor_arg + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value, similar to std::nothrow, + used to disambiguate constructors that accept executor arguments. +

+
constexpr executor_arg_t executor_arg;
+
+

+ See executor_arg_t + and uses_executor + for more information. +

+
+ + Requirements +
+

+ Header: asio/uses_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_arg_t.html b/include/asio/doc/asio/reference/executor_arg_t.html new file mode 100644 index 0000000..18a7e25 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_arg_t.html @@ -0,0 +1,96 @@ + + + +executor_arg_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A special type, similar to std::nothrow_t, used to disambiguate constructors + that accept executor arguments. +

+
struct executor_arg_t
+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_arg_t [constructor] +

+
+

+ Constructor. +

+
+

+ The executor_arg_t + struct is an empty structure type used as a unique type to disambiguate constructor + and function overloading. Specifically, some types have constructors with + executor_arg_t + as the first argument, immediately followed by an argument of a type that + satisfies the Executor type requirements. +

+
+ + Requirements +
+

+ Header: asio/uses_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_arg_t/executor_arg_t.html b/include/asio/doc/asio/reference/executor_arg_t/executor_arg_t.html new file mode 100644 index 0000000..1dd3711 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_arg_t/executor_arg_t.html @@ -0,0 +1,43 @@ + + + +executor_arg_t::executor_arg_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
constexpr executor_arg_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder.html b/include/asio/doc/asio/reference/executor_binder.html new file mode 100644 index 0000000..8b18fb7 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder.html @@ -0,0 +1,243 @@ + + + +executor_binder + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A call wrapper type to bind an executor of type Executor to + an object of type T. +

+
template<
+    typename T,
+    typename Executor>
+class executor_binder
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ argument_type +

+
+

+ The type of the function's argument. +

+
+

+ executor_type +

+
+

+ The type of the associated executor. +

+
+

+ first_argument_type +

+
+

+ The type of the function's first argument. +

+
+

+ result_type +

+
+

+ The return type if a function. +

+
+

+ second_argument_type +

+
+

+ The type of the function's second argument. +

+
+

+ target_type +

+
+

+ The type of the target object. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_binder [constructor] +

+
+

+ Construct an executor wrapper for the specified object.
+ —
Copy constructor.
—
Construct a copy, but specify + a different executor.
—
Construct a copy of a different + executor wrapper type.
—
Construct a copy of a different + executor wrapper type, but specify a different executor.
+ —
Move constructor.
—
Move construct the target + object, but specify a different executor.
—
Move construct + from a different executor wrapper type.
—
Move construct + from a different executor wrapper type, but specify a different + executor. +

+
+

+ get +

+
+

+ Obtain a reference to the target object. +

+
+

+ get_executor +

+
+

+ Obtain the associated executor. +

+
+

+ operator() +

+
+
+

+ ~executor_binder [destructor] +

+
+

+ Destructor. +

+
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/_executor_binder.html b/include/asio/doc/asio/reference/executor_binder/_executor_binder.html new file mode 100644 index 0000000..53792a5 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/_executor_binder.html @@ -0,0 +1,43 @@ + + + +executor_binder::~executor_binder + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~executor_binder();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/argument_type.html b/include/asio/doc/asio/reference/executor_binder/argument_type.html new file mode 100644 index 0000000..1fad186 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/argument_type.html @@ -0,0 +1,72 @@ + + + +executor_binder::argument_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the function's argument. +

+
typedef see_below argument_type;
+
+

+ The type of argument_type is based on the type T + of the wrapper's target object: +

+
    +
  • + if T is a pointer to a function type accepting a single + argument, argument_type is a synonym for the return type + of T; +
  • +
  • + if T is a class type with a member type argument_type, + then argument_type is a synonym for T::argument_type; +
  • +
  • + otherwise argument_type is not defined. +
  • +
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder.html b/include/asio/doc/asio/reference/executor_binder/executor_binder.html new file mode 100644 index 0000000..1e3df9b --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder.html @@ -0,0 +1,128 @@ + + + +executor_binder::executor_binder + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an executor wrapper for the specified object. +

+
template<
+    typename U>
+executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    U && u);
+  » more...
+
+

+ Copy constructor. +

+
executor_binder(
+    const executor_binder & other);
+  » more...
+
+

+ Construct a copy, but specify a different executor. +

+
executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    const executor_binder & other);
+  » more...
+
+

+ Construct a copy of a different executor wrapper type. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    const executor_binder< U, OtherExecutor > & other);
+  » more...
+
+

+ Construct a copy of a different executor wrapper type, but specify a different + executor. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    const executor_binder< U, OtherExecutor > & other);
+  » more...
+
+

+ Move constructor. +

+
executor_binder(
+    executor_binder && other);
+  » more...
+
+

+ Move construct the target object, but specify a different executor. +

+
executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    executor_binder && other);
+  » more...
+
+

+ Move construct from a different executor wrapper type. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    executor_binder< U, OtherExecutor > && other);
+  » more...
+
+

+ Move construct from a different executor wrapper type, but specify a different + executor. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    executor_binder< U, OtherExecutor > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload1.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload1.html new file mode 100644 index 0000000..9d04e69 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload1.html @@ -0,0 +1,52 @@ + + + +executor_binder::executor_binder (1 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an executor wrapper for the specified object. +

+
template<
+    typename U>
+executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    U && u);
+
+

+ This constructor is only valid if the type T is constructible + from type U. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload2.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload2.html new file mode 100644 index 0000000..9dff5e7 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload2.html @@ -0,0 +1,44 @@ + + + +executor_binder::executor_binder (2 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
executor_binder(
+    const executor_binder & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload3.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload3.html new file mode 100644 index 0000000..2a17a73 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload3.html @@ -0,0 +1,46 @@ + + + +executor_binder::executor_binder (3 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a copy, but specify a different executor. +

+
executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    const executor_binder & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload4.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload4.html new file mode 100644 index 0000000..7a093c7 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload4.html @@ -0,0 +1,52 @@ + + + +executor_binder::executor_binder (4 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a copy of a different executor wrapper type. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    const executor_binder< U, OtherExecutor > & other);
+
+

+ This constructor is only valid if the Executor type is constructible + from type OtherExecutor, and the type T is + constructible from type U. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload5.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload5.html new file mode 100644 index 0000000..a2ff99a --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload5.html @@ -0,0 +1,54 @@ + + + +executor_binder::executor_binder (5 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a copy of a different executor wrapper type, but specify a + different executor. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    const executor_binder< U, OtherExecutor > & other);
+
+

+ This constructor is only valid if the type T is constructible + from type U. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload6.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload6.html new file mode 100644 index 0000000..b08495a --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload6.html @@ -0,0 +1,44 @@ + + + +executor_binder::executor_binder (6 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
executor_binder(
+    executor_binder && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload7.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload7.html new file mode 100644 index 0000000..cc85d19 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload7.html @@ -0,0 +1,46 @@ + + + +executor_binder::executor_binder (7 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move construct the target object, but specify a different executor. +

+
executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    executor_binder && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload8.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload8.html new file mode 100644 index 0000000..d48b09e --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload8.html @@ -0,0 +1,47 @@ + + + +executor_binder::executor_binder (8 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move construct from a different executor wrapper type. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    executor_binder< U, OtherExecutor > && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_binder/overload9.html b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload9.html new file mode 100644 index 0000000..eec2b6f --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_binder/overload9.html @@ -0,0 +1,50 @@ + + + +executor_binder::executor_binder (9 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move construct from a different executor wrapper type, but specify a + different executor. +

+
template<
+    typename U,
+    typename OtherExecutor>
+executor_binder(
+    executor_arg_t ,
+    const executor_type & e,
+    executor_binder< U, OtherExecutor > && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/executor_type.html b/include/asio/doc/asio/reference/executor_binder/executor_type.html new file mode 100644 index 0000000..e99e4db --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/executor_type.html @@ -0,0 +1,54 @@ + + + +executor_binder::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the associated executor. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/first_argument_type.html b/include/asio/doc/asio/reference/executor_binder/first_argument_type.html new file mode 100644 index 0000000..b8e67a9 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/first_argument_type.html @@ -0,0 +1,72 @@ + + + +executor_binder::first_argument_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the function's first argument. +

+
typedef see_below first_argument_type;
+
+

+ The type of first_argument_type is based on the type T + of the wrapper's target object: +

+
    +
  • + if T is a pointer to a function type accepting two arguments, + first_argument_type is a synonym for the return type of + T; +
  • +
  • + if T is a class type with a member type first_argument_type, + then first_argument_type is a synonym for T::first_argument_type; +
  • +
  • + otherwise first_argument_type is not defined. +
  • +
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/get.html b/include/asio/doc/asio/reference/executor_binder/get.html new file mode 100644 index 0000000..054efbf --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/get.html @@ -0,0 +1,48 @@ + + + +executor_binder::get + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain a reference + to the target object. +

+
target_type & get();
+  » more...
+
+const target_type & get() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/get/overload1.html b/include/asio/doc/asio/reference/executor_binder/get/overload1.html new file mode 100644 index 0000000..5cf5da4 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/get/overload1.html @@ -0,0 +1,43 @@ + + + +executor_binder::get (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain a reference to the target object. +

+
target_type & get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/get/overload2.html b/include/asio/doc/asio/reference/executor_binder/get/overload2.html new file mode 100644 index 0000000..d2a93ef --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/get/overload2.html @@ -0,0 +1,43 @@ + + + +executor_binder::get (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain a reference to the target object. +

+
const target_type & get() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/get_executor.html b/include/asio/doc/asio/reference/executor_binder/get_executor.html new file mode 100644 index 0000000..d08915d --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/get_executor.html @@ -0,0 +1,44 @@ + + + +executor_binder::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the associated executor. +

+
executor_type get_executor() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_.html b/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_.html new file mode 100644 index 0000000..f7b1232 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_.html @@ -0,0 +1,52 @@ + + + +executor_binder::operator() + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
template<
+    typename... Args>
+auto operator()(
+    Args && ...);
+  » more...
+
+template<
+    typename... Args>
+auto operator()(
+    Args && ...) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_/overload1.html b/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_/overload1.html new file mode 100644 index 0000000..6967657 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_/overload1.html @@ -0,0 +1,43 @@ + + + +executor_binder::operator() (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
template<
+    typename... Args>
+auto operator()(
+    Args && ...);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_/overload2.html b/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_/overload2.html new file mode 100644 index 0000000..b7bc3fd --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/operator_lp__rp_/overload2.html @@ -0,0 +1,43 @@ + + + +executor_binder::operator() (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
template<
+    typename... Args>
+auto operator()(
+    Args && ...) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/result_type.html b/include/asio/doc/asio/reference/executor_binder/result_type.html new file mode 100644 index 0000000..00ae312 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/result_type.html @@ -0,0 +1,71 @@ + + + +executor_binder::result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + return type if a function. +

+
typedef see_below result_type;
+
+

+ The type of result_type is based on the type T + of the wrapper's target object: +

+
    +
  • + if T is a pointer to function type, result_type + is a synonym for the return type of T; +
  • +
  • + if T is a class type with a member type result_type, + then result_type is a synonym for T::result_type; +
  • +
  • + otherwise result_type is not defined. +
  • +
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/second_argument_type.html b/include/asio/doc/asio/reference/executor_binder/second_argument_type.html new file mode 100644 index 0000000..46ea491 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/second_argument_type.html @@ -0,0 +1,72 @@ + + + +executor_binder::second_argument_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the function's second argument. +

+
typedef see_below second_argument_type;
+
+

+ The type of second_argument_type is based on the type T + of the wrapper's target object: +

+
    +
  • + if T is a pointer to a function type accepting two arguments, + second_argument_type is a synonym for the return type + of T; +
  • +
  • + if T is a class type with a member type first_argument_type, + then second_argument_type is a synonym for T::second_argument_type; +
  • +
  • + otherwise second_argument_type is not defined. +
  • +
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_binder/target_type.html b/include/asio/doc/asio/reference/executor_binder/target_type.html new file mode 100644 index 0000000..0ec416d --- /dev/null +++ b/include/asio/doc/asio/reference/executor_binder/target_type.html @@ -0,0 +1,54 @@ + + + +executor_binder::target_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the target object. +

+
typedef T target_type;
+
+
+ + Requirements +
+

+ Header: asio/bind_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard.html b/include/asio/doc/asio/reference/executor_work_guard.html new file mode 100644 index 0000000..b61b675 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard.html @@ -0,0 +1,175 @@ + + + +executor_work_guard + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An object of type executor_work_guard controls ownership of + executor work within a scope. +

+
template<
+    typename Executor>
+class executor_work_guard
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_type +

+
+

+ The underlying executor type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_work_guard [constructor] +

+
+

+ Constructs a executor_work_guard object for the specified executor. +
—
Copy constructor.
—
Move constructor. +

+
+

+ get_executor +

+
+

+ Obtain the associated executor. +

+
+

+ owns_work +

+
+

+ Whether the executor_work_guard object owns some outstanding work. +

+
+

+ reset +

+
+

+ Indicate that the work is no longer outstanding. +

+
+

+ ~executor_work_guard [destructor] +

+
+

+ Destructor. +

+
+
+ + Requirements +
+

+ Header: asio/executor_work_guard.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/_executor_work_guard.html b/include/asio/doc/asio/reference/executor_work_guard/_executor_work_guard.html new file mode 100644 index 0000000..0caedea --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/_executor_work_guard.html @@ -0,0 +1,47 @@ + + + +executor_work_guard::~executor_work_guard + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~executor_work_guard();
+
+

+ Unless the object has already been reset, or is in a moved-from state, + calls on_work_finished() on the stored executor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/executor_type.html b/include/asio/doc/asio/reference/executor_work_guard/executor_type.html new file mode 100644 index 0000000..0b4f803 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/executor_type.html @@ -0,0 +1,54 @@ + + + +executor_work_guard::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + underlying executor type. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/executor_work_guard.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard.html b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard.html new file mode 100644 index 0000000..75802ec --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard.html @@ -0,0 +1,60 @@ + + + +executor_work_guard::executor_work_guard + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructs + a executor_work_guard object for the specified executor. +

+
explicit executor_work_guard(
+    const executor_type & e);
+  » more...
+
+

+ Copy constructor. +

+
executor_work_guard(
+    const executor_work_guard & other);
+  » more...
+
+

+ Move constructor. +

+
executor_work_guard(
+    executor_work_guard && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload1.html b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload1.html new file mode 100644 index 0000000..e7b93c4 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload1.html @@ -0,0 +1,49 @@ + + + +executor_work_guard::executor_work_guard (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructs a executor_work_guard object for the specified + executor. +

+
executor_work_guard(
+    const executor_type & e);
+
+

+ Stores a copy of e and calls on_work_started() + on it. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload2.html b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload2.html new file mode 100644 index 0000000..5874490 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload2.html @@ -0,0 +1,44 @@ + + + +executor_work_guard::executor_work_guard (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
executor_work_guard(
+    const executor_work_guard & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload3.html b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload3.html new file mode 100644 index 0000000..1b13ea1 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/executor_work_guard/overload3.html @@ -0,0 +1,44 @@ + + + +executor_work_guard::executor_work_guard (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
executor_work_guard(
+    executor_work_guard && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/get_executor.html b/include/asio/doc/asio/reference/executor_work_guard/get_executor.html new file mode 100644 index 0000000..290ccba --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/get_executor.html @@ -0,0 +1,44 @@ + + + +executor_work_guard::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the associated executor. +

+
executor_type get_executor() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/owns_work.html b/include/asio/doc/asio/reference/executor_work_guard/owns_work.html new file mode 100644 index 0000000..4927250 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/owns_work.html @@ -0,0 +1,45 @@ + + + +executor_work_guard::owns_work + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Whether + the executor_work_guard + object owns some outstanding work. +

+
bool owns_work() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/executor_work_guard/reset.html b/include/asio/doc/asio/reference/executor_work_guard/reset.html new file mode 100644 index 0000000..4cc1511 --- /dev/null +++ b/include/asio/doc/asio/reference/executor_work_guard/reset.html @@ -0,0 +1,48 @@ + + + +executor_work_guard::reset + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Indicate + that the work is no longer outstanding. +

+
void reset();
+
+

+ Unless the object has already been reset, or is in a moved-from state, + calls on_work_finished() on the stored executor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint.html b/include/asio/doc/asio/reference/generic__basic_endpoint.html new file mode 100644 index 0000000..1a19710 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint.html @@ -0,0 +1,333 @@ + + + +generic::basic_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Describes an endpoint for any socket type. +

+
template<
+    typename Protocol>
+class basic_endpoint
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on the + underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint from the + specified socket address.
—
Construct an endpoint from + the specific endpoint type.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+

+ The generic::basic_endpoint + class template describes an endpoint that may be associated with any socket + type. +

+
+ + Remarks +
+

+ The socket types sockaddr type must be able to fit into a sockaddr_storage + structure. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint.html b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint.html new file mode 100644 index 0000000..5d6cc70 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint.html @@ -0,0 +1,70 @@ + + + +generic::basic_endpoint::basic_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
basic_endpoint();
+  » more...
+
+

+ Construct an endpoint from the specified socket address. +

+
basic_endpoint(
+    const void * socket_address,
+    std::size_t socket_address_size,
+    int socket_protocol = 0);
+  » more...
+
+

+ Construct an endpoint from the specific endpoint type. +

+
template<
+    typename Endpoint>
+basic_endpoint(
+    const Endpoint & endpoint);
+  » more...
+
+

+ Copy constructor. +

+
basic_endpoint(
+    const basic_endpoint & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload1.html b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload1.html new file mode 100644 index 0000000..9c69dc6 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload1.html @@ -0,0 +1,43 @@ + + + +generic::basic_endpoint::basic_endpoint (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
basic_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload2.html b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload2.html new file mode 100644 index 0000000..7bb2c50 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload2.html @@ -0,0 +1,46 @@ + + + +generic::basic_endpoint::basic_endpoint (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an endpoint from the specified socket address. +

+
basic_endpoint(
+    const void * socket_address,
+    std::size_t socket_address_size,
+    int socket_protocol = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload3.html b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload3.html new file mode 100644 index 0000000..d568ddb --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload3.html @@ -0,0 +1,46 @@ + + + +generic::basic_endpoint::basic_endpoint (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an endpoint from the specific endpoint type. +

+
template<
+    typename Endpoint>
+basic_endpoint(
+    const Endpoint & endpoint);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload4.html b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload4.html new file mode 100644 index 0000000..ba9e66a --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/basic_endpoint/overload4.html @@ -0,0 +1,44 @@ + + + +generic::basic_endpoint::basic_endpoint (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_endpoint(
+    const basic_endpoint & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/capacity.html b/include/asio/doc/asio/reference/generic__basic_endpoint/capacity.html new file mode 100644 index 0000000..209b792 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/capacity.html @@ -0,0 +1,44 @@ + + + +generic::basic_endpoint::capacity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the capacity of the endpoint in the native type. +

+
std::size_t capacity() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/data.html b/include/asio/doc/asio/reference/generic__basic_endpoint/data.html new file mode 100644 index 0000000..c496c99 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/data.html @@ -0,0 +1,48 @@ + + + +generic::basic_endpoint::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the underlying endpoint in the native type. +

+
data_type * data();
+  » more...
+
+const data_type * data() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/data/overload1.html b/include/asio/doc/asio/reference/generic__basic_endpoint/data/overload1.html new file mode 100644 index 0000000..13385f9 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/data/overload1.html @@ -0,0 +1,43 @@ + + + +generic::basic_endpoint::data (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying endpoint in the native type. +

+
data_type * data();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/data/overload2.html b/include/asio/doc/asio/reference/generic__basic_endpoint/data/overload2.html new file mode 100644 index 0000000..feb8562 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/data/overload2.html @@ -0,0 +1,43 @@ + + + +generic::basic_endpoint::data (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying endpoint in the native type. +

+
const data_type * data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/data_type.html b/include/asio/doc/asio/reference/generic__basic_endpoint/data_type.html new file mode 100644 index 0000000..882de36 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/data_type.html @@ -0,0 +1,55 @@ + + + +generic::basic_endpoint::data_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the endpoint structure. This type is dependent on the underlying + implementation of the socket layer. +

+
typedef implementation_defined data_type;
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/operator_eq_.html b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_eq_.html new file mode 100644 index 0000000..892e937 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_eq_.html @@ -0,0 +1,45 @@ + + + +generic::basic_endpoint::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + from another endpoint. +

+
basic_endpoint & operator=(
+    const basic_endpoint & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/operator_eq__eq_.html b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_eq__eq_.html new file mode 100644 index 0000000..aad278b --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +generic::basic_endpoint::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two endpoints for equality. +

+
friend bool operator==(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/operator_gt_.html b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_gt_.html new file mode 100644 index 0000000..ba9fd95 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_gt_.html @@ -0,0 +1,56 @@ + + + +generic::basic_endpoint::operator> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator>(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/operator_gt__eq_.html b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_gt__eq_.html new file mode 100644 index 0000000..662c473 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_gt__eq_.html @@ -0,0 +1,56 @@ + + + +generic::basic_endpoint::operator>= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator>=(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/operator_lt_.html b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_lt_.html new file mode 100644 index 0000000..ae1fb17 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_lt_.html @@ -0,0 +1,56 @@ + + + +generic::basic_endpoint::operator< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator<(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/operator_lt__eq_.html b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_lt__eq_.html new file mode 100644 index 0000000..2110d51 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_lt__eq_.html @@ -0,0 +1,56 @@ + + + +generic::basic_endpoint::operator<= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator<=(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/operator_not__eq_.html b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_not__eq_.html new file mode 100644 index 0000000..bbe19eb --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +generic::basic_endpoint::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two endpoints for inequality. +

+
friend bool operator!=(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/protocol.html b/include/asio/doc/asio/reference/generic__basic_endpoint/protocol.html new file mode 100644 index 0000000..0b4af24 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/protocol.html @@ -0,0 +1,44 @@ + + + +generic::basic_endpoint::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol associated with the endpoint. +

+
protocol_type protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/protocol_type.html b/include/asio/doc/asio/reference/generic__basic_endpoint/protocol_type.html new file mode 100644 index 0000000..191abb7 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/protocol_type.html @@ -0,0 +1,54 @@ + + + +generic::basic_endpoint::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type associated with the endpoint. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/generic/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/resize.html b/include/asio/doc/asio/reference/generic__basic_endpoint/resize.html new file mode 100644 index 0000000..b9f5483 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/resize.html @@ -0,0 +1,45 @@ + + + +generic::basic_endpoint::resize + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the underlying size of the endpoint in the native type. +

+
void resize(
+    std::size_t new_size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__basic_endpoint/size.html b/include/asio/doc/asio/reference/generic__basic_endpoint/size.html new file mode 100644 index 0000000..f71869d --- /dev/null +++ b/include/asio/doc/asio/reference/generic__basic_endpoint/size.html @@ -0,0 +1,44 @@ + + + +generic::basic_endpoint::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the underlying size of the endpoint in the native type. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol.html b/include/asio/doc/asio/reference/generic__datagram_protocol.html new file mode 100644 index 0000000..1ed9262 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol.html @@ -0,0 +1,253 @@ + + + +generic::datagram_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for a generic datagram-oriented socket. +

+
class datagram_protocol
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint +

+
+

+ The type of an endpoint. +

+
+

+ socket +

+
+

+ The generic socket type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ datagram_protocol [constructor] +

+
+

+ Construct a protocol object for a specific address family and protocol. +
—
Construct a generic protocol object from a specific + protocol. +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two protocols for inequality. +

+
+

+ operator== +

+
+

+ Compare two protocols for equality. +

+
+

+ The generic::datagram_protocol + class contains flags necessary for datagram-oriented sockets of any address + family and protocol. +

+
+ + Examples +
+

+ Constructing using a native address family and socket protocol: +

+
datagram_protocol p(AF_INET, IPPROTO_UDP);
+
+

+ Constructing from a specific protocol type: +

+
datagram_protocol p(asio::ip::udp::v4());
+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/generic/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol.html b/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol.html new file mode 100644 index 0000000..ba56e65 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol.html @@ -0,0 +1,56 @@ + + + +generic::datagram_protocol::datagram_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a protocol object for a specific address family and protocol. +

+
datagram_protocol(
+    int address_family,
+    int socket_protocol);
+  » more...
+
+

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+datagram_protocol(
+    const Protocol & source_protocol);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol/overload1.html b/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol/overload1.html new file mode 100644 index 0000000..d509d44 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol/overload1.html @@ -0,0 +1,45 @@ + + + +generic::datagram_protocol::datagram_protocol (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a protocol object for a specific address family and protocol. +

+
datagram_protocol(
+    int address_family,
+    int socket_protocol);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol/overload2.html b/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol/overload2.html new file mode 100644 index 0000000..2e5e943 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/datagram_protocol/overload2.html @@ -0,0 +1,59 @@ + + + +generic::datagram_protocol::datagram_protocol (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+datagram_protocol(
+    const Protocol & source_protocol);
+
+
+ + Exceptions +
+
+

+
+
@c
+

+ bad_cast Thrown if the source protocol is not datagram-oriented. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/endpoint.html b/include/asio/doc/asio/reference/generic__datagram_protocol/endpoint.html new file mode 100644 index 0000000..7ac714d --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/endpoint.html @@ -0,0 +1,334 @@ + + + +generic::datagram_protocol::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of an endpoint. +

+
typedef basic_endpoint< datagram_protocol > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint from + the specified socket address.
—
Construct an endpoint + from the specific endpoint type.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+

+ The generic::basic_endpoint + class template describes an endpoint that may be associated with any socket + type. +

+
+ + Remarks +
+

+ The socket types sockaddr type must be able to fit into a sockaddr_storage + structure. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/family.html b/include/asio/doc/asio/reference/generic__datagram_protocol/family.html new file mode 100644 index 0000000..6451286 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/family.html @@ -0,0 +1,44 @@ + + + +generic::datagram_protocol::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/operator_eq__eq_.html b/include/asio/doc/asio/reference/generic__datagram_protocol/operator_eq__eq_.html new file mode 100644 index 0000000..956885e --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +generic::datagram_protocol::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for equality. +

+
friend bool operator==(
+    const datagram_protocol & p1,
+    const datagram_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/operator_not__eq_.html b/include/asio/doc/asio/reference/generic__datagram_protocol/operator_not__eq_.html new file mode 100644 index 0000000..ed4041a --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +generic::datagram_protocol::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for inequality. +

+
friend bool operator!=(
+    const datagram_protocol & p1,
+    const datagram_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/protocol.html b/include/asio/doc/asio/reference/generic__datagram_protocol/protocol.html new file mode 100644 index 0000000..7f32732 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/protocol.html @@ -0,0 +1,44 @@ + + + +generic::datagram_protocol::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/socket.html b/include/asio/doc/asio/reference/generic__datagram_protocol/socket.html new file mode 100644 index 0000000..f1aa387 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/socket.html @@ -0,0 +1,919 @@ + + + +generic::datagram_protocol::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + generic socket type. +

+
typedef basic_datagram_socket< datagram_protocol > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_datagram_socket [constructor] +

+
+

+ Construct a basic_datagram_socket without opening it.
+ —
Construct and open a basic_datagram_socket.
—
+ Construct a basic_datagram_socket, opening it and binding it + to the given local endpoint.
—
Construct a basic_datagram_socket + on an existing native socket.
—
Move-construct a + basic_datagram_socket from another.
—
Move-construct + a basic_datagram_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_datagram_socket from another.
—
+ Move-assign a basic_datagram_socket from a socket of another + protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive a datagram with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send a datagram to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_datagram_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_datagram_socket + class template provides asynchronous and blocking datagram-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__datagram_protocol/type.html b/include/asio/doc/asio/reference/generic__datagram_protocol/type.html new file mode 100644 index 0000000..5d64092 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__datagram_protocol/type.html @@ -0,0 +1,44 @@ + + + +generic::datagram_protocol::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the type of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol.html b/include/asio/doc/asio/reference/generic__raw_protocol.html new file mode 100644 index 0000000..5f9abff --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol.html @@ -0,0 +1,252 @@ + + + +generic::raw_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for a generic raw socket. +

+
class raw_protocol
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint +

+
+

+ The type of an endpoint. +

+
+

+ socket +

+
+

+ The generic socket type. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ raw_protocol [constructor] +

+
+

+ Construct a protocol object for a specific address family and protocol. +
—
Construct a generic protocol object from a specific + protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two protocols for inequality. +

+
+

+ operator== +

+
+

+ Compare two protocols for equality. +

+
+

+ The generic::raw_protocol + class contains flags necessary for raw sockets of any address family and + protocol. +

+
+ + Examples +
+

+ Constructing using a native address family and socket protocol: +

+
raw_protocol p(AF_INET, IPPROTO_ICMP);
+
+

+ Constructing from a specific protocol type: +

+
raw_protocol p(asio::ip::icmp::v4());
+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/generic/raw_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/endpoint.html b/include/asio/doc/asio/reference/generic__raw_protocol/endpoint.html new file mode 100644 index 0000000..fe77aac --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/endpoint.html @@ -0,0 +1,334 @@ + + + +generic::raw_protocol::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of an endpoint. +

+
typedef basic_endpoint< raw_protocol > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint from + the specified socket address.
—
Construct an endpoint + from the specific endpoint type.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+

+ The generic::basic_endpoint + class template describes an endpoint that may be associated with any socket + type. +

+
+ + Remarks +
+

+ The socket types sockaddr type must be able to fit into a sockaddr_storage + structure. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/raw_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/family.html b/include/asio/doc/asio/reference/generic__raw_protocol/family.html new file mode 100644 index 0000000..f7492a6 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/family.html @@ -0,0 +1,44 @@ + + + +generic::raw_protocol::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/operator_eq__eq_.html b/include/asio/doc/asio/reference/generic__raw_protocol/operator_eq__eq_.html new file mode 100644 index 0000000..283dbc0 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +generic::raw_protocol::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for equality. +

+
friend bool operator==(
+    const raw_protocol & p1,
+    const raw_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/raw_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/operator_not__eq_.html b/include/asio/doc/asio/reference/generic__raw_protocol/operator_not__eq_.html new file mode 100644 index 0000000..fc1dd85 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +generic::raw_protocol::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for inequality. +

+
friend bool operator!=(
+    const raw_protocol & p1,
+    const raw_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/raw_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/protocol.html b/include/asio/doc/asio/reference/generic__raw_protocol/protocol.html new file mode 100644 index 0000000..a87af3d --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/protocol.html @@ -0,0 +1,44 @@ + + + +generic::raw_protocol::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol.html b/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol.html new file mode 100644 index 0000000..29023a5 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol.html @@ -0,0 +1,56 @@ + + + +generic::raw_protocol::raw_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a protocol object for a specific address family and protocol. +

+
raw_protocol(
+    int address_family,
+    int socket_protocol);
+  » more...
+
+

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+raw_protocol(
+    const Protocol & source_protocol);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol/overload1.html b/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol/overload1.html new file mode 100644 index 0000000..a59f8b5 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol/overload1.html @@ -0,0 +1,45 @@ + + + +generic::raw_protocol::raw_protocol (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a protocol object for a specific address family and protocol. +

+
raw_protocol(
+    int address_family,
+    int socket_protocol);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol/overload2.html b/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol/overload2.html new file mode 100644 index 0000000..421ca56 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/raw_protocol/overload2.html @@ -0,0 +1,59 @@ + + + +generic::raw_protocol::raw_protocol (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+raw_protocol(
+    const Protocol & source_protocol);
+
+
+ + Exceptions +
+
+

+
+
@c
+

+ bad_cast Thrown if the source protocol is not raw-oriented. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/socket.html b/include/asio/doc/asio/reference/generic__raw_protocol/socket.html new file mode 100644 index 0000000..f898689 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/socket.html @@ -0,0 +1,917 @@ + + + +generic::raw_protocol::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + generic socket type. +

+
typedef basic_raw_socket< raw_protocol > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_raw_socket [constructor] +

+
+

+ Construct a basic_raw_socket without opening it.
—
+ Construct and open a basic_raw_socket.
—
Construct + a basic_raw_socket, opening it and binding it to the given local + endpoint.
—
Construct a basic_raw_socket on an existing + native socket.
—
Move-construct a basic_raw_socket + from another.
—
Move-construct a basic_raw_socket + from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_raw_socket from another.
—
Move-assign + a basic_raw_socket from a socket of another protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive raw data with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send raw data to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_raw_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_raw_socket + class template provides asynchronous and blocking raw-oriented socket functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/raw_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__raw_protocol/type.html b/include/asio/doc/asio/reference/generic__raw_protocol/type.html new file mode 100644 index 0000000..ed99c97 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__raw_protocol/type.html @@ -0,0 +1,44 @@ + + + +generic::raw_protocol::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the type of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol.html new file mode 100644 index 0000000..a209387 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol.html @@ -0,0 +1,248 @@ + + + +generic::seq_packet_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for a generic sequenced packet socket. +

+
class seq_packet_protocol
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint +

+
+

+ The type of an endpoint. +

+
+

+ socket +

+
+

+ The generic socket type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ seq_packet_protocol [constructor] +

+
+

+ Construct a protocol object for a specific address family and protocol. +
—
Construct a generic protocol object from a specific + protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two protocols for inequality. +

+
+

+ operator== +

+
+

+ Compare two protocols for equality. +

+
+

+ The generic::seq_packet_protocol + class contains flags necessary for seq_packet-oriented sockets of any address + family and protocol. +

+
+ + Examples +
+

+ Constructing using a native address family and socket protocol: +

+
seq_packet_protocol p(AF_INET, IPPROTO_SCTP);
+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/generic/seq_packet_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/endpoint.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/endpoint.html new file mode 100644 index 0000000..2818daa --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/endpoint.html @@ -0,0 +1,334 @@ + + + +generic::seq_packet_protocol::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of an endpoint. +

+
typedef basic_endpoint< seq_packet_protocol > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint from + the specified socket address.
—
Construct an endpoint + from the specific endpoint type.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+

+ The generic::basic_endpoint + class template describes an endpoint that may be associated with any socket + type. +

+
+ + Remarks +
+

+ The socket types sockaddr type must be able to fit into a sockaddr_storage + structure. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/seq_packet_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/family.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/family.html new file mode 100644 index 0000000..57fa2f4 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/family.html @@ -0,0 +1,44 @@ + + + +generic::seq_packet_protocol::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/operator_eq__eq_.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/operator_eq__eq_.html new file mode 100644 index 0000000..86b6949 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +generic::seq_packet_protocol::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for equality. +

+
friend bool operator==(
+    const seq_packet_protocol & p1,
+    const seq_packet_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/seq_packet_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/operator_not__eq_.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/operator_not__eq_.html new file mode 100644 index 0000000..4039bd8 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +generic::seq_packet_protocol::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for inequality. +

+
friend bool operator!=(
+    const seq_packet_protocol & p1,
+    const seq_packet_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/seq_packet_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/protocol.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/protocol.html new file mode 100644 index 0000000..5240b59 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/protocol.html @@ -0,0 +1,44 @@ + + + +generic::seq_packet_protocol::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol.html new file mode 100644 index 0000000..29c0961 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol.html @@ -0,0 +1,56 @@ + + + +generic::seq_packet_protocol::seq_packet_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a protocol object for a specific address family and protocol. +

+
seq_packet_protocol(
+    int address_family,
+    int socket_protocol);
+  » more...
+
+

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+seq_packet_protocol(
+    const Protocol & source_protocol);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload1.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload1.html new file mode 100644 index 0000000..fa83cef --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload1.html @@ -0,0 +1,45 @@ + + + +generic::seq_packet_protocol::seq_packet_protocol (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a protocol object for a specific address family and protocol. +

+
seq_packet_protocol(
+    int address_family,
+    int socket_protocol);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload2.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload2.html new file mode 100644 index 0000000..bc3cfe4 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload2.html @@ -0,0 +1,60 @@ + + + +generic::seq_packet_protocol::seq_packet_protocol (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+seq_packet_protocol(
+    const Protocol & source_protocol);
+
+
+ + Exceptions +
+
+

+
+
@c
+

+ bad_cast Thrown if the source protocol is not based around sequenced + packets. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/socket.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/socket.html new file mode 100644 index 0000000..2e59736 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/socket.html @@ -0,0 +1,872 @@ + + + +generic::seq_packet_protocol::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + generic socket type. +

+
typedef basic_seq_packet_socket< seq_packet_protocol > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_seq_packet_socket [constructor] +

+
+

+ Construct a basic_seq_packet_socket without opening it.
+ —
Construct and open a basic_seq_packet_socket.
— +
Construct a basic_seq_packet_socket, opening it and binding + it to the given local endpoint.
—
Construct a basic_seq_packet_socket + on an existing native socket.
—
Move-construct a + basic_seq_packet_socket from another.
—
Move-construct + a basic_seq_packet_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_seq_packet_socket from another.
—
+ Move-assign a basic_seq_packet_socket from a socket of another + protocol type. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_seq_packet_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_seq_packet_socket + class template provides asynchronous and blocking sequenced packet socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/seq_packet_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__seq_packet_protocol/type.html b/include/asio/doc/asio/reference/generic__seq_packet_protocol/type.html new file mode 100644 index 0000000..934dad5 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__seq_packet_protocol/type.html @@ -0,0 +1,44 @@ + + + +generic::seq_packet_protocol::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the type of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol.html b/include/asio/doc/asio/reference/generic__stream_protocol.html new file mode 100644 index 0000000..3635d14 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol.html @@ -0,0 +1,264 @@ + + + +generic::stream_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for a generic stream-oriented socket. +

+
class stream_protocol
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint +

+
+

+ The type of an endpoint. +

+
+

+ iostream +

+
+

+ The generic socket iostream type. +

+
+

+ socket +

+
+

+ The generic socket type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ stream_protocol [constructor] +

+
+

+ Construct a protocol object for a specific address family and protocol. +
—
Construct a generic protocol object from a specific + protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two protocols for inequality. +

+
+

+ operator== +

+
+

+ Compare two protocols for equality. +

+
+

+ The generic::stream_protocol + class contains flags necessary for stream-oriented sockets of any address + family and protocol. +

+
+ + Examples +
+

+ Constructing using a native address family and socket protocol: +

+
stream_protocol p(AF_INET, IPPROTO_TCP);
+
+

+ Constructing from a specific protocol type: +

+
stream_protocol p(asio::ip::tcp::v4());
+
+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/generic/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/endpoint.html b/include/asio/doc/asio/reference/generic__stream_protocol/endpoint.html new file mode 100644 index 0000000..3a45cd1 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/endpoint.html @@ -0,0 +1,334 @@ + + + +generic::stream_protocol::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of an endpoint. +

+
typedef basic_endpoint< stream_protocol > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint from + the specified socket address.
—
Construct an endpoint + from the specific endpoint type.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+

+ The generic::basic_endpoint + class template describes an endpoint that may be associated with any socket + type. +

+
+ + Remarks +
+

+ The socket types sockaddr type must be able to fit into a sockaddr_storage + structure. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/family.html b/include/asio/doc/asio/reference/generic__stream_protocol/family.html new file mode 100644 index 0000000..61dad85 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/family.html @@ -0,0 +1,44 @@ + + + +generic::stream_protocol::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/iostream.html b/include/asio/doc/asio/reference/generic__stream_protocol/iostream.html new file mode 100644 index 0000000..19fae7f --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/iostream.html @@ -0,0 +1,328 @@ + + + +generic::stream_protocol::iostream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + generic socket iostream type. +

+
typedef basic_socket_iostream< stream_protocol > iostream;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type. +

+
+

+ duration_type +

+
+

+ (Deprecated: Use duration.) The duration type. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ time_point +

+
+

+ The time type. +

+
+

+ time_type +

+
+

+ (Deprecated: Use time_point.) The time type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_socket_iostream [constructor] +

+
+

+ Construct a basic_socket_iostream without establishing a connection. +
—
Construct a basic_socket_iostream from the supplied + socket.
—
Move-construct a basic_socket_iostream + from another.
—
Establish a connection to an endpoint + corresponding to a resolver query. +

+
+

+ close +

+
+

+ Close the connection. +

+
+

+ connect +

+
+

+ Establish a connection to an endpoint corresponding to a resolver + query. +

+
+

+ error +

+
+

+ Get the last error associated with the stream. +

+
+

+ expires_after +

+
+

+ Set the stream's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time as an + absolute time.
—
Set the stream's expiry time as + an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set + the stream's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the stream's expiry time as an absolute time. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_iostream from another. +

+
+

+ rdbuf +

+
+

+ Return a pointer to the underlying streambuf. +

+
+

+ socket +

+
+

+ Get a reference to the underlying socket. +

+
+
+ + Requirements +
+

+ Header: asio/generic/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/operator_eq__eq_.html b/include/asio/doc/asio/reference/generic__stream_protocol/operator_eq__eq_.html new file mode 100644 index 0000000..47b741e --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +generic::stream_protocol::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for equality. +

+
friend bool operator==(
+    const stream_protocol & p1,
+    const stream_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/operator_not__eq_.html b/include/asio/doc/asio/reference/generic__stream_protocol/operator_not__eq_.html new file mode 100644 index 0000000..ed9478f --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +generic::stream_protocol::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two protocols for inequality. +

+
friend bool operator!=(
+    const stream_protocol & p1,
+    const stream_protocol & p2);
+
+
+ + Requirements +
+

+ Header: asio/generic/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/protocol.html b/include/asio/doc/asio/reference/generic__stream_protocol/protocol.html new file mode 100644 index 0000000..b4efae0 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/protocol.html @@ -0,0 +1,44 @@ + + + +generic::stream_protocol::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/socket.html b/include/asio/doc/asio/reference/generic__stream_protocol/socket.html new file mode 100644 index 0000000..0692eb2 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/socket.html @@ -0,0 +1,920 @@ + + + +generic::stream_protocol::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + generic socket type. +

+
typedef basic_stream_socket< stream_protocol > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_stream_socket [constructor] +

+
+

+ Construct a basic_stream_socket without opening it.
—
+ Construct and open a basic_stream_socket.
—
Construct + a basic_stream_socket, opening it and binding it to the given + local endpoint.
—
Construct a basic_stream_socket + on an existing native socket.
—
Move-construct a + basic_stream_socket from another.
—
Move-construct + a basic_stream_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_stream_socket from another.
—
+ Move-assign a basic_stream_socket from a socket of another protocol + type. +

+
+

+ read_some +

+
+

+ Read some data from the socket. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the socket. +

+
+

+ ~basic_stream_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_stream_socket + class template provides asynchronous and blocking stream-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/generic/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol.html b/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol.html new file mode 100644 index 0000000..fabed3f --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol.html @@ -0,0 +1,56 @@ + + + +generic::stream_protocol::stream_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a protocol object for a specific address family and protocol. +

+
stream_protocol(
+    int address_family,
+    int socket_protocol);
+  » more...
+
+

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+stream_protocol(
+    const Protocol & source_protocol);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol/overload1.html b/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol/overload1.html new file mode 100644 index 0000000..73da530 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol/overload1.html @@ -0,0 +1,45 @@ + + + +generic::stream_protocol::stream_protocol (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a protocol object for a specific address family and protocol. +

+
stream_protocol(
+    int address_family,
+    int socket_protocol);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol/overload2.html b/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol/overload2.html new file mode 100644 index 0000000..288c020 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/stream_protocol/overload2.html @@ -0,0 +1,59 @@ + + + +generic::stream_protocol::stream_protocol (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a generic protocol object from a specific protocol. +

+
template<
+    typename Protocol>
+stream_protocol(
+    const Protocol & source_protocol);
+
+
+ + Exceptions +
+
+

+
+
@c
+

+ bad_cast Thrown if the source protocol is not stream-oriented. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/generic__stream_protocol/type.html b/include/asio/doc/asio/reference/generic__stream_protocol/type.html new file mode 100644 index 0000000..5d8d879 --- /dev/null +++ b/include/asio/doc/asio/reference/generic__stream_protocol/type.html @@ -0,0 +1,44 @@ + + + +generic::stream_protocol::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the type of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/get_associated_allocator.html b/include/asio/doc/asio/reference/get_associated_allocator.html new file mode 100644 index 0000000..c85b70a --- /dev/null +++ b/include/asio/doc/asio/reference/get_associated_allocator.html @@ -0,0 +1,66 @@ + + + +get_associated_allocator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Helper function + to obtain an object's associated allocator. +

+
template<
+    typename T>
+associated_allocator< T >::type get_associated_allocator(
+    const T & t);
+  » more...
+
+template<
+    typename T,
+    typename Allocator>
+associated_allocator< T, Allocator >::type get_associated_allocator(
+    const T & t,
+    const Allocator & a);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/associated_allocator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/get_associated_allocator/overload1.html b/include/asio/doc/asio/reference/get_associated_allocator/overload1.html new file mode 100644 index 0000000..a24c73f --- /dev/null +++ b/include/asio/doc/asio/reference/get_associated_allocator/overload1.html @@ -0,0 +1,54 @@ + + + +get_associated_allocator (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Helper function to obtain an object's associated allocator. +

+
template<
+    typename T>
+associated_allocator< T >::type get_associated_allocator(
+    const T & t);
+
+
+ + Return + Value +
+

+ associated_allocator<T>::get(t) +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/get_associated_allocator/overload2.html b/include/asio/doc/asio/reference/get_associated_allocator/overload2.html new file mode 100644 index 0000000..6a252bf --- /dev/null +++ b/include/asio/doc/asio/reference/get_associated_allocator/overload2.html @@ -0,0 +1,56 @@ + + + +get_associated_allocator (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Helper function to obtain an object's associated allocator. +

+
template<
+    typename T,
+    typename Allocator>
+associated_allocator< T, Allocator >::type get_associated_allocator(
+    const T & t,
+    const Allocator & a);
+
+
+ + Return + Value +
+

+ associated_allocator<T, Allocator>::get(t, a) +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/get_associated_executor.html b/include/asio/doc/asio/reference/get_associated_executor.html new file mode 100644 index 0000000..d9a6b3e --- /dev/null +++ b/include/asio/doc/asio/reference/get_associated_executor.html @@ -0,0 +1,76 @@ + + + +get_associated_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Helper function + to obtain an object's associated executor. +

+
template<
+    typename T>
+associated_executor< T >::type get_associated_executor(
+    const T & t);
+  » more...
+
+template<
+    typename T,
+    typename Executor>
+associated_executor< T, Executor >::type get_associated_executor(
+    const T & t,
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename T,
+    typename ExecutionContext>
+associated_executor< T, typename ExecutionContext::executor_type >::type get_associated_executor(
+    const T & t,
+    ExecutionContext & ctx,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/associated_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/get_associated_executor/overload1.html b/include/asio/doc/asio/reference/get_associated_executor/overload1.html new file mode 100644 index 0000000..9577dba --- /dev/null +++ b/include/asio/doc/asio/reference/get_associated_executor/overload1.html @@ -0,0 +1,54 @@ + + + +get_associated_executor (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Helper function to obtain an object's associated executor. +

+
template<
+    typename T>
+associated_executor< T >::type get_associated_executor(
+    const T & t);
+
+
+ + Return + Value +
+

+ associated_executor<T>::get(t) +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/get_associated_executor/overload2.html b/include/asio/doc/asio/reference/get_associated_executor/overload2.html new file mode 100644 index 0000000..b28d3f6 --- /dev/null +++ b/include/asio/doc/asio/reference/get_associated_executor/overload2.html @@ -0,0 +1,57 @@ + + + +get_associated_executor (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Helper function to obtain an object's associated executor. +

+
template<
+    typename T,
+    typename Executor>
+associated_executor< T, Executor >::type get_associated_executor(
+    const T & t,
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+
+
+ + Return + Value +
+

+ associated_executor<T, Executor>::get(t, ex) +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/get_associated_executor/overload3.html b/include/asio/doc/asio/reference/get_associated_executor/overload3.html new file mode 100644 index 0000000..3132066 --- /dev/null +++ b/include/asio/doc/asio/reference/get_associated_executor/overload3.html @@ -0,0 +1,58 @@ + + + +get_associated_executor (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Helper function to obtain an object's associated executor. +

+
template<
+    typename T,
+    typename ExecutionContext>
+associated_executor< T, typename ExecutionContext::executor_type >::type get_associated_executor(
+    const T & t,
+    ExecutionContext & ctx,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + Return + Value +
+

+ associated_executor<T, typename ExecutionContext::executor_type>get(t, + ctx.get_executor()) +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/high_resolution_timer.html b/include/asio/doc/asio/reference/high_resolution_timer.html new file mode 100644 index 0000000..c6499f5 --- /dev/null +++ b/include/asio/doc/asio/reference/high_resolution_timer.html @@ -0,0 +1,454 @@ + + + +high_resolution_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for a timer + based on the high resolution clock. +

+
typedef basic_waitable_timer< chrono::high_resolution_clock > high_resolution_timer;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type of the clock. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_point +

+
+

+ The time point type of the clock. +

+
+

+ traits_type +

+
+

+ The wait traits type. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_waitable_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a particular + expiry time relative to now.
—
Move-construct a basic_waitable_timer + from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancel + any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancels + one asynchronous operation that is waiting on the timer. +

+
+

+ expires_after +

+
+

+ Set the timer's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time as an absolute + time.
—
Set the timer's expiry time as an absolute + time.
—
(Deprecated: Use non-error_code overload.) + Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set the + timer's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the timer's expiry time as an absolute time. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_waitable_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_waitable_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_waitable_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A waitable timer is always in one of two states: "expired" or "not + expired". If the wait() or async_wait() function + is called on an expired timer, the wait operation will complete immediately. +

+

+ Most applications will use one of the steady_timer, + system_timer + or high_resolution_timer + typedefs. +

+
+ + Remarks +
+

+ This waitable timer functionality is for use with the C++11 standard library's + <chrono> facility, or with the Boost.Chrono library. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait (C++11): +

+
// Construct a timer without setting an expiry time.
+asio::steady_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_after(std::chrono::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait (C++11): +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::steady_timer timer(my_context,
+    std::chrono::steady_clock::now() + std::chrono::seconds(60));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active waitable timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the action + associated with the timer is performed only once, use something like this: + used: +

+
void on_some_event()
+{
+  if (my_timer.expires_after(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_waitable_timer::expires_after() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+

+ This typedef uses the C++11 <chrono> standard library + facility, if available. Otherwise, it may use the Boost.Chrono library. To + explicitly utilise Boost.Chrono, use the basic_waitable_timer + template directly: +

+
typedef basic_waitable_timer<boost::chrono::high_resolution_clock> timer;
+
+
+ + Requirements +
+

+ Header: asio/high_resolution_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/invalid_service_owner.html b/include/asio/doc/asio/reference/invalid_service_owner.html new file mode 100644 index 0000000..47f5f63 --- /dev/null +++ b/include/asio/doc/asio/reference/invalid_service_owner.html @@ -0,0 +1,84 @@ + + + +invalid_service_owner + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Exception thrown when trying to add a service object to an execution_context + where the service has a different owner. +

+
class invalid_service_owner
+
+
+ + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ invalid_service_owner [constructor] +

+
+
+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/invalid_service_owner/invalid_service_owner.html b/include/asio/doc/asio/reference/invalid_service_owner/invalid_service_owner.html new file mode 100644 index 0000000..0668c93 --- /dev/null +++ b/include/asio/doc/asio/reference/invalid_service_owner/invalid_service_owner.html @@ -0,0 +1,42 @@ + + + +invalid_service_owner::invalid_service_owner + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
invalid_service_owner();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context.html b/include/asio/doc/asio/reference/io_context.html new file mode 100644 index 0000000..ab7670e --- /dev/null +++ b/include/asio/doc/asio/reference/io_context.html @@ -0,0 +1,750 @@ + + + +io_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides core I/O functionality. +

+
class io_context :
+  public execution_context
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type +

+
+

+ Executor implementation type used to submit functions to an io_context. +

+
+

+ service +

+
+

+ Base class for all io_context services. +

+
+

+ strand +

+
+

+ Provides serialised handler execution. +

+
+

+ work +

+
+

+ (Deprecated: Use executor_work_guard.) Class to inform the io_context + when it has work to do. +

+
+

+ count_type +

+
+

+ The type used to count the number of handlers executed by the context. +

+
+

+ executor_type +

+
+

+ Executor used to submit functions to an io_context. +

+
+

+ fork_event +

+
+

+ Fork-related event notifications. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dispatch +

+
+

+ (Deprecated: Use asio::dispatch().) Request the io_context to invoke + the given handler. +

+
+

+ get_executor +

+
+

+ Obtains the executor associated with the io_context. +

+
+

+ io_context [constructor] +

+
+

+ Constructor. +

+
+

+ notify_fork +

+
+

+ Notify the execution_context of a fork-related event. +

+
+

+ poll +

+
+

+ Run the io_context object's event processing loop to execute ready + handlers.
—
(Deprecated: Use non-error_code overload.) + Run the io_context object's event processing loop to execute ready + handlers. +

+
+

+ poll_one +

+
+

+ Run the io_context object's event processing loop to execute one + ready handler.
—
(Deprecated: Use non-error_code overload.) + Run the io_context object's event processing loop to execute one + ready handler. +

+
+

+ post +

+
+

+ (Deprecated: Use asio::post().) Request the io_context to invoke + the given handler and return immediately. +

+
+

+ reset +

+
+

+ (Deprecated: Use restart().) Reset the io_context in preparation + for a subsequent run() invocation. +

+
+

+ restart +

+
+

+ Restart the io_context in preparation for a subsequent run() invocation. +

+
+

+ run +

+
+

+ Run the io_context object's event processing loop.
—
+ (Deprecated: Use non-error_code overload.) Run the io_context object's + event processing loop. +

+
+

+ run_for +

+
+

+ Run the io_context object's event processing loop for a specified + duration. +

+
+

+ run_one +

+
+

+ Run the io_context object's event processing loop to execute at + most one handler.
—
(Deprecated: Use non-error_code + overlaod.) Run the io_context object's event processing loop to + execute at most one handler. +

+
+

+ run_one_for +

+
+

+ Run the io_context object's event processing loop for a specified + duration to execute at most one handler. +

+
+

+ run_one_until +

+
+

+ Run the io_context object's event processing loop until a specified + time to execute at most one handler. +

+
+

+ run_until +

+
+

+ Run the io_context object's event processing loop until a specified + time. +

+
+

+ stop +

+
+

+ Stop the io_context object's event processing loop. +

+
+

+ stopped +

+
+

+ Determine whether the io_context object has been stopped. +

+
+

+ wrap +

+
+

+ (Deprecated: Use asio::bind_executor().) Create a new handler that + automatically dispatches the wrapped handler on the io_context. +

+
+

+ ~io_context [destructor] +

+
+

+ Destructor. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ destroy +

+
+

+ Destroys all services in the context. +

+
+

+ shutdown +

+
+

+ Shuts down all services in the context. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add_service +

+
+

+ (Deprecated: Use make_service().) Add a service object to the execution_context. +

+
+

+ has_service +

+
+

+ Determine if an execution_context contains a specified service + type. +

+
+

+ make_service +

+
+

+ Creates a service object and adds it to the execution_context. +

+
+

+ use_service +

+
+

+
—
Obtain the service object corresponding to the given + type. +

+
+

+ The io_context + class provides the core I/O functionality for users of the asynchronous I/O + objects, including: +

+
    +
  • + asio::ip::tcp::socket +
  • +
  • + asio::ip::tcp::acceptor +
  • +
  • + asio::ip::udp::socket +
  • +
  • + deadline_timer. +
  • +
+

+ The io_context + class also includes facilities intended for developers of custom asynchronous + services. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe, with the + specific exceptions of the restart() and notify_fork() + functions. Calling restart() while there are unfinished run(), + run_one(), run_for(), run_until(), + poll() or poll_one() calls results in undefined + behaviour. The notify_fork() function should not be called while + any io_context + function, or any function on an I/O object that is associated with the io_context, is being + called in another thread. +

+
+ + Synchronous + and asynchronous operations +
+

+ Synchronous operations on I/O objects implicitly run the io_context + object for an individual operation. The io_context + functions run(), run_one(), run_for(), + run_until(), poll() or poll_one() + must be called for the io_context + to perform asynchronous operations on behalf of a C++ program. Notification + that an asynchronous operation has completed is delivered by invocation of + the associated handler. Handlers are invoked only by a thread that is currently + calling any overload of run(), run_one(), run_for(), + run_until(), poll() or poll_one() + for the io_context. +

+
+ + Effect + of exceptions thrown from handlers +
+

+ If an exception is thrown from a handler, the exception is allowed to propagate + through the throwing thread's invocation of run(), run_one(), + run_for(), run_until(), poll() or + poll_one(). No other threads that are calling any of these functions + are affected. It is then the responsibility of the application to catch the + exception. +

+

+ After the exception has been caught, the run(), run_one(), + run_for(), run_until(), poll() or + poll_one() call may be restarted without + the need for an intervening call to restart(). This allows the + thread to rejoin the io_context + object's thread pool without impacting any other threads in the pool. +

+

+ For example: +

+
asio::io_context io_context;
+...
+for (;;)
+{
+  try
+  {
+    io_context.run();
+    break; // run() exited normally
+  }
+  catch (my_exception& e)
+  {
+    // Deal with exception as appropriate.
+  }
+}
+
+
+ + Submitting + arbitrary tasks to the io_context +
+

+ To submit functions to the io_context, + use the dispatch + , post or defer + free functions. +

+

+ For example: +

+
void my_task()
+{
+  ...
+}
+
+...
+
+asio::io_context io_context;
+
+// Submit a function to the io_context.
+asio::post(io_context, my_task);
+
+// Submit a lambda object to the io_context.
+asio::post(io_context,
+    []()
+    {
+      ...
+    });
+
+// Run the io_context until it runs out of work.
+io_context.run();
+
+
+ + Stopping + the io_context from running out of work +
+

+ Some applications may need to prevent an io_context + object's run() call from returning when there is no more work + to do. For example, the io_context + may be being run in a background thread that is launched prior to the application's + asynchronous operations. The run() call may be kept running + by creating an executor that tracks work against the io_context: +

+
asio::io_context io_context;
+auto work = asio::require(io_context.get_executor(),
+    asio::execution::outstanding_work.tracked);
+...
+
+

+ If using C++03, which lacks automatic variable type deduction, you may compute + the return type of the require call: +

+
asio::io_context io_context;
+typename asio::require_result<
+    asio::io_context::executor_type,
+    asio::exeution::outstanding_work_t::tracked_t>
+  work = asio::require(io_context.get_executor(),
+    asio::execution::outstanding_work.tracked);
+...
+
+

+ or store the result in the type-erasing executor wrapper, any_io_executor: +

+
asio::io_context io_context;
+asio::any_io_executor work
+  = asio::require(io_context.get_executor(),
+      asio::execution::outstanding_work.tracked);
+...
+
+

+ To effect a shutdown, the application will then need to call the io_context + object's stop() member function. This will cause the io_context + run() call to return as soon as possible, abandoning unfinished + operations and without permitting ready handlers to be dispatched. +

+

+ Alternatively, if the application requires that all operations and handlers + be allowed to finish normally, store the work-tracking executor in an any_io_executor + object, so that it may be explicitly reset. +

+
asio::io_context io_context;
+asio::any_io_executor work
+  = asio::require(io_context.get_executor(),
+      asio::execution::outstanding_work.tracked);
+...
+work = asio::any_io_executor(); // Allow run() to exit.
+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/_io_context.html b/include/asio/doc/asio/reference/io_context/_io_context.html new file mode 100644 index 0000000..50264b2 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/_io_context.html @@ -0,0 +1,90 @@ + + + +io_context::~io_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~io_context();
+
+

+ On destruction, the io_context + performs the following sequence of operations: +

+
    +
  • + For each service object svc in the io_context + set, in reverse order of the beginning of service object lifetime, + performs svc->shutdown(). +
  • +
  • + Uninvoked handler objects that were scheduled for deferred invocation + on the io_context, + or any associated strand, are destroyed. +
  • +
  • + For each service object svc in the io_context + set, in reverse order of the beginning of service object lifetime, + performs delete static_cast<io_context::service*>(svc). +
  • +
+
+ + Remarks +
+

+ The destruction sequence described above permits programs to simplify their + resource management by using shared_ptr<>. Where an + object's lifetime is tied to the lifetime of a connection (or some other + sequence of asynchronous operations), a shared_ptr to the + object would be bound into the handlers for all asynchronous operations + associated with it. This works as follows: +

+
    +
  • + When a single connection ends, all associated asynchronous operations + complete. The corresponding handler objects are destroyed, and all + shared_ptr references to the objects are destroyed. +
  • +
  • + To shut down the whole program, the io_context + function stop() is called to terminate any run() + calls as soon as possible. The io_context + destructor defined above destroys all handlers, causing all shared_ptr + references to all connection objects to be destroyed. +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/add_service.html b/include/asio/doc/asio/reference/io_context/add_service.html new file mode 100644 index 0000000..932b1db --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/add_service.html @@ -0,0 +1,111 @@ + + + +io_context::add_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +(Deprecated: + Use make_service().) Add a service object to the execution_context. +

+
template<
+    typename Service>
+friend void add_service(
+    execution_context & e,
+    Service * svc);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
svc
+
+

+ The service object. On success, ownership of the service object is + transferred to the execution_context. + When the execution_context + object is destroyed, it will destroy the service object by performing: +

+
delete static_cast<execution_context::service*>(svc)
+
+

+

+
+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
asio::invalid_service_owner
+

+ Thrown if the service's owning execution_context + is not the execution_context + object specified by the e parameter. +

+
+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/count_type.html b/include/asio/doc/asio/reference/io_context/count_type.html new file mode 100644 index 0000000..8a91721 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/count_type.html @@ -0,0 +1,54 @@ + + + +io_context::count_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type used to + count the number of handlers executed by the context. +

+
typedef std::size_t count_type;
+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/destroy.html b/include/asio/doc/asio/reference/io_context/destroy.html new file mode 100644 index 0000000..74fe683 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/destroy.html @@ -0,0 +1,55 @@ + + + +io_context::destroy + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Destroys all services + in the context. +

+
void destroy();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order * of the beginning of service object lifetime, + performs delete static_cast<execution_context::service*>(svc). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/dispatch.html b/include/asio/doc/asio/reference/io_context/dispatch.html new file mode 100644 index 0000000..9727944 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/dispatch.html @@ -0,0 +1,98 @@ + + + +io_context::dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use dispatch.) Request + the io_context + to invoke the given handler. +

+
template<
+    typename LegacyCompletionHandler>
+DEDUCED dispatch(
+    LegacyCompletionHandler && handler);
+
+

+ This function is used to ask the io_context + to execute the given handler. +

+

+ The io_context + guarantees that the handler will only be called in a thread in which the + run(), run_one(), poll() or poll_one() + member functions is currently being invoked. The handler may be executed + inside this function if the guarantee can be met. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called. The io_context + will make a copy of the handler object as required. The function + signature of the handler must be: +

+
void handler();
+
+

+

+
+
+
+
+ + Remarks +
+

+ This function throws an exception only if: +

+
    +
  • + the handler's asio_handler_allocate function; or +
  • +
  • + the handler's copy constructor +
  • +
+

+ throws an exception. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/executor_type.html b/include/asio/doc/asio/reference/io_context/executor_type.html new file mode 100644 index 0000000..e1efecd --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/executor_type.html @@ -0,0 +1,307 @@ + + + +io_context::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Executor + used to submit functions to an io_context. +

+
typedef basic_executor_type< std::allocator< void >, 0 > executor_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type [constructor] +

+
+

+ Copy constructor.
—
Move constructor. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the io_context to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the io_context to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the io_context that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the io_context that it has some outstanding work to do. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator. +

+
+

+ post +

+
+

+ Request the io_context to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property.
+ —
Query the current value of the allocator property. +

+
+

+ query [static] +

+
+

+ Query the current value of the mapping property.
—
+ Query the current value of the outstanding_work property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.never property. +
—
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the relationship.continuation + property.
—
Obtain an executor with the outstanding_work.tracked + property.
—
Obtain an executor with the outstanding_work.untracked + property.
—
Obtain an executor with the specified + allocator property.
—
Obtain an executor with the + default allocator property. +

+
+

+ running_in_this_thread +

+
+

+ Determine whether the io_context is running in the current thread. +

+
+

+ ~basic_executor_type [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/fork_event.html b/include/asio/doc/asio/reference/io_context/fork_event.html new file mode 100644 index 0000000..d83a81f --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/fork_event.html @@ -0,0 +1,73 @@ + + + +io_context::fork_event + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Fork-related event + notifications. +

+
enum fork_event
+
+

+ + + +

+
+ + Values +
+
+

+
+
fork_prepare
+

+ Notify the context that the process is about to fork. +

+
fork_parent
+

+ Notify the context that the process has forked and is the parent. +

+
fork_child
+

+ Notify the context that the process has forked and is the child. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/get_executor.html b/include/asio/doc/asio/reference/io_context/get_executor.html new file mode 100644 index 0000000..7d83955 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/get_executor.html @@ -0,0 +1,44 @@ + + + +io_context::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtains the + executor associated with the io_context. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/has_service.html b/include/asio/doc/asio/reference/io_context/has_service.html new file mode 100644 index 0000000..b76f3e2 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/has_service.html @@ -0,0 +1,87 @@ + + + +io_context::has_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Determine if + an execution_context + contains a specified service type. +

+
template<
+    typename Service>
+friend bool has_service(
+    execution_context & e);
+
+

+ This function is used to determine whether the execution_context + contains a service object corresponding to the given service type. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return Value +
+

+ A boolean indicating whether the execution_context + contains the service. +

+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/io_context.html b/include/asio/doc/asio/reference/io_context/io_context.html new file mode 100644 index 0000000..38a607e --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/io_context.html @@ -0,0 +1,48 @@ + + + +io_context::io_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
io_context();
+  » more...
+
+explicit io_context(
+    int concurrency_hint);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/io_context/overload1.html b/include/asio/doc/asio/reference/io_context/io_context/overload1.html new file mode 100644 index 0000000..b02e5ca --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/io_context/overload1.html @@ -0,0 +1,43 @@ + + + +io_context::io_context (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor. +

+
io_context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/io_context/overload2.html b/include/asio/doc/asio/reference/io_context/io_context/overload2.html new file mode 100644 index 0000000..9c346eb --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/io_context/overload2.html @@ -0,0 +1,61 @@ + + + +io_context::io_context (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor. +

+
io_context(
+    int concurrency_hint);
+
+

+ Construct with a hint about the required level of concurrency. +

+
+ + Parameters +
+
+

+
+
concurrency_hint
+

+ A suggestion to the implementation on how many threads it should + allow to run simultaneously. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/make_service.html b/include/asio/doc/asio/reference/io_context/make_service.html new file mode 100644 index 0000000..5f4f665 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/make_service.html @@ -0,0 +1,97 @@ + + + +io_context::make_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Creates a service + object and adds it to the execution_context. +

+
template<
+    typename Service,
+    typename... Args>
+friend Service & make_service(
+    execution_context & e,
+    Args &&... args);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
args
+

+ Zero or more arguments to be passed to the service constructor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/notify_fork.html b/include/asio/doc/asio/reference/io_context/notify_fork.html new file mode 100644 index 0000000..ffd2810 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/notify_fork.html @@ -0,0 +1,121 @@ + + + +io_context::notify_fork + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Notify the execution_context + of a fork-related event. +

+
void notify_fork(
+    fork_event event);
+
+

+ This function is used to inform the execution_context + that the process is about to fork, or has just forked. This allows the + execution_context, + and the services it contains, to perform any necessary housekeeping to + ensure correct operation following a fork. +

+

+ This function must not be called while any other execution_context + function, or any function associated with the execution_context's derived + class, is being called in another thread. It is, however, safe to call + this function from within a completion handler, provided no other thread + is accessing the execution_context + or its derived class. +

+
+ + Parameters +
+
+

+
+
event
+

+ A fork-related event. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the notification fails the execution_context + object should no longer be used and should be destroyed. +

+
+
+
+ + Example +
+

+ The following code illustrates how to incorporate the notify_fork() + function: +

+
my_execution_context.notify_fork(execution_context::fork_prepare);
+if (fork() == 0)
+{
+  // This is the child process.
+  my_execution_context.notify_fork(execution_context::fork_child);
+}
+else
+{
+  // This is the parent process.
+  my_execution_context.notify_fork(execution_context::fork_parent);
+}
+
+
+ + Remarks +
+

+ For each service object svc in the execution_context + set, performs svc->notify_fork();. When processing the + fork_prepare event, services are visited in reverse order of the beginning + of service object lifetime. Otherwise, services are visited in order of + the beginning of service object lifetime. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/poll.html b/include/asio/doc/asio/reference/io_context/poll.html new file mode 100644 index 0000000..dbaf8a6 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/poll.html @@ -0,0 +1,53 @@ + + + +io_context::poll + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the io_context + object's event processing loop to execute ready handlers. +

+
count_type poll();
+  » more...
+
+

+ (Deprecated: Use non-error_code overload.) Run the io_context + object's event processing loop to execute ready handlers. +

+
count_type poll(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/poll/overload1.html b/include/asio/doc/asio/reference/io_context/poll/overload1.html new file mode 100644 index 0000000..db528e5 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/poll/overload1.html @@ -0,0 +1,57 @@ + + + +io_context::poll (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Run the io_context + object's event processing loop to execute ready handlers. +

+
count_type poll();
+
+

+ The poll() function runs handlers that are ready to run, + without blocking, until the io_context + has been stopped or there are no more ready handlers. +

+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/poll/overload2.html b/include/asio/doc/asio/reference/io_context/poll/overload2.html new file mode 100644 index 0000000..834f394 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/poll/overload2.html @@ -0,0 +1,71 @@ + + + +io_context::poll (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use non-error_code overload.) Run the io_context + object's event processing loop to execute ready handlers. +

+
count_type poll(
+    asio::error_code & ec);
+
+

+ The poll() function runs handlers that are ready to run, + without blocking, until the io_context + has been stopped or there are no more ready handlers. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/poll_one.html b/include/asio/doc/asio/reference/io_context/poll_one.html new file mode 100644 index 0000000..656502d --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/poll_one.html @@ -0,0 +1,53 @@ + + + +io_context::poll_one + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the io_context + object's event processing loop to execute one ready handler. +

+
count_type poll_one();
+  » more...
+
+

+ (Deprecated: Use non-error_code overload.) Run the io_context + object's event processing loop to execute one ready handler. +

+
count_type poll_one(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/poll_one/overload1.html b/include/asio/doc/asio/reference/io_context/poll_one/overload1.html new file mode 100644 index 0000000..e93f7b8 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/poll_one/overload1.html @@ -0,0 +1,56 @@ + + + +io_context::poll_one (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Run the io_context + object's event processing loop to execute one ready handler. +

+
count_type poll_one();
+
+

+ The poll_one() function runs at most one handler that is + ready to run, without blocking. +

+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/poll_one/overload2.html b/include/asio/doc/asio/reference/io_context/poll_one/overload2.html new file mode 100644 index 0000000..b734641 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/poll_one/overload2.html @@ -0,0 +1,70 @@ + + + +io_context::poll_one (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use non-error_code overload.) Run the io_context + object's event processing loop to execute one ready handler. +

+
count_type poll_one(
+    asio::error_code & ec);
+
+

+ The poll_one() function runs at most one handler that is + ready to run, without blocking. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/post.html b/include/asio/doc/asio/reference/io_context/post.html new file mode 100644 index 0000000..bef9ae7 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/post.html @@ -0,0 +1,98 @@ + + + +io_context::post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use post.) + Request the io_context + to invoke the given handler and return immediately. +

+
template<
+    typename LegacyCompletionHandler>
+DEDUCED post(
+    LegacyCompletionHandler && handler);
+
+

+ This function is used to ask the io_context + to execute the given handler, but without allowing the io_context + to call the handler from inside this function. +

+

+ The io_context + guarantees that the handler will only be called in a thread in which the + run(), run_one(), poll() or poll_one() + member functions is currently being invoked. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called. The io_context + will make a copy of the handler object as required. The function + signature of the handler must be: +

+
void handler();
+
+

+

+
+
+
+
+ + Remarks +
+

+ This function throws an exception only if: +

+
    +
  • + the handler's asio_handler_allocate function; or +
  • +
  • + the handler's copy constructor +
  • +
+

+ throws an exception. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/reset.html b/include/asio/doc/asio/reference/io_context/reset.html new file mode 100644 index 0000000..947ab1e --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/reset.html @@ -0,0 +1,59 @@ + + + +io_context::reset + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use restart().) + Reset the io_context + in preparation for a subsequent run() invocation. +

+
void reset();
+
+

+ This function must be called prior to any second or later set of invocations + of the run(), run_one(), poll() + or poll_one() functions when a previous invocation of these + functions returned due to the io_context + being stopped or running out of work. After a call to restart(), + the io_context + object's stopped() function will return false. +

+

+ This function must not be called while there are any unfinished calls to + the run(), run_one(), poll() or + poll_one() functions. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/restart.html b/include/asio/doc/asio/reference/io_context/restart.html new file mode 100644 index 0000000..aae590a --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/restart.html @@ -0,0 +1,58 @@ + + + +io_context::restart + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Restart the io_context + in preparation for a subsequent run() invocation. +

+
void restart();
+
+

+ This function must be called prior to any second or later set of invocations + of the run(), run_one(), poll() + or poll_one() functions when a previous invocation of these + functions returned due to the io_context + being stopped or running out of work. After a call to restart(), + the io_context + object's stopped() function will return false. +

+

+ This function must not be called while there are any unfinished calls to + the run(), run_one(), poll() or + poll_one() functions. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run.html b/include/asio/doc/asio/reference/io_context/run.html new file mode 100644 index 0000000..30b91f2 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run.html @@ -0,0 +1,53 @@ + + + +io_context::run + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the io_context + object's event processing loop. +

+
count_type run();
+  » more...
+
+

+ (Deprecated: Use non-error_code overload.) Run the io_context + object's event processing loop. +

+
count_type run(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run/overload1.html b/include/asio/doc/asio/reference/io_context/run/overload1.html new file mode 100644 index 0000000..be553eb --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run/overload1.html @@ -0,0 +1,88 @@ + + + +io_context::run (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Run the io_context + object's event processing loop. +

+
count_type run();
+
+

+ The run() function blocks until all work has finished and + there are no more handlers to be dispatched, or until the io_context + has been stopped. +

+

+ Multiple threads may call the run() function to set up a + pool of threads from which the io_context + may execute handlers. All threads that are waiting in the pool are equivalent + and the io_context + may choose any one of them to invoke a handler. +

+

+ A normal exit from the run() function implies that the + io_context + object is stopped (the stopped() function returns true). + Subsequent calls to run(), run_one(), poll() + or poll_one() will return immediately unless there is a + prior call to restart(). +

+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + Remarks +
+

+ Calling the run() function from a thread that is currently + calling one of run(), run_one(), run_for(), + run_until(), poll() or poll_one() + on the same io_context + object may introduce the potential for deadlock. It is the caller's reponsibility + to avoid this. +

+

+ The poll() function may also be used to dispatch ready handlers, + but without blocking. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run/overload2.html b/include/asio/doc/asio/reference/io_context/run/overload2.html new file mode 100644 index 0000000..d76d8a6 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run/overload2.html @@ -0,0 +1,102 @@ + + + +io_context::run (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use non-error_code overload.) Run the io_context + object's event processing loop. +

+
count_type run(
+    asio::error_code & ec);
+
+

+ The run() function blocks until all work has finished and + there are no more handlers to be dispatched, or until the io_context + has been stopped. +

+

+ Multiple threads may call the run() function to set up a + pool of threads from which the io_context + may execute handlers. All threads that are waiting in the pool are equivalent + and the io_context + may choose any one of them to invoke a handler. +

+

+ A normal exit from the run() function implies that the + io_context + object is stopped (the stopped() function returns true). + Subsequent calls to run(), run_one(), poll() + or poll_one() will return immediately unless there is a + prior call to restart(). +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + Remarks +
+

+ Calling the run() function from a thread that is currently + calling one of run(), run_one(), run_for(), + run_until(), poll() or poll_one() + on the same io_context + object may introduce the potential for deadlock. It is the caller's reponsibility + to avoid this. +

+

+ The poll() function may also be used to dispatch ready handlers, + but without blocking. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run_for.html b/include/asio/doc/asio/reference/io_context/run_for.html new file mode 100644 index 0000000..eba9eb6 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run_for.html @@ -0,0 +1,74 @@ + + + +io_context::run_for + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the io_context + object's event processing loop for a specified duration. +

+
template<
+    typename Rep,
+    typename Period>
+std::size_t run_for(
+    const chrono::duration< Rep, Period > & rel_time);
+
+

+ The run_for() function blocks until all work has finished + and there are no more handlers to be dispatched, until the io_context + has been stopped, or until the specified duration has elapsed. +

+
+ + Parameters +
+
+

+
+
rel_time
+

+ The duration for which the call may block. +

+
+
+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run_one.html b/include/asio/doc/asio/reference/io_context/run_one.html new file mode 100644 index 0000000..8c484bd --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run_one.html @@ -0,0 +1,53 @@ + + + +io_context::run_one + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the io_context + object's event processing loop to execute at most one handler. +

+
count_type run_one();
+  » more...
+
+

+ (Deprecated: Use non-error_code overlaod.) Run the io_context + object's event processing loop to execute at most one handler. +

+
count_type run_one(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run_one/overload1.html b/include/asio/doc/asio/reference/io_context/run_one/overload1.html new file mode 100644 index 0000000..4c02aae --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run_one/overload1.html @@ -0,0 +1,74 @@ + + + +io_context::run_one (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Run the io_context + object's event processing loop to execute at most one handler. +

+
count_type run_one();
+
+

+ The run_one() function blocks until one handler has been + dispatched, or until the io_context + has been stopped. +

+
+ + Return + Value +
+

+ The number of handlers that were executed. A zero return value implies + that the io_context + object is stopped (the stopped() function returns true). + Subsequent calls to run(), run_one(), poll() + or poll_one() will return immediately unless there is a + prior call to restart(). +

+
+ + Remarks +
+

+ Calling the run_one() function from a thread that is currently + calling one of run(), run_one(), run_for(), + run_until(), poll() or poll_one() + on the same io_context + object may introduce the potential for deadlock. It is the caller's reponsibility + to avoid this. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run_one/overload2.html b/include/asio/doc/asio/reference/io_context/run_one/overload2.html new file mode 100644 index 0000000..622cc25 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run_one/overload2.html @@ -0,0 +1,78 @@ + + + +io_context::run_one (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use non-error_code overlaod.) Run the io_context + object's event processing loop to execute at most one handler. +

+
count_type run_one(
+    asio::error_code & ec);
+
+

+ The run_one() function blocks until one handler has been + dispatched, or until the io_context + has been stopped. +

+
+ + Return + Value +
+

+ The number of handlers that were executed. A zero return value implies + that the io_context + object is stopped (the stopped() function returns true). + Subsequent calls to run(), run_one(), poll() + or poll_one() will return immediately unless there is a + prior call to restart(). +

+

+ The number of handlers that were executed. +

+
+ + Remarks +
+

+ Calling the run_one() function from a thread that is currently + calling one of run(), run_one(), run_for(), + run_until(), poll() or poll_one() + on the same io_context + object may introduce the potential for deadlock. It is the caller's reponsibility + to avoid this. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run_one_for.html b/include/asio/doc/asio/reference/io_context/run_one_for.html new file mode 100644 index 0000000..3780616 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run_one_for.html @@ -0,0 +1,73 @@ + + + +io_context::run_one_for + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the io_context object's + event processing loop for a specified duration to execute at most one handler. +

+
template<
+    typename Rep,
+    typename Period>
+std::size_t run_one_for(
+    const chrono::duration< Rep, Period > & rel_time);
+
+

+ The run_one_for() function blocks until one handler has been + dispatched, until the io_context + has been stopped, or until the specified duration has elapsed. +

+
+ + Parameters +
+
+

+
+
rel_time
+

+ The duration for which the call may block. +

+
+
+
+ + Return Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run_one_until.html b/include/asio/doc/asio/reference/io_context/run_one_until.html new file mode 100644 index 0000000..d54341c --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run_one_until.html @@ -0,0 +1,75 @@ + + + +io_context::run_one_until + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the + io_context + object's event processing loop until a specified time to execute at most + one handler. +

+
template<
+    typename Clock,
+    typename Duration>
+std::size_t run_one_until(
+    const chrono::time_point< Clock, Duration > & abs_time);
+
+

+ The run_one_until() function blocks until one handler has + been dispatched, until the io_context + has been stopped, or until the specified time has been reached. +

+
+ + Parameters +
+
+

+
+
abs_time
+

+ The time point until which the call may block. +

+
+
+
+ + Return Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/run_until.html b/include/asio/doc/asio/reference/io_context/run_until.html new file mode 100644 index 0000000..8044d22 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/run_until.html @@ -0,0 +1,74 @@ + + + +io_context::run_until + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Run the io_context + object's event processing loop until a specified time. +

+
template<
+    typename Clock,
+    typename Duration>
+std::size_t run_until(
+    const chrono::time_point< Clock, Duration > & abs_time);
+
+

+ The run_until() function blocks until all work has finished + and there are no more handlers to be dispatched, until the io_context + has been stopped, or until the specified time has been reached. +

+
+ + Parameters +
+
+

+
+
abs_time
+

+ The time point until which the call may block. +

+
+
+
+ + Return + Value +
+

+ The number of handlers that were executed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/shutdown.html b/include/asio/doc/asio/reference/io_context/shutdown.html new file mode 100644 index 0000000..d060560 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/shutdown.html @@ -0,0 +1,55 @@ + + + +io_context::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Shuts down all services + in the context. +

+
void shutdown();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order of the beginning of service object lifetime, + performs svc->shutdown(). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/stop.html b/include/asio/doc/asio/reference/io_context/stop.html new file mode 100644 index 0000000..eaa6270 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/stop.html @@ -0,0 +1,51 @@ + + + +io_context::stop + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Stop the io_context + object's event processing loop. +

+
void stop();
+
+

+ This function does not block, but instead simply signals the io_context + to stop. All invocations of its run() or run_one() + member functions should return as soon as possible. Subsequent calls to + run(), run_one(), poll() or poll_one() + will return immediately until restart() is called. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/stopped.html b/include/asio/doc/asio/reference/io_context/stopped.html new file mode 100644 index 0000000..660d099 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/stopped.html @@ -0,0 +1,62 @@ + + + +io_context::stopped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine whether the + io_context + object has been stopped. +

+
bool stopped() const;
+
+

+ This function is used to determine whether an io_context + object has been stopped, either through an explicit call to stop(), + or due to running out of work. When an io_context + object is stopped, calls to run(), run_one(), + poll() or poll_one() will return immediately + without invoking any handlers. +

+
+ + Return + Value +
+

+ true if the io_context + object is stopped, otherwise false. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/use_service.html b/include/asio/doc/asio/reference/io_context/use_service.html new file mode 100644 index 0000000..6935ac0 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/use_service.html @@ -0,0 +1,55 @@ + + + +io_context::use_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+  » more...
+
+

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/use_service/overload1.html b/include/asio/doc/asio/reference/io_context/use_service/overload1.html new file mode 100644 index 0000000..6564cf0 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/use_service/overload1.html @@ -0,0 +1,53 @@ + + + +io_context::use_service (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/use_service/overload2.html b/include/asio/doc/asio/reference/io_context/use_service/overload2.html new file mode 100644 index 0000000..50c0d22 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/use_service/overload2.html @@ -0,0 +1,88 @@ + + + +io_context::use_service (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+
+

+ This function is used to locate a service object that corresponds to + the given service type. If there is no existing implementation of the + service, then the execution_context + will create a new instance of the service. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ The service interface implementing the specified service type. Ownership + of the service interface is not transferred to the caller. +

+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context/wrap.html b/include/asio/doc/asio/reference/io_context/wrap.html new file mode 100644 index 0000000..dda6e51 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context/wrap.html @@ -0,0 +1,101 @@ + + + +io_context::wrap + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use bind_executor.) + Create a new handler that automatically dispatches the wrapped handler + on the io_context. +

+
template<
+    typename Handler>
+unspecified wrap(
+    Handler handler);
+
+

+ This function is used to create a new handler function object that, when + invoked, will automatically pass the wrapped handler to the io_context + object's dispatch function. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be wrapped. The io_context + will make a copy of the handler object as required. The function + signature of the handler must be: +

+
void handler(A1 a1, ... An an);
+
+

+

+
+
+
+
+ + Return + Value +
+

+ A function object that, when invoked, passes the wrapped handler to the + io_context + object's dispatch function. Given a function object with the signature: +

+
R f(A1 a1, ... An an);
+
+

+ If this function object is passed to the wrap function like so: +

+
io_context.wrap(f);
+
+

+ then the return value is a function object with the signature +

+
void g(A1 a1, ... An an);
+
+

+ that, when invoked, executes code equivalent to: +

+
io_context.dispatch(boost::bind(f, a1, ... an));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type.html b/include/asio/doc/asio/reference/io_context__basic_executor_type.html new file mode 100644 index 0000000..b26b6e1 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type.html @@ -0,0 +1,308 @@ + + + +io_context::basic_executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Executor implementation type used to submit functions to an io_context. +

+
template<
+    typename Allocator,
+    unsigned int Bits>
+class basic_executor_type
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type [constructor] +

+
+

+ Copy constructor.
—
Move constructor. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the io_context to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the io_context to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the io_context that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the io_context that it has some outstanding work to do. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator. +

+
+

+ post +

+
+

+ Request the io_context to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property.
—
+ Query the current value of the allocator property. +

+
+

+ query [static] +

+
+

+ Query the current value of the mapping property.
—
+ Query the current value of the outstanding_work property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.never property.
+ —
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the relationship.continuation + property.
—
Obtain an executor with the outstanding_work.tracked + property.
—
Obtain an executor with the outstanding_work.untracked + property.
—
Obtain an executor with the specified allocator + property.
—
Obtain an executor with the default allocator + property. +

+
+

+ running_in_this_thread +

+
+

+ Determine whether the io_context is running in the current thread. +

+
+

+ ~basic_executor_type [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/_basic_executor_type.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/_basic_executor_type.html new file mode 100644 index 0000000..ac5882e --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/_basic_executor_type.html @@ -0,0 +1,43 @@ + + + +io_context::basic_executor_type::~basic_executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~basic_executor_type();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type.html new file mode 100644 index 0000000..81879f2 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type.html @@ -0,0 +1,53 @@ + + + +io_context::basic_executor_type::basic_executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Copy + constructor. +

+
basic_executor_type(
+    const basic_executor_type & other);
+  » more...
+
+

+ Move constructor. +

+
basic_executor_type(
+    basic_executor_type && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type/overload1.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type/overload1.html new file mode 100644 index 0000000..bea6f77 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type/overload1.html @@ -0,0 +1,44 @@ + + + +io_context::basic_executor_type::basic_executor_type (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_executor_type(
+    const basic_executor_type & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type/overload2.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type/overload2.html new file mode 100644 index 0000000..508d7df --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/basic_executor_type/overload2.html @@ -0,0 +1,44 @@ + + + +io_context::basic_executor_type::basic_executor_type (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
basic_executor_type(
+    basic_executor_type && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/context.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/context.html new file mode 100644 index 0000000..cf0d24b --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/context.html @@ -0,0 +1,44 @@ + + + +io_context::basic_executor_type::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the underlying execution context. +

+
io_context & context() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/defer.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/defer.html new file mode 100644 index 0000000..6290471 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/defer.html @@ -0,0 +1,87 @@ + + + +io_context::basic_executor_type::defer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the io_context + to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void defer(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the io_context + to execute the given function object. The function object will never be + executed inside defer(). Instead, it will be scheduled to + run on the io_context. +

+

+ If the current thread belongs to the io_context, + defer() will delay scheduling the function object until the + current thread returns control to the pool. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/dispatch.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/dispatch.html new file mode 100644 index 0000000..d1d8bbf --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/dispatch.html @@ -0,0 +1,83 @@ + + + +io_context::basic_executor_type::dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the io_context + to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void dispatch(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the io_context + to execute the given function object. If the current thread is running + the io_context, + dispatch() executes the function before returning. Otherwise, + the function will be scheduled to run on the io_context. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/execute.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/execute.html new file mode 100644 index 0000000..902cd33 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/execute.html @@ -0,0 +1,57 @@ + + + +io_context::basic_executor_type::execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Execution + function. +

+
template<
+    typename Function>
+void execute(
+    Function && f) const;
+
+

+ Do not call this function directly. It is intended for use with the execution::execute + customisation point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+execution::execute(ex, my_function_object);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/on_work_finished.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/on_work_finished.html new file mode 100644 index 0000000..66d2bc3 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/on_work_finished.html @@ -0,0 +1,52 @@ + + + +io_context::basic_executor_type::on_work_finished + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the io_context + that some work is no longer outstanding. +

+
void on_work_finished() const;
+
+

+ This function is used to inform the io_context + that some work has finished. Once the count of unfinished work reaches + zero, the io_context + is stopped and the run() and run_one() functions + may exit. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/on_work_started.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/on_work_started.html new file mode 100644 index 0000000..fbaf3a6 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/on_work_started.html @@ -0,0 +1,50 @@ + + + +io_context::basic_executor_type::on_work_started + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the io_context + that it has some outstanding work to do. +

+
void on_work_started() const;
+
+

+ This function is used to inform the io_context + that some work has begun. This ensures that the io_context's run() + and run_one() functions do not exit while the work is underway. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_.html new file mode 100644 index 0000000..ed294d2 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_.html @@ -0,0 +1,53 @@ + + + +io_context::basic_executor_type::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment + operator. +

+
basic_executor_type & operator=(
+    const basic_executor_type & other);
+  » more...
+
+

+ Move assignment operator. +

+
basic_executor_type & operator=(
+    basic_executor_type && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_/overload1.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_/overload1.html new file mode 100644 index 0000000..ba5f2c8 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +io_context::basic_executor_type::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator. +

+
basic_executor_type & operator=(
+    const basic_executor_type & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_/overload2.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_/overload2.html new file mode 100644 index 0000000..ac8fa3b --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq_/overload2.html @@ -0,0 +1,44 @@ + + + +io_context::basic_executor_type::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move assignment operator. +

+
basic_executor_type & operator=(
+    basic_executor_type && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq__eq_.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq__eq_.html new file mode 100644 index 0000000..fdf12ef --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_eq__eq_.html @@ -0,0 +1,59 @@ + + + +io_context::basic_executor_type::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two executors for equality. +

+
friend bool operator==(
+    const basic_executor_type & a,
+    const basic_executor_type & b);
+
+

+ Two executors are equal if they refer to the same underlying io_context. +

+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_not__eq_.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_not__eq_.html new file mode 100644 index 0000000..fe01251 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/operator_not__eq_.html @@ -0,0 +1,59 @@ + + + +io_context::basic_executor_type::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two executors for inequality. +

+
friend bool operator!=(
+    const basic_executor_type & a,
+    const basic_executor_type & b);
+
+

+ Two executors are equal if they refer to the same underlying io_context. +

+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/post.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/post.html new file mode 100644 index 0000000..5ff4b49 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/post.html @@ -0,0 +1,82 @@ + + + +io_context::basic_executor_type::post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the io_context + to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void post(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the io_context + to execute the given function object. The function object will never be + executed inside post(). Instead, it will be scheduled to run + on the io_context. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query.html new file mode 100644 index 0000000..2b02a49 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query.html @@ -0,0 +1,73 @@ + + + +io_context::basic_executor_type::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Query + the current value of the context property. +

+
io_context & query(
+    execution::context_t ) const;
+  » more...
+
+

+ Query the current value of the blocking property. +

+
constexpr execution::blocking_t query(
+    execution::blocking_t ) const;
+  » more...
+
+

+ Query the current value of the relationship property. +

+
constexpr execution::relationship_t query(
+    execution::relationship_t ) const;
+  » more...
+
+

+ Query the current value of the allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr Allocator query(
+    execution::allocator_t< OtherAllocator > ) const;
+  » more...
+
+constexpr Allocator query(
+    execution::allocator_t< void > ) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload1.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload1.html new file mode 100644 index 0000000..15cf9f0 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload1.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::query (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the context property. +

+
io_context & query(
+    execution::context_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+asio::io_context& ctx = asio::query(
+    ex, asio::execution::context);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload2.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload2.html new file mode 100644 index 0000000..a00b3e9 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload2.html @@ -0,0 +1,57 @@ + + + +io_context::basic_executor_type::query (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the blocking property. +

+
constexpr execution::blocking_t query(
+    execution::blocking_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+if (asio::query(ex, asio::execution::blocking)
+      == asio::execution::blocking.always)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload3.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload3.html new file mode 100644 index 0000000..a23178d --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload3.html @@ -0,0 +1,57 @@ + + + +io_context::basic_executor_type::query (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the relationship property. +

+
constexpr execution::relationship_t query(
+    execution::relationship_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+if (asio::query(ex, asio::execution::relationship)
+      == asio::execution::relationship.continuation)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload4.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload4.html new file mode 100644 index 0000000..437da9d --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload4.html @@ -0,0 +1,58 @@ + + + +io_context::basic_executor_type::query (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr Allocator query(
+    execution::allocator_t< OtherAllocator > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+auto alloc = asio::query(ex,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload5.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload5.html new file mode 100644 index 0000000..76d8b86 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query/overload5.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::query (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the allocator property. +

+
constexpr Allocator query(
+    execution::allocator_t< void > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+auto alloc = asio::query(ex,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static.html new file mode 100644 index 0000000..8bb9072 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static.html @@ -0,0 +1,53 @@ + + + +io_context::basic_executor_type::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Query + the current value of the mapping property. +

+
static constexpr execution::mapping_t query(
+    execution::mapping_t );
+  » more...
+
+

+ Query the current value of the outstanding_work property. +

+
static constexpr execution::outstanding_work_t query(
+    execution::outstanding_work_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static/overload1.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static/overload1.html new file mode 100644 index 0000000..d422c94 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static/overload1.html @@ -0,0 +1,57 @@ + + + +io_context::basic_executor_type::query (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the mapping property. +

+
static constexpr execution::mapping_t query(
+    execution::mapping_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+if (asio::query(ex, asio::execution::mapping)
+      == asio::execution::mapping.thread)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static/overload2.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static/overload2.html new file mode 100644 index 0000000..ccecbd5 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/query__static/overload2.html @@ -0,0 +1,57 @@ + + + +io_context::basic_executor_type::query (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the outstanding_work property. +

+
static constexpr execution::outstanding_work_t query(
+    execution::outstanding_work_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_io_context.get_executor();
+if (asio::query(ex, asio::execution::outstanding_work)
+      == asio::execution::outstanding_work.tracked)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require.html new file mode 100644 index 0000000..d42216c --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require.html @@ -0,0 +1,97 @@ + + + +io_context::basic_executor_type::require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an executor with the blocking.possibly property. +

+
constexpr basic_executor_type require(
+    execution::blocking_t::possibly_t ) const;
+  » more...
+
+

+ Obtain an executor with the blocking.never property. +

+
constexpr basic_executor_type require(
+    execution::blocking_t::never_t ) const;
+  » more...
+
+

+ Obtain an executor with the relationship.fork property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::fork_t ) const;
+  » more...
+
+

+ Obtain an executor with the relationship.continuation property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::continuation_t ) const;
+  » more...
+
+

+ Obtain an executor with the outstanding_work.tracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::tracked_t ) const;
+  » more...
+
+

+ Obtain an executor with the outstanding_work.untracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::untracked_t ) const;
+  » more...
+
+

+ Obtain an executor with the specified allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr basic_executor_type< OtherAllocator, Bits > require(
+    execution::allocator_t< OtherAllocator > a) const;
+  » more...
+
+

+ Obtain an executor with the default allocator property. +

+
constexpr basic_executor_type< std::allocator< void >, Bits > require(
+    execution::allocator_t< void > ) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload1.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload1.html new file mode 100644 index 0000000..369d56c --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload1.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::require (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.possibly property. +

+
constexpr basic_executor_type require(
+    execution::blocking_t::possibly_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.possibly);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload2.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload2.html new file mode 100644 index 0000000..134c4dd --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload2.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::require (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.never property. +

+
constexpr basic_executor_type require(
+    execution::blocking_t::never_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.never);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload3.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload3.html new file mode 100644 index 0000000..e4addb0 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload3.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::require (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the relationship.fork property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::fork_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::relationship.fork);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload4.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload4.html new file mode 100644 index 0000000..1dafd1e --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload4.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::require (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the relationship.continuation property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::continuation_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::relationship.continuation);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload5.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload5.html new file mode 100644 index 0000000..2892f65 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload5.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::require (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the outstanding_work.tracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::tracked_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::outstanding_work.tracked);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload6.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload6.html new file mode 100644 index 0000000..878de27 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload6.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::require (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the outstanding_work.untracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::untracked_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::outstanding_work.untracked);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload7.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload7.html new file mode 100644 index 0000000..4bf0bce --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload7.html @@ -0,0 +1,58 @@ + + + +io_context::basic_executor_type::require (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the specified allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr basic_executor_type< OtherAllocator, Bits > require(
+    execution::allocator_t< OtherAllocator > a) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::allocator(my_allocator));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload8.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload8.html new file mode 100644 index 0000000..0d85b13 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/require/overload8.html @@ -0,0 +1,56 @@ + + + +io_context::basic_executor_type::require (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the default allocator property. +

+
constexpr basic_executor_type< std::allocator< void >, Bits > require(
+    execution::allocator_t< void > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_io_context.get_executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__basic_executor_type/running_in_this_thread.html b/include/asio/doc/asio/reference/io_context__basic_executor_type/running_in_this_thread.html new file mode 100644 index 0000000..ca06f65 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__basic_executor_type/running_in_this_thread.html @@ -0,0 +1,54 @@ + + + +io_context::basic_executor_type::running_in_this_thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the io_context + is running in the current thread. +

+
bool running_in_this_thread() const;
+
+
+ + Return + Value +
+

+ true if the current thread is running the io_context. + Otherwise returns false. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__service.html b/include/asio/doc/asio/reference/io_context__service.html new file mode 100644 index 0000000..9143156 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__service.html @@ -0,0 +1,137 @@ + + + +io_context::service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Base class for all io_context + services. +

+
class service
+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ get_io_context +

+
+

+ Get the io_context object that owns the service. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ service [constructor] +

+
+

+ Constructor. +

+
+

+ ~service [destructor] +

+
+

+ Destructor. +

+
+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__service/_service.html b/include/asio/doc/asio/reference/io_context__service/_service.html new file mode 100644 index 0000000..95e7b19 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__service/_service.html @@ -0,0 +1,43 @@ + + + +io_context::service::~service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
virtual ~service();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__service/get_io_context.html b/include/asio/doc/asio/reference/io_context__service/get_io_context.html new file mode 100644 index 0000000..ce01554 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__service/get_io_context.html @@ -0,0 +1,45 @@ + + + +io_context::service::get_io_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the io_context + object that owns the service. +

+
asio::io_context & get_io_context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__service/service.html b/include/asio/doc/asio/reference/io_context__service/service.html new file mode 100644 index 0000000..d2a81e6 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__service/service.html @@ -0,0 +1,58 @@ + + + +io_context::service::service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
service(
+    asio::io_context & owner);
+
+
+ + Parameters +
+
+

+
+
owner
+

+ The io_context + object that owns the service. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand.html b/include/asio/doc/asio/reference/io_context__strand.html new file mode 100644 index 0000000..e6d4914 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand.html @@ -0,0 +1,338 @@ + + + +io_context::strand + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides serialised handler execution. +

+
class strand
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the strand to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the strand to invoke the given function object.
+ —
(Deprecated: Use asio::dispatch().) Request the strand to + invoke the given handler. +

+
+

+ on_work_finished +

+
+

+ Inform the strand that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the strand that it has some outstanding work to do. +

+
+

+ post +

+
+

+ Request the strand to invoke the given function object.
+ —
(Deprecated: Use asio::post().) Request the strand to invoke + the given handler and return immediately. +

+
+

+ running_in_this_thread +

+
+

+ Determine whether the strand is running in the current thread. +

+
+

+ strand [constructor] +

+
+

+ Constructor. +

+
+

+ wrap +

+
+

+ (Deprecated: Use asio::bind_executor().) Create a new handler that + automatically dispatches the wrapped handler on the strand. +

+
+

+ ~strand [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two strands for inequality. +

+
+

+ operator== +

+
+

+ Compare two strands for equality. +

+
+

+ The io_context::strand + class provides the ability to post and dispatch handlers with the guarantee + that none of those handlers will execute concurrently. +

+
+ + Order + of handler invocation +
+

+ Given: +

+
    +
  • + a strand object s +
  • +
  • + an object a meeting completion handler requirements +
  • +
  • + an object a1 which is an arbitrary copy of a + made by the implementation +
  • +
  • + an object b meeting completion handler requirements +
  • +
  • + an object b1 which is an arbitrary copy of b + made by the implementation +
  • +
+

+ if any of the following conditions are true: +

+
    +
  • + s.post(a) happens-before s.post(b) +
  • +
  • + s.post(a) happens-before s.dispatch(b), where + the latter is performed outside the strand +
  • +
  • + s.dispatch(a) happens-before s.post(b), where + the former is performed outside the strand +
  • +
  • + s.dispatch(a) happens-before s.dispatch(b), + where both are performed outside the strand +
  • +
+

+ then asio_handler_invoke(a1, &a1) happens-before asio_handler_invoke(b1, + &b1). +

+

+ Note that in the following case: +

+
async_op_1(..., s.wrap(a));
+async_op_2(..., s.wrap(b));
+
+

+ the completion of the first async operation will perform s.dispatch(a), + and the second will perform s.dispatch(b), but the order in + which those are performed is unspecified. That is, you cannot state whether + one happens-before the other. Therefore none of the above conditions are + met and no ordering guarantee is made. +

+
+ + Remarks +
+

+ The implementation makes no guarantee that handlers posted or dispatched + through different strand objects will be invoked concurrently. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/io_context_strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/_strand.html b/include/asio/doc/asio/reference/io_context__strand/_strand.html new file mode 100644 index 0000000..9532b36 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/_strand.html @@ -0,0 +1,50 @@ + + + +io_context::strand::~strand + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~strand();
+
+

+ Destroys a strand. +

+

+ Handlers posted through the strand that have not yet been invoked will + still be dispatched in a way that meets the guarantee of non-concurrency. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/context.html b/include/asio/doc/asio/reference/io_context__strand/context.html new file mode 100644 index 0000000..9cb50cb --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/context.html @@ -0,0 +1,44 @@ + + + +io_context::strand::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the underlying execution context. +

+
asio::io_context & context() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/defer.html b/include/asio/doc/asio/reference/io_context__strand/defer.html new file mode 100644 index 0000000..15452cf --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/defer.html @@ -0,0 +1,80 @@ + + + +io_context::strand::defer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the + strand to invoke the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void defer(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object will never be executed inside this function. + Instead, it will be scheduled to run by the underlying io_context. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/dispatch.html b/include/asio/doc/asio/reference/io_context__strand/dispatch.html new file mode 100644 index 0000000..a22baf9 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/dispatch.html @@ -0,0 +1,60 @@ + + + +io_context::strand::dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the strand to invoke the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void dispatch(
+    Function && f,
+    const Allocator & a) const;
+  » more...
+
+

+ (Deprecated: Use dispatch.) + Request the strand to invoke the given handler. +

+
template<
+    typename LegacyCompletionHandler>
+DEDUCED dispatch(
+    LegacyCompletionHandler && handler);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/dispatch/overload1.html b/include/asio/doc/asio/reference/io_context__strand/dispatch/overload1.html new file mode 100644 index 0000000..9550269 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/dispatch/overload1.html @@ -0,0 +1,82 @@ + + + +io_context::strand::dispatch (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Request the strand to invoke the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void dispatch(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the strand to execute the given function + object on its underlying io_context. + The function object will be executed inside this function if the strand + is not otherwise busy and if the underlying io_context's executor's + dispatch() function is also able to execute the function + before returning. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy + of the handler object as required. The function signature of the + function object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/dispatch/overload2.html b/include/asio/doc/asio/reference/io_context__strand/dispatch/overload2.html new file mode 100644 index 0000000..cbdcee2 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/dispatch/overload2.html @@ -0,0 +1,85 @@ + + + +io_context::strand::dispatch (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use dispatch.) + Request the strand to invoke the given handler. +

+
template<
+    typename LegacyCompletionHandler>
+DEDUCED dispatch(
+    LegacyCompletionHandler && handler);
+
+

+ This function is used to ask the strand to execute the given handler. +

+

+ The strand object guarantees that handlers posted or dispatched through + the strand will not be executed concurrently. The handler may be executed + inside this function if the guarantee can be met. If this function is + called from within a handler that was posted or dispatched through the + same strand, then the new handler will be executed immediately. +

+

+ The strand's guarantee is in addition to the guarantee provided by the + underlying io_context. + The io_context + guarantees that the handler will only be called in a thread in which + the io_context's run member function is currently being invoked. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called. The strand will make a copy of the handler + object as required. The function signature of the handler must + be: +

+
void handler();
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/on_work_finished.html b/include/asio/doc/asio/reference/io_context__strand/on_work_finished.html new file mode 100644 index 0000000..51224f0 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/on_work_finished.html @@ -0,0 +1,47 @@ + + + +io_context::strand::on_work_finished + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the strand that some work is no longer outstanding. +

+
void on_work_finished() const;
+
+

+ The strand delegates this call to its underlying io_context. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/on_work_started.html b/include/asio/doc/asio/reference/io_context__strand/on_work_started.html new file mode 100644 index 0000000..66c04c1 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/on_work_started.html @@ -0,0 +1,47 @@ + + + +io_context::strand::on_work_started + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the strand that it has some outstanding work to do. +

+
void on_work_started() const;
+
+

+ The strand delegates this call to its underlying io_context. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/operator_eq__eq_.html b/include/asio/doc/asio/reference/io_context__strand/operator_eq__eq_.html new file mode 100644 index 0000000..e9b0be4 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/operator_eq__eq_.html @@ -0,0 +1,60 @@ + + + +io_context::strand::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two strands for equality. +

+
friend bool operator==(
+    const strand & a,
+    const strand & b);
+
+

+ Two strands are equal if they refer to the same ordered, non-concurrent + state. +

+
+ + Requirements +
+

+ Header: asio/io_context_strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/operator_not__eq_.html b/include/asio/doc/asio/reference/io_context__strand/operator_not__eq_.html new file mode 100644 index 0000000..3321b96 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/operator_not__eq_.html @@ -0,0 +1,60 @@ + + + +io_context::strand::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two strands for inequality. +

+
friend bool operator!=(
+    const strand & a,
+    const strand & b);
+
+

+ Two strands are equal if they refer to the same ordered, non-concurrent + state. +

+
+ + Requirements +
+

+ Header: asio/io_context_strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/post.html b/include/asio/doc/asio/reference/io_context__strand/post.html new file mode 100644 index 0000000..f012ca3 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/post.html @@ -0,0 +1,60 @@ + + + +io_context::strand::post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the + strand to invoke the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void post(
+    Function && f,
+    const Allocator & a) const;
+  » more...
+
+

+ (Deprecated: Use post.) + Request the strand to invoke the given handler and return immediately. +

+
template<
+    typename LegacyCompletionHandler>
+DEDUCED post(
+    LegacyCompletionHandler && handler);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/post/overload1.html b/include/asio/doc/asio/reference/io_context__strand/post/overload1.html new file mode 100644 index 0000000..ceb3c0d --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/post/overload1.html @@ -0,0 +1,79 @@ + + + +io_context::strand::post (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Request the strand to invoke the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void post(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object will never be executed inside this function. + Instead, it will be scheduled to run by the underlying io_context. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy + of the handler object as required. The function signature of the + function object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/post/overload2.html b/include/asio/doc/asio/reference/io_context__strand/post/overload2.html new file mode 100644 index 0000000..869fbca --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/post/overload2.html @@ -0,0 +1,81 @@ + + + +io_context::strand::post (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use post.) + Request the strand to invoke the given handler and return immediately. +

+
template<
+    typename LegacyCompletionHandler>
+DEDUCED post(
+    LegacyCompletionHandler && handler);
+
+

+ This function is used to ask the strand to execute the given handler, + but without allowing the strand to call the handler from inside this + function. +

+

+ The strand object guarantees that handlers posted or dispatched through + the strand will not be executed concurrently. The strand's guarantee + is in addition to the guarantee provided by the underlying io_context. + The io_context + guarantees that the handler will only be called in a thread in which + the io_context's run member function is currently being invoked. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called. The strand will make a copy of the handler + object as required. The function signature of the handler must + be: +

+
void handler();
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/running_in_this_thread.html b/include/asio/doc/asio/reference/io_context__strand/running_in_this_thread.html new file mode 100644 index 0000000..a825cf3 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/running_in_this_thread.html @@ -0,0 +1,54 @@ + + + +io_context::strand::running_in_this_thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the strand is running in the current thread. +

+
bool running_in_this_thread() const;
+
+
+ + Return + Value +
+

+ true if the current thread is executing a handler that was + submitted to the strand using post(), dispatch() + or wrap(). Otherwise returns false. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/strand.html b/include/asio/doc/asio/reference/io_context__strand/strand.html new file mode 100644 index 0000000..fab521b --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/strand.html @@ -0,0 +1,62 @@ + + + +io_context::strand::strand + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
strand(
+    asio::io_context & io_context);
+
+

+ Constructs the strand. +

+
+ + Parameters +
+
+

+
+
io_context
+

+ The io_context + object that the strand will use to dispatch handlers that are ready + to be run. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__strand/wrap.html b/include/asio/doc/asio/reference/io_context__strand/wrap.html new file mode 100644 index 0000000..eeaaafa --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__strand/wrap.html @@ -0,0 +1,99 @@ + + + +io_context::strand::wrap + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use bind_executor.) + Create a new handler that automatically dispatches the wrapped handler + on the strand. +

+
template<
+    typename Handler>
+unspecified wrap(
+    Handler handler);
+
+

+ This function is used to create a new handler function object that, when + invoked, will automatically pass the wrapped handler to the strand's dispatch + function. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be wrapped. The strand will make a copy of the handler + object as required. The function signature of the handler must be: +

+
void handler(A1 a1, ... An an);
+
+

+

+
+
+
+
+ + Return Value +
+

+ A function object that, when invoked, passes the wrapped handler to the + strand's dispatch function. Given a function object with the signature: +

+
R f(A1 a1, ... An an);
+
+

+ If this function object is passed to the wrap function like so: +

+
strand.wrap(f);
+
+

+ then the return value is a function object with the signature +

+
void g(A1 a1, ... An an);
+
+

+ that, when invoked, executes code equivalent to: +

+
strand.dispatch(boost::bind(f, a1, ... an));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__work.html b/include/asio/doc/asio/reference/io_context__work.html new file mode 100644 index 0000000..b1cb83f --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__work.html @@ -0,0 +1,126 @@ + + + +io_context::work + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use executor_work_guard.) + Class to inform the io_context + when it has work to do. +

+
class work
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ get_io_context +

+
+

+ Get the io_context associated with the work. +

+
+

+ work [constructor] +

+
+

+ Constructor notifies the io_context that work is starting.
+ —
Copy constructor notifies the io_context that work is starting. +

+
+

+ ~work [destructor] +

+
+

+ Destructor notifies the io_context that the work is complete. +

+
+

+ The work class is used to inform the io_context + when work starts and finishes. This ensures that the io_context + object's run() function will not exit while work is underway, + and that it does exit when there is no unfinished work remaining. +

+

+ The work class is copy-constructible so that it may be used as a data member + in a handler class. It is not assignable. +

+
+ + Requirements +
+

+ Header: asio/io_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__work/_work.html b/include/asio/doc/asio/reference/io_context__work/_work.html new file mode 100644 index 0000000..ae3a1fb --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__work/_work.html @@ -0,0 +1,51 @@ + + + +io_context::work::~work + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor notifies + the io_context + that the work is complete. +

+
~work();
+
+

+ The destructor is used to inform the io_context + that some work has finished. Once the count of unfinished work reaches + zero, the io_context + object's run() function is permitted to exit. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__work/get_io_context.html b/include/asio/doc/asio/reference/io_context__work/get_io_context.html new file mode 100644 index 0000000..9779140 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__work/get_io_context.html @@ -0,0 +1,45 @@ + + + +io_context::work::get_io_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the io_context + associated with the work. +

+
asio::io_context & get_io_context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__work/work.html b/include/asio/doc/asio/reference/io_context__work/work.html new file mode 100644 index 0000000..01043a4 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__work/work.html @@ -0,0 +1,55 @@ + + + +io_context::work::work + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor notifies + the io_context + that work is starting. +

+
explicit work(
+    asio::io_context & io_context);
+  » more...
+
+

+ Copy constructor notifies the io_context + that work is starting. +

+
work(
+    const work & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__work/work/overload1.html b/include/asio/doc/asio/reference/io_context__work/work/overload1.html new file mode 100644 index 0000000..a9da0bf --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__work/work/overload1.html @@ -0,0 +1,51 @@ + + + +io_context::work::work (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor notifies the io_context + that work is starting. +

+
work(
+    asio::io_context & io_context);
+
+

+ The constructor is used to inform the io_context + that some work has begun. This ensures that the io_context + object's run() function will not exit while the work is + underway. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_context__work/work/overload2.html b/include/asio/doc/asio/reference/io_context__work/work/overload2.html new file mode 100644 index 0000000..14b87a7 --- /dev/null +++ b/include/asio/doc/asio/reference/io_context__work/work/overload2.html @@ -0,0 +1,51 @@ + + + +io_context::work::work (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor notifies the io_context + that work is starting. +

+
work(
+    const work & other);
+
+

+ The constructor is used to inform the io_context + that some work has begun. This ensures that the io_context + object's run() function will not exit while the work is + underway. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/io_service.html b/include/asio/doc/asio/reference/io_service.html new file mode 100644 index 0000000..b9e8ed0 --- /dev/null +++ b/include/asio/doc/asio/reference/io_service.html @@ -0,0 +1,750 @@ + + + +io_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for backwards compatibility. +

+
typedef io_context io_service;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type +

+
+

+ Executor implementation type used to submit functions to an io_context. +

+
+

+ service +

+
+

+ Base class for all io_context services. +

+
+

+ strand +

+
+

+ Provides serialised handler execution. +

+
+

+ work +

+
+

+ (Deprecated: Use executor_work_guard.) Class to inform the io_context + when it has work to do. +

+
+

+ count_type +

+
+

+ The type used to count the number of handlers executed by the context. +

+
+

+ executor_type +

+
+

+ Executor used to submit functions to an io_context. +

+
+

+ fork_event +

+
+

+ Fork-related event notifications. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dispatch +

+
+

+ (Deprecated: Use asio::dispatch().) Request the io_context to invoke + the given handler. +

+
+

+ get_executor +

+
+

+ Obtains the executor associated with the io_context. +

+
+

+ io_context [constructor] +

+
+

+ Constructor. +

+
+

+ notify_fork +

+
+

+ Notify the execution_context of a fork-related event. +

+
+

+ poll +

+
+

+ Run the io_context object's event processing loop to execute ready + handlers.
—
(Deprecated: Use non-error_code overload.) + Run the io_context object's event processing loop to execute ready + handlers. +

+
+

+ poll_one +

+
+

+ Run the io_context object's event processing loop to execute one + ready handler.
—
(Deprecated: Use non-error_code overload.) + Run the io_context object's event processing loop to execute one + ready handler. +

+
+

+ post +

+
+

+ (Deprecated: Use asio::post().) Request the io_context to invoke + the given handler and return immediately. +

+
+

+ reset +

+
+

+ (Deprecated: Use restart().) Reset the io_context in preparation + for a subsequent run() invocation. +

+
+

+ restart +

+
+

+ Restart the io_context in preparation for a subsequent run() invocation. +

+
+

+ run +

+
+

+ Run the io_context object's event processing loop.
—
+ (Deprecated: Use non-error_code overload.) Run the io_context object's + event processing loop. +

+
+

+ run_for +

+
+

+ Run the io_context object's event processing loop for a specified + duration. +

+
+

+ run_one +

+
+

+ Run the io_context object's event processing loop to execute at + most one handler.
—
(Deprecated: Use non-error_code + overlaod.) Run the io_context object's event processing loop to + execute at most one handler. +

+
+

+ run_one_for +

+
+

+ Run the io_context object's event processing loop for a specified + duration to execute at most one handler. +

+
+

+ run_one_until +

+
+

+ Run the io_context object's event processing loop until a specified + time to execute at most one handler. +

+
+

+ run_until +

+
+

+ Run the io_context object's event processing loop until a specified + time. +

+
+

+ stop +

+
+

+ Stop the io_context object's event processing loop. +

+
+

+ stopped +

+
+

+ Determine whether the io_context object has been stopped. +

+
+

+ wrap +

+
+

+ (Deprecated: Use asio::bind_executor().) Create a new handler that + automatically dispatches the wrapped handler on the io_context. +

+
+

+ ~io_context [destructor] +

+
+

+ Destructor. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ destroy +

+
+

+ Destroys all services in the context. +

+
+

+ shutdown +

+
+

+ Shuts down all services in the context. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add_service +

+
+

+ (Deprecated: Use make_service().) Add a service object to the execution_context. +

+
+

+ has_service +

+
+

+ Determine if an execution_context contains a specified service + type. +

+
+

+ make_service +

+
+

+ Creates a service object and adds it to the execution_context. +

+
+

+ use_service +

+
+

+
—
Obtain the service object corresponding to the given + type. +

+
+

+ The io_context + class provides the core I/O functionality for users of the asynchronous I/O + objects, including: +

+
    +
  • + asio::ip::tcp::socket +
  • +
  • + asio::ip::tcp::acceptor +
  • +
  • + asio::ip::udp::socket +
  • +
  • + deadline_timer. +
  • +
+

+ The io_context + class also includes facilities intended for developers of custom asynchronous + services. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe, with the + specific exceptions of the restart() and notify_fork() + functions. Calling restart() while there are unfinished run(), + run_one(), run_for(), run_until(), + poll() or poll_one() calls results in undefined + behaviour. The notify_fork() function should not be called while + any io_context + function, or any function on an I/O object that is associated with the io_context, is being + called in another thread. +

+
+ + Synchronous + and asynchronous operations +
+

+ Synchronous operations on I/O objects implicitly run the io_context + object for an individual operation. The io_context + functions run(), run_one(), run_for(), + run_until(), poll() or poll_one() + must be called for the io_context + to perform asynchronous operations on behalf of a C++ program. Notification + that an asynchronous operation has completed is delivered by invocation of + the associated handler. Handlers are invoked only by a thread that is currently + calling any overload of run(), run_one(), run_for(), + run_until(), poll() or poll_one() + for the io_context. +

+
+ + Effect + of exceptions thrown from handlers +
+

+ If an exception is thrown from a handler, the exception is allowed to propagate + through the throwing thread's invocation of run(), run_one(), + run_for(), run_until(), poll() or + poll_one(). No other threads that are calling any of these functions + are affected. It is then the responsibility of the application to catch the + exception. +

+

+ After the exception has been caught, the run(), run_one(), + run_for(), run_until(), poll() or + poll_one() call may be restarted without + the need for an intervening call to restart(). This allows the + thread to rejoin the io_context + object's thread pool without impacting any other threads in the pool. +

+

+ For example: +

+
asio::io_context io_context;
+...
+for (;;)
+{
+  try
+  {
+    io_context.run();
+    break; // run() exited normally
+  }
+  catch (my_exception& e)
+  {
+    // Deal with exception as appropriate.
+  }
+}
+
+
+ + Submitting + arbitrary tasks to the io_context +
+

+ To submit functions to the io_context, + use the dispatch + , post or defer + free functions. +

+

+ For example: +

+
void my_task()
+{
+  ...
+}
+
+...
+
+asio::io_context io_context;
+
+// Submit a function to the io_context.
+asio::post(io_context, my_task);
+
+// Submit a lambda object to the io_context.
+asio::post(io_context,
+    []()
+    {
+      ...
+    });
+
+// Run the io_context until it runs out of work.
+io_context.run();
+
+
+ + Stopping + the io_context from running out of work +
+

+ Some applications may need to prevent an io_context + object's run() call from returning when there is no more work + to do. For example, the io_context + may be being run in a background thread that is launched prior to the application's + asynchronous operations. The run() call may be kept running + by creating an executor that tracks work against the io_context: +

+
asio::io_context io_context;
+auto work = asio::require(io_context.get_executor(),
+    asio::execution::outstanding_work.tracked);
+...
+
+

+ If using C++03, which lacks automatic variable type deduction, you may compute + the return type of the require call: +

+
asio::io_context io_context;
+typename asio::require_result<
+    asio::io_context::executor_type,
+    asio::exeution::outstanding_work_t::tracked_t>
+  work = asio::require(io_context.get_executor(),
+    asio::execution::outstanding_work.tracked);
+...
+
+

+ or store the result in the type-erasing executor wrapper, any_io_executor: +

+
asio::io_context io_context;
+asio::any_io_executor work
+  = asio::require(io_context.get_executor(),
+      asio::execution::outstanding_work.tracked);
+...
+
+

+ To effect a shutdown, the application will then need to call the io_context + object's stop() member function. This will cause the io_context + run() call to return as soon as possible, abandoning unfinished + operations and without permitting ready handlers to be dispatched. +

+

+ Alternatively, if the application requires that all operations and handlers + be allowed to finish normally, store the work-tracking executor in an any_io_executor + object, so that it may be explicitly reset. +

+
asio::io_context io_context;
+asio::any_io_executor work
+  = asio::require(io_context.get_executor(),
+      asio::execution::outstanding_work.tracked);
+...
+work = asio::any_io_executor(); // Allow run() to exit.
+
+
+ + Requirements +
+

+ Header: asio/io_service.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address.html b/include/asio/doc/asio/reference/ip__address.html new file mode 100644 index 0000000..a1362ec --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address.html @@ -0,0 +1,377 @@ + + + +ip::address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Implements version-independent IP addresses. +

+
class address
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address + [constructor] +

+
+

+ Default constructor.
—
Construct an address from an + IPv4 address.
—
Construct an address from an IPv6 address. +
—
Copy constructor. +

+
+

+ from_string [static] +

+
+

+ (Deprecated: Use make_address().) Create an address from an IPv4 + address string in dotted decimal form, or from an IPv6 address + in hexadecimal notation. +

+
+

+ is_loopback +

+
+

+ Determine whether the address is a loopback address. +

+
+

+ is_multicast +

+
+

+ Determine whether the address is a multicast address. +

+
+

+ is_unspecified +

+
+

+ Determine whether the address is unspecified. +

+
+

+ is_v4 +

+
+

+ Get whether the address is an IP version 4 address. +

+
+

+ is_v6 +

+
+

+ Get whether the address is an IP version 6 address. +

+
+

+ operator= +

+
+

+ Assign from another address.
—
Assign from an IPv4 + address.
—
Assign from an IPv6 address. +

+
+

+ to_string +

+
+

+ Get the address as a string.
—
(Deprecated: Use other + overload.) Get the address as a string. +

+
+

+ to_v4 +

+
+

+ Get the address as an IP version 4 address. +

+
+

+ to_v6 +

+
+

+ Get the address as an IP version 6 address. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator< +

+
+

+ Compare addresses for ordering. +

+
+

+ operator<= +

+
+

+ Compare addresses for ordering. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ operator> +

+
+

+ Compare addresses for ordering. +

+
+

+ operator>= +

+
+

+ Compare addresses for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_address +

+
+

+ Create an address from an IPv4 address string in dotted decimal + form, or from an IPv6 address in hexadecimal notation. +

+
+

+ operator<< +

+
+

+ Output an address as a string. +

+
+

+ The ip::address + class provides the ability to use either IP version 4 or version 6 addresses. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/address.html b/include/asio/doc/asio/reference/ip__address/address.html new file mode 100644 index 0000000..67627c5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/address.html @@ -0,0 +1,65 @@ + + + +ip::address::address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default constructor. +

+
address();
+  » more...
+
+

+ Construct an address from an IPv4 address. +

+
address(
+    const asio::ip::address_v4 & ipv4_address);
+  » more...
+
+

+ Construct an address from an IPv6 address. +

+
address(
+    const asio::ip::address_v6 & ipv6_address);
+  » more...
+
+

+ Copy constructor. +

+
address(
+    const address & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/address/overload1.html b/include/asio/doc/asio/reference/ip__address/address/overload1.html new file mode 100644 index 0000000..be0dfb4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/address/overload1.html @@ -0,0 +1,43 @@ + + + +ip::address::address (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
address();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/address/overload2.html b/include/asio/doc/asio/reference/ip__address/address/overload2.html new file mode 100644 index 0000000..0d2bf4d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/address/overload2.html @@ -0,0 +1,44 @@ + + + +ip::address::address (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an address from an IPv4 address. +

+
address(
+    const asio::ip::address_v4 & ipv4_address);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/address/overload3.html b/include/asio/doc/asio/reference/ip__address/address/overload3.html new file mode 100644 index 0000000..363dc60 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/address/overload3.html @@ -0,0 +1,44 @@ + + + +ip::address::address (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an address from an IPv6 address. +

+
address(
+    const asio::ip::address_v6 & ipv6_address);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/address/overload4.html b/include/asio/doc/asio/reference/ip__address/address/overload4.html new file mode 100644 index 0000000..9d35cd2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/address/overload4.html @@ -0,0 +1,44 @@ + + + +ip::address::address (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
address(
+    const address & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/from_string.html b/include/asio/doc/asio/reference/ip__address/from_string.html new file mode 100644 index 0000000..6bd8ed7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/from_string.html @@ -0,0 +1,61 @@ + + + +ip::address::from_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use make_address().) Create an address from an IPv4 address + string in dotted decimal form, or from an IPv6 address in hexadecimal notation. +

+
static address from_string(
+    const char * str);
+  » more...
+
+static address from_string(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+static address from_string(
+    const std::string & str);
+  » more...
+
+static address from_string(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/from_string/overload1.html b/include/asio/doc/asio/reference/ip__address/from_string/overload1.html new file mode 100644 index 0000000..5d07794 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/from_string/overload1.html @@ -0,0 +1,46 @@ + + + +ip::address::from_string (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address().) Create an address from + an IPv4 address string in dotted decimal form, or from an IPv6 address + in hexadecimal notation. +

+
static address from_string(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/from_string/overload2.html b/include/asio/doc/asio/reference/ip__address/from_string/overload2.html new file mode 100644 index 0000000..83fc746 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/from_string/overload2.html @@ -0,0 +1,47 @@ + + + +ip::address::from_string (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address().) Create an address from + an IPv4 address string in dotted decimal form, or from an IPv6 address + in hexadecimal notation. +

+
static address from_string(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/from_string/overload3.html b/include/asio/doc/asio/reference/ip__address/from_string/overload3.html new file mode 100644 index 0000000..b543b90 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/from_string/overload3.html @@ -0,0 +1,46 @@ + + + +ip::address::from_string (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address().) Create an address from + an IPv4 address string in dotted decimal form, or from an IPv6 address + in hexadecimal notation. +

+
static address from_string(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/from_string/overload4.html b/include/asio/doc/asio/reference/ip__address/from_string/overload4.html new file mode 100644 index 0000000..fa0ab94 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/from_string/overload4.html @@ -0,0 +1,47 @@ + + + +ip::address::from_string (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address().) Create an address from + an IPv4 address string in dotted decimal form, or from an IPv6 address + in hexadecimal notation. +

+
static address from_string(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/is_loopback.html b/include/asio/doc/asio/reference/ip__address/is_loopback.html new file mode 100644 index 0000000..1850ddc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/is_loopback.html @@ -0,0 +1,44 @@ + + + +ip::address::is_loopback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine whether + the address is a loopback address. +

+
bool is_loopback() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/is_multicast.html b/include/asio/doc/asio/reference/ip__address/is_multicast.html new file mode 100644 index 0000000..1131cb1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/is_multicast.html @@ -0,0 +1,44 @@ + + + +ip::address::is_multicast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a multicast address. +

+
bool is_multicast() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/is_unspecified.html b/include/asio/doc/asio/reference/ip__address/is_unspecified.html new file mode 100644 index 0000000..fae2100 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/is_unspecified.html @@ -0,0 +1,44 @@ + + + +ip::address::is_unspecified + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is unspecified. +

+
bool is_unspecified() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/is_v4.html b/include/asio/doc/asio/reference/ip__address/is_v4.html new file mode 100644 index 0000000..4809042 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/is_v4.html @@ -0,0 +1,44 @@ + + + +ip::address::is_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get whether the address + is an IP version 4 address. +

+
bool is_v4() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/is_v6.html b/include/asio/doc/asio/reference/ip__address/is_v6.html new file mode 100644 index 0000000..d845f96 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/is_v6.html @@ -0,0 +1,44 @@ + + + +ip::address::is_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get whether the address + is an IP version 6 address. +

+
bool is_v6() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/make_address.html b/include/asio/doc/asio/reference/ip__address/make_address.html new file mode 100644 index 0000000..96fa91d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/make_address.html @@ -0,0 +1,70 @@ + + + +ip::address::make_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create an + address from an IPv4 address string in dotted decimal form, or from an + IPv6 address in hexadecimal notation. +

+
address make_address(
+    const char * str);
+  » more...
+
+address make_address(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+address make_address(
+    const std::string & str);
+  » more...
+
+address make_address(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+address make_address(
+    string_view str);
+  » more...
+
+address make_address(
+    string_view str,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/make_address/overload1.html b/include/asio/doc/asio/reference/ip__address/make_address/overload1.html new file mode 100644 index 0000000..b5676e1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/make_address/overload1.html @@ -0,0 +1,45 @@ + + + +ip::address::make_address (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an address from an IPv4 address string in dotted decimal form, + or from an IPv6 address in hexadecimal notation. +

+
address make_address(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/make_address/overload2.html b/include/asio/doc/asio/reference/ip__address/make_address/overload2.html new file mode 100644 index 0000000..ecb0ef2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/make_address/overload2.html @@ -0,0 +1,46 @@ + + + +ip::address::make_address (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an address from an IPv4 address string in dotted decimal form, + or from an IPv6 address in hexadecimal notation. +

+
address make_address(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/make_address/overload3.html b/include/asio/doc/asio/reference/ip__address/make_address/overload3.html new file mode 100644 index 0000000..353beb8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/make_address/overload3.html @@ -0,0 +1,45 @@ + + + +ip::address::make_address (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an address from an IPv4 address string in dotted decimal form, + or from an IPv6 address in hexadecimal notation. +

+
address make_address(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/make_address/overload4.html b/include/asio/doc/asio/reference/ip__address/make_address/overload4.html new file mode 100644 index 0000000..3f55e5f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/make_address/overload4.html @@ -0,0 +1,46 @@ + + + +ip::address::make_address (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an address from an IPv4 address string in dotted decimal form, + or from an IPv6 address in hexadecimal notation. +

+
address make_address(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/make_address/overload5.html b/include/asio/doc/asio/reference/ip__address/make_address/overload5.html new file mode 100644 index 0000000..0e88f8c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/make_address/overload5.html @@ -0,0 +1,45 @@ + + + +ip::address::make_address (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an address from an IPv4 address string in dotted decimal form, + or from an IPv6 address in hexadecimal notation. +

+
address make_address(
+    string_view str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/make_address/overload6.html b/include/asio/doc/asio/reference/ip__address/make_address/overload6.html new file mode 100644 index 0000000..11379c2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/make_address/overload6.html @@ -0,0 +1,46 @@ + + + +ip::address::make_address (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an address from an IPv4 address string in dotted decimal form, + or from an IPv6 address in hexadecimal notation. +

+
address make_address(
+    string_view str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_eq_.html b/include/asio/doc/asio/reference/ip__address/operator_eq_.html new file mode 100644 index 0000000..0476a8e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_eq_.html @@ -0,0 +1,60 @@ + + + +ip::address::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign from + another address. +

+
address & operator=(
+    const address & other);
+  » more...
+
+

+ Assign from an IPv4 address. +

+
address & operator=(
+    const asio::ip::address_v4 & ipv4_address);
+  » more...
+
+

+ Assign from an IPv6 address. +

+
address & operator=(
+    const asio::ip::address_v6 & ipv6_address);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_eq_/overload1.html b/include/asio/doc/asio/reference/ip__address/operator_eq_/overload1.html new file mode 100644 index 0000000..6851a2d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +ip::address::operator= (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign from another address. +

+
address & operator=(
+    const address & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_eq_/overload2.html b/include/asio/doc/asio/reference/ip__address/operator_eq_/overload2.html new file mode 100644 index 0000000..94b218d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_eq_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::address::operator= (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign from an IPv4 address. +

+
address & operator=(
+    const asio::ip::address_v4 & ipv4_address);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_eq_/overload3.html b/include/asio/doc/asio/reference/ip__address/operator_eq_/overload3.html new file mode 100644 index 0000000..390b982 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_eq_/overload3.html @@ -0,0 +1,44 @@ + + + +ip::address::operator= (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign from an IPv6 address. +

+
address & operator=(
+    const asio::ip::address_v6 & ipv6_address);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__address/operator_eq__eq_.html new file mode 100644 index 0000000..1e8ba62 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two addresses for equality. +

+
friend bool operator==(
+    const address & a1,
+    const address & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_gt_.html b/include/asio/doc/asio/reference/ip__address/operator_gt_.html new file mode 100644 index 0000000..c55b8f5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_gt_.html @@ -0,0 +1,56 @@ + + + +ip::address::operator> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare addresses + for ordering. +

+
friend bool operator>(
+    const address & a1,
+    const address & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_gt__eq_.html b/include/asio/doc/asio/reference/ip__address/operator_gt__eq_.html new file mode 100644 index 0000000..e14a929 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_gt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address::operator>= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator>=(
+    const address & a1,
+    const address & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_lt_.html b/include/asio/doc/asio/reference/ip__address/operator_lt_.html new file mode 100644 index 0000000..9b98b6f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_lt_.html @@ -0,0 +1,56 @@ + + + +ip::address::operator< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare addresses + for ordering. +

+
friend bool operator<(
+    const address & a1,
+    const address & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_lt__eq_.html b/include/asio/doc/asio/reference/ip__address/operator_lt__eq_.html new file mode 100644 index 0000000..6065994 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_lt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address::operator<= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator<=(
+    const address & a1,
+    const address & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_lt__lt_.html b/include/asio/doc/asio/reference/ip__address/operator_lt__lt_.html new file mode 100644 index 0000000..857ca25 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_lt__lt_.html @@ -0,0 +1,77 @@ + + + +ip::address::operator<< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Output + an address as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const address & addr);
+
+

+ Used to output a human-readable string for a specified address. +

+
+ + Parameters +
+
+

+
+
os
+

+ The output stream to which the string will be written. +

+
addr
+

+ The address to be written. +

+
+
+
+ + Return + Value +
+

+ The output stream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__address/operator_not__eq_.html new file mode 100644 index 0000000..b9b3a20 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two addresses for inequality. +

+
friend bool operator!=(
+    const address & a1,
+    const address & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/to_string.html b/include/asio/doc/asio/reference/ip__address/to_string.html new file mode 100644 index 0000000..95c34ee --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/to_string.html @@ -0,0 +1,52 @@ + + + +ip::address::to_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address + as a string. +

+
std::string to_string() const;
+  » more...
+
+

+ (Deprecated: Use other overload.) Get the address as a string. +

+
std::string to_string(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/to_string/overload1.html b/include/asio/doc/asio/reference/ip__address/to_string/overload1.html new file mode 100644 index 0000000..30517d8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/to_string/overload1.html @@ -0,0 +1,43 @@ + + + +ip::address::to_string (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the address as a string. +

+
std::string to_string() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/to_string/overload2.html b/include/asio/doc/asio/reference/ip__address/to_string/overload2.html new file mode 100644 index 0000000..26cd5cd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/to_string/overload2.html @@ -0,0 +1,44 @@ + + + +ip::address::to_string (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use other overload.) Get the address as a string. +

+
std::string to_string(
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/to_v4.html b/include/asio/doc/asio/reference/ip__address/to_v4.html new file mode 100644 index 0000000..ea97caa --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/to_v4.html @@ -0,0 +1,44 @@ + + + +ip::address::to_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address as an IP + version 4 address. +

+
asio::ip::address_v4 to_v4() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address/to_v6.html b/include/asio/doc/asio/reference/ip__address/to_v6.html new file mode 100644 index 0000000..7151606 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address/to_v6.html @@ -0,0 +1,44 @@ + + + +ip::address::to_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address as an IP + version 6 address. +

+
asio::ip::address_v6 to_v6() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4.html b/include/asio/doc/asio/reference/ip__address_v4.html new file mode 100644 index 0000000..286b0ac --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4.html @@ -0,0 +1,530 @@ + + + +ip::address_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Implements IP version 4 style addresses. +

+
class address_v4
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bytes_type +

+
+

+ The type used to represent an address as an array of bytes. +

+
+

+ uint_type +

+
+

+ The type used to represent an address as an unsigned integer. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_v4 [constructor] +

+
+

+ Default constructor.
—
Construct an address from raw + bytes.
—
Construct an address from an unsigned integer + in host byte order.
—
Copy constructor. +

+
+

+ any + [static] +

+
+

+ Obtain an address object that represents any address. +

+
+

+ broadcast [static] +

+
+

+ Obtain an address object that represents the broadcast address. +
—
(Deprecated: Use network_v4 class.) Obtain an address + object that represents the broadcast address that corresponds to + the specified address and netmask. +

+
+

+ from_string [static] +

+
+

+ (Deprecated: Use make_address_v4().) Create an address from an + IP address string in dotted decimal form. +

+
+

+ is_class_a +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class A address. +

+
+

+ is_class_b +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class B address. +

+
+

+ is_class_c +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class C address. +

+
+

+ is_loopback +

+
+

+ Determine whether the address is a loopback address. +

+
+

+ is_multicast +

+
+

+ Determine whether the address is a multicast address. +

+
+

+ is_unspecified +

+
+

+ Determine whether the address is unspecified. +

+
+

+ loopback [static] +

+
+

+ Obtain an address object that represents the loopback address. +

+
+

+ netmask [static] +

+
+

+ (Deprecated: Use network_v4 class.) Obtain the netmask that corresponds + to the address, based on its address class. +

+
+

+ operator= +

+
+

+ Assign from another address. +

+
+

+ to_bytes +

+
+

+ Get the address in bytes, in network byte order. +

+
+

+ to_string +

+
+

+ Get the address as a string in dotted decimal format.
—
+ (Deprecated: Use other overload.) Get the address as a string in + dotted decimal format. +

+
+

+ to_uint +

+
+

+ Get the address as an unsigned integer in host byte order. +

+
+

+ to_ulong +

+
+

+ Get the address as an unsigned long in host byte order. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator< +

+
+

+ Compare addresses for ordering. +

+
+

+ operator<= +

+
+

+ Compare addresses for ordering. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ operator> +

+
+

+ Compare addresses for ordering. +

+
+

+ operator>= +

+
+

+ Compare addresses for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_address_v4 +

+
+

+ Create an IPv4 address from raw bytes in network order. +

+

+ Create an IPv4 address from an unsigned integer in host byte order. +

+

+ Create an IPv4 address from an IP address string in dotted decimal + form. +

+

+ Create an IPv4 address from a IPv4-mapped IPv6 address. +

+
+

+ make_network_v4 +

+
+

+ Create an IPv4 network from an address and prefix length. +

+

+ Create an IPv4 network from an address and netmask. +

+
+

+ operator<< +

+
+

+ Output an address as a string. +

+

+ Output a network as a string. +

+
+

+ The ip::address_v4 + class provides the ability to use and manipulate IP version 4 addresses. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/address_v4.html b/include/asio/doc/asio/reference/ip__address_v4/address_v4.html new file mode 100644 index 0000000..4772230 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/address_v4.html @@ -0,0 +1,66 @@ + + + +ip::address_v4::address_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
address_v4();
+  » more...
+
+

+ Construct an address from raw bytes. +

+
explicit address_v4(
+    const bytes_type & bytes);
+  » more...
+
+

+ Construct an address from an unsigned integer in host byte order. +

+
explicit address_v4(
+    uint_type addr);
+  » more...
+
+

+ Copy constructor. +

+
address_v4(
+    const address_v4 & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload1.html b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload1.html new file mode 100644 index 0000000..06e6f4d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload1.html @@ -0,0 +1,43 @@ + + + +ip::address_v4::address_v4 (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
address_v4();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload2.html b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload2.html new file mode 100644 index 0000000..68e4f3f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload2.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::address_v4 (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an address from raw bytes. +

+
address_v4(
+    const bytes_type & bytes);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload3.html b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload3.html new file mode 100644 index 0000000..b21cbd6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload3.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::address_v4 (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an address from an unsigned integer in host byte order. +

+
address_v4(
+    uint_type addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload4.html b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload4.html new file mode 100644 index 0000000..12725e0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/address_v4/overload4.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::address_v4 (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
address_v4(
+    const address_v4 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/any.html b/include/asio/doc/asio/reference/ip__address_v4/any.html new file mode 100644 index 0000000..9c35bf7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/any.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::any + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address object + that represents any address. +

+
static address_v4 any();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/broadcast.html b/include/asio/doc/asio/reference/ip__address_v4/broadcast.html new file mode 100644 index 0000000..9d645d1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/broadcast.html @@ -0,0 +1,55 @@ + + + +ip::address_v4::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an + address object that represents the broadcast address. +

+
static address_v4 broadcast();
+  » more...
+
+

+ (Deprecated: Use ip::network_v4 + class.) Obtain an address object that represents the broadcast address + that corresponds to the specified address and netmask. +

+
static address_v4 broadcast(
+    const address_v4 & addr,
+    const address_v4 & mask);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/broadcast/overload1.html b/include/asio/doc/asio/reference/ip__address_v4/broadcast/overload1.html new file mode 100644 index 0000000..cd51d2c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/broadcast/overload1.html @@ -0,0 +1,43 @@ + + + +ip::address_v4::broadcast (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an address object that represents the broadcast address. +

+
static address_v4 broadcast();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/broadcast/overload2.html b/include/asio/doc/asio/reference/ip__address_v4/broadcast/overload2.html new file mode 100644 index 0000000..d2715ac --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/broadcast/overload2.html @@ -0,0 +1,47 @@ + + + +ip::address_v4::broadcast (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use ip::network_v4 + class.) Obtain an address object that represents the broadcast address + that corresponds to the specified address and netmask. +

+
static address_v4 broadcast(
+    const address_v4 & addr,
+    const address_v4 & mask);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/bytes_type.html b/include/asio/doc/asio/reference/ip__address_v4/bytes_type.html new file mode 100644 index 0000000..b73526c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/bytes_type.html @@ -0,0 +1,62 @@ + + + +ip::address_v4::bytes_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + used to represent an address as an array of bytes. +

+
typedef array< unsigned char, 4 > bytes_type;
+
+
+ + Remarks +
+

+ This type is defined in terms of the C++0x template std::array + when it is available. Otherwise, it uses boost:array. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/from_string.html b/include/asio/doc/asio/reference/ip__address_v4/from_string.html new file mode 100644 index 0000000..971631a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/from_string.html @@ -0,0 +1,61 @@ + + + +ip::address_v4::from_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use make_address_v4().) Create an address from an IP address + string in dotted decimal form. +

+
static address_v4 from_string(
+    const char * str);
+  » more...
+
+static address_v4 from_string(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+static address_v4 from_string(
+    const std::string & str);
+  » more...
+
+static address_v4 from_string(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/from_string/overload1.html b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload1.html new file mode 100644 index 0000000..106e5eb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload1.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::from_string (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v4().) Create an address from + an IP address string in dotted decimal form. +

+
static address_v4 from_string(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/from_string/overload2.html b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload2.html new file mode 100644 index 0000000..f86bb76 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload2.html @@ -0,0 +1,46 @@ + + + +ip::address_v4::from_string (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v4().) Create an address from + an IP address string in dotted decimal form. +

+
static address_v4 from_string(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/from_string/overload3.html b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload3.html new file mode 100644 index 0000000..76509d8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload3.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::from_string (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v4().) Create an address from + an IP address string in dotted decimal form. +

+
static address_v4 from_string(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/from_string/overload4.html b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload4.html new file mode 100644 index 0000000..437735a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/from_string/overload4.html @@ -0,0 +1,46 @@ + + + +ip::address_v4::from_string (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v4().) Create an address from + an IP address string in dotted decimal form. +

+
static address_v4 from_string(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/is_class_a.html b/include/asio/doc/asio/reference/ip__address_v4/is_class_a.html new file mode 100644 index 0000000..a9be842 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/is_class_a.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::is_class_a + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use ip::network_v4 + class.) Determine whether the address is a class A address. +

+
bool is_class_a() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/is_class_b.html b/include/asio/doc/asio/reference/ip__address_v4/is_class_b.html new file mode 100644 index 0000000..8dded57 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/is_class_b.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::is_class_b + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use ip::network_v4 + class.) Determine whether the address is a class B address. +

+
bool is_class_b() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/is_class_c.html b/include/asio/doc/asio/reference/ip__address_v4/is_class_c.html new file mode 100644 index 0000000..b03b047 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/is_class_c.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::is_class_c + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use ip::network_v4 + class.) Determine whether the address is a class C address. +

+
bool is_class_c() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/is_loopback.html b/include/asio/doc/asio/reference/ip__address_v4/is_loopback.html new file mode 100644 index 0000000..c47c8fc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/is_loopback.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::is_loopback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a loopback address. +

+
bool is_loopback() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/is_multicast.html b/include/asio/doc/asio/reference/ip__address_v4/is_multicast.html new file mode 100644 index 0000000..faf7fb0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/is_multicast.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::is_multicast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a multicast address. +

+
bool is_multicast() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/is_unspecified.html b/include/asio/doc/asio/reference/ip__address_v4/is_unspecified.html new file mode 100644 index 0000000..41419c2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/is_unspecified.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::is_unspecified + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is unspecified. +

+
bool is_unspecified() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/loopback.html b/include/asio/doc/asio/reference/ip__address_v4/loopback.html new file mode 100644 index 0000000..32661ba --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/loopback.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::loopback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address + object that represents the loopback address. +

+
static address_v4 loopback();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4.html new file mode 100644 index 0000000..20551d2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4.html @@ -0,0 +1,91 @@ + + + +ip::address_v4::make_address_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + an IPv4 address from raw bytes in network order. +

+
address_v4 make_address_v4(
+    const address_v4::bytes_type & bytes);
+  » more...
+
+

+ Create an IPv4 address from an unsigned integer in host byte order. +

+
address_v4 make_address_v4(
+    address_v4::uint_type addr);
+  » more...
+
+

+ Create an IPv4 address from an IP address string in dotted decimal form. +

+
address_v4 make_address_v4(
+    const char * str);
+  » more...
+
+address_v4 make_address_v4(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+address_v4 make_address_v4(
+    const std::string & str);
+  » more...
+
+address_v4 make_address_v4(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+address_v4 make_address_v4(
+    string_view str);
+  » more...
+
+address_v4 make_address_v4(
+    string_view str,
+    asio::error_code & ec);
+  » more...
+
+

+ Create an IPv4 address from a IPv4-mapped IPv6 address. +

+
address_v4 make_address_v4(
+    v4_mapped_t ,
+    const address_v6 & v6_addr);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload1.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload1.html new file mode 100644 index 0000000..6646d30 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload1.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::make_address_v4 (1 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from raw bytes in network order. +

+
address_v4 make_address_v4(
+    const address_v4::bytes_type & bytes);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload2.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload2.html new file mode 100644 index 0000000..654296e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload2.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::make_address_v4 (2 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from an unsigned integer in host byte order. +

+
address_v4 make_address_v4(
+    address_v4::uint_type addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload3.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload3.html new file mode 100644 index 0000000..e3db05d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload3.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::make_address_v4 (3 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from an IP address string in dotted decimal form. +

+
address_v4 make_address_v4(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload4.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload4.html new file mode 100644 index 0000000..5506eea --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload4.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::make_address_v4 (4 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from an IP address string in dotted decimal form. +

+
address_v4 make_address_v4(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload5.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload5.html new file mode 100644 index 0000000..19bc85f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload5.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::make_address_v4 (5 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from an IP address string in dotted decimal form. +

+
address_v4 make_address_v4(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload6.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload6.html new file mode 100644 index 0000000..98c5dc8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload6.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::make_address_v4 (6 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from an IP address string in dotted decimal form. +

+
address_v4 make_address_v4(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload7.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload7.html new file mode 100644 index 0000000..4aa6b7a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload7.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::make_address_v4 (7 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from an IP address string in dotted decimal form. +

+
address_v4 make_address_v4(
+    string_view str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload8.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload8.html new file mode 100644 index 0000000..74080b4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload8.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::make_address_v4 (8 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from an IP address string in dotted decimal form. +

+
address_v4 make_address_v4(
+    string_view str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload9.html b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload9.html new file mode 100644 index 0000000..5c6b15f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_address_v4/overload9.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::make_address_v4 (9 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 address from a IPv4-mapped IPv6 address. +

+
address_v4 make_address_v4(
+    v4_mapped_t ,
+    const address_v6 & v6_addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_network_v4.html b/include/asio/doc/asio/reference/ip__address_v4/make_network_v4.html new file mode 100644 index 0000000..e2aa2ee --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_network_v4.html @@ -0,0 +1,55 @@ + + + +ip::address_v4::make_network_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + an IPv4 network from an address and prefix length. +

+
network_v4 make_network_v4(
+    const address_v4 & addr,
+    unsigned short prefix_len);
+  » more...
+
+

+ Create an IPv4 network from an address and netmask. +

+
network_v4 make_network_v4(
+    const address_v4 & addr,
+    const address_v4 & mask);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_network_v4/overload1.html b/include/asio/doc/asio/reference/ip__address_v4/make_network_v4/overload1.html new file mode 100644 index 0000000..60a2267 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_network_v4/overload1.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::make_network_v4 (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from an address and prefix length. +

+
network_v4 make_network_v4(
+    const address_v4 & addr,
+    unsigned short prefix_len);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/make_network_v4/overload2.html b/include/asio/doc/asio/reference/ip__address_v4/make_network_v4/overload2.html new file mode 100644 index 0000000..0136342 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/make_network_v4/overload2.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::make_network_v4 (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from an address and netmask. +

+
network_v4 make_network_v4(
+    const address_v4 & addr,
+    const address_v4 & mask);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/netmask.html b/include/asio/doc/asio/reference/ip__address_v4/netmask.html new file mode 100644 index 0000000..77132dc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/netmask.html @@ -0,0 +1,47 @@ + + + +ip::address_v4::netmask + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use ip::network_v4 + class.) Obtain the netmask that corresponds to the address, based on its + address class. +

+
static address_v4 netmask(
+    const address_v4 & addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_eq_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_eq_.html new file mode 100644 index 0000000..d284193 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + from another address. +

+
address_v4 & operator=(
+    const address_v4 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_eq__eq_.html new file mode 100644 index 0000000..487eaa3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v4::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two addresses for equality. +

+
friend bool operator==(
+    const address_v4 & a1,
+    const address_v4 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_gt_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_gt_.html new file mode 100644 index 0000000..7d5540a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_gt_.html @@ -0,0 +1,56 @@ + + + +ip::address_v4::operator> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator>(
+    const address_v4 & a1,
+    const address_v4 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_gt__eq_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_gt__eq_.html new file mode 100644 index 0000000..008ce6a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_gt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v4::operator>= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator>=(
+    const address_v4 & a1,
+    const address_v4 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_lt_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_lt_.html new file mode 100644 index 0000000..9b42082 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_lt_.html @@ -0,0 +1,56 @@ + + + +ip::address_v4::operator< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator<(
+    const address_v4 & a1,
+    const address_v4 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_lt__eq_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__eq_.html new file mode 100644 index 0000000..686aa4f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v4::operator<= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator<=(
+    const address_v4 & a1,
+    const address_v4 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_.html new file mode 100644 index 0000000..cc8a3d5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_.html @@ -0,0 +1,61 @@ + + + +ip::address_v4::operator<< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Output + an address as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const address_v4 & addr);
+  » more...
+
+

+ Output a network as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const network_v4 & net);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_/overload1.html b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_/overload1.html new file mode 100644 index 0000000..bafba63 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_/overload1.html @@ -0,0 +1,76 @@ + + + +ip::address_v4::operator<< (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Output an address as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const address_v4 & addr);
+
+

+ Used to output a human-readable string for a specified address. +

+
+ + Parameters +
+
+

+
+
os
+

+ The output stream to which the string will be written. +

+
addr
+

+ The address to be written. +

+
+
+
+ + Return + Value +
+

+ The output stream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_/overload2.html b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_/overload2.html new file mode 100644 index 0000000..be304ab --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_lt__lt_/overload2.html @@ -0,0 +1,76 @@ + + + +ip::address_v4::operator<< (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Output a network as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const network_v4 & net);
+
+

+ Used to output a human-readable string for a specified network. +

+
+ + Parameters +
+
+

+
+
os
+

+ The output stream to which the string will be written. +

+
net
+

+ The network to be written. +

+
+
+
+ + Return + Value +
+

+ The output stream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__address_v4/operator_not__eq_.html new file mode 100644 index 0000000..4beef4b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v4::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two addresses for inequality. +

+
friend bool operator!=(
+    const address_v4 & a1,
+    const address_v4 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/to_bytes.html b/include/asio/doc/asio/reference/ip__address_v4/to_bytes.html new file mode 100644 index 0000000..1a20e93 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/to_bytes.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::to_bytes + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address + in bytes, in network byte order. +

+
bytes_type to_bytes() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/to_string.html b/include/asio/doc/asio/reference/ip__address_v4/to_string.html new file mode 100644 index 0000000..b251dd8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/to_string.html @@ -0,0 +1,53 @@ + + + +ip::address_v4::to_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address + as a string in dotted decimal format. +

+
std::string to_string() const;
+  » more...
+
+

+ (Deprecated: Use other overload.) Get the address as a string in dotted + decimal format. +

+
std::string to_string(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/to_string/overload1.html b/include/asio/doc/asio/reference/ip__address_v4/to_string/overload1.html new file mode 100644 index 0000000..e46417e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/to_string/overload1.html @@ -0,0 +1,43 @@ + + + +ip::address_v4::to_string (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the address as a string in dotted decimal format. +

+
std::string to_string() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/to_string/overload2.html b/include/asio/doc/asio/reference/ip__address_v4/to_string/overload2.html new file mode 100644 index 0000000..5f4e2b0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/to_string/overload2.html @@ -0,0 +1,45 @@ + + + +ip::address_v4::to_string (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use other overload.) Get the address as a string in dotted + decimal format. +

+
std::string to_string(
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/to_uint.html b/include/asio/doc/asio/reference/ip__address_v4/to_uint.html new file mode 100644 index 0000000..43fe7ec --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/to_uint.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::to_uint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address + as an unsigned integer in host byte order. +

+
uint_type to_uint() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/to_ulong.html b/include/asio/doc/asio/reference/ip__address_v4/to_ulong.html new file mode 100644 index 0000000..3b0823a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/to_ulong.html @@ -0,0 +1,44 @@ + + + +ip::address_v4::to_ulong + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address + as an unsigned long in host byte order. +

+
unsigned long to_ulong() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4/uint_type.html b/include/asio/doc/asio/reference/ip__address_v4/uint_type.html new file mode 100644 index 0000000..3006fb8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4/uint_type.html @@ -0,0 +1,54 @@ + + + +ip::address_v4::uint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + used to represent an address as an unsigned integer. +

+
typedef uint_least32_t uint_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4_iterator.html b/include/asio/doc/asio/reference/ip__address_v4_iterator.html new file mode 100644 index 0000000..2a5f0cb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4_iterator.html @@ -0,0 +1,298 @@ + + + +ip::address_v4_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An input iterator + that can be used for traversing IPv4 addresses. +

+
typedef basic_address_iterator< address_v4 > address_v4_iterator;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ Distance between two iterators. +

+
+

+ iterator_category +

+
+

+ Denotes that the iterator satisfies the input iterator requirements. +

+
+

+ pointer +

+
+

+ The type of a pointer to an element pointed to by the iterator. +

+
+

+ reference +

+
+

+ The type of a reference to an element pointed to by the iterator. +

+
+

+ value_type +

+
+

+ The type of the elements pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_iterator +

+
+

+ Construct an iterator that points to the specified address.
+ —
Copy constructor. +

+
+

+ operator * +

+
+

+ Dereference the iterator. +

+
+

+ operator++ +

+
+

+ Pre-increment operator.
—
Post-increment operator. +

+
+

+ operator-- +

+
+

+ Pre-decrement operator.
—
Post-decrement operator. +

+
+

+ operator-> +

+
+

+ Dereference the iterator. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ In addition to satisfying the input iterator requirements, this iterator + also supports decrement. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v4_range.html b/include/asio/doc/asio/reference/ip__address_v4_range.html new file mode 100644 index 0000000..f02be27 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v4_range.html @@ -0,0 +1,208 @@ + + + +ip::address_v4_range + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Represents a range + of IPv4 addresses. +

+
typedef basic_address_range< address_v4 > address_v4_range;
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ iterator +

+
+

+ The type of an iterator that points into the range. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_range +

+
+

+ Construct an empty range.
—
Construct an range that + represents the given range of addresses.
—
Copy constructor. +

+
+

+ begin +

+
+

+ Obtain an iterator that points to the start of the range. +

+
+

+ empty +

+
+

+ Determine whether the range is empty. +

+
+

+ end +

+
+

+ Obtain an iterator that points to the end of the range. +

+
+

+ find +

+
+

+ Find an address in the range. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+

+ size +

+
+

+ Return the size of the range. +

+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4_range.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6.html b/include/asio/doc/asio/reference/ip__address_v6.html new file mode 100644 index 0000000..9581872 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6.html @@ -0,0 +1,578 @@ + + + +ip::address_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Implements IP version 6 style addresses. +

+
class address_v6
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bytes_type +

+
+

+ The type used to represent an address as an array of bytes. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_v6 [constructor] +

+
+

+ Default constructor.
—
Construct an address from raw + bytes and scope ID.
—
Copy constructor. +

+
+

+ any + [static] +

+
+

+ Obtain an address object that represents any address. +

+
+

+ from_string [static] +

+
+

+ (Deprecated: Use make_address_v6().) Create an IPv6 address from + an IP address string. +

+
+

+ is_link_local +

+
+

+ Determine whether the address is link local. +

+
+

+ is_loopback +

+
+

+ Determine whether the address is a loopback address. +

+
+

+ is_multicast +

+
+

+ Determine whether the address is a multicast address. +

+
+

+ is_multicast_global +

+
+

+ Determine whether the address is a global multicast address. +

+
+

+ is_multicast_link_local +

+
+

+ Determine whether the address is a link-local multicast address. +

+
+

+ is_multicast_node_local +

+
+

+ Determine whether the address is a node-local multicast address. +

+
+

+ is_multicast_org_local +

+
+

+ Determine whether the address is a org-local multicast address. +

+
+

+ is_multicast_site_local +

+
+

+ Determine whether the address is a site-local multicast address. +

+
+

+ is_site_local +

+
+

+ Determine whether the address is site local. +

+
+

+ is_unspecified +

+
+

+ Determine whether the address is unspecified. +

+
+

+ is_v4_compatible +

+
+

+ (Deprecated: No replacement.) Determine whether the address is + an IPv4-compatible address. +

+
+

+ is_v4_mapped +

+
+

+ Determine whether the address is a mapped IPv4 address. +

+
+

+ loopback [static] +

+
+

+ Obtain an address object that represents the loopback address. +

+
+

+ operator= +

+
+

+ Assign from another address. +

+
+

+ scope_id +

+
+

+ The scope ID of the address. +

+
+

+ to_bytes +

+
+

+ Get the address in bytes, in network byte order. +

+
+

+ to_string +

+
+

+ Get the address as a string.
—
(Deprecated: Use other + overload.) Get the address as a string. +

+
+

+ to_v4 +

+
+

+ (Deprecated: Use make_address_v4().) Converts an IPv4-mapped or + IPv4-compatible address to an IPv4 address. +

+
+

+ v4_compatible [static] +

+
+

+ (Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. +

+
+

+ v4_mapped [static] +

+
+

+ (Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 + address. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator< +

+
+

+ Compare addresses for ordering. +

+
+

+ operator<= +

+
+

+ Compare addresses for ordering. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ operator> +

+
+

+ Compare addresses for ordering. +

+
+

+ operator>= +

+
+

+ Compare addresses for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_address_v6 +

+
+

+ Create an IPv6 address from raw bytes and scope ID. +

+

+ Create an IPv6 address from an IP address string. +

+

+ Createan IPv6 address from an IP address string. +

+

+ Create an IPv4-mapped IPv6 address from an IPv4 address. +

+
+

+ make_network_v6 +

+
+

+ Create an IPv6 network from an address and prefix length. +

+
+

+ operator<< +

+
+

+ Output an address as a string. +

+

+ Output a network as a string. +

+
+

+ The ip::address_v6 + class provides the ability to use and manipulate IP version 6 addresses. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/address_v6.html b/include/asio/doc/asio/reference/ip__address_v6/address_v6.html new file mode 100644 index 0000000..c654c51 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/address_v6.html @@ -0,0 +1,60 @@ + + + +ip::address_v6::address_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
address_v6();
+  » more...
+
+

+ Construct an address from raw bytes and scope ID. +

+
explicit address_v6(
+    const bytes_type & bytes,
+    unsigned long scope_id = 0);
+  » more...
+
+

+ Copy constructor. +

+
address_v6(
+    const address_v6 & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload1.html b/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload1.html new file mode 100644 index 0000000..f7b4f99 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload1.html @@ -0,0 +1,43 @@ + + + +ip::address_v6::address_v6 (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
address_v6();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload2.html b/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload2.html new file mode 100644 index 0000000..58f1871 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload2.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::address_v6 (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an address from raw bytes and scope ID. +

+
address_v6(
+    const bytes_type & bytes,
+    unsigned long scope_id = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload3.html b/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload3.html new file mode 100644 index 0000000..9c67485 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/address_v6/overload3.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::address_v6 (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
address_v6(
+    const address_v6 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/any.html b/include/asio/doc/asio/reference/ip__address_v6/any.html new file mode 100644 index 0000000..3e6d801 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/any.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::any + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address object + that represents any address. +

+
static address_v6 any();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/bytes_type.html b/include/asio/doc/asio/reference/ip__address_v6/bytes_type.html new file mode 100644 index 0000000..6ffbcef --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/bytes_type.html @@ -0,0 +1,62 @@ + + + +ip::address_v6::bytes_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + used to represent an address as an array of bytes. +

+
typedef array< unsigned char, 16 > bytes_type;
+
+
+ + Remarks +
+

+ This type is defined in terms of the C++0x template std::array + when it is available. Otherwise, it uses boost:array. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/from_string.html b/include/asio/doc/asio/reference/ip__address_v6/from_string.html new file mode 100644 index 0000000..d6c01e5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/from_string.html @@ -0,0 +1,61 @@ + + + +ip::address_v6::from_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use make_address_v6().) Create an IPv6 address from an IP + address string. +

+
static address_v6 from_string(
+    const char * str);
+  » more...
+
+static address_v6 from_string(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+static address_v6 from_string(
+    const std::string & str);
+  » more...
+
+static address_v6 from_string(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/from_string/overload1.html b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload1.html new file mode 100644 index 0000000..a736a37 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload1.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::from_string (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v6().) Create an IPv6 address + from an IP address string. +

+
static address_v6 from_string(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/from_string/overload2.html b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload2.html new file mode 100644 index 0000000..be01b2d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload2.html @@ -0,0 +1,46 @@ + + + +ip::address_v6::from_string (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v6().) Create an IPv6 address + from an IP address string. +

+
static address_v6 from_string(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/from_string/overload3.html b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload3.html new file mode 100644 index 0000000..105f0a7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload3.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::from_string (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v6().) Create an IPv6 address + from an IP address string. +

+
static address_v6 from_string(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/from_string/overload4.html b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload4.html new file mode 100644 index 0000000..581f825 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/from_string/overload4.html @@ -0,0 +1,46 @@ + + + +ip::address_v6::from_string (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use make_address_v6().) Create an IPv6 address + from an IP address string. +

+
static address_v6 from_string(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_link_local.html b/include/asio/doc/asio/reference/ip__address_v6/is_link_local.html new file mode 100644 index 0000000..62b954c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_link_local.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_link_local + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is link local. +

+
bool is_link_local() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_loopback.html b/include/asio/doc/asio/reference/ip__address_v6/is_loopback.html new file mode 100644 index 0000000..e445f6b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_loopback.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_loopback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a loopback address. +

+
bool is_loopback() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_multicast.html b/include/asio/doc/asio/reference/ip__address_v6/is_multicast.html new file mode 100644 index 0000000..a696bfa --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_multicast.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_multicast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a multicast address. +

+
bool is_multicast() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_multicast_global.html b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_global.html new file mode 100644 index 0000000..5a014bc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_global.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_multicast_global + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a global multicast address. +

+
bool is_multicast_global() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_multicast_link_local.html b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_link_local.html new file mode 100644 index 0000000..81cef69 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_link_local.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_multicast_link_local + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a link-local multicast address. +

+
bool is_multicast_link_local() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_multicast_node_local.html b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_node_local.html new file mode 100644 index 0000000..011de52 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_node_local.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_multicast_node_local + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a node-local multicast address. +

+
bool is_multicast_node_local() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_multicast_org_local.html b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_org_local.html new file mode 100644 index 0000000..c282c39 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_org_local.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_multicast_org_local + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a org-local multicast address. +

+
bool is_multicast_org_local() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_multicast_site_local.html b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_site_local.html new file mode 100644 index 0000000..5787147 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_multicast_site_local.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_multicast_site_local + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a site-local multicast address. +

+
bool is_multicast_site_local() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_site_local.html b/include/asio/doc/asio/reference/ip__address_v6/is_site_local.html new file mode 100644 index 0000000..9502a36 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_site_local.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_site_local + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is site local. +

+
bool is_site_local() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_unspecified.html b/include/asio/doc/asio/reference/ip__address_v6/is_unspecified.html new file mode 100644 index 0000000..3680b30 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_unspecified.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_unspecified + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is unspecified. +

+
bool is_unspecified() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_v4_compatible.html b/include/asio/doc/asio/reference/ip__address_v6/is_v4_compatible.html new file mode 100644 index 0000000..31db121 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_v4_compatible.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_v4_compatible + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + No replacement.) Determine whether the address is an IPv4-compatible address. +

+
bool is_v4_compatible() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/is_v4_mapped.html b/include/asio/doc/asio/reference/ip__address_v6/is_v4_mapped.html new file mode 100644 index 0000000..8dcb3b2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/is_v4_mapped.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::is_v4_mapped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the address is a mapped IPv4 address. +

+
bool is_v4_mapped() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/loopback.html b/include/asio/doc/asio/reference/ip__address_v6/loopback.html new file mode 100644 index 0000000..228f11b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/loopback.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::loopback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address + object that represents the loopback address. +

+
static address_v6 loopback();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6.html new file mode 100644 index 0000000..6eae99c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6.html @@ -0,0 +1,88 @@ + + + +ip::address_v6::make_address_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + an IPv6 address from raw bytes and scope ID. +

+
address_v6 make_address_v6(
+    const address_v6::bytes_type & bytes,
+    unsigned long scope_id = 0);
+  » more...
+
+

+ Create an IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    const char * str);
+  » more...
+
+address_v6 make_address_v6(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+

+ Createan IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    const std::string & str);
+  » more...
+
+address_v6 make_address_v6(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+address_v6 make_address_v6(
+    string_view str);
+  » more...
+
+address_v6 make_address_v6(
+    string_view str,
+    asio::error_code & ec);
+  » more...
+
+

+ Create an IPv4-mapped IPv6 address from an IPv4 address. +

+
address_v6 make_address_v6(
+    v4_mapped_t ,
+    const address_v4 & v4_addr);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload1.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload1.html new file mode 100644 index 0000000..023af28 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload1.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::make_address_v6 (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 address from raw bytes and scope ID. +

+
address_v6 make_address_v6(
+    const address_v6::bytes_type & bytes,
+    unsigned long scope_id = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload2.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload2.html new file mode 100644 index 0000000..f0584bb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload2.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::make_address_v6 (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload3.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload3.html new file mode 100644 index 0000000..8089645 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload3.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::make_address_v6 (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload4.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload4.html new file mode 100644 index 0000000..9cd0613 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload4.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::make_address_v6 (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Createan IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload5.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload5.html new file mode 100644 index 0000000..e574b5f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload5.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::make_address_v6 (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload6.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload6.html new file mode 100644 index 0000000..94f1bb6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload6.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::make_address_v6 (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    string_view str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload7.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload7.html new file mode 100644 index 0000000..a249988 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload7.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::make_address_v6 (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 address from an IP address string. +

+
address_v6 make_address_v6(
+    string_view str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload8.html b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload8.html new file mode 100644 index 0000000..9c8a8dd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_address_v6/overload8.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::make_address_v6 (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4-mapped IPv6 address from an IPv4 address. +

+
address_v6 make_address_v6(
+    v4_mapped_t ,
+    const address_v4 & v4_addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/make_network_v6.html b/include/asio/doc/asio/reference/ip__address_v6/make_network_v6.html new file mode 100644 index 0000000..2c22c74 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/make_network_v6.html @@ -0,0 +1,46 @@ + + + +ip::address_v6::make_network_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + an IPv6 network from an address and prefix length. +

+
network_v6 make_network_v6(
+    const address_v6 & addr,
+    unsigned short prefix_len);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_eq_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_eq_.html new file mode 100644 index 0000000..a995ba3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + from another address. +

+
address_v6 & operator=(
+    const address_v6 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_eq__eq_.html new file mode 100644 index 0000000..b65e916 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v6::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two addresses for equality. +

+
friend bool operator==(
+    const address_v6 & a1,
+    const address_v6 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_gt_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_gt_.html new file mode 100644 index 0000000..a466f1c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_gt_.html @@ -0,0 +1,56 @@ + + + +ip::address_v6::operator> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator>(
+    const address_v6 & a1,
+    const address_v6 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_gt__eq_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_gt__eq_.html new file mode 100644 index 0000000..82e19f2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_gt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v6::operator>= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator>=(
+    const address_v6 & a1,
+    const address_v6 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_lt_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_lt_.html new file mode 100644 index 0000000..da07ba6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_lt_.html @@ -0,0 +1,56 @@ + + + +ip::address_v6::operator< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator<(
+    const address_v6 & a1,
+    const address_v6 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_lt__eq_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__eq_.html new file mode 100644 index 0000000..7d56eb6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v6::operator<= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + addresses for ordering. +

+
friend bool operator<=(
+    const address_v6 & a1,
+    const address_v6 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_.html new file mode 100644 index 0000000..69f91ad --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_.html @@ -0,0 +1,61 @@ + + + +ip::address_v6::operator<< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Output + an address as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const address_v6 & addr);
+  » more...
+
+

+ Output a network as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const network_v6 & net);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_/overload1.html b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_/overload1.html new file mode 100644 index 0000000..d721851 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_/overload1.html @@ -0,0 +1,76 @@ + + + +ip::address_v6::operator<< (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Output an address as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const address_v6 & addr);
+
+

+ Used to output a human-readable string for a specified address. +

+
+ + Parameters +
+
+

+
+
os
+

+ The output stream to which the string will be written. +

+
addr
+

+ The address to be written. +

+
+
+
+ + Return + Value +
+

+ The output stream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_/overload2.html b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_/overload2.html new file mode 100644 index 0000000..89da903 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_lt__lt_/overload2.html @@ -0,0 +1,76 @@ + + + +ip::address_v6::operator<< (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Output a network as a string. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const network_v6 & net);
+
+

+ Used to output a human-readable string for a specified network. +

+
+ + Parameters +
+
+

+
+
os
+

+ The output stream to which the string will be written. +

+
net
+

+ The network to be written. +

+
+
+
+ + Return + Value +
+

+ The output stream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__address_v6/operator_not__eq_.html new file mode 100644 index 0000000..d9b7e83 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::address_v6::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two addresses for inequality. +

+
friend bool operator!=(
+    const address_v6 & a1,
+    const address_v6 & a2);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/scope_id.html b/include/asio/doc/asio/reference/ip__address_v6/scope_id.html new file mode 100644 index 0000000..7fd852d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/scope_id.html @@ -0,0 +1,49 @@ + + + +ip::address_v6::scope_id + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The scope ID + of the address. +

+
unsigned long scope_id() const;
+  » more...
+
+void scope_id(
+    unsigned long id);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/scope_id/overload1.html b/include/asio/doc/asio/reference/ip__address_v6/scope_id/overload1.html new file mode 100644 index 0000000..cf6009d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/scope_id/overload1.html @@ -0,0 +1,46 @@ + + + +ip::address_v6::scope_id (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The scope ID of the address. +

+
unsigned long scope_id() const;
+
+

+ Returns the scope ID associated with the IPv6 address. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/scope_id/overload2.html b/include/asio/doc/asio/reference/ip__address_v6/scope_id/overload2.html new file mode 100644 index 0000000..507c3bb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/scope_id/overload2.html @@ -0,0 +1,47 @@ + + + +ip::address_v6::scope_id (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The scope ID of the address. +

+
void scope_id(
+    unsigned long id);
+
+

+ Modifies the scope ID associated with the IPv6 address. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/to_bytes.html b/include/asio/doc/asio/reference/ip__address_v6/to_bytes.html new file mode 100644 index 0000000..1aaae1d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/to_bytes.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::to_bytes + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address + in bytes, in network byte order. +

+
bytes_type to_bytes() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/to_string.html b/include/asio/doc/asio/reference/ip__address_v6/to_string.html new file mode 100644 index 0000000..7b8edf4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/to_string.html @@ -0,0 +1,52 @@ + + + +ip::address_v6::to_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the address + as a string. +

+
std::string to_string() const;
+  » more...
+
+

+ (Deprecated: Use other overload.) Get the address as a string. +

+
std::string to_string(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/to_string/overload1.html b/include/asio/doc/asio/reference/ip__address_v6/to_string/overload1.html new file mode 100644 index 0000000..de48067 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/to_string/overload1.html @@ -0,0 +1,43 @@ + + + +ip::address_v6::to_string (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the address as a string. +

+
std::string to_string() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/to_string/overload2.html b/include/asio/doc/asio/reference/ip__address_v6/to_string/overload2.html new file mode 100644 index 0000000..f123597 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/to_string/overload2.html @@ -0,0 +1,44 @@ + + + +ip::address_v6::to_string (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use other overload.) Get the address as a string. +

+
std::string to_string(
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/to_v4.html b/include/asio/doc/asio/reference/ip__address_v6/to_v4.html new file mode 100644 index 0000000..1bd3e9d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/to_v4.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::to_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: Use + make_address_v4().) Converts an IPv4-mapped or IPv4-compatible + address to an IPv4 address. +

+
address_v4 to_v4() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/v4_compatible.html b/include/asio/doc/asio/reference/ip__address_v6/v4_compatible.html new file mode 100644 index 0000000..32ce2f4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/v4_compatible.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::v4_compatible + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + No replacement.) Create an IPv4-compatible IPv6 address. +

+
static address_v6 v4_compatible(
+    const address_v4 & addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6/v4_mapped.html b/include/asio/doc/asio/reference/ip__address_v6/v4_mapped.html new file mode 100644 index 0000000..de4a4ba --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6/v4_mapped.html @@ -0,0 +1,45 @@ + + + +ip::address_v6::v4_mapped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use make_address_v6().) Create an IPv4-mapped IPv6 address. +

+
static address_v6 v4_mapped(
+    const address_v4 & addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6_iterator.html b/include/asio/doc/asio/reference/ip__address_v6_iterator.html new file mode 100644 index 0000000..33100bd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6_iterator.html @@ -0,0 +1,298 @@ + + + +ip::address_v6_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An input iterator + that can be used for traversing IPv6 addresses. +

+
typedef basic_address_iterator< address_v6 > address_v6_iterator;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ Distance between two iterators. +

+
+

+ iterator_category +

+
+

+ Denotes that the iterator satisfies the input iterator requirements. +

+
+

+ pointer +

+
+

+ The type of a pointer to an element pointed to by the iterator. +

+
+

+ reference +

+
+

+ The type of a reference to an element pointed to by the iterator. +

+
+

+ value_type +

+
+

+ The type of the elements pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_iterator +

+
+

+ Construct an iterator that points to the specified address.
+ —
Copy constructor. +

+
+

+ operator * +

+
+

+ Dereference the iterator. +

+
+

+ operator++ +

+
+

+ Pre-increment operator.
—
Post-increment operator. +

+
+

+ operator-- +

+
+

+ Pre-decrement operator.
—
Post-decrement operator. +

+
+

+ operator-> +

+
+

+ Dereference the iterator. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ In addition to satisfying the input iterator requirements, this iterator + also supports decrement. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__address_v6_range.html b/include/asio/doc/asio/reference/ip__address_v6_range.html new file mode 100644 index 0000000..7c447e3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__address_v6_range.html @@ -0,0 +1,196 @@ + + + +ip::address_v6_range + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Represents a range + of IPv6 addresses. +

+
typedef basic_address_range< address_v6 > address_v6_range;
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ iterator +

+
+

+ The type of an iterator that points into the range. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_range +

+
+

+ Construct an empty range.
—
Construct an range that + represents the given range of addresses.
—
Copy constructor. +

+
+

+ begin +

+
+

+ Obtain an iterator that points to the start of the range. +

+
+

+ empty +

+
+

+ Determine whether the range is empty. +

+
+

+ end +

+
+

+ Obtain an iterator that points to the end of the range. +

+
+

+ find +

+
+

+ Find an address in the range. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6_range.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__bad_address_cast.html b/include/asio/doc/asio/reference/ip__bad_address_cast.html new file mode 100644 index 0000000..de99ca4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__bad_address_cast.html @@ -0,0 +1,112 @@ + + + +ip::bad_address_cast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Thrown to indicate a failed address conversion. +

+
class bad_address_cast
+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bad_address_cast [constructor] +

+
+

+ Default constructor. +

+
+

+ what +

+
+

+ Get the message associated with the exception. +

+
+

+ ~bad_address_cast [destructor] +

+
+

+ Destructor. +

+
+
+ + Requirements +
+

+ Header: asio/ip/bad_address_cast.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__bad_address_cast/_bad_address_cast.html b/include/asio/doc/asio/reference/ip__bad_address_cast/_bad_address_cast.html new file mode 100644 index 0000000..5b71ade --- /dev/null +++ b/include/asio/doc/asio/reference/ip__bad_address_cast/_bad_address_cast.html @@ -0,0 +1,43 @@ + + + +ip::bad_address_cast::~bad_address_cast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
virtual ~bad_address_cast();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__bad_address_cast/bad_address_cast.html b/include/asio/doc/asio/reference/ip__bad_address_cast/bad_address_cast.html new file mode 100644 index 0000000..4be5e37 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__bad_address_cast/bad_address_cast.html @@ -0,0 +1,44 @@ + + + +ip::bad_address_cast::bad_address_cast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
bad_address_cast();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__bad_address_cast/what.html b/include/asio/doc/asio/reference/ip__bad_address_cast/what.html new file mode 100644 index 0000000..141310b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__bad_address_cast/what.html @@ -0,0 +1,44 @@ + + + +ip::bad_address_cast::what + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + message associated with the exception. +

+
virtual const char * what() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_.html new file mode 100644 index 0000000..06d9200 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_.html @@ -0,0 +1,299 @@ + + + +ip::basic_address_iterator< address_v4 > + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An input iterator that can be used for traversing IPv4 addresses. +

+
template<>
+class basic_address_iterator< address_v4 >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ Distance between two iterators. +

+
+

+ iterator_category +

+
+

+ Denotes that the iterator satisfies the input iterator requirements. +

+
+

+ pointer +

+
+

+ The type of a pointer to an element pointed to by the iterator. +

+
+

+ reference +

+
+

+ The type of a reference to an element pointed to by the iterator. +

+
+

+ value_type +

+
+

+ The type of the elements pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_iterator +

+
+

+ Construct an iterator that points to the specified address.
+ —
Copy constructor. +

+
+

+ operator * +

+
+

+ Dereference the iterator. +

+
+

+ operator++ +

+
+

+ Pre-increment operator.
—
Post-increment operator. +

+
+

+ operator-- +

+
+

+ Pre-decrement operator.
—
Post-decrement operator. +

+
+

+ operator-> +

+
+

+ Dereference the iterator. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ In addition to satisfying the input iterator requirements, this iterator + also supports decrement. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator.html new file mode 100644 index 0000000..29f235d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator.html @@ -0,0 +1,53 @@ + + + +ip::basic_address_iterator< address_v4 >::basic_address_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an iterator that points to the specified address. +

+
basic_address_iterator(
+    const address_v4 & addr);
+  » more...
+
+

+ Copy constructor. +

+
basic_address_iterator(
+    const basic_address_iterator & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload1.html new file mode 100644 index 0000000..dc49cbe --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload1.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v4 >::basic_address_iterator (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an iterator that points to the specified address. +

+
basic_address_iterator(
+    const address_v4 & addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload2.html new file mode 100644 index 0000000..65ea20b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v4 >::basic_address_iterator (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_address_iterator(
+    const basic_address_iterator & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/difference_type.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/difference_type.html new file mode 100644 index 0000000..4bbc968 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/difference_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_address_iterator< address_v4 >::difference_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Distance between two iterators. +

+
typedef std::ptrdiff_t difference_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/iterator_category.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/iterator_category.html new file mode 100644 index 0000000..c7e314c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/iterator_category.html @@ -0,0 +1,54 @@ + + + +ip::basic_address_iterator< address_v4 >::iterator_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Denotes that the iterator satisfies the input iterator requirements. +

+
typedef std::input_iterator_tag iterator_category;
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator__star_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator__star_.html new file mode 100644 index 0000000..b4977ca --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator__star_.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v4 >::operator * + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference the iterator. +

+
const address_v4 & operator *() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_arrow_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_arrow_.html new file mode 100644 index 0000000..5fbd8df --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_arrow_.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v4 >::operator-> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference the iterator. +

+
const address_v4 * operator->() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_.html new file mode 100644 index 0000000..e70c16a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_iterator< address_v4 >::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment operator. +

+
basic_address_iterator & operator=(
+    const basic_address_iterator & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq__eq_.html new file mode 100644 index 0000000..f29d039 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_address_iterator< address_v4 >::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two addresses for equality. +

+
friend bool operator==(
+    const basic_address_iterator & a,
+    const basic_address_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_.html new file mode 100644 index 0000000..2d1f295 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_.html @@ -0,0 +1,52 @@ + + + +ip::basic_address_iterator< address_v4 >::operator-- + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Pre-decrement operator. +

+
basic_address_iterator & operator--();
+  » more...
+
+

+ Post-decrement operator. +

+
basic_address_iterator operator--(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload1.html new file mode 100644 index 0000000..5a5ba5c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_address_iterator< address_v4 >::operator-- (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Pre-decrement operator. +

+
basic_address_iterator & operator--();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload2.html new file mode 100644 index 0000000..33436a0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v4 >::operator-- (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Post-decrement operator. +

+
basic_address_iterator operator--(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_not__eq_.html new file mode 100644 index 0000000..4716c9c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_address_iterator< address_v4 >::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two addresses for inequality. +

+
friend bool operator!=(
+    const basic_address_iterator & a,
+    const basic_address_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_.html new file mode 100644 index 0000000..3028443 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_.html @@ -0,0 +1,52 @@ + + + +ip::basic_address_iterator< address_v4 >::operator++ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Pre-increment operator. +

+
basic_address_iterator & operator++();
+  » more...
+
+

+ Post-increment operator. +

+
basic_address_iterator operator++(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload1.html new file mode 100644 index 0000000..fdeaade --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_address_iterator< address_v4 >::operator++ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Pre-increment operator. +

+
basic_address_iterator & operator++();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload2.html new file mode 100644 index 0000000..ab986f3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v4 >::operator++ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Post-increment operator. +

+
basic_address_iterator operator++(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/pointer.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/pointer.html new file mode 100644 index 0000000..f00ce87 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/pointer.html @@ -0,0 +1,54 @@ + + + +ip::basic_address_iterator< address_v4 >::pointer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of a pointer to an element pointed to by the iterator. +

+
typedef const address_v4 * pointer;
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/reference.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/reference.html new file mode 100644 index 0000000..58adfa2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/reference.html @@ -0,0 +1,534 @@ + + + +ip::basic_address_iterator< address_v4 >::reference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of a reference to an element pointed to by the + iterator. +

+
typedef const address_v4 & reference;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bytes_type +

+
+

+ The type used to represent an address as an array of bytes. +

+
+

+ uint_type +

+
+

+ The type used to represent an address as an unsigned integer. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_v4 [constructor] +

+
+

+ Default constructor.
—
Construct an address from + raw bytes.
—
Construct an address from an unsigned + integer in host byte order.
—
Copy constructor. +

+
+

+ any + [static] +

+
+

+ Obtain an address object that represents any address. +

+
+

+ broadcast [static] +

+
+

+ Obtain an address object that represents the broadcast address. +
—
(Deprecated: Use network_v4 class.) Obtain an address + object that represents the broadcast address that corresponds + to the specified address and netmask. +

+
+

+ from_string [static] +

+
+

+ (Deprecated: Use make_address_v4().) Create an address from an + IP address string in dotted decimal form. +

+
+

+ is_class_a +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class A address. +

+
+

+ is_class_b +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class B address. +

+
+

+ is_class_c +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class C address. +

+
+

+ is_loopback +

+
+

+ Determine whether the address is a loopback address. +

+
+

+ is_multicast +

+
+

+ Determine whether the address is a multicast address. +

+
+

+ is_unspecified +

+
+

+ Determine whether the address is unspecified. +

+
+

+ loopback [static] +

+
+

+ Obtain an address object that represents the loopback address. +

+
+

+ netmask [static] +

+
+

+ (Deprecated: Use network_v4 class.) Obtain the netmask that corresponds + to the address, based on its address class. +

+
+

+ operator= +

+
+

+ Assign from another address. +

+
+

+ to_bytes +

+
+

+ Get the address in bytes, in network byte order. +

+
+

+ to_string +

+
+

+ Get the address as a string in dotted decimal format.
+ —
(Deprecated: Use other overload.) Get the address as a + string in dotted decimal format. +

+
+

+ to_uint +

+
+

+ Get the address as an unsigned integer in host byte order. +

+
+

+ to_ulong +

+
+

+ Get the address as an unsigned long in host byte order. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator< +

+
+

+ Compare addresses for ordering. +

+
+

+ operator<= +

+
+

+ Compare addresses for ordering. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ operator> +

+
+

+ Compare addresses for ordering. +

+
+

+ operator>= +

+
+

+ Compare addresses for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_address_v4 +

+
+

+ Create an IPv4 address from raw bytes in network order. +

+

+ Create an IPv4 address from an unsigned integer in host byte + order. +

+

+ Create an IPv4 address from an IP address string in dotted decimal + form. +

+

+ Create an IPv4 address from a IPv4-mapped IPv6 address. +

+
+

+ make_network_v4 +

+
+

+ Create an IPv4 network from an address and prefix length. +

+

+ Create an IPv4 network from an address and netmask. +

+
+

+ operator<< +

+
+

+ Output an address as a string. +

+

+ Output a network as a string. +

+
+

+ The ip::address_v4 + class provides the ability to use and manipulate IP version 4 addresses. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/value_type.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/value_type.html new file mode 100644 index 0000000..0a1212d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/value_type.html @@ -0,0 +1,533 @@ + + + +ip::basic_address_iterator< address_v4 >::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of the elements pointed to by the iterator. +

+
typedef address_v4 value_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bytes_type +

+
+

+ The type used to represent an address as an array of bytes. +

+
+

+ uint_type +

+
+

+ The type used to represent an address as an unsigned integer. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_v4 [constructor] +

+
+

+ Default constructor.
—
Construct an address from + raw bytes.
—
Construct an address from an unsigned + integer in host byte order.
—
Copy constructor. +

+
+

+ any + [static] +

+
+

+ Obtain an address object that represents any address. +

+
+

+ broadcast [static] +

+
+

+ Obtain an address object that represents the broadcast address. +
—
(Deprecated: Use network_v4 class.) Obtain an address + object that represents the broadcast address that corresponds + to the specified address and netmask. +

+
+

+ from_string [static] +

+
+

+ (Deprecated: Use make_address_v4().) Create an address from an + IP address string in dotted decimal form. +

+
+

+ is_class_a +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class A address. +

+
+

+ is_class_b +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class B address. +

+
+

+ is_class_c +

+
+

+ (Deprecated: Use network_v4 class.) Determine whether the address + is a class C address. +

+
+

+ is_loopback +

+
+

+ Determine whether the address is a loopback address. +

+
+

+ is_multicast +

+
+

+ Determine whether the address is a multicast address. +

+
+

+ is_unspecified +

+
+

+ Determine whether the address is unspecified. +

+
+

+ loopback [static] +

+
+

+ Obtain an address object that represents the loopback address. +

+
+

+ netmask [static] +

+
+

+ (Deprecated: Use network_v4 class.) Obtain the netmask that corresponds + to the address, based on its address class. +

+
+

+ operator= +

+
+

+ Assign from another address. +

+
+

+ to_bytes +

+
+

+ Get the address in bytes, in network byte order. +

+
+

+ to_string +

+
+

+ Get the address as a string in dotted decimal format.
+ —
(Deprecated: Use other overload.) Get the address as a + string in dotted decimal format. +

+
+

+ to_uint +

+
+

+ Get the address as an unsigned integer in host byte order. +

+
+

+ to_ulong +

+
+

+ Get the address as an unsigned long in host byte order. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator< +

+
+

+ Compare addresses for ordering. +

+
+

+ operator<= +

+
+

+ Compare addresses for ordering. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ operator> +

+
+

+ Compare addresses for ordering. +

+
+

+ operator>= +

+
+

+ Compare addresses for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_address_v4 +

+
+

+ Create an IPv4 address from raw bytes in network order. +

+

+ Create an IPv4 address from an unsigned integer in host byte + order. +

+

+ Create an IPv4 address from an IP address string in dotted decimal + form. +

+

+ Create an IPv4 address from a IPv4-mapped IPv6 address. +

+
+

+ make_network_v4 +

+
+

+ Create an IPv4 network from an address and prefix length. +

+

+ Create an IPv4 network from an address and netmask. +

+
+

+ operator<< +

+
+

+ Output an address as a string. +

+

+ Output a network as a string. +

+
+

+ The ip::address_v4 + class provides the ability to use and manipulate IP version 4 addresses. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_.html new file mode 100644 index 0000000..b89775c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_.html @@ -0,0 +1,299 @@ + + + +ip::basic_address_iterator< address_v6 > + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An input iterator that can be used for traversing IPv6 addresses. +

+
template<>
+class basic_address_iterator< address_v6 >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ Distance between two iterators. +

+
+

+ iterator_category +

+
+

+ Denotes that the iterator satisfies the input iterator requirements. +

+
+

+ pointer +

+
+

+ The type of a pointer to an element pointed to by the iterator. +

+
+

+ reference +

+
+

+ The type of a reference to an element pointed to by the iterator. +

+
+

+ value_type +

+
+

+ The type of the elements pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_iterator +

+
+

+ Construct an iterator that points to the specified address.
+ —
Copy constructor. +

+
+

+ operator * +

+
+

+ Dereference the iterator. +

+
+

+ operator++ +

+
+

+ Pre-increment operator.
—
Post-increment operator. +

+
+

+ operator-- +

+
+

+ Pre-decrement operator.
—
Post-decrement operator. +

+
+

+ operator-> +

+
+

+ Dereference the iterator. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ In addition to satisfying the input iterator requirements, this iterator + also supports decrement. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator.html new file mode 100644 index 0000000..9763c9b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator.html @@ -0,0 +1,53 @@ + + + +ip::basic_address_iterator< address_v6 >::basic_address_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an iterator that points to the specified address. +

+
basic_address_iterator(
+    const address_v6 & addr);
+  » more...
+
+

+ Copy constructor. +

+
basic_address_iterator(
+    const basic_address_iterator & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload1.html new file mode 100644 index 0000000..c5757d6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload1.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v6 >::basic_address_iterator (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an iterator that points to the specified address. +

+
basic_address_iterator(
+    const address_v6 & addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload2.html new file mode 100644 index 0000000..954788d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v6 >::basic_address_iterator (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_address_iterator(
+    const basic_address_iterator & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/difference_type.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/difference_type.html new file mode 100644 index 0000000..6f9eef3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/difference_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_address_iterator< address_v6 >::difference_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Distance between two iterators. +

+
typedef std::ptrdiff_t difference_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/iterator_category.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/iterator_category.html new file mode 100644 index 0000000..e30ef32 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/iterator_category.html @@ -0,0 +1,54 @@ + + + +ip::basic_address_iterator< address_v6 >::iterator_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Denotes that the iterator satisfies the input iterator requirements. +

+
typedef std::input_iterator_tag iterator_category;
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator__star_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator__star_.html new file mode 100644 index 0000000..b6c7410 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator__star_.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v6 >::operator * + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference the iterator. +

+
const address_v6 & operator *() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_arrow_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_arrow_.html new file mode 100644 index 0000000..5e464ab --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_arrow_.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v6 >::operator-> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference the iterator. +

+
const address_v6 * operator->() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_.html new file mode 100644 index 0000000..8734b5b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_iterator< address_v6 >::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment operator. +

+
basic_address_iterator & operator=(
+    const basic_address_iterator & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq__eq_.html new file mode 100644 index 0000000..63b4a3e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_address_iterator< address_v6 >::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two addresses for equality. +

+
friend bool operator==(
+    const basic_address_iterator & a,
+    const basic_address_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_.html new file mode 100644 index 0000000..5547e62 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_.html @@ -0,0 +1,52 @@ + + + +ip::basic_address_iterator< address_v6 >::operator-- + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Pre-decrement operator. +

+
basic_address_iterator & operator--();
+  » more...
+
+

+ Post-decrement operator. +

+
basic_address_iterator operator--(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload1.html new file mode 100644 index 0000000..29d0869 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_address_iterator< address_v6 >::operator-- (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Pre-decrement operator. +

+
basic_address_iterator & operator--();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload2.html new file mode 100644 index 0000000..604d8d9 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v6 >::operator-- (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Post-decrement operator. +

+
basic_address_iterator operator--(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_not__eq_.html new file mode 100644 index 0000000..27cc0af --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_address_iterator< address_v6 >::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two addresses for inequality. +

+
friend bool operator!=(
+    const basic_address_iterator & a,
+    const basic_address_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_.html new file mode 100644 index 0000000..31ce21c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_.html @@ -0,0 +1,52 @@ + + + +ip::basic_address_iterator< address_v6 >::operator++ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Pre-increment operator. +

+
basic_address_iterator & operator++();
+  » more...
+
+

+ Post-increment operator. +

+
basic_address_iterator operator++(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload1.html new file mode 100644 index 0000000..3256e21 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_address_iterator< address_v6 >::operator++ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Pre-increment operator. +

+
basic_address_iterator & operator++();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload2.html new file mode 100644 index 0000000..928731c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_iterator< address_v6 >::operator++ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Post-increment operator. +

+
basic_address_iterator operator++(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/pointer.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/pointer.html new file mode 100644 index 0000000..b9fd851 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/pointer.html @@ -0,0 +1,54 @@ + + + +ip::basic_address_iterator< address_v6 >::pointer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of a pointer to an element pointed to by the iterator. +

+
typedef const address_v6 * pointer;
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/reference.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/reference.html new file mode 100644 index 0000000..dfd9c55 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/reference.html @@ -0,0 +1,582 @@ + + + +ip::basic_address_iterator< address_v6 >::reference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of a reference to an element pointed to by the + iterator. +

+
typedef const address_v6 & reference;
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bytes_type +

+
+

+ The type used to represent an address as an array of bytes. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_v6 [constructor] +

+
+

+ Default constructor.
—
Construct an address from + raw bytes and scope ID.
—
Copy constructor. +

+
+

+ any + [static] +

+
+

+ Obtain an address object that represents any address. +

+
+

+ from_string [static] +

+
+

+ (Deprecated: Use make_address_v6().) Create an IPv6 address from + an IP address string. +

+
+

+ is_link_local +

+
+

+ Determine whether the address is link local. +

+
+

+ is_loopback +

+
+

+ Determine whether the address is a loopback address. +

+
+

+ is_multicast +

+
+

+ Determine whether the address is a multicast address. +

+
+

+ is_multicast_global +

+
+

+ Determine whether the address is a global multicast address. +

+
+

+ is_multicast_link_local +

+
+

+ Determine whether the address is a link-local multicast address. +

+
+

+ is_multicast_node_local +

+
+

+ Determine whether the address is a node-local multicast address. +

+
+

+ is_multicast_org_local +

+
+

+ Determine whether the address is a org-local multicast address. +

+
+

+ is_multicast_site_local +

+
+

+ Determine whether the address is a site-local multicast address. +

+
+

+ is_site_local +

+
+

+ Determine whether the address is site local. +

+
+

+ is_unspecified +

+
+

+ Determine whether the address is unspecified. +

+
+

+ is_v4_compatible +

+
+

+ (Deprecated: No replacement.) Determine whether the address is + an IPv4-compatible address. +

+
+

+ is_v4_mapped +

+
+

+ Determine whether the address is a mapped IPv4 address. +

+
+

+ loopback [static] +

+
+

+ Obtain an address object that represents the loopback address. +

+
+

+ operator= +

+
+

+ Assign from another address. +

+
+

+ scope_id +

+
+

+ The scope ID of the address. +

+
+

+ to_bytes +

+
+

+ Get the address in bytes, in network byte order. +

+
+

+ to_string +

+
+

+ Get the address as a string.
—
(Deprecated: Use other + overload.) Get the address as a string. +

+
+

+ to_v4 +

+
+

+ (Deprecated: Use make_address_v4().) Converts an IPv4-mapped + or IPv4-compatible address to an IPv4 address. +

+
+

+ v4_compatible [static] +

+
+

+ (Deprecated: No replacement.) Create an IPv4-compatible IPv6 + address. +

+
+

+ v4_mapped [static] +

+
+

+ (Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 + address. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator< +

+
+

+ Compare addresses for ordering. +

+
+

+ operator<= +

+
+

+ Compare addresses for ordering. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ operator> +

+
+

+ Compare addresses for ordering. +

+
+

+ operator>= +

+
+

+ Compare addresses for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_address_v6 +

+
+

+ Create an IPv6 address from raw bytes and scope ID. +

+

+ Create an IPv6 address from an IP address string. +

+

+ Createan IPv6 address from an IP address string. +

+

+ Create an IPv4-mapped IPv6 address from an IPv4 address. +

+
+

+ make_network_v6 +

+
+

+ Create an IPv6 network from an address and prefix length. +

+
+

+ operator<< +

+
+

+ Output an address as a string. +

+

+ Output a network as a string. +

+
+

+ The ip::address_v6 + class provides the ability to use and manipulate IP version 6 addresses. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/value_type.html b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/value_type.html new file mode 100644 index 0000000..3a0698f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/value_type.html @@ -0,0 +1,581 @@ + + + +ip::basic_address_iterator< address_v6 >::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of the elements pointed to by the iterator. +

+
typedef address_v6 value_type;
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bytes_type +

+
+

+ The type used to represent an address as an array of bytes. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_v6 [constructor] +

+
+

+ Default constructor.
—
Construct an address from + raw bytes and scope ID.
—
Copy constructor. +

+
+

+ any + [static] +

+
+

+ Obtain an address object that represents any address. +

+
+

+ from_string [static] +

+
+

+ (Deprecated: Use make_address_v6().) Create an IPv6 address from + an IP address string. +

+
+

+ is_link_local +

+
+

+ Determine whether the address is link local. +

+
+

+ is_loopback +

+
+

+ Determine whether the address is a loopback address. +

+
+

+ is_multicast +

+
+

+ Determine whether the address is a multicast address. +

+
+

+ is_multicast_global +

+
+

+ Determine whether the address is a global multicast address. +

+
+

+ is_multicast_link_local +

+
+

+ Determine whether the address is a link-local multicast address. +

+
+

+ is_multicast_node_local +

+
+

+ Determine whether the address is a node-local multicast address. +

+
+

+ is_multicast_org_local +

+
+

+ Determine whether the address is a org-local multicast address. +

+
+

+ is_multicast_site_local +

+
+

+ Determine whether the address is a site-local multicast address. +

+
+

+ is_site_local +

+
+

+ Determine whether the address is site local. +

+
+

+ is_unspecified +

+
+

+ Determine whether the address is unspecified. +

+
+

+ is_v4_compatible +

+
+

+ (Deprecated: No replacement.) Determine whether the address is + an IPv4-compatible address. +

+
+

+ is_v4_mapped +

+
+

+ Determine whether the address is a mapped IPv4 address. +

+
+

+ loopback [static] +

+
+

+ Obtain an address object that represents the loopback address. +

+
+

+ operator= +

+
+

+ Assign from another address. +

+
+

+ scope_id +

+
+

+ The scope ID of the address. +

+
+

+ to_bytes +

+
+

+ Get the address in bytes, in network byte order. +

+
+

+ to_string +

+
+

+ Get the address as a string.
—
(Deprecated: Use other + overload.) Get the address as a string. +

+
+

+ to_v4 +

+
+

+ (Deprecated: Use make_address_v4().) Converts an IPv4-mapped + or IPv4-compatible address to an IPv4 address. +

+
+

+ v4_compatible [static] +

+
+

+ (Deprecated: No replacement.) Create an IPv4-compatible IPv6 + address. +

+
+

+ v4_mapped [static] +

+
+

+ (Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 + address. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator< +

+
+

+ Compare addresses for ordering. +

+
+

+ operator<= +

+
+

+ Compare addresses for ordering. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ operator> +

+
+

+ Compare addresses for ordering. +

+
+

+ operator>= +

+
+

+ Compare addresses for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_address_v6 +

+
+

+ Create an IPv6 address from raw bytes and scope ID. +

+

+ Create an IPv6 address from an IP address string. +

+

+ Createan IPv6 address from an IP address string. +

+

+ Create an IPv4-mapped IPv6 address from an IPv4 address. +

+
+

+ make_network_v6 +

+
+

+ Create an IPv6 network from an address and prefix length. +

+
+

+ operator<< +

+
+

+ Output an address as a string. +

+

+ Output a network as a string. +

+
+

+ The ip::address_v6 + class provides the ability to use and manipulate IP version 6 addresses. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_.html new file mode 100644 index 0000000..786b7fe --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_.html @@ -0,0 +1,209 @@ + + + +ip::basic_address_range< address_v4 > + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Represents a range of IPv4 addresses. +

+
template<>
+class basic_address_range< address_v4 >
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ iterator +

+
+

+ The type of an iterator that points into the range. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_range +

+
+

+ Construct an empty range.
—
Construct an range that + represents the given range of addresses.
—
Copy constructor. +

+
+

+ begin +

+
+

+ Obtain an iterator that points to the start of the range. +

+
+

+ empty +

+
+

+ Determine whether the range is empty. +

+
+

+ end +

+
+

+ Obtain an iterator that points to the end of the range. +

+
+

+ find +

+
+

+ Find an address in the range. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+

+ size +

+
+

+ Return the size of the range. +

+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4_range.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range.html new file mode 100644 index 0000000..d435f87 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range.html @@ -0,0 +1,60 @@ + + + +ip::basic_address_range< address_v4 >::basic_address_range + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an empty range. +

+
basic_address_range();
+  » more...
+
+

+ Construct an range that represents the given range of addresses. +

+
explicit basic_address_range(
+    const iterator & first,
+    const iterator & last);
+  » more...
+
+

+ Copy constructor. +

+
basic_address_range(
+    const basic_address_range & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload1.html new file mode 100644 index 0000000..f1d43b7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_address_range< address_v4 >::basic_address_range (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an empty range. +

+
basic_address_range();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload2.html new file mode 100644 index 0000000..a942b0f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload2.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_range< address_v4 >::basic_address_range (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an range that represents the given range of addresses. +

+
basic_address_range(
+    const iterator & first,
+    const iterator & last);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload3.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload3.html new file mode 100644 index 0000000..c7d2819 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload3.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v4 >::basic_address_range (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_address_range(
+    const basic_address_range & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/begin.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/begin.html new file mode 100644 index 0000000..81c8f47 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/begin.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v4 >::begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an iterator that points to the start of the range. +

+
iterator begin() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/empty.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/empty.html new file mode 100644 index 0000000..ac86a0d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/empty.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v4 >::empty + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine whether the range is empty. +

+
bool empty() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/end.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/end.html new file mode 100644 index 0000000..94215eb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/end.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v4 >::end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an iterator that points to the end of the range. +

+
iterator end() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/find.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/find.html new file mode 100644 index 0000000..d70aff6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/find.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_range< address_v4 >::find + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Find an address in the range. +

+
iterator find(
+    const address_v4 & addr) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/iterator.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/iterator.html new file mode 100644 index 0000000..922b71c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/iterator.html @@ -0,0 +1,299 @@ + + + +ip::basic_address_range< address_v4 >::iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of an iterator that points into the range. +

+
typedef basic_address_iterator< address_v4 > iterator;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ Distance between two iterators. +

+
+

+ iterator_category +

+
+

+ Denotes that the iterator satisfies the input iterator requirements. +

+
+

+ pointer +

+
+

+ The type of a pointer to an element pointed to by the iterator. +

+
+

+ reference +

+
+

+ The type of a reference to an element pointed to by the iterator. +

+
+

+ value_type +

+
+

+ The type of the elements pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_iterator +

+
+

+ Construct an iterator that points to the specified address. +
—
Copy constructor. +

+
+

+ operator * +

+
+

+ Dereference the iterator. +

+
+

+ operator++ +

+
+

+ Pre-increment operator.
—
Post-increment operator. +

+
+

+ operator-- +

+
+

+ Pre-decrement operator.
—
Post-decrement operator. +

+
+

+ operator-> +

+
+

+ Dereference the iterator. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ In addition to satisfying the input iterator requirements, this iterator + also supports decrement. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v4_range.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_.html new file mode 100644 index 0000000..b3cc327 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_range< address_v4 >::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment operator. +

+
basic_address_range & operator=(
+    const basic_address_range & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/size.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/size.html new file mode 100644 index 0000000..8a488c8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v4__gt_/size.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v4 >::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Return the size of the range. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_.html new file mode 100644 index 0000000..6d25c0c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_.html @@ -0,0 +1,197 @@ + + + +ip::basic_address_range< address_v6 > + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Represents a range of IPv6 addresses. +

+
template<>
+class basic_address_range< address_v6 >
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ iterator +

+
+

+ The type of an iterator that points into the range. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_range +

+
+

+ Construct an empty range.
—
Construct an range that + represents the given range of addresses.
—
Copy constructor. +

+
+

+ begin +

+
+

+ Obtain an iterator that points to the start of the range. +

+
+

+ empty +

+
+

+ Determine whether the range is empty. +

+
+

+ end +

+
+

+ Obtain an iterator that points to the end of the range. +

+
+

+ find +

+
+

+ Find an address in the range. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6_range.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range.html new file mode 100644 index 0000000..f9188a7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range.html @@ -0,0 +1,60 @@ + + + +ip::basic_address_range< address_v6 >::basic_address_range + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct an empty range. +

+
basic_address_range();
+  » more...
+
+

+ Construct an range that represents the given range of addresses. +

+
explicit basic_address_range(
+    const iterator & first,
+    const iterator & last);
+  » more...
+
+

+ Copy constructor. +

+
basic_address_range(
+    const basic_address_range & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload1.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload1.html new file mode 100644 index 0000000..53e2804 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_address_range< address_v6 >::basic_address_range (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an empty range. +

+
basic_address_range();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload2.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload2.html new file mode 100644 index 0000000..0fc96e7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload2.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_range< address_v6 >::basic_address_range (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an range that represents the given range of addresses. +

+
basic_address_range(
+    const iterator & first,
+    const iterator & last);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload3.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload3.html new file mode 100644 index 0000000..2f50cf8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload3.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v6 >::basic_address_range (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_address_range(
+    const basic_address_range & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/begin.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/begin.html new file mode 100644 index 0000000..1d02c94 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/begin.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v6 >::begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an iterator that points to the start of the range. +

+
iterator begin() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/empty.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/empty.html new file mode 100644 index 0000000..f2d6f0d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/empty.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v6 >::empty + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine whether the range is empty. +

+
bool empty() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/end.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/end.html new file mode 100644 index 0000000..9fc3a76 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/end.html @@ -0,0 +1,44 @@ + + + +ip::basic_address_range< address_v6 >::end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an iterator that points to the end of the range. +

+
iterator end() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/find.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/find.html new file mode 100644 index 0000000..c54409b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/find.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_range< address_v6 >::find + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Find an address in the range. +

+
iterator find(
+    const address_v6 & addr) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/iterator.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/iterator.html new file mode 100644 index 0000000..b762898 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/iterator.html @@ -0,0 +1,299 @@ + + + +ip::basic_address_range< address_v6 >::iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of an iterator that points into the range. +

+
typedef basic_address_iterator< address_v6 > iterator;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ Distance between two iterators. +

+
+

+ iterator_category +

+
+

+ Denotes that the iterator satisfies the input iterator requirements. +

+
+

+ pointer +

+
+

+ The type of a pointer to an element pointed to by the iterator. +

+
+

+ reference +

+
+

+ The type of a reference to an element pointed to by the iterator. +

+
+

+ value_type +

+
+

+ The type of the elements pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_address_iterator +

+
+

+ Construct an iterator that points to the specified address. +
—
Copy constructor. +

+
+

+ operator * +

+
+

+ Dereference the iterator. +

+
+

+ operator++ +

+
+

+ Pre-increment operator.
—
Post-increment operator. +

+
+

+ operator-- +

+
+

+ Pre-decrement operator.
—
Post-decrement operator. +

+
+

+ operator-> +

+
+

+ Dereference the iterator. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two addresses for inequality. +

+
+

+ operator== +

+
+

+ Compare two addresses for equality. +

+
+

+ In addition to satisfying the input iterator requirements, this iterator + also supports decrement. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/address_v6_range.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_.html new file mode 100644 index 0000000..bb4f0cb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::basic_address_range< address_v6 >::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment operator. +

+
basic_address_range & operator=(
+    const basic_address_range & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint.html b/include/asio/doc/asio/reference/ip__basic_endpoint.html new file mode 100644 index 0000000..ffe9148 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint.html @@ -0,0 +1,395 @@ + + + +ip::basic_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Describes an endpoint for a version-independent IP socket. +

+
template<
+    typename InternetProtocol>
+class basic_endpoint
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on the + underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address +

+
+

+ Get the IP address associated with the endpoint.
—
+ Set the IP address associated with the endpoint. +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint using + a port number, specified in the host's byte order. The IP address + will be the any address (i.e. INADDR_ANY or in6addr_any). This + constructor would typically be used for accepting new connections. +
—
Construct an endpoint using a port number and an + IP address. This constructor may be used for accepting connections + on a specific interface or for making a connection to a remote + endpoint.
—
Copy constructor.
—
Move constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint.
—
Move-assign from another + endpoint. +

+
+

+ port +

+
+

+ Get the port associated with the endpoint. The port number is always + in the host's byte order.
—
Set the port associated + with the endpoint. The port number is always in the host's byte + order. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator<< +

+
+

+ Output an endpoint as a string. +

+
+

+ The ip::basic_endpoint + class template describes an endpoint that may be associated with a particular + socket. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/address.html b/include/asio/doc/asio/reference/ip__basic_endpoint/address.html new file mode 100644 index 0000000..e082bac --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/address.html @@ -0,0 +1,52 @@ + + + +ip::basic_endpoint::address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + IP address associated with the endpoint. +

+
asio::ip::address address() const;
+  » more...
+
+

+ Set the IP address associated with the endpoint. +

+
void address(
+    const asio::ip::address & addr);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/address/overload1.html b/include/asio/doc/asio/reference/ip__basic_endpoint/address/overload1.html new file mode 100644 index 0000000..e925d41 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/address/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_endpoint::address (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the IP address associated with the endpoint. +

+
asio::ip::address address() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/address/overload2.html b/include/asio/doc/asio/reference/ip__basic_endpoint/address/overload2.html new file mode 100644 index 0000000..61ead4d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/address/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::address (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the IP address associated with the endpoint. +

+
void address(
+    const asio::ip::address & addr);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint.html b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint.html new file mode 100644 index 0000000..6c4cc20 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint.html @@ -0,0 +1,79 @@ + + + +ip::basic_endpoint::basic_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
basic_endpoint();
+  » more...
+
+

+ Construct an endpoint using a port number, specified in the host's byte + order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). + This constructor would typically be used for accepting new connections. +

+
basic_endpoint(
+    const InternetProtocol & internet_protocol,
+    unsigned short port_num);
+  » more...
+
+

+ Construct an endpoint using a port number and an IP address. This constructor + may be used for accepting connections on a specific interface or for making + a connection to a remote endpoint. +

+
basic_endpoint(
+    const asio::ip::address & addr,
+    unsigned short port_num);
+  » more...
+
+

+ Copy constructor. +

+
basic_endpoint(
+    const basic_endpoint & other);
+  » more...
+
+

+ Move constructor. +

+
basic_endpoint(
+    basic_endpoint && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload1.html b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload1.html new file mode 100644 index 0000000..d8f4c2e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_endpoint::basic_endpoint (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
basic_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload2.html b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload2.html new file mode 100644 index 0000000..adb5219 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload2.html @@ -0,0 +1,61 @@ + + + +ip::basic_endpoint::basic_endpoint (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an endpoint using a port number, specified in the host's byte + order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). + This constructor would typically be used for accepting new connections. +

+
basic_endpoint(
+    const InternetProtocol & internet_protocol,
+    unsigned short port_num);
+
+
+ + Examples +
+

+ To initialise an IPv4 TCP endpoint for port 1234, use: +

+
asio::ip::tcp::endpoint ep(asio::ip::tcp::v4(), 1234);
+
+

+ To specify an IPv6 UDP endpoint for port 9876, use: +

+
asio::ip::udp::endpoint ep(asio::ip::udp::v6(), 9876);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload3.html b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload3.html new file mode 100644 index 0000000..55778e1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload3.html @@ -0,0 +1,47 @@ + + + +ip::basic_endpoint::basic_endpoint (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an endpoint using a port number and an IP address. This constructor + may be used for accepting connections on a specific interface or for + making a connection to a remote endpoint. +

+
basic_endpoint(
+    const asio::ip::address & addr,
+    unsigned short port_num);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload4.html b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload4.html new file mode 100644 index 0000000..22274a8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload4.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::basic_endpoint (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_endpoint(
+    const basic_endpoint & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload5.html b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload5.html new file mode 100644 index 0000000..69e7a89 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/basic_endpoint/overload5.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::basic_endpoint (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
basic_endpoint(
+    basic_endpoint && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/capacity.html b/include/asio/doc/asio/reference/ip__basic_endpoint/capacity.html new file mode 100644 index 0000000..8d04d9c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/capacity.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::capacity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the capacity of the endpoint in the native type. +

+
std::size_t capacity() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/data.html b/include/asio/doc/asio/reference/ip__basic_endpoint/data.html new file mode 100644 index 0000000..360c322 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/data.html @@ -0,0 +1,48 @@ + + + +ip::basic_endpoint::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the underlying + endpoint in the native type. +

+
data_type * data();
+  » more...
+
+const data_type * data() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/data/overload1.html b/include/asio/doc/asio/reference/ip__basic_endpoint/data/overload1.html new file mode 100644 index 0000000..d06e280 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/data/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_endpoint::data (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying endpoint in the native type. +

+
data_type * data();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/data/overload2.html b/include/asio/doc/asio/reference/ip__basic_endpoint/data/overload2.html new file mode 100644 index 0000000..f1d5956 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/data/overload2.html @@ -0,0 +1,43 @@ + + + +ip::basic_endpoint::data (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying endpoint in the native type. +

+
const data_type * data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/data_type.html b/include/asio/doc/asio/reference/ip__basic_endpoint/data_type.html new file mode 100644 index 0000000..862ca25 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/data_type.html @@ -0,0 +1,55 @@ + + + +ip::basic_endpoint::data_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the endpoint structure. This type is dependent on the underlying + implementation of the socket layer. +

+
typedef implementation_defined data_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_.html new file mode 100644 index 0000000..8abb66c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_.html @@ -0,0 +1,53 @@ + + + +ip::basic_endpoint::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + from another endpoint. +

+
basic_endpoint & operator=(
+    const basic_endpoint & other);
+  » more...
+
+

+ Move-assign from another endpoint. +

+
basic_endpoint & operator=(
+    basic_endpoint && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_/overload1.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_/overload1.html new file mode 100644 index 0000000..574bbc9 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign from another endpoint. +

+
basic_endpoint & operator=(
+    const basic_endpoint & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_/overload2.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_/overload2.html new file mode 100644 index 0000000..8cc7f36 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assign from another endpoint. +

+
basic_endpoint & operator=(
+    basic_endpoint && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq__eq_.html new file mode 100644 index 0000000..a0e52bd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_endpoint::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two endpoints for equality. +

+
friend bool operator==(
+    const basic_endpoint< InternetProtocol > & e1,
+    const basic_endpoint< InternetProtocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_gt_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_gt_.html new file mode 100644 index 0000000..aad49f8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_gt_.html @@ -0,0 +1,56 @@ + + + +ip::basic_endpoint::operator> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator>(
+    const basic_endpoint< InternetProtocol > & e1,
+    const basic_endpoint< InternetProtocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_gt__eq_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_gt__eq_.html new file mode 100644 index 0000000..28cbdae --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_gt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_endpoint::operator>= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator>=(
+    const basic_endpoint< InternetProtocol > & e1,
+    const basic_endpoint< InternetProtocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt_.html new file mode 100644 index 0000000..954d3f3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt_.html @@ -0,0 +1,56 @@ + + + +ip::basic_endpoint::operator< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator<(
+    const basic_endpoint< InternetProtocol > & e1,
+    const basic_endpoint< InternetProtocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt__eq_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt__eq_.html new file mode 100644 index 0000000..2aa8b98 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_endpoint::operator<= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator<=(
+    const basic_endpoint< InternetProtocol > & e1,
+    const basic_endpoint< InternetProtocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt__lt_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt__lt_.html new file mode 100644 index 0000000..1abd740 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_lt__lt_.html @@ -0,0 +1,74 @@ + + + +ip::basic_endpoint::operator<< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Output + an endpoint as a string. +

+
std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const basic_endpoint< InternetProtocol > & endpoint);
+
+

+ Used to output a human-readable string for a specified endpoint. +

+
+ + Parameters +
+
+

+
+
os
+

+ The output stream to which the string will be written. +

+
endpoint
+

+ The endpoint to be written. +

+
+
+
+ + Return + Value +
+

+ The output stream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_not__eq_.html new file mode 100644 index 0000000..970ddbe --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_endpoint::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two endpoints for inequality. +

+
friend bool operator!=(
+    const basic_endpoint< InternetProtocol > & e1,
+    const basic_endpoint< InternetProtocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/port.html b/include/asio/doc/asio/reference/ip__basic_endpoint/port.html new file mode 100644 index 0000000..e4071b2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/port.html @@ -0,0 +1,54 @@ + + + +ip::basic_endpoint::port + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the port + associated with the endpoint. The port number is always in the host's byte + order. +

+
unsigned short port() const;
+  » more...
+
+

+ Set the port associated with the endpoint. The port number is always in + the host's byte order. +

+
void port(
+    unsigned short port_num);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/port/overload1.html b/include/asio/doc/asio/reference/ip__basic_endpoint/port/overload1.html new file mode 100644 index 0000000..76287c1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/port/overload1.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::port (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the port associated with the endpoint. The port number is always + in the host's byte order. +

+
unsigned short port() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/port/overload2.html b/include/asio/doc/asio/reference/ip__basic_endpoint/port/overload2.html new file mode 100644 index 0000000..92c7bc6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/port/overload2.html @@ -0,0 +1,45 @@ + + + +ip::basic_endpoint::port (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the port associated with the endpoint. The port number is always + in the host's byte order. +

+
void port(
+    unsigned short port_num);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/protocol.html b/include/asio/doc/asio/reference/ip__basic_endpoint/protocol.html new file mode 100644 index 0000000..c3aeef3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/protocol.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol associated with the endpoint. +

+
protocol_type protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/protocol_type.html b/include/asio/doc/asio/reference/ip__basic_endpoint/protocol_type.html new file mode 100644 index 0000000..6372adc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/protocol_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_endpoint::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type associated with the endpoint. +

+
typedef InternetProtocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/resize.html b/include/asio/doc/asio/reference/ip__basic_endpoint/resize.html new file mode 100644 index 0000000..f4c85da --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/resize.html @@ -0,0 +1,45 @@ + + + +ip::basic_endpoint::resize + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set the + underlying size of the endpoint in the native type. +

+
void resize(
+    std::size_t new_size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_endpoint/size.html b/include/asio/doc/asio/reference/ip__basic_endpoint/size.html new file mode 100644 index 0000000..6b7e52b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_endpoint/size.html @@ -0,0 +1,44 @@ + + + +ip::basic_endpoint::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the underlying + size of the endpoint in the native type. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver.html b/include/asio/doc/asio/reference/ip__basic_resolver.html new file mode 100644 index 0000000..7a530c6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver.html @@ -0,0 +1,424 @@ + + + +ip::basic_resolver + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides endpoint resolution functionality. +

+
template<
+    typename InternetProtocol,
+    typename Executor>
+class basic_resolver :
+  public ip::resolver_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the resolver type to another executor. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+

+ iterator +

+
+

+ (Deprecated.) The iterator type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ query +

+
+

+ (Deprecated.) The query type. +

+
+

+ results_type +

+
+

+ The results type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Asynchronously perform forward resolution of a query to a list + of entries.
—
Asynchronously perform forward resolution + of a query to a list of entries.
—
Asynchronously perform + reverse resolution of an endpoint to a list of entries. +

+
+

+ basic_resolver [constructor] +

+
+

+ Construct with executor.
—
Construct with execution + context.
—
Move-construct a basic_resolver from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the resolver. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_resolver from another. +

+
+

+ resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Perform forward resolution of a query to a list of entries.
+ —
Perform forward resolution of a query to a list of entries. +
—
Perform reverse resolution of an endpoint to a list + of entries. +

+
+

+ ~basic_resolver [destructor] +

+
+

+ Destroys the resolver. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is configured + for the system. Only return IPv6 addresses if a non-loopback IPv6 + address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a port + number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+

+ The ip::basic_resolver + class template provides the ability to resolve a query to a list of endpoints. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/_basic_resolver.html b/include/asio/doc/asio/reference/ip__basic_resolver/_basic_resolver.html new file mode 100644 index 0000000..ecb7d98 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/_basic_resolver.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver::~basic_resolver + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destroys + the resolver. +

+
~basic_resolver();
+
+

+ This function destroys the resolver, cancelling any outstanding asynchronous + wait operations associated with the resolver as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/address_configured.html b/include/asio/doc/asio/reference/ip__basic_resolver/address_configured.html new file mode 100644 index 0000000..25bd762 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/address_configured.html @@ -0,0 +1,49 @@ + + + +ip::basic_resolver::address_configured + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Only + return IPv4 addresses if a non-loopback IPv4 address is configured for + the system. Only return IPv6 addresses if a non-loopback IPv6 address is + configured for the system. +

+
static const flags address_configured = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/all_matching.html b/include/asio/doc/asio/reference/ip__basic_resolver/all_matching.html new file mode 100644 index 0000000..4d48165 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/all_matching.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver::all_matching + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +If + used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
static const flags all_matching = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve.html b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve.html new file mode 100644 index 0000000..b9888cf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve.html @@ -0,0 +1,99 @@ + + + +ip::basic_resolver::async_resolve + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use overload with separate host and service parameters.) Asynchronously + perform forward resolution of a query to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const query & q,
+    ResolveHandler && handler = DEFAULT);
+  » more...
+
+

+ Asynchronously perform forward resolution of a query to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    string_view host,
+    string_view service,
+    ResolveHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    ResolveHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    ResolveHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    ResolveHandler && handler = DEFAULT);
+  » more...
+
+

+ Asynchronously perform reverse resolution of an endpoint to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const endpoint_type & e,
+    ResolveHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload1.html new file mode 100644 index 0000000..0f58baf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload1.html @@ -0,0 +1,88 @@ + + + +ip::basic_resolver::async_resolve (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use overload with separate host and service parameters.) + Asynchronously perform forward resolution of a query to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const query & q,
+    ResolveHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously resolve a query into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
q
+

+ A query object that determines what endpoints will be returned. +

+
handler
+
+

+ The handler to be called when the resolve operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  resolver::results_type results // Resolved endpoints as a range.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+

+ A successful resolve operation is guaranteed to pass a non-empty range + to the handler. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload2.html new file mode 100644 index 0000000..e6bff0f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload2.html @@ -0,0 +1,116 @@ + + + +ip::basic_resolver::async_resolve (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously perform forward resolution of a query to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    string_view host,
+    string_view service,
+    ResolveHandler && handler = DEFAULT);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
handler
+
+

+ The handler to be called when the resolve operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  resolver::results_type results // Resolved endpoints as a range.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+

+ A successful resolve operation is guaranteed to pass a non-empty range + to the handler. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload3.html b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload3.html new file mode 100644 index 0000000..a227b0d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload3.html @@ -0,0 +1,124 @@ + + + +ip::basic_resolver::async_resolve (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously perform forward resolution of a query to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    ResolveHandler && handler = DEFAULT);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. + See the ip::resolver_base + documentation for the set of available flags. +

+
handler
+
+

+ The handler to be called when the resolve operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  resolver::results_type results // Resolved endpoints as a range.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+

+ A successful resolve operation is guaranteed to pass a non-empty range + to the handler. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload4.html b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload4.html new file mode 100644 index 0000000..9cdc161 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload4.html @@ -0,0 +1,122 @@ + + + +ip::basic_resolver::async_resolve (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously perform forward resolution of a query to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    ResolveHandler && handler = DEFAULT);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
handler
+
+

+ The handler to be called when the resolve operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  resolver::results_type results // Resolved endpoints as a range.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+

+ A successful resolve operation is guaranteed to pass a non-empty range + to the handler. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload5.html b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload5.html new file mode 100644 index 0000000..f177885 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload5.html @@ -0,0 +1,130 @@ + + + +ip::basic_resolver::async_resolve (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously perform forward resolution of a query to a list of entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    ResolveHandler && handler = DEFAULT);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. + See the ip::resolver_base + documentation for the set of available flags. +

+
handler
+
+

+ The handler to be called when the resolve operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  resolver::results_type results // Resolved endpoints as a range.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+

+ A successful resolve operation is guaranteed to pass a non-empty range + to the handler. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload6.html b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload6.html new file mode 100644 index 0000000..b8baeb7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/async_resolve/overload6.html @@ -0,0 +1,88 @@ + + + +ip::basic_resolver::async_resolve (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asynchronously perform reverse resolution of an endpoint to a list of + entries. +

+
template<
+    typename ResolveHandler = DEFAULT>
+DEDUCED async_resolve(
+    const endpoint_type & e,
+    ResolveHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously resolve an endpoint into a list + of endpoint entries. +

+
+ + Parameters +
+
+

+
+
e
+

+ An endpoint object that determines what endpoints will be returned. +

+
handler
+
+

+ The handler to be called when the resolve operation completes. + Copies will be made of the handler as required. The function signature + of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  resolver::results_type results // Resolved endpoints as a range.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+

+ A successful resolve operation is guaranteed to pass a non-empty range + to the handler. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver.html b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver.html new file mode 100644 index 0000000..c2390ee --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver.html @@ -0,0 +1,64 @@ + + + +ip::basic_resolver::basic_resolver + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + with executor. +

+
explicit basic_resolver(
+    const executor_type & ex);
+  » more...
+
+

+ Construct with execution context. +

+
template<
+    typename ExecutionContext>
+explicit basic_resolver(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a ip::basic_resolver + from another. +

+
basic_resolver(
+    basic_resolver && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload1.html new file mode 100644 index 0000000..d8e0f5a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload1.html @@ -0,0 +1,61 @@ + + + +ip::basic_resolver::basic_resolver (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with executor. +

+
basic_resolver(
+    const executor_type & ex);
+
+

+ This constructor creates a ip::basic_resolver. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the resolver will use, by default, to dispatch + handlers for any asynchronous operations performed on the resolver. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload2.html new file mode 100644 index 0000000..15ba4fe --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload2.html @@ -0,0 +1,65 @@ + + + +ip::basic_resolver::basic_resolver (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with execution context. +

+
template<
+    typename ExecutionContext>
+basic_resolver(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a ip::basic_resolver. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the resolver + will use, by default, to dispatch handlers for any asynchronous + operations performed on the resolver. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload3.html b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload3.html new file mode 100644 index 0000000..bd2a76b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/basic_resolver/overload3.html @@ -0,0 +1,71 @@ + + + +ip::basic_resolver::basic_resolver (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a ip::basic_resolver + from another. +

+
basic_resolver(
+    basic_resolver && other);
+
+

+ This constructor moves a resolver from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other ip::basic_resolver + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_resolver(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/cancel.html b/include/asio/doc/asio/reference/ip__basic_resolver/cancel.html new file mode 100644 index 0000000..e2aad68 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/cancel.html @@ -0,0 +1,49 @@ + + + +ip::basic_resolver::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + any asynchronous operations that are waiting on the resolver. +

+
void cancel();
+
+

+ This function forces the completion of any pending asynchronous operations + on the host resolver. The handler for each cancelled operation will be + invoked with the asio::error::operation_aborted error code. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/canonical_name.html b/include/asio/doc/asio/reference/ip__basic_resolver/canonical_name.html new file mode 100644 index 0000000..c2d4339 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/canonical_name.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver::canonical_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Determine + the canonical name of the host specified in the query. +

+
static const flags canonical_name = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/endpoint_type.html b/include/asio/doc/asio/reference/ip__basic_resolver/endpoint_type.html new file mode 100644 index 0000000..65a7328 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/endpoint_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type. +

+
typedef InternetProtocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/executor_type.html b/include/asio/doc/asio/reference/ip__basic_resolver/executor_type.html new file mode 100644 index 0000000..6870c5c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/executor_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/flags.html b/include/asio/doc/asio/reference/ip__basic_resolver/flags.html new file mode 100644 index 0000000..73281e4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/flags.html @@ -0,0 +1,57 @@ + + + +ip::basic_resolver::flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +A bitmask + type (C++ Std [lib.bitmask.types]). +

+
typedef unspecified flags;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/get_executor.html b/include/asio/doc/asio/reference/ip__basic_resolver/get_executor.html new file mode 100644 index 0000000..ba85a15 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/get_executor.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/iterator.html b/include/asio/doc/asio/reference/ip__basic_resolver/iterator.html new file mode 100644 index 0000000..5f95957 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/iterator.html @@ -0,0 +1,390 @@ + + + +ip::basic_resolver::iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated.) + The iterator type. +

+
typedef basic_resolver_iterator< InternetProtocol > iterator;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ The type used for the distance between two iterators. +

+
+

+ iterator_category +

+
+

+ The iterator category. +

+
+

+ pointer +

+
+

+ The type of the result of applying operator->() to the iterator. +

+
+

+ reference +

+
+

+ The type of the result of applying operator*() to the iterator. +

+
+

+ value_type +

+
+

+ The type of the value pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_iterator [constructor] +

+
+

+ Default constructor creates an end iterator.
—
Copy + constructor.
—
Move constructor. +

+
+

+ operator * +

+
+

+ Dereference an iterator. +

+
+

+ operator++ +

+
+

+ Increment operator (prefix).
—
Increment operator + (postfix). +

+
+

+ operator-> +

+
+

+ Dereference an iterator. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move-assignment operator. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dereference +

+
+
+

+ equal +

+
+
+

+ increment +

+
+
+
+ + Protected + Data Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_ +

+
+
+

+ values_ +

+
+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Test two iterators for inequality. +

+
+

+ operator== +

+
+

+ Test two iterators for equality. +

+
+

+ The ip::basic_resolver_iterator + class template is used to define iterators over the results returned by + a resolver. +

+

+ The iterator's value_type, obtained when the iterator is dereferenced, + is: +

+
const basic_resolver_entry<InternetProtocol>
+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/numeric_host.html b/include/asio/doc/asio/reference/ip__basic_resolver/numeric_host.html new file mode 100644 index 0000000..e635852 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/numeric_host.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver::numeric_host + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Host + name should be treated as a numeric string defining an IPv4 or IPv6 address + and no name resolution should be attempted. +

+
static const flags numeric_host = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/numeric_service.html b/include/asio/doc/asio/reference/ip__basic_resolver/numeric_service.html new file mode 100644 index 0000000..f58b9d2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/numeric_service.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver::numeric_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Service + name should be treated as a numeric string defining a port number and no + name resolution should be attempted. +

+
static const flags numeric_service = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_resolver/operator_eq_.html new file mode 100644 index 0000000..830f717 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/operator_eq_.html @@ -0,0 +1,72 @@ + + + +ip::basic_resolver::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a ip::basic_resolver + from another. +

+
basic_resolver & operator=(
+    basic_resolver && other);
+
+

+ This assignment operator moves a resolver from one object to another. Cancels + any outstanding asynchronous operations associated with the target object. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other ip::basic_resolver + object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_resolver(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/passive.html b/include/asio/doc/asio/reference/ip__basic_resolver/passive.html new file mode 100644 index 0000000..f62bd13 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/passive.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver::passive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Indicate + that returned endpoint is intended for use as a locally bound socket endpoint. +

+
static const flags passive = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/protocol_type.html b/include/asio/doc/asio/reference/ip__basic_resolver/protocol_type.html new file mode 100644 index 0000000..73dfb0c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/protocol_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type. +

+
typedef InternetProtocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/query.html b/include/asio/doc/asio/reference/ip__basic_resolver/query.html new file mode 100644 index 0000000..e7a3bbc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/query.html @@ -0,0 +1,308 @@ + + + +ip::basic_resolver::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated.) + The query type. +

+
typedef basic_resolver_query< InternetProtocol > query;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint query. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_query [constructor] +

+
+

+ Construct with specified service name for any protocol.
+ —
Construct with specified service name for a given protocol. +
—
Construct with specified host name and service + name for any protocol.
—
Construct with specified + host name and service name for a given protocol. +

+
+

+ hints +

+
+

+ Get the hints associated with the query. +

+
+

+ host_name +

+
+

+ Get the host name associated with the query. +

+
+

+ service_name +

+
+

+ Get the service name associated with the query. +

+
+
+ + Data Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is + configured for the system. Only return IPv6 addresses if a non-loopback + IPv6 address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a + port number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+

+ The ip::basic_resolver_query + class template describes a query that can be passed to a resolver. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve.html new file mode 100644 index 0000000..b0677ef --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve.html @@ -0,0 +1,119 @@ + + + +ip::basic_resolver::resolve + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use overload with separate host and service parameters.) Perform forward + resolution of a query to a list of entries. +

+
results_type resolve(
+    const query & q);
+  » more...
+
+results_type resolve(
+    const query & q,
+    asio::error_code & ec);
+  » more...
+
+

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    string_view host,
+    string_view service);
+  » more...
+
+results_type resolve(
+    string_view host,
+    string_view service,
+    asio::error_code & ec);
+  » more...
+
+results_type resolve(
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags);
+  » more...
+
+results_type resolve(
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    asio::error_code & ec);
+  » more...
+
+results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service);
+  » more...
+
+results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    asio::error_code & ec);
+  » more...
+
+results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags);
+  » more...
+
+results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    asio::error_code & ec);
+  » more...
+
+

+ Perform reverse resolution of an endpoint to a list of entries. +

+
results_type resolve(
+    const endpoint_type & e);
+  » more...
+
+results_type resolve(
+    const endpoint_type & e,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload1.html new file mode 100644 index 0000000..e5cb07f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload1.html @@ -0,0 +1,83 @@ + + + +ip::basic_resolver::resolve (1 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use overload with separate host and service parameters.) + Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    const query & q);
+
+

+ This function is used to resolve a query into a list of endpoint entries. +

+
+ + Parameters +
+
+

+
+
q
+

+ A query object that determines what endpoints will be returned. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. A successful + call to this function is guaranteed to return a non-empty range. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload10.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload10.html new file mode 100644 index 0000000..9ea9101 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload10.html @@ -0,0 +1,119 @@ + + + +ip::basic_resolver::resolve (10 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    asio::error_code & ec);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. + See the ip::resolver_base + documentation for the set of available flags. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. An empty range + is returned if an error occurs. A successful call to this function is + guaranteed to return a non-empty range. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload11.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload11.html new file mode 100644 index 0000000..1938db3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload11.html @@ -0,0 +1,83 @@ + + + +ip::basic_resolver::resolve (11 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform reverse resolution of an endpoint to a list of entries. +

+
results_type resolve(
+    const endpoint_type & e);
+
+

+ This function is used to resolve an endpoint into a list of endpoint + entries. +

+
+ + Parameters +
+
+

+
+
e
+

+ An endpoint object that determines what endpoints will be returned. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. A successful + call to this function is guaranteed to return a non-empty range. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload12.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload12.html new file mode 100644 index 0000000..a6da4b7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload12.html @@ -0,0 +1,76 @@ + + + +ip::basic_resolver::resolve (12 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform reverse resolution of an endpoint to a list of entries. +

+
results_type resolve(
+    const endpoint_type & e,
+    asio::error_code & ec);
+
+

+ This function is used to resolve an endpoint into a list of endpoint + entries. +

+
+ + Parameters +
+
+

+
+
e
+

+ An endpoint object that determines what endpoints will be returned. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. An empty range + is returned if an error occurs. A successful call to this function is + guaranteed to return a non-empty range. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload2.html new file mode 100644 index 0000000..a5b8504 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload2.html @@ -0,0 +1,76 @@ + + + +ip::basic_resolver::resolve (2 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use overload with separate host and service parameters.) + Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    const query & q,
+    asio::error_code & ec);
+
+

+ This function is used to resolve a query into a list of endpoint entries. +

+
+ + Parameters +
+
+

+
+
q
+

+ A query object that determines what endpoints will be returned. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. An empty range + is returned if an error occurs. A successful call to this function is + guaranteed to return a non-empty range. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload3.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload3.html new file mode 100644 index 0000000..37be4ee --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload3.html @@ -0,0 +1,112 @@ + + + +ip::basic_resolver::resolve (3 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    string_view host,
+    string_view service);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. A successful + call to this function is guaranteed to return a non-empty range. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload4.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload4.html new file mode 100644 index 0000000..e64c0a3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload4.html @@ -0,0 +1,105 @@ + + + +ip::basic_resolver::resolve (4 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    string_view host,
+    string_view service,
+    asio::error_code & ec);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. An empty range + is returned if an error occurs. A successful call to this function is + guaranteed to return a non-empty range. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload5.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload5.html new file mode 100644 index 0000000..1b67708 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload5.html @@ -0,0 +1,120 @@ + + + +ip::basic_resolver::resolve (5 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. + See the ip::resolver_base + documentation for the set of available flags. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. A successful + call to this function is guaranteed to return a non-empty range. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload6.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload6.html new file mode 100644 index 0000000..4aefb6a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload6.html @@ -0,0 +1,113 @@ + + + +ip::basic_resolver::resolve (6 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags,
+    asio::error_code & ec);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. + See the ip::resolver_base + documentation for the set of available flags. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. An empty range + is returned if an error occurs. A successful call to this function is + guaranteed to return a non-empty range. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload7.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload7.html new file mode 100644 index 0000000..6735ffd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload7.html @@ -0,0 +1,118 @@ + + + +ip::basic_resolver::resolve (7 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. A successful + call to this function is guaranteed to return a non-empty range. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload8.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload8.html new file mode 100644 index 0000000..9256277 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload8.html @@ -0,0 +1,111 @@ + + + +ip::basic_resolver::resolve (8 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    asio::error_code & ec);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. An empty range + is returned if an error occurs. A successful call to this function is + guaranteed to return a non-empty range. +

+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload9.html b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload9.html new file mode 100644 index 0000000..064a1d6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/resolve/overload9.html @@ -0,0 +1,126 @@ + + + +ip::basic_resolver::resolve (9 of 12 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform forward resolution of a query to a list of entries. +

+
results_type resolve(
+    const protocol_type & protocol,
+    string_view host,
+    string_view service,
+    resolver_base::flags resolve_flags);
+
+

+ This function is used to resolve host and service names into a list of + endpoint entries. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. + See the ip::resolver_base + documentation for the set of available flags. +

+
+
+
+ + Return + Value +
+

+ A range object representing the list of endpoint entries. A successful + call to this function is guaranteed to return a non-empty range. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/results_type.html b/include/asio/doc/asio/reference/ip__basic_resolver/results_type.html new file mode 100644 index 0000000..ee9290a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/results_type.html @@ -0,0 +1,568 @@ + + + +ip::basic_resolver::results_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + results type. +

+
typedef basic_resolver_results< InternetProtocol > results_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_iterator +

+
+

+ The type of an iterator into the range. +

+
+

+ const_reference +

+
+

+ The type of a const reference to a value in the range. +

+
+

+ difference_type +

+
+

+ Type used to represent the distance between two iterators in + the range. +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the results. +

+
+

+ iterator +

+
+

+ The type of an iterator into the range. +

+
+

+ iterator_category +

+
+

+ The iterator category. +

+
+

+ pointer +

+
+

+ The type of the result of applying operator->() to the iterator. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the results. +

+
+

+ reference +

+
+

+ The type of a non-const reference to a value in the range. +

+
+

+ size_type +

+
+

+ Type used to represent a count of the elements in the range. +

+
+

+ value_type +

+
+

+ The type of a value in the results range. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_results [constructor] +

+
+

+ Default constructor creates an empty range.
—
Copy + constructor.
—
Move constructor. +

+
+

+ begin +

+
+

+ Obtain a begin iterator for the results range. +

+
+

+ cbegin +

+
+

+ Obtain a begin iterator for the results range. +

+
+

+ cend +

+
+

+ Obtain an end iterator for the results range. +

+
+

+ empty +

+
+

+ Determine whether the results range is empty. +

+
+

+ end +

+
+

+ Obtain an end iterator for the results range. +

+
+

+ max_size +

+
+

+ Get the maximum number of entries permitted in a results range. +

+
+

+ operator * +

+
+

+ Dereference an iterator. +

+
+

+ operator++ +

+
+

+ Increment operator (prefix).
—
Increment operator + (postfix). +

+
+

+ operator-> +

+
+

+ Dereference an iterator. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move-assignment operator. +

+
+

+ size +

+
+

+ Get the number of entries in the results range. +

+
+

+ swap +

+
+

+ Swap the results range with another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dereference +

+
+
+

+ equal +

+
+
+

+ increment +

+
+
+
+ + Protected + Data Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_ +

+
+
+

+ values_ +

+
+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Test two iterators for inequality. +

+
+

+ operator== +

+
+

+ Test two iterators for equality. +

+
+

+ The ip::basic_resolver_results + class template is used to define a range over the results returned by a + resolver. +

+

+ The iterator's value_type, obtained when a results iterator is dereferenced, + is: +

+
const basic_resolver_entry<InternetProtocol>
+
+
+ + Remarks +
+

+ For backward compatibility, ip::basic_resolver_results + is derived from ip::basic_resolver_iterator. + This derivation is deprecated. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver/v4_mapped.html b/include/asio/doc/asio/reference/ip__basic_resolver/v4_mapped.html new file mode 100644 index 0000000..0815f6e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver/v4_mapped.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver::v4_mapped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +If + the query protocol family is specified as IPv6, return IPv4-mapped IPv6 + addresses on finding no IPv6 addresses. +

+
static const flags v4_mapped = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver__rebind_executor.html b/include/asio/doc/asio/reference/ip__basic_resolver__rebind_executor.html new file mode 100644 index 0000000..c290dfd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver__rebind_executor.html @@ -0,0 +1,88 @@ + + + +ip::basic_resolver::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the resolver type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The resolver type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver__rebind_executor/other.html b/include/asio/doc/asio/reference/ip__basic_resolver__rebind_executor/other.html new file mode 100644 index 0000000..356280c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver__rebind_executor/other.html @@ -0,0 +1,422 @@ + + + +ip::basic_resolver::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + resolver type when rebound to the specified executor. +

+
typedef basic_resolver< InternetProtocol, Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the resolver type to another executor. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+

+ iterator +

+
+

+ (Deprecated.) The iterator type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ query +

+
+

+ (Deprecated.) The query type. +

+
+

+ results_type +

+
+

+ The results type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Asynchronously perform forward resolution of a query to a list + of entries.
—
Asynchronously perform forward resolution + of a query to a list of entries.
—
Asynchronously + perform reverse resolution of an endpoint to a list of entries. +

+
+

+ basic_resolver [constructor] +

+
+

+ Construct with executor.
—
Construct with execution + context.
—
Move-construct a basic_resolver from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the resolver. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_resolver from another. +

+
+

+ resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Perform forward resolution of a query to a list of entries. +
—
Perform forward resolution of a query to a list + of entries.
—
Perform reverse resolution of an endpoint + to a list of entries. +

+
+

+ ~basic_resolver [destructor] +

+
+

+ Destroys the resolver. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is + configured for the system. Only return IPv6 addresses if a non-loopback + IPv6 address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a + port number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+

+ The ip::basic_resolver + class template provides the ability to resolve a query to a list of endpoints. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry.html new file mode 100644 index 0000000..b0905d5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry.html @@ -0,0 +1,202 @@ + + + +ip::basic_resolver_entry + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An entry produced by a resolver. +

+
template<
+    typename InternetProtocol>
+class basic_resolver_entry
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the endpoint entry. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint entry. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_entry [constructor] +

+
+

+ Default constructor.
—
Construct with specified endpoint, + host name and service name. +

+
+

+ endpoint +

+
+

+ Get the endpoint associated with the entry. +

+
+

+ host_name +

+
+

+ Get the host name associated with the entry. +

+
+

+ operator endpoint_type +

+
+

+ Convert to the endpoint associated with the entry. +

+
+

+ service_name +

+
+

+ Get the service name associated with the entry. +

+
+

+ The ip::basic_resolver_entry + class template describes an entry as returned by a resolver. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_entry.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry.html new file mode 100644 index 0000000..f7cc8f4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_entry::basic_resolver_entry + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
basic_resolver_entry();
+  » more...
+
+

+ Construct with specified endpoint, host name and service name. +

+
basic_resolver_entry(
+    const endpoint_type & ep,
+    string_view host,
+    string_view service);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload1.html new file mode 100644 index 0000000..4953ada --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_resolver_entry::basic_resolver_entry (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
basic_resolver_entry();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload2.html new file mode 100644 index 0000000..3190fec --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload2.html @@ -0,0 +1,46 @@ + + + +ip::basic_resolver_entry::basic_resolver_entry (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with specified endpoint, host name and service name. +

+
basic_resolver_entry(
+    const endpoint_type & ep,
+    string_view host,
+    string_view service);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/endpoint.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/endpoint.html new file mode 100644 index 0000000..01e9308 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/endpoint.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_entry::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the endpoint associated with the entry. +

+
endpoint_type endpoint() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/endpoint_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/endpoint_type.html new file mode 100644 index 0000000..c05b97f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/endpoint_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_entry::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type associated with the endpoint entry. +

+
typedef InternetProtocol::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_entry.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name.html new file mode 100644 index 0000000..04e234b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name.html @@ -0,0 +1,51 @@ + + + +ip::basic_resolver_entry::host_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the host name associated with the entry. +

+
std::string host_name() const;
+  » more...
+
+template<
+    class Allocator>
+std::basic_string< char, std::char_traits< char >, Allocator > host_name(
+    const Allocator & alloc = Allocator()) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name/overload1.html new file mode 100644 index 0000000..2f09322 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_resolver_entry::host_name (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the host name associated with the entry. +

+
std::string host_name() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name/overload2.html new file mode 100644 index 0000000..e86af60 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/host_name/overload2.html @@ -0,0 +1,46 @@ + + + +ip::basic_resolver_entry::host_name (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the host name associated with the entry. +

+
template<
+    class Allocator>
+std::basic_string< char, std::char_traits< char >, Allocator > host_name(
+    const Allocator & alloc = Allocator()) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/operator_endpoint_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/operator_endpoint_type.html new file mode 100644 index 0000000..4e1d74e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/operator_endpoint_type.html @@ -0,0 +1,45 @@ + + + +ip::basic_resolver_entry::operator endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Convert to the endpoint associated + with the entry. +

+
operator endpoint_type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/protocol_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/protocol_type.html new file mode 100644 index 0000000..5f4634b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/protocol_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_entry::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type associated with the endpoint entry. +

+
typedef InternetProtocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_entry.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name.html new file mode 100644 index 0000000..ce3f7c2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name.html @@ -0,0 +1,51 @@ + + + +ip::basic_resolver_entry::service_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the service name associated with the entry. +

+
std::string service_name() const;
+  » more...
+
+template<
+    class Allocator>
+std::basic_string< char, std::char_traits< char >, Allocator > service_name(
+    const Allocator & alloc = Allocator()) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name/overload1.html new file mode 100644 index 0000000..cb0b7ca --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_resolver_entry::service_name (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the service name associated with the entry. +

+
std::string service_name() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name/overload2.html new file mode 100644 index 0000000..9ff9baa --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_entry/service_name/overload2.html @@ -0,0 +1,46 @@ + + + +ip::basic_resolver_entry::service_name (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the service name associated with the entry. +

+
template<
+    class Allocator>
+std::basic_string< char, std::char_traits< char >, Allocator > service_name(
+    const Allocator & alloc = Allocator()) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator.html new file mode 100644 index 0000000..0b59f75 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator.html @@ -0,0 +1,388 @@ + + + +ip::basic_resolver_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An iterator over the entries produced by a resolver. +

+
template<
+    typename InternetProtocol>
+class basic_resolver_iterator
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ The type used for the distance between two iterators. +

+
+

+ iterator_category +

+
+

+ The iterator category. +

+
+

+ pointer +

+
+

+ The type of the result of applying operator->() to the iterator. +

+
+

+ reference +

+
+

+ The type of the result of applying operator*() to the iterator. +

+
+

+ value_type +

+
+

+ The type of the value pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_iterator [constructor] +

+
+

+ Default constructor creates an end iterator.
—
Copy + constructor.
—
Move constructor. +

+
+

+ operator * +

+
+

+ Dereference an iterator. +

+
+

+ operator++ +

+
+

+ Increment operator (prefix).
—
Increment operator (postfix). +

+
+

+ operator-> +

+
+

+ Dereference an iterator. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move-assignment operator. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dereference +

+
+
+

+ equal +

+
+
+

+ increment +

+
+
+
+ + Protected + Data Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_ +

+
+
+

+ values_ +

+
+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Test two iterators for inequality. +

+
+

+ operator== +

+
+

+ Test two iterators for equality. +

+
+

+ The ip::basic_resolver_iterator + class template is used to define iterators over the results returned by a + resolver. +

+

+ The iterator's value_type, obtained when the iterator is dereferenced, is: +

+
const basic_resolver_entry<InternetProtocol>
+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator.html new file mode 100644 index 0000000..eb719ce --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator.html @@ -0,0 +1,59 @@ + + + +ip::basic_resolver_iterator::basic_resolver_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor creates an end iterator. +

+
basic_resolver_iterator();
+  » more...
+
+

+ Copy constructor. +

+
basic_resolver_iterator(
+    const basic_resolver_iterator & other);
+  » more...
+
+

+ Move constructor. +

+
basic_resolver_iterator(
+    basic_resolver_iterator && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload1.html new file mode 100644 index 0000000..2b44604 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_resolver_iterator::basic_resolver_iterator (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor creates an end iterator. +

+
basic_resolver_iterator();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload2.html new file mode 100644 index 0000000..db89f19 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_iterator::basic_resolver_iterator (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_resolver_iterator(
+    const basic_resolver_iterator & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload3.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload3.html new file mode 100644 index 0000000..673ecdf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload3.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_iterator::basic_resolver_iterator (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
basic_resolver_iterator(
+    basic_resolver_iterator && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/dereference.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/dereference.html new file mode 100644 index 0000000..e20c3f9 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/dereference.html @@ -0,0 +1,42 @@ + + + +ip::basic_resolver_iterator::dereference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const basic_resolver_entry< InternetProtocol > & dereference() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/difference_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/difference_type.html new file mode 100644 index 0000000..21653cd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/difference_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_iterator::difference_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type used for the distance between two iterators. +

+
typedef std::ptrdiff_t difference_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/equal.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/equal.html new file mode 100644 index 0000000..cabf6eb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/equal.html @@ -0,0 +1,43 @@ + + + +ip::basic_resolver_iterator::equal + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
bool equal(
+    const basic_resolver_iterator & other) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/increment.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/increment.html new file mode 100644 index 0000000..0766a2e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/increment.html @@ -0,0 +1,42 @@ + + + +ip::basic_resolver_iterator::increment + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void increment();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/index_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/index_.html new file mode 100644 index 0000000..2cbbc94 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/index_.html @@ -0,0 +1,42 @@ + + + +ip::basic_resolver_iterator::index_ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
std::size_t index_;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/iterator_category.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/iterator_category.html new file mode 100644 index 0000000..fb938ee --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/iterator_category.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_iterator::iterator_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + iterator category. +

+
typedef std::forward_iterator_tag iterator_category;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator__star_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator__star_.html new file mode 100644 index 0000000..015b2d4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator__star_.html @@ -0,0 +1,45 @@ + + + +ip::basic_resolver_iterator::operator * + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference + an iterator. +

+
const basic_resolver_entry< InternetProtocol > & operator *() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_arrow_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_arrow_.html new file mode 100644 index 0000000..d1df9ad --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_arrow_.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_iterator::operator-> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Dereference + an iterator. +

+
const basic_resolver_entry< InternetProtocol > * operator->() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_.html new file mode 100644 index 0000000..f38ed9e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_.html @@ -0,0 +1,53 @@ + + + +ip::basic_resolver_iterator::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment + operator. +

+
basic_resolver_iterator & operator=(
+    const basic_resolver_iterator & other);
+  » more...
+
+

+ Move-assignment operator. +

+
basic_resolver_iterator & operator=(
+    basic_resolver_iterator && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_/overload1.html new file mode 100644 index 0000000..26a96d8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_iterator::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator. +

+
basic_resolver_iterator & operator=(
+    const basic_resolver_iterator & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_/overload2.html new file mode 100644 index 0000000..654d133 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_iterator::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assignment operator. +

+
basic_resolver_iterator & operator=(
+    basic_resolver_iterator && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq__eq_.html new file mode 100644 index 0000000..21e157a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_resolver_iterator::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + two iterators for equality. +

+
friend bool operator==(
+    const basic_resolver_iterator & a,
+    const basic_resolver_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_not__eq_.html new file mode 100644 index 0000000..a879b10 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::basic_resolver_iterator::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + two iterators for inequality. +

+
friend bool operator!=(
+    const basic_resolver_iterator & a,
+    const basic_resolver_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_.html new file mode 100644 index 0000000..1a5629a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_.html @@ -0,0 +1,52 @@ + + + +ip::basic_resolver_iterator::operator++ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Increment + operator (prefix). +

+
basic_resolver_iterator & operator++();
+  » more...
+
+

+ Increment operator (postfix). +

+
basic_resolver_iterator operator++(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload1.html new file mode 100644 index 0000000..8637083 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_resolver_iterator::operator++ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Increment operator (prefix). +

+
basic_resolver_iterator & operator++();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload2.html new file mode 100644 index 0000000..74d86be --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_iterator::operator++ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Increment operator (postfix). +

+
basic_resolver_iterator operator++(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/pointer.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/pointer.html new file mode 100644 index 0000000..191bd69 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/pointer.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_iterator::pointer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the result of applying operator->() to the iterator. +

+
typedef const basic_resolver_entry< InternetProtocol > * pointer;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/reference.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/reference.html new file mode 100644 index 0000000..06ca8be --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/reference.html @@ -0,0 +1,203 @@ + + + +ip::basic_resolver_iterator::reference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the result of applying operator*() to the iterator. +

+
typedef const basic_resolver_entry< InternetProtocol > & reference;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the endpoint entry. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint entry. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_entry [constructor] +

+
+

+ Default constructor.
—
Construct with specified endpoint, + host name and service name. +

+
+

+ endpoint +

+
+

+ Get the endpoint associated with the entry. +

+
+

+ host_name +

+
+

+ Get the host name associated with the entry. +

+
+

+ operator endpoint_type +

+
+

+ Convert to the endpoint associated with the entry. +

+
+

+ service_name +

+
+

+ Get the service name associated with the entry. +

+
+

+ The ip::basic_resolver_entry + class template describes an entry as returned by a resolver. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/value_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/value_type.html new file mode 100644 index 0000000..7810c4f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/value_type.html @@ -0,0 +1,203 @@ + + + +ip::basic_resolver_iterator::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the value pointed to by the iterator. +

+
typedef basic_resolver_entry< InternetProtocol > value_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the endpoint entry. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint entry. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_entry [constructor] +

+
+

+ Default constructor.
—
Construct with specified endpoint, + host name and service name. +

+
+

+ endpoint +

+
+

+ Get the endpoint associated with the entry. +

+
+

+ host_name +

+
+

+ Get the host name associated with the entry. +

+
+

+ operator endpoint_type +

+
+

+ Convert to the endpoint associated with the entry. +

+
+

+ service_name +

+
+

+ Get the service name associated with the entry. +

+
+

+ The ip::basic_resolver_entry + class template describes an entry as returned by a resolver. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_iterator.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_iterator/values_.html b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/values_.html new file mode 100644 index 0000000..c6e456e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_iterator/values_.html @@ -0,0 +1,42 @@ + + + +ip::basic_resolver_iterator::values_ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
values_ptr_type values_;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query.html b/include/asio/doc/asio/reference/ip__basic_resolver_query.html new file mode 100644 index 0000000..dd8f1b9 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query.html @@ -0,0 +1,308 @@ + + + +ip::basic_resolver_query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ An query to be passed to a resolver. +

+
template<
+    typename InternetProtocol>
+class basic_resolver_query :
+  public ip::resolver_query_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint query. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_query [constructor] +

+
+

+ Construct with specified service name for any protocol.
+ —
Construct with specified service name for a given protocol. +
—
Construct with specified host name and service name + for any protocol.
—
Construct with specified host name + and service name for a given protocol. +

+
+

+ hints +

+
+

+ Get the hints associated with the query. +

+
+

+ host_name +

+
+

+ Get the host name associated with the query. +

+
+

+ service_name +

+
+

+ Get the service name associated with the query. +

+
+
+ + Data Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is configured + for the system. Only return IPv6 addresses if a non-loopback IPv6 + address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a port + number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+

+ The ip::basic_resolver_query + class template describes a query that can be passed to a resolver. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/address_configured.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/address_configured.html new file mode 100644 index 0000000..4cb69aa --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/address_configured.html @@ -0,0 +1,49 @@ + + + +ip::basic_resolver_query::address_configured + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Only + return IPv4 addresses if a non-loopback IPv4 address is configured for + the system. Only return IPv6 addresses if a non-loopback IPv6 address is + configured for the system. +

+
static const flags address_configured = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/all_matching.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/all_matching.html new file mode 100644 index 0000000..ff8fea1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/all_matching.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver_query::all_matching + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +If + used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
static const flags all_matching = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query.html new file mode 100644 index 0000000..432b753 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query.html @@ -0,0 +1,75 @@ + + + +ip::basic_resolver_query::basic_resolver_query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + with specified service name for any protocol. +

+
basic_resolver_query(
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = passive|address_configured);
+  » more...
+
+

+ Construct with specified service name for a given protocol. +

+
basic_resolver_query(
+    const protocol_type & protocol,
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = passive|address_configured);
+  » more...
+
+

+ Construct with specified host name and service name for any protocol. +

+
basic_resolver_query(
+    const std::string & host,
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = address_configured);
+  » more...
+
+

+ Construct with specified host name and service name for a given protocol. +

+
basic_resolver_query(
+    const protocol_type & protocol,
+    const std::string & host,
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = address_configured);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload1.html new file mode 100644 index 0000000..32cfa28 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload1.html @@ -0,0 +1,78 @@ + + + +ip::basic_resolver_query::basic_resolver_query (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with specified service name for any protocol. +

+
basic_resolver_query(
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = passive|address_configured);
+
+

+ This constructor is typically used to perform name resolution for local + service binding. +

+
+ + Parameters +
+
+

+
+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for local service binding. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload2.html new file mode 100644 index 0000000..84d2613 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload2.html @@ -0,0 +1,84 @@ + + + +ip::basic_resolver_query::basic_resolver_query (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with specified service name for a given protocol. +

+
basic_resolver_query(
+    const protocol_type & protocol,
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = passive|address_configured);
+
+

+ This constructor is typically used to perform name resolution for local + service binding with a specific protocol version. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for local service binding. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload3.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload3.html new file mode 100644 index 0000000..d7559cf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload3.html @@ -0,0 +1,96 @@ + + + +ip::basic_resolver_query::basic_resolver_query (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with specified host name and service name for any protocol. +

+
basic_resolver_query(
+    const std::string & host,
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = address_configured);
+
+

+ This constructor is typically used to perform name resolution for communication + with remote hosts. +

+
+ + Parameters +
+
+

+
+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload4.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload4.html new file mode 100644 index 0000000..5cb09ba --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/basic_resolver_query/overload4.html @@ -0,0 +1,102 @@ + + + +ip::basic_resolver_query::basic_resolver_query (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with specified host name and service name for a given protocol. +

+
basic_resolver_query(
+    const protocol_type & protocol,
+    const std::string & host,
+    const std::string & service,
+    resolver_query_base::flags resolve_flags = address_configured);
+
+

+ This constructor is typically used to perform name resolution for communication + with remote hosts. +

+
+ + Parameters +
+
+

+
+
protocol
+

+ A protocol object, normally representing either the IPv4 or IPv6 + version of an internet protocol. +

+
host
+

+ A string identifying a location. May be a descriptive name or a + numeric address string. If an empty string and the passive flag + has been specified, the resolved endpoints are suitable for local + service binding. If an empty string and passive is not specified, + the resolved endpoints will use the loopback address. +

+
service
+

+ A string identifying the requested service. This may be a descriptive + name or a numeric string corresponding to a port number. May be + an empty string, in which case all resolved endpoints will have + a port number of 0. +

+
resolve_flags
+

+ A set of flags that determine how name resolution should be performed. + The default flags are suitable for communication with remote hosts. +

+
+
+
+ + Remarks +
+

+ On POSIX systems, host names may be locally defined in the file /etc/hosts. + On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts. + Remote host name resolution is performed using DNS. Operating systems + may use additional locations when resolving host names (such as NETBIOS + names on Windows). +

+

+ On POSIX systems, service names are typically defined in the file /etc/services. + On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services. + Operating systems may use additional locations when resolving service + names. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/canonical_name.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/canonical_name.html new file mode 100644 index 0000000..4aa6c19 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/canonical_name.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver_query::canonical_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Determine + the canonical name of the host specified in the query. +

+
static const flags canonical_name = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/flags.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/flags.html new file mode 100644 index 0000000..ba01fa0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/flags.html @@ -0,0 +1,57 @@ + + + +ip::basic_resolver_query::flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +A + bitmask type (C++ Std [lib.bitmask.types]). +

+
typedef unspecified flags;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/hints.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/hints.html new file mode 100644 index 0000000..26eb6a9 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/hints.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_query::hints + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the hints associated with the query. +

+
const asio::detail::addrinfo_type & hints() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/host_name.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/host_name.html new file mode 100644 index 0000000..48fcab5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/host_name.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_query::host_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the host name associated with the query. +

+
std::string host_name() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/numeric_host.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/numeric_host.html new file mode 100644 index 0000000..ddf2aa3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/numeric_host.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver_query::numeric_host + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Host + name should be treated as a numeric string defining an IPv4 or IPv6 address + and no name resolution should be attempted. +

+
static const flags numeric_host = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/numeric_service.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/numeric_service.html new file mode 100644 index 0000000..f6d9eb0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/numeric_service.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver_query::numeric_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Service + name should be treated as a numeric string defining a port number and no + name resolution should be attempted. +

+
static const flags numeric_service = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/passive.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/passive.html new file mode 100644 index 0000000..73d2da7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/passive.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver_query::passive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Indicate + that returned endpoint is intended for use as a locally bound socket endpoint. +

+
static const flags passive = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/protocol_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/protocol_type.html new file mode 100644 index 0000000..4e6cdbc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/protocol_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_query::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type associated with the endpoint query. +

+
typedef InternetProtocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/service_name.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/service_name.html new file mode 100644 index 0000000..b26cf87 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/service_name.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_query::service_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the service name associated with the query. +

+
std::string service_name() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_query/v4_mapped.html b/include/asio/doc/asio/reference/ip__basic_resolver_query/v4_mapped.html new file mode 100644 index 0000000..49aaa10 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_query/v4_mapped.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver_query::v4_mapped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +If + the query protocol family is specified as IPv6, return IPv4-mapped IPv6 + addresses on finding no IPv6 addresses. +

+
static const flags v4_mapped = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results.html b/include/asio/doc/asio/reference/ip__basic_resolver_results.html new file mode 100644 index 0000000..d15b587 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results.html @@ -0,0 +1,567 @@ + + + +ip::basic_resolver_results + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A range of entries produced by a resolver. +

+
template<
+    typename InternetProtocol>
+class basic_resolver_results :
+  public ip::basic_resolver_iterator< InternetProtocol >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_iterator +

+
+

+ The type of an iterator into the range. +

+
+

+ const_reference +

+
+

+ The type of a const reference to a value in the range. +

+
+

+ difference_type +

+
+

+ Type used to represent the distance between two iterators in the + range. +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the results. +

+
+

+ iterator +

+
+

+ The type of an iterator into the range. +

+
+

+ iterator_category +

+
+

+ The iterator category. +

+
+

+ pointer +

+
+

+ The type of the result of applying operator->() to the iterator. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the results. +

+
+

+ reference +

+
+

+ The type of a non-const reference to a value in the range. +

+
+

+ size_type +

+
+

+ Type used to represent a count of the elements in the range. +

+
+

+ value_type +

+
+

+ The type of a value in the results range. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_results [constructor] +

+
+

+ Default constructor creates an empty range.
—
Copy + constructor.
—
Move constructor. +

+
+

+ begin +

+
+

+ Obtain a begin iterator for the results range. +

+
+

+ cbegin +

+
+

+ Obtain a begin iterator for the results range. +

+
+

+ cend +

+
+

+ Obtain an end iterator for the results range. +

+
+

+ empty +

+
+

+ Determine whether the results range is empty. +

+
+

+ end +

+
+

+ Obtain an end iterator for the results range. +

+
+

+ max_size +

+
+

+ Get the maximum number of entries permitted in a results range. +

+
+

+ operator * +

+
+

+ Dereference an iterator. +

+
+

+ operator++ +

+
+

+ Increment operator (prefix).
—
Increment operator (postfix). +

+
+

+ operator-> +

+
+

+ Dereference an iterator. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move-assignment operator. +

+
+

+ size +

+
+

+ Get the number of entries in the results range. +

+
+

+ swap +

+
+

+ Swap the results range with another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dereference +

+
+
+

+ equal +

+
+
+

+ increment +

+
+
+
+ + Protected + Data Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_ +

+
+
+

+ values_ +

+
+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Test two iterators for inequality. +

+
+

+ operator== +

+
+

+ Test two iterators for equality. +

+
+

+ The ip::basic_resolver_results + class template is used to define a range over the results returned by a resolver. +

+

+ The iterator's value_type, obtained when a results iterator is dereferenced, + is: +

+
const basic_resolver_entry<InternetProtocol>
+
+
+ + Remarks +
+

+ For backward compatibility, ip::basic_resolver_results + is derived from ip::basic_resolver_iterator. + This derivation is deprecated. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results.html new file mode 100644 index 0000000..6cd223f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results.html @@ -0,0 +1,59 @@ + + + +ip::basic_resolver_results::basic_resolver_results + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor creates an empty range. +

+
basic_resolver_results();
+  » more...
+
+

+ Copy constructor. +

+
basic_resolver_results(
+    const basic_resolver_results & other);
+  » more...
+
+

+ Move constructor. +

+
basic_resolver_results(
+    basic_resolver_results && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload1.html new file mode 100644 index 0000000..490937d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload1.html @@ -0,0 +1,43 @@ + + + +ip::basic_resolver_results::basic_resolver_results (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor creates an empty range. +

+
basic_resolver_results();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload2.html new file mode 100644 index 0000000..8e7afab --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::basic_resolver_results (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_resolver_results(
+    const basic_resolver_results & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload3.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload3.html new file mode 100644 index 0000000..456400f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/basic_resolver_results/overload3.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::basic_resolver_results (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
basic_resolver_results(
+    basic_resolver_results && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/begin.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/begin.html new file mode 100644 index 0000000..33f995a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/begin.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + a begin iterator for the results range. +

+
const_iterator begin() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/cbegin.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/cbegin.html new file mode 100644 index 0000000..f161fe7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/cbegin.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::cbegin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + a begin iterator for the results range. +

+
const_iterator cbegin() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/cend.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/cend.html new file mode 100644 index 0000000..f5b78a1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/cend.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::cend + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an end iterator for the results range. +

+
const_iterator cend() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/const_iterator.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/const_iterator.html new file mode 100644 index 0000000..faad0ce --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/const_iterator.html @@ -0,0 +1,390 @@ + + + +ip::basic_resolver_results::const_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of an iterator into the range. +

+
typedef basic_resolver_iterator< protocol_type > const_iterator;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ The type used for the distance between two iterators. +

+
+

+ iterator_category +

+
+

+ The iterator category. +

+
+

+ pointer +

+
+

+ The type of the result of applying operator->() to the iterator. +

+
+

+ reference +

+
+

+ The type of the result of applying operator*() to the iterator. +

+
+

+ value_type +

+
+

+ The type of the value pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_iterator [constructor] +

+
+

+ Default constructor creates an end iterator.
—
Copy + constructor.
—
Move constructor. +

+
+

+ operator * +

+
+

+ Dereference an iterator. +

+
+

+ operator++ +

+
+

+ Increment operator (prefix).
—
Increment operator + (postfix). +

+
+

+ operator-> +

+
+

+ Dereference an iterator. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move-assignment operator. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dereference +

+
+
+

+ equal +

+
+
+

+ increment +

+
+
+
+ + Protected + Data Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_ +

+
+
+

+ values_ +

+
+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Test two iterators for inequality. +

+
+

+ operator== +

+
+

+ Test two iterators for equality. +

+
+

+ The ip::basic_resolver_iterator + class template is used to define iterators over the results returned by + a resolver. +

+

+ The iterator's value_type, obtained when the iterator is dereferenced, + is: +

+
const basic_resolver_entry<InternetProtocol>
+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/const_reference.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/const_reference.html new file mode 100644 index 0000000..18da9c1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/const_reference.html @@ -0,0 +1,203 @@ + + + +ip::basic_resolver_results::const_reference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of a const reference to a value in the range. +

+
typedef const value_type & const_reference;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the endpoint entry. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint entry. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_entry [constructor] +

+
+

+ Default constructor.
—
Construct with specified endpoint, + host name and service name. +

+
+

+ endpoint +

+
+

+ Get the endpoint associated with the entry. +

+
+

+ host_name +

+
+

+ Get the host name associated with the entry. +

+
+

+ operator endpoint_type +

+
+

+ Convert to the endpoint associated with the entry. +

+
+

+ service_name +

+
+

+ Get the service name associated with the entry. +

+
+

+ The ip::basic_resolver_entry + class template describes an entry as returned by a resolver. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/dereference.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/dereference.html new file mode 100644 index 0000000..eced440 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/dereference.html @@ -0,0 +1,45 @@ + + + +ip::basic_resolver_results::dereference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +

+
const basic_resolver_entry< InternetProtocol > & dereference() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/difference_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/difference_type.html new file mode 100644 index 0000000..f1ac141 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/difference_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_results::difference_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Type + used to represent the distance between two iterators in the range. +

+
typedef std::ptrdiff_t difference_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/empty.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/empty.html new file mode 100644 index 0000000..afe0a17 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/empty.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::empty + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the results range is empty. +

+
bool empty() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/end.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/end.html new file mode 100644 index 0000000..d9b60d2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/end.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an end iterator for the results range. +

+
const_iterator end() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/endpoint_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/endpoint_type.html new file mode 100644 index 0000000..b60bb55 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/endpoint_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_results::endpoint_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + endpoint type associated with the results. +

+
typedef protocol_type::endpoint endpoint_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/equal.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/equal.html new file mode 100644 index 0000000..0a8d74f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/equal.html @@ -0,0 +1,46 @@ + + + +ip::basic_resolver_results::equal + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +

+
bool equal(
+    const basic_resolver_iterator & other) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/increment.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/increment.html new file mode 100644 index 0000000..e92339e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/increment.html @@ -0,0 +1,45 @@ + + + +ip::basic_resolver_results::increment + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +

+
void increment();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/index_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/index_.html new file mode 100644 index 0000000..2f3181e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/index_.html @@ -0,0 +1,45 @@ + + + +ip::basic_resolver_results::index_ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +

+
std::size_t index_;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/iterator.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/iterator.html new file mode 100644 index 0000000..80da0f4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/iterator.html @@ -0,0 +1,390 @@ + + + +ip::basic_resolver_results::iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of an iterator into the range. +

+
typedef const_iterator iterator;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ difference_type +

+
+

+ The type used for the distance between two iterators. +

+
+

+ iterator_category +

+
+

+ The iterator category. +

+
+

+ pointer +

+
+

+ The type of the result of applying operator->() to the iterator. +

+
+

+ reference +

+
+

+ The type of the result of applying operator*() to the iterator. +

+
+

+ value_type +

+
+

+ The type of the value pointed to by the iterator. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_iterator [constructor] +

+
+

+ Default constructor creates an end iterator.
—
Copy + constructor.
—
Move constructor. +

+
+

+ operator * +

+
+

+ Dereference an iterator. +

+
+

+ operator++ +

+
+

+ Increment operator (prefix).
—
Increment operator + (postfix). +

+
+

+ operator-> +

+
+

+ Dereference an iterator. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move-assignment operator. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ dereference +

+
+
+

+ equal +

+
+
+

+ increment +

+
+
+
+ + Protected + Data Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_ +

+
+
+

+ values_ +

+
+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Test two iterators for inequality. +

+
+

+ operator== +

+
+

+ Test two iterators for equality. +

+
+

+ The ip::basic_resolver_iterator + class template is used to define iterators over the results returned by + a resolver. +

+

+ The iterator's value_type, obtained when the iterator is dereferenced, + is: +

+
const basic_resolver_entry<InternetProtocol>
+
+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/iterator_category.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/iterator_category.html new file mode 100644 index 0000000..2314acd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/iterator_category.html @@ -0,0 +1,57 @@ + + + +ip::basic_resolver_results::iterator_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +The + iterator category. +

+
typedef std::forward_iterator_tag iterator_category;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/max_size.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/max_size.html new file mode 100644 index 0000000..b4af820 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/max_size.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::max_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the maximum number of entries permitted in a results range. +

+
size_type max_size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator__star_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator__star_.html new file mode 100644 index 0000000..cbb45fa --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator__star_.html @@ -0,0 +1,48 @@ + + + +ip::basic_resolver_results::operator * + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +Dereference + an iterator. +

+
const basic_resolver_entry< InternetProtocol > & operator *() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_arrow_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_arrow_.html new file mode 100644 index 0000000..56a7a91 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_arrow_.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver_results::operator-> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +Dereference + an iterator. +

+
const basic_resolver_entry< InternetProtocol > * operator->() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_.html new file mode 100644 index 0000000..7dbfb20 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_.html @@ -0,0 +1,53 @@ + + + +ip::basic_resolver_results::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment + operator. +

+
basic_resolver_results & operator=(
+    const basic_resolver_results & other);
+  » more...
+
+

+ Move-assignment operator. +

+
basic_resolver_results & operator=(
+    basic_resolver_results && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload1.html new file mode 100644 index 0000000..6bffdd3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator. +

+
basic_resolver_results & operator=(
+    const basic_resolver_results & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload2.html new file mode 100644 index 0000000..2ba76ed --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq_/overload2.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-assignment operator. +

+
basic_resolver_results & operator=(
+    basic_resolver_results && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_.html new file mode 100644 index 0000000..54ccc05 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_.html @@ -0,0 +1,52 @@ + + + +ip::basic_resolver_results::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + two iterators for equality. +

+
friend bool operator==(
+    const basic_resolver_results & a,
+    const basic_resolver_results & b);
+  » more...
+
+friend bool operator==(
+    const basic_resolver_iterator & a,
+    const basic_resolver_iterator & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload1.html new file mode 100644 index 0000000..50161ed --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload1.html @@ -0,0 +1,55 @@ + + + +ip::basic_resolver_results::operator== (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Test two iterators for equality. +

+
friend bool operator==(
+    const basic_resolver_results & a,
+    const basic_resolver_results & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload2.html new file mode 100644 index 0000000..30b0a6c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload2.html @@ -0,0 +1,58 @@ + + + +ip::basic_resolver_results::operator== (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ Test two iterators for equality. +

+
friend bool operator==(
+    const basic_resolver_iterator & a,
+    const basic_resolver_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_.html new file mode 100644 index 0000000..b3eb91f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_.html @@ -0,0 +1,52 @@ + + + +ip::basic_resolver_results::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + two iterators for inequality. +

+
friend bool operator!=(
+    const basic_resolver_results & a,
+    const basic_resolver_results & b);
+  » more...
+
+friend bool operator!=(
+    const basic_resolver_iterator & a,
+    const basic_resolver_iterator & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload1.html new file mode 100644 index 0000000..24bebb8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload1.html @@ -0,0 +1,55 @@ + + + +ip::basic_resolver_results::operator!= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Test two iterators for inequality. +

+
friend bool operator!=(
+    const basic_resolver_results & a,
+    const basic_resolver_results & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload2.html new file mode 100644 index 0000000..3175cab --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_not__eq_/overload2.html @@ -0,0 +1,58 @@ + + + +ip::basic_resolver_results::operator!= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ Test two iterators for inequality. +

+
friend bool operator!=(
+    const basic_resolver_iterator & a,
+    const basic_resolver_iterator & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_.html new file mode 100644 index 0000000..11448c3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_.html @@ -0,0 +1,52 @@ + + + +ip::basic_resolver_results::operator++ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Increment + operator (prefix). +

+
basic_resolver_iterator & operator++();
+  » more...
+
+

+ Increment operator (postfix). +

+
basic_resolver_iterator operator++(
+    int );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload1.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload1.html new file mode 100644 index 0000000..09865cd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload1.html @@ -0,0 +1,46 @@ + + + +ip::basic_resolver_results::operator++ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ Increment operator (prefix). +

+
basic_resolver_iterator & operator++();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload2.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload2.html new file mode 100644 index 0000000..9c485c9 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload2.html @@ -0,0 +1,47 @@ + + + +ip::basic_resolver_results::operator++ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ Increment operator (postfix). +

+
basic_resolver_iterator operator++(
+    int );
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/pointer.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/pointer.html new file mode 100644 index 0000000..4c43022 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/pointer.html @@ -0,0 +1,57 @@ + + + +ip::basic_resolver_results::pointer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +The + type of the result of applying operator->() to the iterator. +

+
typedef const basic_resolver_entry< InternetProtocol > * pointer;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/protocol_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/protocol_type.html new file mode 100644 index 0000000..32ad530 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/protocol_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_results::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type associated with the results. +

+
typedef InternetProtocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/reference.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/reference.html new file mode 100644 index 0000000..a6c3600 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/reference.html @@ -0,0 +1,203 @@ + + + +ip::basic_resolver_results::reference + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of a non-const reference to a value in the range. +

+
typedef value_type & reference;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the endpoint entry. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint entry. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_entry [constructor] +

+
+

+ Default constructor.
—
Construct with specified endpoint, + host name and service name. +

+
+

+ endpoint +

+
+

+ Get the endpoint associated with the entry. +

+
+

+ host_name +

+
+

+ Get the host name associated with the entry. +

+
+

+ operator endpoint_type +

+
+

+ Convert to the endpoint associated with the entry. +

+
+

+ service_name +

+
+

+ Get the service name associated with the entry. +

+
+

+ The ip::basic_resolver_entry + class template describes an entry as returned by a resolver. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/size.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/size.html new file mode 100644 index 0000000..44af028 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/size.html @@ -0,0 +1,44 @@ + + + +ip::basic_resolver_results::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the number of entries in the results range. +

+
size_type size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/size_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/size_type.html new file mode 100644 index 0000000..6b2a22a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/size_type.html @@ -0,0 +1,54 @@ + + + +ip::basic_resolver_results::size_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Type + used to represent a count of the elements in the range. +

+
typedef std::size_t size_type;
+
+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/swap.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/swap.html new file mode 100644 index 0000000..1ed2140 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/swap.html @@ -0,0 +1,45 @@ + + + +ip::basic_resolver_results::swap + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Swap + the results range with another. +

+
void swap(
+    basic_resolver_results & that);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/value_type.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/value_type.html new file mode 100644 index 0000000..b984b72 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/value_type.html @@ -0,0 +1,203 @@ + + + +ip::basic_resolver_results::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of a value in the results range. +

+
typedef basic_resolver_entry< protocol_type > value_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint_type +

+
+

+ The endpoint type associated with the endpoint entry. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint entry. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_resolver_entry [constructor] +

+
+

+ Default constructor.
—
Construct with specified endpoint, + host name and service name. +

+
+

+ endpoint +

+
+

+ Get the endpoint associated with the entry. +

+
+

+ host_name +

+
+

+ Get the host name associated with the entry. +

+
+

+ operator endpoint_type +

+
+

+ Convert to the endpoint associated with the entry. +

+
+

+ service_name +

+
+

+ Get the service name associated with the entry. +

+
+

+ The ip::basic_resolver_entry + class template describes an entry as returned by a resolver. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/basic_resolver_results.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__basic_resolver_results/values_.html b/include/asio/doc/asio/reference/ip__basic_resolver_results/values_.html new file mode 100644 index 0000000..59babf8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__basic_resolver_results/values_.html @@ -0,0 +1,45 @@ + + + +ip::basic_resolver_results::values_ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::basic_resolver. +

+

+ +

+
values_ptr_type values_;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__host_name.html b/include/asio/doc/asio/reference/ip__host_name.html new file mode 100644 index 0000000..0c9f163 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__host_name.html @@ -0,0 +1,58 @@ + + + +ip::host_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the current host name. +

+
std::string host_name();
+  » more...
+
+std::string host_name(
+    asio::error_code & ec);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/ip/host_name.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__host_name/overload1.html b/include/asio/doc/asio/reference/ip__host_name/overload1.html new file mode 100644 index 0000000..1c2cc91 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__host_name/overload1.html @@ -0,0 +1,43 @@ + + + +ip::host_name (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the current host name. +

+
std::string host_name();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__host_name/overload2.html b/include/asio/doc/asio/reference/ip__host_name/overload2.html new file mode 100644 index 0000000..4b73876 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__host_name/overload2.html @@ -0,0 +1,44 @@ + + + +ip::host_name (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the current host name. +

+
std::string host_name(
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp.html b/include/asio/doc/asio/reference/ip__icmp.html new file mode 100644 index 0000000..7909a9e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp.html @@ -0,0 +1,262 @@ + + + +ip::icmp + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for ICMP. +

+
class icmp
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint +

+
+

+ The type of a ICMP endpoint. +

+
+

+ resolver +

+
+

+ The ICMP resolver type. +

+
+

+ socket +

+
+

+ The ICMP socket type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+

+ v4 + [static] +

+
+

+ Construct to represent the IPv4 ICMP protocol. +

+
+

+ v6 + [static] +

+
+

+ Construct to represent the IPv6 ICMP protocol. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two protocols for inequality. +

+
+

+ operator== +

+
+

+ Compare two protocols for equality. +

+
+

+ The ip::icmp + class contains flags necessary for ICMP sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/ip/icmp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/endpoint.html b/include/asio/doc/asio/reference/ip__icmp/endpoint.html new file mode 100644 index 0000000..c38b065 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/endpoint.html @@ -0,0 +1,394 @@ + + + +ip::icmp::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of a ICMP endpoint. +

+
typedef basic_endpoint< icmp > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address +

+
+

+ Get the IP address associated with the endpoint.
—
+ Set the IP address associated with the endpoint. +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint using + a port number, specified in the host's byte order. The IP address + will be the any address (i.e. INADDR_ANY or in6addr_any). This + constructor would typically be used for accepting new connections. +
—
Construct an endpoint using a port number and an + IP address. This constructor may be used for accepting connections + on a specific interface or for making a connection to a remote + endpoint.
—
Copy constructor.
—
Move + constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint.
—
Move-assign from + another endpoint. +

+
+

+ port +

+
+

+ Get the port associated with the endpoint. The port number is + always in the host's byte order.
—
Set the port associated + with the endpoint. The port number is always in the host's byte + order. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+
+ + Related Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator<< +

+
+

+ Output an endpoint as a string. +

+
+

+ The ip::basic_endpoint + class template describes an endpoint that may be associated with a particular + socket. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/icmp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/family.html b/include/asio/doc/asio/reference/ip__icmp/family.html new file mode 100644 index 0000000..8958696 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/family.html @@ -0,0 +1,44 @@ + + + +ip::icmp::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for the + protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__icmp/operator_eq__eq_.html new file mode 100644 index 0000000..5e76f5a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::icmp::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two protocols + for equality. +

+
friend bool operator==(
+    const icmp & p1,
+    const icmp & p2);
+
+
+ + Requirements +
+

+ Header: asio/ip/icmp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__icmp/operator_not__eq_.html new file mode 100644 index 0000000..d7cdd0a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::icmp::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two + protocols for inequality. +

+
friend bool operator!=(
+    const icmp & p1,
+    const icmp & p2);
+
+
+ + Requirements +
+

+ Header: asio/ip/icmp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/protocol.html b/include/asio/doc/asio/reference/ip__icmp/protocol.html new file mode 100644 index 0000000..d279550 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/protocol.html @@ -0,0 +1,44 @@ + + + +ip::icmp::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for + the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/resolver.html b/include/asio/doc/asio/reference/ip__icmp/resolver.html new file mode 100644 index 0000000..230c84c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/resolver.html @@ -0,0 +1,421 @@ + + + +ip::icmp::resolver + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The ICMP resolver type. +

+
typedef basic_resolver< icmp > resolver;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the resolver type to another executor. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+

+ iterator +

+
+

+ (Deprecated.) The iterator type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ query +

+
+

+ (Deprecated.) The query type. +

+
+

+ results_type +

+
+

+ The results type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Asynchronously perform forward resolution of a query to a list + of entries.
—
Asynchronously perform forward resolution + of a query to a list of entries.
—
Asynchronously + perform reverse resolution of an endpoint to a list of entries. +

+
+

+ basic_resolver [constructor] +

+
+

+ Construct with executor.
—
Construct with execution + context.
—
Move-construct a basic_resolver from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the resolver. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_resolver from another. +

+
+

+ resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Perform forward resolution of a query to a list of entries. +
—
Perform forward resolution of a query to a list + of entries.
—
Perform reverse resolution of an endpoint + to a list of entries. +

+
+

+ ~basic_resolver [destructor] +

+
+

+ Destroys the resolver. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is + configured for the system. Only return IPv6 addresses if a non-loopback + IPv6 address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a + port number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+

+ The ip::basic_resolver + class template provides the ability to resolve a query to a list of endpoints. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/icmp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/socket.html b/include/asio/doc/asio/reference/ip__icmp/socket.html new file mode 100644 index 0000000..cf1dc7b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/socket.html @@ -0,0 +1,916 @@ + + + +ip::icmp::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The ICMP socket type. +

+
typedef basic_raw_socket< icmp > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_raw_socket [constructor] +

+
+

+ Construct a basic_raw_socket without opening it.
—
+ Construct and open a basic_raw_socket.
—
Construct + a basic_raw_socket, opening it and binding it to the given local + endpoint.
—
Construct a basic_raw_socket on an existing + native socket.
—
Move-construct a basic_raw_socket + from another.
—
Move-construct a basic_raw_socket + from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_raw_socket from another.
—
Move-assign + a basic_raw_socket from a socket of another protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive raw data with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send raw data to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_raw_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_raw_socket + class template provides asynchronous and blocking raw-oriented socket functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/icmp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/type.html b/include/asio/doc/asio/reference/ip__icmp/type.html new file mode 100644 index 0000000..8f2883a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/type.html @@ -0,0 +1,44 @@ + + + +ip::icmp::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for the type + of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/v4.html b/include/asio/doc/asio/reference/ip__icmp/v4.html new file mode 100644 index 0000000..561ad11 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/v4.html @@ -0,0 +1,44 @@ + + + +ip::icmp::v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct to represent the IPv4 ICMP + protocol. +

+
static icmp v4();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__icmp/v6.html b/include/asio/doc/asio/reference/ip__icmp/v6.html new file mode 100644 index 0000000..fdf1249 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__icmp/v6.html @@ -0,0 +1,44 @@ + + + +ip::icmp::v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct to represent the IPv6 ICMP + protocol. +

+
static icmp v6();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__multicast__enable_loopback.html b/include/asio/doc/asio/reference/ip__multicast__enable_loopback.html new file mode 100644 index 0000000..ef132b3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__multicast__enable_loopback.html @@ -0,0 +1,79 @@ + + + +ip::multicast::enable_loopback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option determining whether outgoing multicast packets will be received on + the same socket if it is a member of the multicast group. +

+
typedef implementation_defined enable_loopback;
+
+

+ Implements the IPPROTO_IP/IP_MULTICAST_LOOP socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::multicast::enable_loopback option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::multicast::enable_loopback option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/ip/multicast.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__multicast__hops.html b/include/asio/doc/asio/reference/ip__multicast__hops.html new file mode 100644 index 0000000..b23995d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__multicast__hops.html @@ -0,0 +1,78 @@ + + + +ip::multicast::hops + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option for time-to-live + associated with outgoing multicast packets. +

+
typedef implementation_defined hops;
+
+

+ Implements the IPPROTO_IP/IP_MULTICAST_TTL socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::multicast::hops option(4);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::multicast::hops option;
+socket.get_option(option);
+int ttl = option.value();
+
+
+ + Requirements +
+

+ Header: asio/ip/multicast.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__multicast__join_group.html b/include/asio/doc/asio/reference/ip__multicast__join_group.html new file mode 100644 index 0000000..a5472e4 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__multicast__join_group.html @@ -0,0 +1,71 @@ + + + +ip::multicast::join_group + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option + to join a multicast group on a specified interface. +

+
typedef implementation_defined join_group;
+
+

+ Implements the IPPROTO_IP/IP_ADD_MEMBERSHIP socket option. +

+
+ + Examples +
+

+ Setting the option to join a multicast group: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::address multicast_address =
+  asio::ip::address::from_string("225.0.0.1");
+asio::ip::multicast::join_group option(multicast_address);
+socket.set_option(option);
+
+
+ + Requirements +
+

+ Header: asio/ip/multicast.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__multicast__leave_group.html b/include/asio/doc/asio/reference/ip__multicast__leave_group.html new file mode 100644 index 0000000..e2c2c6f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__multicast__leave_group.html @@ -0,0 +1,71 @@ + + + +ip::multicast::leave_group + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option to leave a multicast group on a specified interface. +

+
typedef implementation_defined leave_group;
+
+

+ Implements the IPPROTO_IP/IP_DROP_MEMBERSHIP socket option. +

+
+ + Examples +
+

+ Setting the option to leave a multicast group: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::address multicast_address =
+  asio::ip::address::from_string("225.0.0.1");
+asio::ip::multicast::leave_group option(multicast_address);
+socket.set_option(option);
+
+
+ + Requirements +
+

+ Header: asio/ip/multicast.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__multicast__outbound_interface.html b/include/asio/doc/asio/reference/ip__multicast__outbound_interface.html new file mode 100644 index 0000000..3e84c49 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__multicast__outbound_interface.html @@ -0,0 +1,71 @@ + + + +ip::multicast::outbound_interface + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option for local interface to use for outgoing multicast packets. +

+
typedef implementation_defined outbound_interface;
+
+

+ Implements the IPPROTO_IP/IP_MULTICAST_IF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::address_v4 local_interface =
+  asio::ip::address_v4::from_string("1.2.3.4");
+asio::ip::multicast::outbound_interface option(local_interface);
+socket.set_option(option);
+
+
+ + Requirements +
+

+ Header: asio/ip/multicast.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4.html b/include/asio/doc/asio/reference/ip__network_v4.html new file mode 100644 index 0000000..619ff92 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4.html @@ -0,0 +1,327 @@ + + + +ip::network_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Represents an IPv4 network. +

+
class network_v4
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address +

+
+

+ Obtain the address object specified when the network object was + created. +

+
+

+ broadcast +

+
+

+ Obtain an address object that represents the network's broadcast + address. +

+
+

+ canonical +

+
+

+ Obtain the true network address, omitting any host bits. +

+
+

+ hosts +

+
+

+ Obtain an address range corresponding to the hosts in the network. +

+
+

+ is_host +

+
+

+ Test if network is a valid host address. +

+
+

+ is_subnet_of +

+
+

+ Test if a network is a real subnet of another network. +

+
+

+ netmask +

+
+

+ Obtain the netmask that was specified when the network object was + created. +

+
+

+ network +

+
+

+ Obtain an address object that represents the network address. +

+
+

+ network_v4 [constructor] +

+
+

+ Default constructor.
—
Construct a network based on + the specified address and prefix length.
—
Construct + network based on the specified address and netmask.
—
+ Copy constructor. +

+
+

+ operator= +

+
+

+ Assign from another network. +

+
+

+ prefix_length +

+
+

+ Obtain the prefix length that was specified when the network object + was created. +

+
+

+ to_string +

+
+

+ Get the network as an address in dotted decimal format. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two networks for inequality. +

+
+

+ operator== +

+
+

+ Compare two networks for equality. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_network_v4 +

+
+

+ Create an IPv4 network from a string containing IP address and + prefix length. +

+
+

+ The ip::network_v4 + class provides the ability to use and manipulate IP version 4 networks. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/network_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/address.html b/include/asio/doc/asio/reference/ip__network_v4/address.html new file mode 100644 index 0000000..82224bf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/address.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the address + object specified when the network object was created. +

+
address_v4 address() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/broadcast.html b/include/asio/doc/asio/reference/ip__network_v4/broadcast.html new file mode 100644 index 0000000..4b0fd1b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/broadcast.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an + address object that represents the network's broadcast address. +

+
address_v4 broadcast() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/canonical.html b/include/asio/doc/asio/reference/ip__network_v4/canonical.html new file mode 100644 index 0000000..121af72 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/canonical.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::canonical + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the + true network address, omitting any host bits. +

+
network_v4 canonical() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/hosts.html b/include/asio/doc/asio/reference/ip__network_v4/hosts.html new file mode 100644 index 0000000..6def824 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/hosts.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::hosts + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address + range corresponding to the hosts in the network. +

+
address_v4_range hosts() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/is_host.html b/include/asio/doc/asio/reference/ip__network_v4/is_host.html new file mode 100644 index 0000000..446c98a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/is_host.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::is_host + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test if network + is a valid host address. +

+
bool is_host() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/is_subnet_of.html b/include/asio/doc/asio/reference/ip__network_v4/is_subnet_of.html new file mode 100644 index 0000000..910f689 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/is_subnet_of.html @@ -0,0 +1,45 @@ + + + +ip::network_v4::is_subnet_of + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + if a network is a real subnet of another network. +

+
bool is_subnet_of(
+    const network_v4 & other) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/make_network_v4.html b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4.html new file mode 100644 index 0000000..b76efca --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4.html @@ -0,0 +1,69 @@ + + + +ip::network_v4::make_network_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + an IPv4 network from a string containing IP address and prefix length. +

+
network_v4 make_network_v4(
+    const char * str);
+  » more...
+
+network_v4 make_network_v4(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+network_v4 make_network_v4(
+    const std::string & str);
+  » more...
+
+network_v4 make_network_v4(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+network_v4 make_network_v4(
+    string_view str);
+  » more...
+
+network_v4 make_network_v4(
+    string_view str,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload1.html b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload1.html new file mode 100644 index 0000000..1d909d2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload1.html @@ -0,0 +1,45 @@ + + + +ip::network_v4::make_network_v4 (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from a string containing IP address and prefix + length. +

+
network_v4 make_network_v4(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload2.html b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload2.html new file mode 100644 index 0000000..f45c75b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload2.html @@ -0,0 +1,46 @@ + + + +ip::network_v4::make_network_v4 (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from a string containing IP address and prefix + length. +

+
network_v4 make_network_v4(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload3.html b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload3.html new file mode 100644 index 0000000..3dfceb5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload3.html @@ -0,0 +1,45 @@ + + + +ip::network_v4::make_network_v4 (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from a string containing IP address and prefix + length. +

+
network_v4 make_network_v4(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload4.html b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload4.html new file mode 100644 index 0000000..4478a5b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload4.html @@ -0,0 +1,46 @@ + + + +ip::network_v4::make_network_v4 (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from a string containing IP address and prefix + length. +

+
network_v4 make_network_v4(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload5.html b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload5.html new file mode 100644 index 0000000..8f19edd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload5.html @@ -0,0 +1,45 @@ + + + +ip::network_v4::make_network_v4 (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from a string containing IP address and prefix + length. +

+
network_v4 make_network_v4(
+    string_view str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload6.html b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload6.html new file mode 100644 index 0000000..7ad16a2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/make_network_v4/overload6.html @@ -0,0 +1,46 @@ + + + +ip::network_v4::make_network_v4 (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv4 network from a string containing IP address and prefix + length. +

+
network_v4 make_network_v4(
+    string_view str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/netmask.html b/include/asio/doc/asio/reference/ip__network_v4/netmask.html new file mode 100644 index 0000000..c3104cf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/netmask.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::netmask + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the netmask + that was specified when the network object was created. +

+
address_v4 netmask() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/network.html b/include/asio/doc/asio/reference/ip__network_v4/network.html new file mode 100644 index 0000000..815c377 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/network.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::network + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address + object that represents the network address. +

+
address_v4 network() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/network_v4.html b/include/asio/doc/asio/reference/ip__network_v4/network_v4.html new file mode 100644 index 0000000..869c84b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/network_v4.html @@ -0,0 +1,68 @@ + + + +ip::network_v4::network_v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
network_v4();
+  » more...
+
+

+ Construct a network based on the specified address and prefix length. +

+
network_v4(
+    const address_v4 & addr,
+    unsigned short prefix_len);
+  » more...
+
+

+ Construct network based on the specified address and netmask. +

+
network_v4(
+    const address_v4 & addr,
+    const address_v4 & mask);
+  » more...
+
+

+ Copy constructor. +

+
network_v4(
+    const network_v4 & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload1.html b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload1.html new file mode 100644 index 0000000..89b81d1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload1.html @@ -0,0 +1,43 @@ + + + +ip::network_v4::network_v4 (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
network_v4();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload2.html b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload2.html new file mode 100644 index 0000000..5553f34 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload2.html @@ -0,0 +1,45 @@ + + + +ip::network_v4::network_v4 (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a network based on the specified address and prefix length. +

+
network_v4(
+    const address_v4 & addr,
+    unsigned short prefix_len);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload3.html b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload3.html new file mode 100644 index 0000000..ea1b2b1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload3.html @@ -0,0 +1,45 @@ + + + +ip::network_v4::network_v4 (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct network based on the specified address and netmask. +

+
network_v4(
+    const address_v4 & addr,
+    const address_v4 & mask);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload4.html b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload4.html new file mode 100644 index 0000000..7921a52 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/network_v4/overload4.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::network_v4 (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
network_v4(
+    const network_v4 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/operator_eq_.html b/include/asio/doc/asio/reference/ip__network_v4/operator_eq_.html new file mode 100644 index 0000000..8e7487f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::network_v4::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + from another network. +

+
network_v4 & operator=(
+    const network_v4 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__network_v4/operator_eq__eq_.html new file mode 100644 index 0000000..83aa503 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::network_v4::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two networks for equality. +

+
friend bool operator==(
+    const network_v4 & a,
+    const network_v4 & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/network_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__network_v4/operator_not__eq_.html new file mode 100644 index 0000000..b74fdb3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::network_v4::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two networks for inequality. +

+
friend bool operator!=(
+    const network_v4 & a,
+    const network_v4 & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/network_v4.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/prefix_length.html b/include/asio/doc/asio/reference/ip__network_v4/prefix_length.html new file mode 100644 index 0000000..6d96b51 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/prefix_length.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::prefix_length + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the prefix length that was specified when the network object was created. +

+
unsigned short prefix_length() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/to_string.html b/include/asio/doc/asio/reference/ip__network_v4/to_string.html new file mode 100644 index 0000000..43dc843 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/to_string.html @@ -0,0 +1,49 @@ + + + +ip::network_v4::to_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the network + as an address in dotted decimal format. +

+
std::string to_string() const;
+  » more...
+
+std::string to_string(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/to_string/overload1.html b/include/asio/doc/asio/reference/ip__network_v4/to_string/overload1.html new file mode 100644 index 0000000..1e5447b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/to_string/overload1.html @@ -0,0 +1,43 @@ + + + +ip::network_v4::to_string (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the network as an address in dotted decimal format. +

+
std::string to_string() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v4/to_string/overload2.html b/include/asio/doc/asio/reference/ip__network_v4/to_string/overload2.html new file mode 100644 index 0000000..785a456 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v4/to_string/overload2.html @@ -0,0 +1,44 @@ + + + +ip::network_v4::to_string (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the network as an address in dotted decimal format. +

+
std::string to_string(
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6.html b/include/asio/doc/asio/reference/ip__network_v6.html new file mode 100644 index 0000000..9a672c8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6.html @@ -0,0 +1,299 @@ + + + +ip::network_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Represents an IPv6 network. +

+
class network_v6
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address +

+
+

+ Obtain the address object specified when the network object was + created. +

+
+

+ canonical +

+
+

+ Obtain the true network address, omitting any host bits. +

+
+

+ hosts +

+
+

+ Obtain an address range corresponding to the hosts in the network. +

+
+

+ is_host +

+
+

+ Test if network is a valid host address. +

+
+

+ is_subnet_of +

+
+

+ Test if a network is a real subnet of another network. +

+
+

+ network +

+
+

+ Obtain an address object that represents the network address. +

+
+

+ network_v6 [constructor] +

+
+

+ Default constructor.
—
Construct a network based on + the specified address and prefix length.
—
Copy constructor. +

+
+

+ operator= +

+
+

+ Assign from another network. +

+
+

+ prefix_length +

+
+

+ Obtain the prefix length that was specified when the network object + was created. +

+
+

+ to_string +

+
+

+ Get the network as an address in dotted decimal format. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two networks for inequality. +

+
+

+ operator== +

+
+

+ Compare two networks for equality. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ make_network_v6 +

+
+

+ Create an IPv6 network from a string containing IP address and + prefix length. +

+
+

+ The ip::network_v6 + class provides the ability to use and manipulate IP version 6 networks. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/network_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/address.html b/include/asio/doc/asio/reference/ip__network_v6/address.html new file mode 100644 index 0000000..f6a166a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/address.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the address + object specified when the network object was created. +

+
address_v6 address() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/canonical.html b/include/asio/doc/asio/reference/ip__network_v6/canonical.html new file mode 100644 index 0000000..454b172 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/canonical.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::canonical + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the + true network address, omitting any host bits. +

+
network_v6 canonical() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/hosts.html b/include/asio/doc/asio/reference/ip__network_v6/hosts.html new file mode 100644 index 0000000..ee059d6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/hosts.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::hosts + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address + range corresponding to the hosts in the network. +

+
address_v6_range hosts() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/is_host.html b/include/asio/doc/asio/reference/ip__network_v6/is_host.html new file mode 100644 index 0000000..91f2e78 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/is_host.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::is_host + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test if network + is a valid host address. +

+
bool is_host() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/is_subnet_of.html b/include/asio/doc/asio/reference/ip__network_v6/is_subnet_of.html new file mode 100644 index 0000000..ebd4605 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/is_subnet_of.html @@ -0,0 +1,45 @@ + + + +ip::network_v6::is_subnet_of + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test + if a network is a real subnet of another network. +

+
bool is_subnet_of(
+    const network_v6 & other) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/make_network_v6.html b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6.html new file mode 100644 index 0000000..8e766e8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6.html @@ -0,0 +1,69 @@ + + + +ip::network_v6::make_network_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + an IPv6 network from a string containing IP address and prefix length. +

+
network_v6 make_network_v6(
+    const char * str);
+  » more...
+
+network_v6 make_network_v6(
+    const char * str,
+    asio::error_code & ec);
+  » more...
+
+network_v6 make_network_v6(
+    const std::string & str);
+  » more...
+
+network_v6 make_network_v6(
+    const std::string & str,
+    asio::error_code & ec);
+  » more...
+
+network_v6 make_network_v6(
+    string_view str);
+  » more...
+
+network_v6 make_network_v6(
+    string_view str,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload1.html b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload1.html new file mode 100644 index 0000000..de99d6b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload1.html @@ -0,0 +1,45 @@ + + + +ip::network_v6::make_network_v6 (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 network from a string containing IP address and prefix + length. +

+
network_v6 make_network_v6(
+    const char * str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload2.html b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload2.html new file mode 100644 index 0000000..aa40c1c --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload2.html @@ -0,0 +1,46 @@ + + + +ip::network_v6::make_network_v6 (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 network from a string containing IP address and prefix + length. +

+
network_v6 make_network_v6(
+    const char * str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload3.html b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload3.html new file mode 100644 index 0000000..9d3b7d0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload3.html @@ -0,0 +1,45 @@ + + + +ip::network_v6::make_network_v6 (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 network from a string containing IP address and prefix + length. +

+
network_v6 make_network_v6(
+    const std::string & str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload4.html b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload4.html new file mode 100644 index 0000000..c9e7fc3 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload4.html @@ -0,0 +1,46 @@ + + + +ip::network_v6::make_network_v6 (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 network from a string containing IP address and prefix + length. +

+
network_v6 make_network_v6(
+    const std::string & str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload5.html b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload5.html new file mode 100644 index 0000000..7cf812d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload5.html @@ -0,0 +1,45 @@ + + + +ip::network_v6::make_network_v6 (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 network from a string containing IP address and prefix + length. +

+
network_v6 make_network_v6(
+    string_view str);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload6.html b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload6.html new file mode 100644 index 0000000..78c6d3b --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/make_network_v6/overload6.html @@ -0,0 +1,46 @@ + + + +ip::network_v6::make_network_v6 (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an IPv6 network from a string containing IP address and prefix + length. +

+
network_v6 make_network_v6(
+    string_view str,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/network.html b/include/asio/doc/asio/reference/ip__network_v6/network.html new file mode 100644 index 0000000..15813f2 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/network.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::network + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an address + object that represents the network address. +

+
address_v6 network() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/network_v6.html b/include/asio/doc/asio/reference/ip__network_v6/network_v6.html new file mode 100644 index 0000000..ef337fc --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/network_v6.html @@ -0,0 +1,60 @@ + + + +ip::network_v6::network_v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
network_v6();
+  » more...
+
+

+ Construct a network based on the specified address and prefix length. +

+
network_v6(
+    const address_v6 & addr,
+    unsigned short prefix_len);
+  » more...
+
+

+ Copy constructor. +

+
network_v6(
+    const network_v6 & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload1.html b/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload1.html new file mode 100644 index 0000000..5cd1285 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload1.html @@ -0,0 +1,43 @@ + + + +ip::network_v6::network_v6 (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
network_v6();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload2.html b/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload2.html new file mode 100644 index 0000000..629dac8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload2.html @@ -0,0 +1,45 @@ + + + +ip::network_v6::network_v6 (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a network based on the specified address and prefix length. +

+
network_v6(
+    const address_v6 & addr,
+    unsigned short prefix_len);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload3.html b/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload3.html new file mode 100644 index 0000000..530249e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/network_v6/overload3.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::network_v6 (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
network_v6(
+    const network_v6 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/operator_eq_.html b/include/asio/doc/asio/reference/ip__network_v6/operator_eq_.html new file mode 100644 index 0000000..c5d8109 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/operator_eq_.html @@ -0,0 +1,45 @@ + + + +ip::network_v6::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + from another network. +

+
network_v6 & operator=(
+    const network_v6 & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__network_v6/operator_eq__eq_.html new file mode 100644 index 0000000..7408436 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::network_v6::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two networks for equality. +

+
friend bool operator==(
+    const network_v6 & a,
+    const network_v6 & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/network_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__network_v6/operator_not__eq_.html new file mode 100644 index 0000000..22c5f78 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::network_v6::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two networks for inequality. +

+
friend bool operator!=(
+    const network_v6 & a,
+    const network_v6 & b);
+
+
+ + Requirements +
+

+ Header: asio/ip/network_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/prefix_length.html b/include/asio/doc/asio/reference/ip__network_v6/prefix_length.html new file mode 100644 index 0000000..d970302 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/prefix_length.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::prefix_length + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the prefix length that was specified when the network object was created. +

+
unsigned short prefix_length() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/to_string.html b/include/asio/doc/asio/reference/ip__network_v6/to_string.html new file mode 100644 index 0000000..7f9550e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/to_string.html @@ -0,0 +1,49 @@ + + + +ip::network_v6::to_string + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the network + as an address in dotted decimal format. +

+
std::string to_string() const;
+  » more...
+
+std::string to_string(
+    asio::error_code & ec) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/to_string/overload1.html b/include/asio/doc/asio/reference/ip__network_v6/to_string/overload1.html new file mode 100644 index 0000000..eb802bf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/to_string/overload1.html @@ -0,0 +1,43 @@ + + + +ip::network_v6::to_string (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the network as an address in dotted decimal format. +

+
std::string to_string() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__network_v6/to_string/overload2.html b/include/asio/doc/asio/reference/ip__network_v6/to_string/overload2.html new file mode 100644 index 0000000..4b20f06 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__network_v6/to_string/overload2.html @@ -0,0 +1,44 @@ + + + +ip::network_v6::to_string (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the network as an address in dotted decimal format. +

+
std::string to_string(
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base.html b/include/asio/doc/asio/reference/ip__resolver_base.html new file mode 100644 index 0000000..6049816 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base.html @@ -0,0 +1,238 @@ + + + +ip::resolver_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The ip::resolver_base + class is used as a base for the ip::basic_resolver + class templates to provide a common place to define the flag constants. +

+
class resolver_base
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~resolver_base [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is configured + for the system. Only return IPv6 addresses if a non-loopback IPv6 + address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a port + number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+
+ + Requirements +
+

+ Header: asio/ip/resolver_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/_resolver_base.html b/include/asio/doc/asio/reference/ip__resolver_base/_resolver_base.html new file mode 100644 index 0000000..fe03e96 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/_resolver_base.html @@ -0,0 +1,44 @@ + + + +ip::resolver_base::~resolver_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~resolver_base();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/address_configured.html b/include/asio/doc/asio/reference/ip__resolver_base/address_configured.html new file mode 100644 index 0000000..f874cba --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/address_configured.html @@ -0,0 +1,46 @@ + + + +ip::resolver_base::address_configured + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Only + return IPv4 addresses if a non-loopback IPv4 address is configured for + the system. Only return IPv6 addresses if a non-loopback IPv6 address is + configured for the system. +

+
static const flags address_configured = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/all_matching.html b/include/asio/doc/asio/reference/ip__resolver_base/all_matching.html new file mode 100644 index 0000000..e15be1f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/all_matching.html @@ -0,0 +1,44 @@ + + + +ip::resolver_base::all_matching + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +If + used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
static const flags all_matching = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/canonical_name.html b/include/asio/doc/asio/reference/ip__resolver_base/canonical_name.html new file mode 100644 index 0000000..d113a3a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/canonical_name.html @@ -0,0 +1,44 @@ + + + +ip::resolver_base::canonical_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + the canonical name of the host specified in the query. +

+
static const flags canonical_name = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/flags.html b/include/asio/doc/asio/reference/ip__resolver_base/flags.html new file mode 100644 index 0000000..4bc6227 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/flags.html @@ -0,0 +1,54 @@ + + + +ip::resolver_base::flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A bitmask type + (C++ Std [lib.bitmask.types]). +

+
typedef unspecified flags;
+
+
+ + Requirements +
+

+ Header: asio/ip/resolver_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/numeric_host.html b/include/asio/doc/asio/reference/ip__resolver_base/numeric_host.html new file mode 100644 index 0000000..ab3bcfa --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/numeric_host.html @@ -0,0 +1,45 @@ + + + +ip::resolver_base::numeric_host + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Host + name should be treated as a numeric string defining an IPv4 or IPv6 address + and no name resolution should be attempted. +

+
static const flags numeric_host = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/numeric_service.html b/include/asio/doc/asio/reference/ip__resolver_base/numeric_service.html new file mode 100644 index 0000000..237087d --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/numeric_service.html @@ -0,0 +1,45 @@ + + + +ip::resolver_base::numeric_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Service + name should be treated as a numeric string defining a port number and no + name resolution should be attempted. +

+
static const flags numeric_service = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/passive.html b/include/asio/doc/asio/reference/ip__resolver_base/passive.html new file mode 100644 index 0000000..17f6e54 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/passive.html @@ -0,0 +1,44 @@ + + + +ip::resolver_base::passive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Indicate + that returned endpoint is intended for use as a locally bound socket endpoint. +

+
static const flags passive = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_base/v4_mapped.html b/include/asio/doc/asio/reference/ip__resolver_base/v4_mapped.html new file mode 100644 index 0000000..68e9dcb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_base/v4_mapped.html @@ -0,0 +1,45 @@ + + + +ip::resolver_base::v4_mapped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +If + the query protocol family is specified as IPv6, return IPv4-mapped IPv6 + addresses on finding no IPv6 addresses. +

+
static const flags v4_mapped = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base.html b/include/asio/doc/asio/reference/ip__resolver_query_base.html new file mode 100644 index 0000000..d25ba03 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base.html @@ -0,0 +1,239 @@ + + + +ip::resolver_query_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The ip::resolver_query_base + class is used as a base for the ip::basic_resolver_query + class templates to provide a common place to define the flag constants. +

+
class resolver_query_base :
+  public ip::resolver_base
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~resolver_query_base [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is configured + for the system. Only return IPv6 addresses if a non-loopback IPv6 + address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a port + number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+
+ + Requirements +
+

+ Header: asio/ip/resolver_query_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/_resolver_query_base.html b/include/asio/doc/asio/reference/ip__resolver_query_base/_resolver_query_base.html new file mode 100644 index 0000000..ccfabc1 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/_resolver_query_base.html @@ -0,0 +1,44 @@ + + + +ip::resolver_query_base::~resolver_query_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~resolver_query_base();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/address_configured.html b/include/asio/doc/asio/reference/ip__resolver_query_base/address_configured.html new file mode 100644 index 0000000..940c7e7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/address_configured.html @@ -0,0 +1,49 @@ + + + +ip::resolver_query_base::address_configured + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Only + return IPv4 addresses if a non-loopback IPv4 address is configured for + the system. Only return IPv6 addresses if a non-loopback IPv6 address is + configured for the system. +

+
static const flags address_configured = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/all_matching.html b/include/asio/doc/asio/reference/ip__resolver_query_base/all_matching.html new file mode 100644 index 0000000..00ab603 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/all_matching.html @@ -0,0 +1,47 @@ + + + +ip::resolver_query_base::all_matching + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +If + used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
static const flags all_matching = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/canonical_name.html b/include/asio/doc/asio/reference/ip__resolver_query_base/canonical_name.html new file mode 100644 index 0000000..d6575f6 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/canonical_name.html @@ -0,0 +1,47 @@ + + + +ip::resolver_query_base::canonical_name + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Determine + the canonical name of the host specified in the query. +

+
static const flags canonical_name = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/flags.html b/include/asio/doc/asio/reference/ip__resolver_query_base/flags.html new file mode 100644 index 0000000..e5bd32f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/flags.html @@ -0,0 +1,57 @@ + + + +ip::resolver_query_base::flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +A + bitmask type (C++ Std [lib.bitmask.types]). +

+
typedef unspecified flags;
+
+
+ + Requirements +
+

+ Header: asio/ip/resolver_query_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/numeric_host.html b/include/asio/doc/asio/reference/ip__resolver_query_base/numeric_host.html new file mode 100644 index 0000000..af66ba9 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/numeric_host.html @@ -0,0 +1,48 @@ + + + +ip::resolver_query_base::numeric_host + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Host + name should be treated as a numeric string defining an IPv4 or IPv6 address + and no name resolution should be attempted. +

+
static const flags numeric_host = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/numeric_service.html b/include/asio/doc/asio/reference/ip__resolver_query_base/numeric_service.html new file mode 100644 index 0000000..c4f0d2e --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/numeric_service.html @@ -0,0 +1,48 @@ + + + +ip::resolver_query_base::numeric_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Service + name should be treated as a numeric string defining a port number and no + name resolution should be attempted. +

+
static const flags numeric_service = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/passive.html b/include/asio/doc/asio/reference/ip__resolver_query_base/passive.html new file mode 100644 index 0000000..724cdee --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/passive.html @@ -0,0 +1,47 @@ + + + +ip::resolver_query_base::passive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +Indicate + that returned endpoint is intended for use as a locally bound socket endpoint. +

+
static const flags passive = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__resolver_query_base/v4_mapped.html b/include/asio/doc/asio/reference/ip__resolver_query_base/v4_mapped.html new file mode 100644 index 0000000..117d6b7 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__resolver_query_base/v4_mapped.html @@ -0,0 +1,48 @@ + + + +ip::resolver_query_base::v4_mapped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from ip::resolver_base. +

+

+ +If + the query protocol family is specified as IPv6, return IPv4-mapped IPv6 + addresses on finding no IPv6 addresses. +

+
static const flags v4_mapped = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp.html b/include/asio/doc/asio/reference/ip__tcp.html new file mode 100644 index 0000000..aff2d02 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp.html @@ -0,0 +1,298 @@ + + + +ip::tcp + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for TCP. +

+
class tcp
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ acceptor +

+
+

+ The TCP acceptor type. +

+
+

+ endpoint +

+
+

+ The type of a TCP endpoint. +

+
+

+ iostream +

+
+

+ The TCP iostream type. +

+
+

+ no_delay +

+
+

+ Socket option for disabling the Nagle algorithm. +

+
+

+ resolver +

+
+

+ The TCP resolver type. +

+
+

+ socket +

+
+

+ The TCP socket type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+

+ v4 + [static] +

+
+

+ Construct to represent the IPv4 TCP protocol. +

+
+

+ v6 + [static] +

+
+

+ Construct to represent the IPv6 TCP protocol. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two protocols for inequality. +

+
+

+ operator== +

+
+

+ Compare two protocols for equality. +

+
+

+ The ip::tcp class + contains flags necessary for TCP sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/acceptor.html b/include/asio/doc/asio/reference/ip__tcp/acceptor.html new file mode 100644 index 0000000..bee8695 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/acceptor.html @@ -0,0 +1,776 @@ + + + +ip::tcp::acceptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The TCP acceptor type. +

+
typedef basic_socket_acceptor< tcp > acceptor;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the acceptor type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of an acceptor. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ accept +

+
+

+ Accept a new connection.
—
Accept a new connection + and obtain the endpoint of the peer. +

+
+

+ assign +

+
+

+ Assigns an existing native acceptor to the acceptor. +

+
+

+ async_accept +

+
+

+ Start an asynchronous accept. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the acceptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_socket_acceptor [constructor] +

+
+

+ Construct an acceptor without opening it.
—
Construct + an open acceptor.
—
Construct an acceptor opened + on the given endpoint.
—
Construct a basic_socket_acceptor + on an existing native acceptor.
—
Move-construct + a basic_socket_acceptor from another.
—
Move-construct + a basic_socket_acceptor from an acceptor of another protocol + type. +

+
+

+ bind +

+
+

+ Bind the acceptor to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the acceptor. +

+
+

+ close +

+
+

+ Close the acceptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the acceptor. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the acceptor. +

+
+

+ is_open +

+
+

+ Determine whether the acceptor is open. +

+
+

+ listen +

+
+

+ Place the acceptor into the state where it will listen for new + connections. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the acceptor. +

+
+

+ native_handle +

+
+

+ Get the native acceptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native acceptor implementation. +
—
Sets the non-blocking mode of the native acceptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the acceptor.
—
Sets + the non-blocking mode of the acceptor. +

+
+

+ open +

+
+

+ Open the acceptor using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_acceptor from another.
—
+ Move-assign a basic_socket_acceptor from an acceptor of another + protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native acceptor. +

+
+

+ set_option +

+
+

+ Set an option on the acceptor. +

+
+

+ wait +

+
+

+ Wait for the acceptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_socket_acceptor [destructor] +

+
+

+ Destroys the acceptor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket_acceptor + class template is used for accepting new socket connections. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ Opening a socket acceptor with the SO_REUSEADDR option enabled: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port);
+acceptor.open(endpoint.protocol());
+acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true));
+acceptor.bind(endpoint);
+acceptor.listen();
+
+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/endpoint.html b/include/asio/doc/asio/reference/ip__tcp/endpoint.html new file mode 100644 index 0000000..c308791 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/endpoint.html @@ -0,0 +1,395 @@ + + + +ip::tcp::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of a TCP endpoint. +

+
typedef basic_endpoint< tcp > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address +

+
+

+ Get the IP address associated with the endpoint.
—
+ Set the IP address associated with the endpoint. +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint using + a port number, specified in the host's byte order. The IP address + will be the any address (i.e. INADDR_ANY or in6addr_any). This + constructor would typically be used for accepting new connections. +
—
Construct an endpoint using a port number and an + IP address. This constructor may be used for accepting connections + on a specific interface or for making a connection to a remote + endpoint.
—
Copy constructor.
—
Move + constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint.
—
Move-assign from + another endpoint. +

+
+

+ port +

+
+

+ Get the port associated with the endpoint. The port number is + always in the host's byte order.
—
Set the port associated + with the endpoint. The port number is always in the host's byte + order. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator<< +

+
+

+ Output an endpoint as a string. +

+
+

+ The ip::basic_endpoint + class template describes an endpoint that may be associated with a particular + socket. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/family.html b/include/asio/doc/asio/reference/ip__tcp/family.html new file mode 100644 index 0000000..1404c75 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/family.html @@ -0,0 +1,44 @@ + + + +ip::tcp::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for the + protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/iostream.html b/include/asio/doc/asio/reference/ip__tcp/iostream.html new file mode 100644 index 0000000..7220178 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/iostream.html @@ -0,0 +1,327 @@ + + + +ip::tcp::iostream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The TCP iostream type. +

+
typedef basic_socket_iostream< tcp > iostream;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type. +

+
+

+ duration_type +

+
+

+ (Deprecated: Use duration.) The duration type. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ time_point +

+
+

+ The time type. +

+
+

+ time_type +

+
+

+ (Deprecated: Use time_point.) The time type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_socket_iostream [constructor] +

+
+

+ Construct a basic_socket_iostream without establishing a connection. +
—
Construct a basic_socket_iostream from the supplied + socket.
—
Move-construct a basic_socket_iostream + from another.
—
Establish a connection to an endpoint + corresponding to a resolver query. +

+
+

+ close +

+
+

+ Close the connection. +

+
+

+ connect +

+
+

+ Establish a connection to an endpoint corresponding to a resolver + query. +

+
+

+ error +

+
+

+ Get the last error associated with the stream. +

+
+

+ expires_after +

+
+

+ Set the stream's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time as an + absolute time.
—
Set the stream's expiry time as + an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set + the stream's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the stream's expiry time as an absolute time. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_iostream from another. +

+
+

+ rdbuf +

+
+

+ Return a pointer to the underlying streambuf. +

+
+

+ socket +

+
+

+ Get a reference to the underlying socket. +

+
+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/no_delay.html b/include/asio/doc/asio/reference/ip__tcp/no_delay.html new file mode 100644 index 0000000..3c3be66 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/no_delay.html @@ -0,0 +1,78 @@ + + + +ip::tcp::no_delay + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option for disabling + the Nagle algorithm. +

+
typedef implementation_defined no_delay;
+
+

+ Implements the IPPROTO_TCP/TCP_NODELAY socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::tcp::no_delay option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__tcp/operator_eq__eq_.html new file mode 100644 index 0000000..2267dbd --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::tcp::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two protocols + for equality. +

+
friend bool operator==(
+    const tcp & p1,
+    const tcp & p2);
+
+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__tcp/operator_not__eq_.html new file mode 100644 index 0000000..95c4fc0 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::tcp::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two protocols + for inequality. +

+
friend bool operator!=(
+    const tcp & p1,
+    const tcp & p2);
+
+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/protocol.html b/include/asio/doc/asio/reference/ip__tcp/protocol.html new file mode 100644 index 0000000..9bcf486 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/protocol.html @@ -0,0 +1,44 @@ + + + +ip::tcp::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for + the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/resolver.html b/include/asio/doc/asio/reference/ip__tcp/resolver.html new file mode 100644 index 0000000..177a8aa --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/resolver.html @@ -0,0 +1,421 @@ + + + +ip::tcp::resolver + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The TCP resolver type. +

+
typedef basic_resolver< tcp > resolver;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the resolver type to another executor. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+

+ iterator +

+
+

+ (Deprecated.) The iterator type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ query +

+
+

+ (Deprecated.) The query type. +

+
+

+ results_type +

+
+

+ The results type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Asynchronously perform forward resolution of a query to a list + of entries.
—
Asynchronously perform forward resolution + of a query to a list of entries.
—
Asynchronously + perform reverse resolution of an endpoint to a list of entries. +

+
+

+ basic_resolver [constructor] +

+
+

+ Construct with executor.
—
Construct with execution + context.
—
Move-construct a basic_resolver from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the resolver. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_resolver from another. +

+
+

+ resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Perform forward resolution of a query to a list of entries. +
—
Perform forward resolution of a query to a list + of entries.
—
Perform reverse resolution of an endpoint + to a list of entries. +

+
+

+ ~basic_resolver [destructor] +

+
+

+ Destroys the resolver. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is + configured for the system. Only return IPv6 addresses if a non-loopback + IPv6 address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a + port number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+

+ The ip::basic_resolver + class template provides the ability to resolve a query to a list of endpoints. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/socket.html b/include/asio/doc/asio/reference/ip__tcp/socket.html new file mode 100644 index 0000000..88dd6bf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/socket.html @@ -0,0 +1,919 @@ + + + +ip::tcp::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The TCP socket type. +

+
typedef basic_stream_socket< tcp > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_stream_socket [constructor] +

+
+

+ Construct a basic_stream_socket without opening it.
—
+ Construct and open a basic_stream_socket.
—
Construct + a basic_stream_socket, opening it and binding it to the given + local endpoint.
—
Construct a basic_stream_socket + on an existing native socket.
—
Move-construct a + basic_stream_socket from another.
—
Move-construct + a basic_stream_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_stream_socket from another.
—
+ Move-assign a basic_stream_socket from a socket of another protocol + type. +

+
+

+ read_some +

+
+

+ Read some data from the socket. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the socket. +

+
+

+ ~basic_stream_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_stream_socket + class template provides asynchronous and blocking stream-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/tcp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/type.html b/include/asio/doc/asio/reference/ip__tcp/type.html new file mode 100644 index 0000000..b1dfd69 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/type.html @@ -0,0 +1,44 @@ + + + +ip::tcp::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for the type + of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/v4.html b/include/asio/doc/asio/reference/ip__tcp/v4.html new file mode 100644 index 0000000..0e7c28a --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/v4.html @@ -0,0 +1,43 @@ + + + +ip::tcp::v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct to represent the IPv4 TCP protocol. +

+
static tcp v4();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__tcp/v6.html b/include/asio/doc/asio/reference/ip__tcp/v6.html new file mode 100644 index 0000000..4d79385 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__tcp/v6.html @@ -0,0 +1,43 @@ + + + +ip::tcp::v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct to represent the IPv6 TCP protocol. +

+
static tcp v6();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp.html b/include/asio/doc/asio/reference/ip__udp.html new file mode 100644 index 0000000..2e05218 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp.html @@ -0,0 +1,262 @@ + + + +ip::udp + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for UDP. +

+
class udp
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint +

+
+

+ The type of a UDP endpoint. +

+
+

+ resolver +

+
+

+ The UDP resolver type. +

+
+

+ socket +

+
+

+ The UDP socket type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+

+ v4 + [static] +

+
+

+ Construct to represent the IPv4 UDP protocol. +

+
+

+ v6 + [static] +

+
+

+ Construct to represent the IPv6 UDP protocol. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two protocols for inequality. +

+
+

+ operator== +

+
+

+ Compare two protocols for equality. +

+
+

+ The ip::udp class + contains flags necessary for UDP sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/ip/udp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/endpoint.html b/include/asio/doc/asio/reference/ip__udp/endpoint.html new file mode 100644 index 0000000..e5f5259 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/endpoint.html @@ -0,0 +1,395 @@ + + + +ip::udp::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type of a UDP endpoint. +

+
typedef basic_endpoint< udp > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address +

+
+

+ Get the IP address associated with the endpoint.
—
+ Set the IP address associated with the endpoint. +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint using + a port number, specified in the host's byte order. The IP address + will be the any address (i.e. INADDR_ANY or in6addr_any). This + constructor would typically be used for accepting new connections. +
—
Construct an endpoint using a port number and an + IP address. This constructor may be used for accepting connections + on a specific interface or for making a connection to a remote + endpoint.
—
Copy constructor.
—
Move + constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint.
—
Move-assign from + another endpoint. +

+
+

+ port +

+
+

+ Get the port associated with the endpoint. The port number is + always in the host's byte order.
—
Set the port associated + with the endpoint. The port number is always in the host's byte + order. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator<< +

+
+

+ Output an endpoint as a string. +

+
+

+ The ip::basic_endpoint + class template describes an endpoint that may be associated with a particular + socket. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/udp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/family.html b/include/asio/doc/asio/reference/ip__udp/family.html new file mode 100644 index 0000000..266aded --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/family.html @@ -0,0 +1,44 @@ + + + +ip::udp::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for the + protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/operator_eq__eq_.html b/include/asio/doc/asio/reference/ip__udp/operator_eq__eq_.html new file mode 100644 index 0000000..2f87b05 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +ip::udp::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two protocols + for equality. +

+
friend bool operator==(
+    const udp & p1,
+    const udp & p2);
+
+
+ + Requirements +
+

+ Header: asio/ip/udp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/operator_not__eq_.html b/include/asio/doc/asio/reference/ip__udp/operator_not__eq_.html new file mode 100644 index 0000000..7010adf --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +ip::udp::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two protocols + for inequality. +

+
friend bool operator!=(
+    const udp & p1,
+    const udp & p2);
+
+
+ + Requirements +
+

+ Header: asio/ip/udp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/protocol.html b/include/asio/doc/asio/reference/ip__udp/protocol.html new file mode 100644 index 0000000..d62772f --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/protocol.html @@ -0,0 +1,44 @@ + + + +ip::udp::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for + the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/resolver.html b/include/asio/doc/asio/reference/ip__udp/resolver.html new file mode 100644 index 0000000..8a912d5 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/resolver.html @@ -0,0 +1,421 @@ + + + +ip::udp::resolver + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The UDP resolver type. +

+
typedef basic_resolver< udp > resolver;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the resolver type to another executor. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ flags +

+
+

+ A bitmask type (C++ Std [lib.bitmask.types]). +

+
+

+ iterator +

+
+

+ (Deprecated.) The iterator type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ query +

+
+

+ (Deprecated.) The query type. +

+
+

+ results_type +

+
+

+ The results type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Asynchronously perform forward resolution of a query to a list + of entries.
—
Asynchronously perform forward resolution + of a query to a list of entries.
—
Asynchronously + perform reverse resolution of an endpoint to a list of entries. +

+
+

+ basic_resolver [constructor] +

+
+

+ Construct with executor.
—
Construct with execution + context.
—
Move-construct a basic_resolver from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the resolver. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_resolver from another. +

+
+

+ resolve +

+
+

+ (Deprecated: Use overload with separate host and service parameters.) + Perform forward resolution of a query to a list of entries. +
—
Perform forward resolution of a query to a list + of entries.
—
Perform reverse resolution of an endpoint + to a list of entries. +

+
+

+ ~basic_resolver [destructor] +

+
+

+ Destroys the resolver. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ address_configured [static] +

+
+

+ Only return IPv4 addresses if a non-loopback IPv4 address is + configured for the system. Only return IPv6 addresses if a non-loopback + IPv6 address is configured for the system. +

+
+

+ all_matching [static] +

+
+

+ If used with v4_mapped, return all matching IPv6 and IPv4 addresses. +

+
+

+ canonical_name [static] +

+
+

+ Determine the canonical name of the host specified in the query. +

+
+

+ numeric_host [static] +

+
+

+ Host name should be treated as a numeric string defining an IPv4 + or IPv6 address and no name resolution should be attempted. +

+
+

+ numeric_service [static] +

+
+

+ Service name should be treated as a numeric string defining a + port number and no name resolution should be attempted. +

+
+

+ passive [static] +

+
+

+ Indicate that returned endpoint is intended for use as a locally + bound socket endpoint. +

+
+

+ v4_mapped [static] +

+
+

+ If the query protocol family is specified as IPv6, return IPv4-mapped + IPv6 addresses on finding no IPv6 addresses. +

+
+

+ The ip::basic_resolver + class template provides the ability to resolve a query to a list of endpoints. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/udp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/socket.html b/include/asio/doc/asio/reference/ip__udp/socket.html new file mode 100644 index 0000000..871a6bb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/socket.html @@ -0,0 +1,918 @@ + + + +ip::udp::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The UDP socket type. +

+
typedef basic_datagram_socket< udp > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_datagram_socket [constructor] +

+
+

+ Construct a basic_datagram_socket without opening it.
+ —
Construct and open a basic_datagram_socket.
—
+ Construct a basic_datagram_socket, opening it and binding it + to the given local endpoint.
—
Construct a basic_datagram_socket + on an existing native socket.
—
Move-construct a + basic_datagram_socket from another.
—
Move-construct + a basic_datagram_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_datagram_socket from another.
—
+ Move-assign a basic_datagram_socket from a socket of another + protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive a datagram with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send a datagram to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_datagram_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_datagram_socket + class template provides asynchronous and blocking datagram-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/ip/udp.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/type.html b/include/asio/doc/asio/reference/ip__udp/type.html new file mode 100644 index 0000000..a97d9c8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/type.html @@ -0,0 +1,44 @@ + + + +ip::udp::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain an identifier for the type + of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/v4.html b/include/asio/doc/asio/reference/ip__udp/v4.html new file mode 100644 index 0000000..1be5796 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/v4.html @@ -0,0 +1,43 @@ + + + +ip::udp::v4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct to represent the IPv4 UDP protocol. +

+
static udp v4();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__udp/v6.html b/include/asio/doc/asio/reference/ip__udp/v6.html new file mode 100644 index 0000000..e7563a8 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__udp/v6.html @@ -0,0 +1,43 @@ + + + +ip::udp::v6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct to represent the IPv6 UDP protocol. +

+
static udp v6();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__unicast__hops.html b/include/asio/doc/asio/reference/ip__unicast__hops.html new file mode 100644 index 0000000..6d6ef87 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__unicast__hops.html @@ -0,0 +1,78 @@ + + + +ip::unicast::hops + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option for time-to-live + associated with outgoing unicast packets. +

+
typedef implementation_defined hops;
+
+

+ Implements the IPPROTO_IP/IP_UNICAST_TTL socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::unicast::hops option(4);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::ip::unicast::hops option;
+socket.get_option(option);
+int ttl = option.value();
+
+
+ + Requirements +
+

+ Header: asio/ip/unicast.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__v4_mapped_t.html b/include/asio/doc/asio/reference/ip__v4_mapped_t.html new file mode 100644 index 0000000..58473bb --- /dev/null +++ b/include/asio/doc/asio/reference/ip__v4_mapped_t.html @@ -0,0 +1,68 @@ + + + +ip::v4_mapped_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Tag type used for distinguishing + overloads that deal in IPv4-mapped IPv6 addresses. +

+
enum v4_mapped_t
+
+

+ +

+
+ + Values +
+
+

+
+
v4_mapped
+
+
+
+
+ + Requirements +
+

+ Header: asio/ip/address_v6.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ip__v6_only.html b/include/asio/doc/asio/reference/ip__v6_only.html new file mode 100644 index 0000000..10e6384 --- /dev/null +++ b/include/asio/doc/asio/reference/ip__v6_only.html @@ -0,0 +1,78 @@ + + + +ip::v6_only + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option for determining whether + an IPv6 socket supports IPv6 communication only. +

+
typedef implementation_defined v6_only;
+
+

+ Implements the IPPROTO_IPV6/IP_V6ONLY socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::v6_only option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::ip::v6_only option;
+socket.get_option(option);
+bool v6_only = option.value();
+
+
+ + Requirements +
+

+ Header: asio/ip/v6_only.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_applicable_property.html b/include/asio/doc/asio/reference/is_applicable_property.html new file mode 100644 index 0000000..fa5d498 --- /dev/null +++ b/include/asio/doc/asio/reference/is_applicable_property.html @@ -0,0 +1,53 @@ + + + +is_applicable_property + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
template<
+    typename T,
+    typename Property,
+    typename  = void>
+struct is_applicable_property
+
+
+ + Requirements +
+

+ Header: asio/is_applicable_property.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_const_buffer_sequence.html b/include/asio/doc/asio/reference/is_const_buffer_sequence.html new file mode 100644 index 0000000..8d57625 --- /dev/null +++ b/include/asio/doc/asio/reference/is_const_buffer_sequence.html @@ -0,0 +1,54 @@ + + + +is_const_buffer_sequence + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Trait to determine whether a type satisfies the ConstBufferSequence requirements. +

+
template<
+    typename T>
+struct is_const_buffer_sequence
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_dynamic_buffer.html b/include/asio/doc/asio/reference/is_dynamic_buffer.html new file mode 100644 index 0000000..e544847 --- /dev/null +++ b/include/asio/doc/asio/reference/is_dynamic_buffer.html @@ -0,0 +1,59 @@ + + + +is_dynamic_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Trait to determine whether a type satisfies the DynamicBuffer requirements. +

+
template<
+    typename T>
+struct is_dynamic_buffer
+
+

+ If ASIO_NO_DYNAMIC_BUFFER_V1 is not defined, determines whether + the type satisfies the DynamicBuffer_v1 requirements. Otherwise, if ASIO_NO_DYNAMIC_BUFFER_V1 + is defined, determines whether the type satisfies the DynamicBuffer_v2 requirements. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_dynamic_buffer_v1.html b/include/asio/doc/asio/reference/is_dynamic_buffer_v1.html new file mode 100644 index 0000000..5df46b2 --- /dev/null +++ b/include/asio/doc/asio/reference/is_dynamic_buffer_v1.html @@ -0,0 +1,54 @@ + + + +is_dynamic_buffer_v1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Trait to determine whether a type satisfies the DynamicBuffer_v1 requirements. +

+
template<
+    typename T>
+struct is_dynamic_buffer_v1
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_dynamic_buffer_v2.html b/include/asio/doc/asio/reference/is_dynamic_buffer_v2.html new file mode 100644 index 0000000..a9390f3 --- /dev/null +++ b/include/asio/doc/asio/reference/is_dynamic_buffer_v2.html @@ -0,0 +1,54 @@ + + + +is_dynamic_buffer_v2 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Trait to determine whether a type satisfies the DynamicBuffer_v2 requirements. +

+
template<
+    typename T>
+struct is_dynamic_buffer_v2
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_endpoint_sequence.html b/include/asio/doc/asio/reference/is_endpoint_sequence.html new file mode 100644 index 0000000..5307a10 --- /dev/null +++ b/include/asio/doc/asio/reference/is_endpoint_sequence.html @@ -0,0 +1,91 @@ + + + +is_endpoint_sequence + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Type trait used to determine whether a type is an endpoint sequence that + can be used with with connect and async_connect. +

+
template<
+    typename T>
+struct is_endpoint_sequence
+
+
+ + Data + Members +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ value [static] +

+
+

+ The value member is true if the type may be used as an endpoint + sequence. +

+
+
+ + Requirements +
+

+ Header: asio/connect.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_endpoint_sequence/value.html b/include/asio/doc/asio/reference/is_endpoint_sequence/value.html new file mode 100644 index 0000000..d185b00 --- /dev/null +++ b/include/asio/doc/asio/reference/is_endpoint_sequence/value.html @@ -0,0 +1,44 @@ + + + +is_endpoint_sequence::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The value + member is true if the type may be used as an endpoint sequence. +

+
static const bool value;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_executor.html b/include/asio/doc/asio/reference/is_executor.html new file mode 100644 index 0000000..4a5d8a5 --- /dev/null +++ b/include/asio/doc/asio/reference/is_executor.html @@ -0,0 +1,60 @@ + + + +is_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The is_executor + trait detects whether a type T meets the Executor type requirements. +

+
template<
+    typename T>
+struct is_executor
+
+

+ Class template is_executor is a UnaryTypeTrait that is derived + from true_type if the type T meets the syntactic + requirements for Executor, otherwise false_type. +

+
+ + Requirements +
+

+ Header: asio/is_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_match_condition.html b/include/asio/doc/asio/reference/is_match_condition.html new file mode 100644 index 0000000..c6c82e2 --- /dev/null +++ b/include/asio/doc/asio/reference/is_match_condition.html @@ -0,0 +1,90 @@ + + + +is_match_condition + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Type trait used to determine whether a type can be used as a match condition + function with read_until and async_read_until. +

+
template<
+    typename T>
+struct is_match_condition
+
+
+ + Data + Members +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ value [static] +

+
+

+ The value member is true if the type may be used as a match condition. +

+
+
+ + Requirements +
+

+ Header: asio/read_until.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_match_condition/value.html b/include/asio/doc/asio/reference/is_match_condition/value.html new file mode 100644 index 0000000..513b163 --- /dev/null +++ b/include/asio/doc/asio/reference/is_match_condition/value.html @@ -0,0 +1,44 @@ + + + +is_match_condition::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The value + member is true if the type may be used as a match condition. +

+
static const bool value;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_mutable_buffer_sequence.html b/include/asio/doc/asio/reference/is_mutable_buffer_sequence.html new file mode 100644 index 0000000..6ed09a7 --- /dev/null +++ b/include/asio/doc/asio/reference/is_mutable_buffer_sequence.html @@ -0,0 +1,54 @@ + + + +is_mutable_buffer_sequence + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Trait to determine whether a type satisfies the MutableBufferSequence requirements. +

+
template<
+    typename T>
+struct is_mutable_buffer_sequence
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_nothrow_prefer.html b/include/asio/doc/asio/reference/is_nothrow_prefer.html new file mode 100644 index 0000000..28c775b --- /dev/null +++ b/include/asio/doc/asio/reference/is_nothrow_prefer.html @@ -0,0 +1,62 @@ + + + +is_nothrow_prefer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a prefer expression will + not throw. +

+
template<
+    typename T,
+    typename... Properties>
+struct is_nothrow_prefer
+
+

+ Class template is_nothrow_prefer is a trait that is derived + from true_type if the expression asio::prefer(std::declval<T>(), + std::declval<Properties>()...) is noexcept; otherwise + false_type. +

+
+ + Requirements +
+

+ Header: asio/prefer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_nothrow_query.html b/include/asio/doc/asio/reference/is_nothrow_query.html new file mode 100644 index 0000000..c22e869 --- /dev/null +++ b/include/asio/doc/asio/reference/is_nothrow_query.html @@ -0,0 +1,62 @@ + + + +is_nothrow_query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a query expression will + not throw. +

+
template<
+    typename T,
+    typename Property>
+struct is_nothrow_query
+
+

+ Class template is_nothrow_query is a trait that is derived from + true_type if the expression asio::query(std::declval<T>(), + std::declval<Property>()) is noexcept; otherwise + false_type. +

+
+ + Requirements +
+

+ Header: asio/query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_nothrow_require.html b/include/asio/doc/asio/reference/is_nothrow_require.html new file mode 100644 index 0000000..1bd0423 --- /dev/null +++ b/include/asio/doc/asio/reference/is_nothrow_require.html @@ -0,0 +1,62 @@ + + + +is_nothrow_require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a require expression will + not throw. +

+
template<
+    typename T,
+    typename... Properties>
+struct is_nothrow_require
+
+

+ Class template is_nothrow_require is a trait that is derived + from true_type if the expression asio::require(std::declval<T>(), + std::declval<Properties>()...) is noexcept; otherwise + false_type. +

+
+ + Requirements +
+

+ Header: asio/require.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_nothrow_require_concept.html b/include/asio/doc/asio/reference/is_nothrow_require_concept.html new file mode 100644 index 0000000..42ee8bc --- /dev/null +++ b/include/asio/doc/asio/reference/is_nothrow_require_concept.html @@ -0,0 +1,62 @@ + + + +is_nothrow_require_concept + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines whether a require_concept expression + will not throw. +

+
template<
+    typename T,
+    typename Property>
+struct is_nothrow_require_concept
+
+

+ Class template is_nothrow_require_concept is a trait that is + derived from true_type if the expression asio::require_concept(std::declval<T>(), + std::declval<Property>()) is noexcept; otherwise + false_type. +

+
+ + Requirements +
+

+ Header: asio/require_concept.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_read_buffered.html b/include/asio/doc/asio/reference/is_read_buffered.html new file mode 100644 index 0000000..5ef9158 --- /dev/null +++ b/include/asio/doc/asio/reference/is_read_buffered.html @@ -0,0 +1,92 @@ + + + +is_read_buffered + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The is_read_buffered + class is a traits class that may be used to determine whether a stream type + supports buffering of read data. +

+
template<
+    typename Stream>
+class is_read_buffered
+
+
+ + Data + Members +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ value [static] +

+
+

+ The value member is true only if the Stream type supports buffering + of read data. +

+
+
+ + Requirements +
+

+ Header: asio/is_read_buffered.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_read_buffered/value.html b/include/asio/doc/asio/reference/is_read_buffered/value.html new file mode 100644 index 0000000..2bf5f01 --- /dev/null +++ b/include/asio/doc/asio/reference/is_read_buffered/value.html @@ -0,0 +1,44 @@ + + + +is_read_buffered::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The value member + is true only if the Stream type supports buffering of read data. +

+
static const bool value;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_write_buffered.html b/include/asio/doc/asio/reference/is_write_buffered.html new file mode 100644 index 0000000..f04ff63 --- /dev/null +++ b/include/asio/doc/asio/reference/is_write_buffered.html @@ -0,0 +1,92 @@ + + + +is_write_buffered + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The is_write_buffered + class is a traits class that may be used to determine whether a stream type + supports buffering of written data. +

+
template<
+    typename Stream>
+class is_write_buffered
+
+
+ + Data + Members +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ value [static] +

+
+

+ The value member is true only if the Stream type supports buffering + of written data. +

+
+
+ + Requirements +
+

+ Header: asio/is_write_buffered.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/is_write_buffered/value.html b/include/asio/doc/asio/reference/is_write_buffered/value.html new file mode 100644 index 0000000..19d79c9 --- /dev/null +++ b/include/asio/doc/asio/reference/is_write_buffered/value.html @@ -0,0 +1,44 @@ + + + +is_write_buffered::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The value member + is true only if the Stream type supports buffering of written data. +

+
static const bool value;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint.html b/include/asio/doc/asio/reference/local__basic_endpoint.html new file mode 100644 index 0000000..e14e7d8 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint.html @@ -0,0 +1,372 @@ + + + +local::basic_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Describes an endpoint for a UNIX socket. +

+
template<
+    typename Protocol>
+class basic_endpoint
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on the + underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint using + the specified path name.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ path +

+
+

+ Get the path associated with the endpoint.
—
Set the + path associated with the endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator<< +

+
+

+ Output an endpoint as a string. +

+
+

+ The local::basic_endpoint + class template describes an endpoint that may be associated with a particular + UNIX socket. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint.html b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint.html new file mode 100644 index 0000000..797bae4 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint.html @@ -0,0 +1,63 @@ + + + +local::basic_endpoint::basic_endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
basic_endpoint();
+  » more...
+
+

+ Construct an endpoint using the specified path name. +

+
basic_endpoint(
+    const char * path_name);
+  » more...
+
+basic_endpoint(
+    const std::string & path_name);
+  » more...
+
+

+ Copy constructor. +

+
basic_endpoint(
+    const basic_endpoint & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload1.html b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload1.html new file mode 100644 index 0000000..12ecc7a --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload1.html @@ -0,0 +1,43 @@ + + + +local::basic_endpoint::basic_endpoint (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
basic_endpoint();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload2.html b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload2.html new file mode 100644 index 0000000..dbadcdd --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload2.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::basic_endpoint (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an endpoint using the specified path name. +

+
basic_endpoint(
+    const char * path_name);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload3.html b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload3.html new file mode 100644 index 0000000..4ce4b69 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload3.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::basic_endpoint (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an endpoint using the specified path name. +

+
basic_endpoint(
+    const std::string & path_name);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload4.html b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload4.html new file mode 100644 index 0000000..fb524a8 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/basic_endpoint/overload4.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::basic_endpoint (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_endpoint(
+    const basic_endpoint & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/capacity.html b/include/asio/doc/asio/reference/local__basic_endpoint/capacity.html new file mode 100644 index 0000000..7f53e84 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/capacity.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::capacity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the capacity of the endpoint in the native type. +

+
std::size_t capacity() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/data.html b/include/asio/doc/asio/reference/local__basic_endpoint/data.html new file mode 100644 index 0000000..df1f04d --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/data.html @@ -0,0 +1,48 @@ + + + +local::basic_endpoint::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + underlying endpoint in the native type. +

+
data_type * data();
+  » more...
+
+const data_type * data() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/data/overload1.html b/include/asio/doc/asio/reference/local__basic_endpoint/data/overload1.html new file mode 100644 index 0000000..0e3e2ac --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/data/overload1.html @@ -0,0 +1,43 @@ + + + +local::basic_endpoint::data (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying endpoint in the native type. +

+
data_type * data();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/data/overload2.html b/include/asio/doc/asio/reference/local__basic_endpoint/data/overload2.html new file mode 100644 index 0000000..c7a1b63 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/data/overload2.html @@ -0,0 +1,43 @@ + + + +local::basic_endpoint::data (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the underlying endpoint in the native type. +

+
const data_type * data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/data_type.html b/include/asio/doc/asio/reference/local__basic_endpoint/data_type.html new file mode 100644 index 0000000..01b52b5 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/data_type.html @@ -0,0 +1,55 @@ + + + +local::basic_endpoint::data_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the endpoint structure. This type is dependent on the underlying + implementation of the socket layer. +

+
typedef implementation_defined data_type;
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_eq_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_eq_.html new file mode 100644 index 0000000..2b8bed0 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_eq_.html @@ -0,0 +1,45 @@ + + + +local::basic_endpoint::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + from another endpoint. +

+
basic_endpoint & operator=(
+    const basic_endpoint & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_eq__eq_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_eq__eq_.html new file mode 100644 index 0000000..97ceea5 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_eq__eq_.html @@ -0,0 +1,56 @@ + + + +local::basic_endpoint::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two endpoints for equality. +

+
friend bool operator==(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_gt_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_gt_.html new file mode 100644 index 0000000..1db809d --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_gt_.html @@ -0,0 +1,56 @@ + + + +local::basic_endpoint::operator> + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator>(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_gt__eq_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_gt__eq_.html new file mode 100644 index 0000000..6c6e439 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_gt__eq_.html @@ -0,0 +1,56 @@ + + + +local::basic_endpoint::operator>= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator>=(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt_.html new file mode 100644 index 0000000..92348d9 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt_.html @@ -0,0 +1,56 @@ + + + +local::basic_endpoint::operator< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator<(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt__eq_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt__eq_.html new file mode 100644 index 0000000..8c0fa9f --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt__eq_.html @@ -0,0 +1,56 @@ + + + +local::basic_endpoint::operator<= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + endpoints for ordering. +

+
friend bool operator<=(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt__lt_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt__lt_.html new file mode 100644 index 0000000..e45ec28 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_lt__lt_.html @@ -0,0 +1,74 @@ + + + +local::basic_endpoint::operator<< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Output + an endpoint as a string. +

+
std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const basic_endpoint< Protocol > & endpoint);
+
+

+ Used to output a human-readable string for a specified endpoint. +

+
+ + Parameters +
+
+

+
+
os
+

+ The output stream to which the string will be written. +

+
endpoint
+

+ The endpoint to be written. +

+
+
+
+ + Return + Value +
+

+ The output stream. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/operator_not__eq_.html b/include/asio/doc/asio/reference/local__basic_endpoint/operator_not__eq_.html new file mode 100644 index 0000000..6a25b23 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/operator_not__eq_.html @@ -0,0 +1,56 @@ + + + +local::basic_endpoint::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two endpoints for inequality. +

+
friend bool operator!=(
+    const basic_endpoint< Protocol > & e1,
+    const basic_endpoint< Protocol > & e2);
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/path.html b/include/asio/doc/asio/reference/local__basic_endpoint/path.html new file mode 100644 index 0000000..47639cd --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/path.html @@ -0,0 +1,56 @@ + + + +local::basic_endpoint::path + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + path associated with the endpoint. +

+
std::string path() const;
+  » more...
+
+

+ Set the path associated with the endpoint. +

+
void path(
+    const char * p);
+  » more...
+
+void path(
+    const std::string & p);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/path/overload1.html b/include/asio/doc/asio/reference/local__basic_endpoint/path/overload1.html new file mode 100644 index 0000000..b40b2d1 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/path/overload1.html @@ -0,0 +1,43 @@ + + + +local::basic_endpoint::path (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the path associated with the endpoint. +

+
std::string path() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/path/overload2.html b/include/asio/doc/asio/reference/local__basic_endpoint/path/overload2.html new file mode 100644 index 0000000..5ea0a5c --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/path/overload2.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::path (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the path associated with the endpoint. +

+
void path(
+    const char * p);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/path/overload3.html b/include/asio/doc/asio/reference/local__basic_endpoint/path/overload3.html new file mode 100644 index 0000000..4eae128 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/path/overload3.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::path (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the path associated with the endpoint. +

+
void path(
+    const std::string & p);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/protocol.html b/include/asio/doc/asio/reference/local__basic_endpoint/protocol.html new file mode 100644 index 0000000..c96476c --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/protocol.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol associated with the endpoint. +

+
protocol_type protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/protocol_type.html b/include/asio/doc/asio/reference/local__basic_endpoint/protocol_type.html new file mode 100644 index 0000000..0f21324 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/protocol_type.html @@ -0,0 +1,54 @@ + + + +local::basic_endpoint::protocol_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + protocol type associated with the endpoint. +

+
typedef Protocol protocol_type;
+
+
+ + Requirements +
+

+ Header: asio/local/basic_endpoint.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/resize.html b/include/asio/doc/asio/reference/local__basic_endpoint/resize.html new file mode 100644 index 0000000..4a5677f --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/resize.html @@ -0,0 +1,45 @@ + + + +local::basic_endpoint::resize + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the underlying size of the endpoint in the native type. +

+
void resize(
+    std::size_t new_size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__basic_endpoint/size.html b/include/asio/doc/asio/reference/local__basic_endpoint/size.html new file mode 100644 index 0000000..b1db765 --- /dev/null +++ b/include/asio/doc/asio/reference/local__basic_endpoint/size.html @@ -0,0 +1,44 @@ + + + +local::basic_endpoint::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + underlying size of the endpoint in the native type. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__connect_pair.html b/include/asio/doc/asio/reference/local__connect_pair.html new file mode 100644 index 0000000..9e009a4 --- /dev/null +++ b/include/asio/doc/asio/reference/local__connect_pair.html @@ -0,0 +1,71 @@ + + + +local::connect_pair + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create a pair of connected + sockets. +

+
template<
+    typename Protocol,
+    typename Executor1,
+    typename Executor2>
+void connect_pair(
+    basic_socket< Protocol, Executor1 > & socket1,
+    basic_socket< Protocol, Executor2 > & socket2);
+  » more...
+
+template<
+    typename Protocol,
+    typename Executor1,
+    typename Executor2>
+void connect_pair(
+    basic_socket< Protocol, Executor1 > & socket1,
+    basic_socket< Protocol, Executor2 > & socket2,
+    asio::error_code & ec);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/local/connect_pair.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__connect_pair/overload1.html b/include/asio/doc/asio/reference/local__connect_pair/overload1.html new file mode 100644 index 0000000..604fdb3 --- /dev/null +++ b/include/asio/doc/asio/reference/local__connect_pair/overload1.html @@ -0,0 +1,49 @@ + + + +local::connect_pair (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a pair of connected sockets. +

+
template<
+    typename Protocol,
+    typename Executor1,
+    typename Executor2>
+void connect_pair(
+    basic_socket< Protocol, Executor1 > & socket1,
+    basic_socket< Protocol, Executor2 > & socket2);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__connect_pair/overload2.html b/include/asio/doc/asio/reference/local__connect_pair/overload2.html new file mode 100644 index 0000000..701a054 --- /dev/null +++ b/include/asio/doc/asio/reference/local__connect_pair/overload2.html @@ -0,0 +1,50 @@ + + + +local::connect_pair (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a pair of connected sockets. +

+
template<
+    typename Protocol,
+    typename Executor1,
+    typename Executor2>
+void connect_pair(
+    basic_socket< Protocol, Executor1 > & socket1,
+    basic_socket< Protocol, Executor2 > & socket2,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__datagram_protocol.html b/include/asio/doc/asio/reference/local__datagram_protocol.html new file mode 100644 index 0000000..0b0c61f --- /dev/null +++ b/include/asio/doc/asio/reference/local__datagram_protocol.html @@ -0,0 +1,175 @@ + + + +local::datagram_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for datagram-oriented UNIX sockets. +

+
class datagram_protocol
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ endpoint +

+
+

+ The type of a UNIX domain endpoint. +

+
+

+ socket +

+
+

+ The UNIX domain socket type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+

+ The local::datagram_protocol + class contains flags necessary for datagram-oriented UNIX domain sockets. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/local/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__datagram_protocol/endpoint.html b/include/asio/doc/asio/reference/local__datagram_protocol/endpoint.html new file mode 100644 index 0000000..089463b --- /dev/null +++ b/include/asio/doc/asio/reference/local__datagram_protocol/endpoint.html @@ -0,0 +1,373 @@ + + + +local::datagram_protocol::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of a UNIX domain endpoint. +

+
typedef basic_endpoint< datagram_protocol > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint using + the specified path name.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ path +

+
+

+ Get the path associated with the endpoint.
—
Set + the path associated with the endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator<< +

+
+

+ Output an endpoint as a string. +

+
+

+ The local::basic_endpoint + class template describes an endpoint that may be associated with a particular + UNIX socket. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/local/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__datagram_protocol/family.html b/include/asio/doc/asio/reference/local__datagram_protocol/family.html new file mode 100644 index 0000000..ddfa92e --- /dev/null +++ b/include/asio/doc/asio/reference/local__datagram_protocol/family.html @@ -0,0 +1,44 @@ + + + +local::datagram_protocol::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__datagram_protocol/protocol.html b/include/asio/doc/asio/reference/local__datagram_protocol/protocol.html new file mode 100644 index 0000000..a5abcce --- /dev/null +++ b/include/asio/doc/asio/reference/local__datagram_protocol/protocol.html @@ -0,0 +1,44 @@ + + + +local::datagram_protocol::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__datagram_protocol/socket.html b/include/asio/doc/asio/reference/local__datagram_protocol/socket.html new file mode 100644 index 0000000..5167d1d --- /dev/null +++ b/include/asio/doc/asio/reference/local__datagram_protocol/socket.html @@ -0,0 +1,919 @@ + + + +local::datagram_protocol::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + UNIX domain socket type. +

+
typedef basic_datagram_socket< datagram_protocol > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive on a connected socket. +

+
+

+ async_receive_from +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send on a connected socket. +

+
+

+ async_send_to +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_datagram_socket [constructor] +

+
+

+ Construct a basic_datagram_socket without opening it.
+ —
Construct and open a basic_datagram_socket.
—
+ Construct a basic_datagram_socket, opening it and binding it + to the given local endpoint.
—
Construct a basic_datagram_socket + on an existing native socket.
—
Move-construct a + basic_datagram_socket from another.
—
Move-construct + a basic_datagram_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_datagram_socket from another.
—
+ Move-assign a basic_datagram_socket from a socket of another + protocol type. +

+
+

+ receive +

+
+

+ Receive some data on a connected socket. +

+
+

+ receive_from +

+
+

+ Receive a datagram with the endpoint of the sender. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on a connected socket. +

+
+

+ send_to +

+
+

+ Send a datagram to the specified endpoint. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_datagram_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_datagram_socket + class template provides asynchronous and blocking datagram-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/local/datagram_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__datagram_protocol/type.html b/include/asio/doc/asio/reference/local__datagram_protocol/type.html new file mode 100644 index 0000000..ea2a00e --- /dev/null +++ b/include/asio/doc/asio/reference/local__datagram_protocol/type.html @@ -0,0 +1,44 @@ + + + +local::datagram_protocol::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the type of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol.html b/include/asio/doc/asio/reference/local__stream_protocol.html new file mode 100644 index 0000000..fdd491d --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol.html @@ -0,0 +1,199 @@ + + + +local::stream_protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Encapsulates the flags needed for stream-oriented UNIX sockets. +

+
class stream_protocol
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ acceptor +

+
+

+ The UNIX domain acceptor type. +

+
+

+ endpoint +

+
+

+ The type of a UNIX domain endpoint. +

+
+

+ iostream +

+
+

+ The UNIX domain iostream type. +

+
+

+ socket +

+
+

+ The UNIX domain socket type. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ family +

+
+

+ Obtain an identifier for the protocol family. +

+
+

+ protocol +

+
+

+ Obtain an identifier for the protocol. +

+
+

+ type +

+
+

+ Obtain an identifier for the type of the protocol. +

+
+

+ The local::stream_protocol + class contains flags necessary for stream-oriented UNIX domain sockets. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Safe. +

+
+ + Requirements +
+

+ Header: asio/local/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol/acceptor.html b/include/asio/doc/asio/reference/local__stream_protocol/acceptor.html new file mode 100644 index 0000000..d726e35 --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol/acceptor.html @@ -0,0 +1,777 @@ + + + +local::stream_protocol::acceptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + UNIX domain acceptor type. +

+
typedef basic_socket_acceptor< stream_protocol > acceptor;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the acceptor type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of an acceptor. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ accept +

+
+

+ Accept a new connection.
—
Accept a new connection + and obtain the endpoint of the peer. +

+
+

+ assign +

+
+

+ Assigns an existing native acceptor to the acceptor. +

+
+

+ async_accept +

+
+

+ Start an asynchronous accept. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the acceptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_socket_acceptor [constructor] +

+
+

+ Construct an acceptor without opening it.
—
Construct + an open acceptor.
—
Construct an acceptor opened + on the given endpoint.
—
Construct a basic_socket_acceptor + on an existing native acceptor.
—
Move-construct + a basic_socket_acceptor from another.
—
Move-construct + a basic_socket_acceptor from an acceptor of another protocol + type. +

+
+

+ bind +

+
+

+ Bind the acceptor to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the acceptor. +

+
+

+ close +

+
+

+ Close the acceptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the acceptor. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the acceptor. +

+
+

+ is_open +

+
+

+ Determine whether the acceptor is open. +

+
+

+ listen +

+
+

+ Place the acceptor into the state where it will listen for new + connections. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the acceptor. +

+
+

+ native_handle +

+
+

+ Get the native acceptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native acceptor implementation. +
—
Sets the non-blocking mode of the native acceptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the acceptor.
—
Sets + the non-blocking mode of the acceptor. +

+
+

+ open +

+
+

+ Open the acceptor using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_acceptor from another.
—
+ Move-assign a basic_socket_acceptor from an acceptor of another + protocol type. +

+
+

+ release +

+
+

+ Release ownership of the underlying native acceptor. +

+
+

+ set_option +

+
+

+ Set an option on the acceptor. +

+
+

+ wait +

+
+

+ Wait for the acceptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ ~basic_socket_acceptor [destructor] +

+
+

+ Destroys the acceptor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_socket_acceptor + class template is used for accepting new socket connections. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ Opening a socket acceptor with the SO_REUSEADDR option enabled: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port);
+acceptor.open(endpoint.protocol());
+acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true));
+acceptor.bind(endpoint);
+acceptor.listen();
+
+
+ + Requirements +
+

+ Header: asio/local/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol/endpoint.html b/include/asio/doc/asio/reference/local__stream_protocol/endpoint.html new file mode 100644 index 0000000..412e3d4 --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol/endpoint.html @@ -0,0 +1,373 @@ + + + +local::stream_protocol::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of a UNIX domain endpoint. +

+
typedef basic_endpoint< stream_protocol > endpoint;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data_type +

+
+

+ The type of the endpoint structure. This type is dependent on + the underlying implementation of the socket layer. +

+
+

+ protocol_type +

+
+

+ The protocol type associated with the endpoint. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_endpoint [constructor] +

+
+

+ Default constructor.
—
Construct an endpoint using + the specified path name.
—
Copy constructor. +

+
+

+ capacity +

+
+

+ Get the capacity of the endpoint in the native type. +

+
+

+ data +

+
+

+ Get the underlying endpoint in the native type. +

+
+

+ operator= +

+
+

+ Assign from another endpoint. +

+
+

+ path +

+
+

+ Get the path associated with the endpoint.
—
Set + the path associated with the endpoint. +

+
+

+ protocol +

+
+

+ The protocol associated with the endpoint. +

+
+

+ resize +

+
+

+ Set the underlying size of the endpoint in the native type. +

+
+

+ size +

+
+

+ Get the underlying size of the endpoint in the native type. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two endpoints for inequality. +

+
+

+ operator< +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator<= +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator== +

+
+

+ Compare two endpoints for equality. +

+
+

+ operator> +

+
+

+ Compare endpoints for ordering. +

+
+

+ operator>= +

+
+

+ Compare endpoints for ordering. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator<< +

+
+

+ Output an endpoint as a string. +

+
+

+ The local::basic_endpoint + class template describes an endpoint that may be associated with a particular + UNIX socket. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/local/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol/family.html b/include/asio/doc/asio/reference/local__stream_protocol/family.html new file mode 100644 index 0000000..9fa73e2 --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol/family.html @@ -0,0 +1,44 @@ + + + +local::stream_protocol::family + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol family. +

+
int family() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol/iostream.html b/include/asio/doc/asio/reference/local__stream_protocol/iostream.html new file mode 100644 index 0000000..55db8c6 --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol/iostream.html @@ -0,0 +1,328 @@ + + + +local::stream_protocol::iostream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + UNIX domain iostream type. +

+
typedef basic_socket_iostream< stream_protocol > iostream;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type. +

+
+

+ duration_type +

+
+

+ (Deprecated: Use duration.) The duration type. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ time_point +

+
+

+ The time type. +

+
+

+ time_type +

+
+

+ (Deprecated: Use time_point.) The time type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_socket_iostream [constructor] +

+
+

+ Construct a basic_socket_iostream without establishing a connection. +
—
Construct a basic_socket_iostream from the supplied + socket.
—
Move-construct a basic_socket_iostream + from another.
—
Establish a connection to an endpoint + corresponding to a resolver query. +

+
+

+ close +

+
+

+ Close the connection. +

+
+

+ connect +

+
+

+ Establish a connection to an endpoint corresponding to a resolver + query. +

+
+

+ error +

+
+

+ Get the last error associated with the stream. +

+
+

+ expires_after +

+
+

+ Set the stream's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time as an + absolute time.
—
Set the stream's expiry time as + an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the stream's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set + the stream's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the stream's expiry time as an absolute time. +

+
+

+ operator= +

+
+

+ Move-assign a basic_socket_iostream from another. +

+
+

+ rdbuf +

+
+

+ Return a pointer to the underlying streambuf. +

+
+

+ socket +

+
+

+ Get a reference to the underlying socket. +

+
+
+ + Requirements +
+

+ Header: asio/local/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol/protocol.html b/include/asio/doc/asio/reference/local__stream_protocol/protocol.html new file mode 100644 index 0000000..0817715 --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol/protocol.html @@ -0,0 +1,44 @@ + + + +local::stream_protocol::protocol + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the protocol. +

+
int protocol() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol/socket.html b/include/asio/doc/asio/reference/local__stream_protocol/socket.html new file mode 100644 index 0000000..8a26b9d --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol/socket.html @@ -0,0 +1,920 @@ + + + +local::stream_protocol::socket + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + UNIX domain socket type. +

+
typedef basic_stream_socket< stream_protocol > socket;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the socket type to another executor. +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ endpoint_type +

+
+

+ The endpoint type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close + if unsent data is present. +

+
+

+ lowest_layer_type +

+
+

+ A basic_socket is always the lowest layer. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive + operations. +

+
+

+ native_handle_type +

+
+

+ The native representation of a socket. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ protocol_type +

+
+

+ The protocol type. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native socket to the socket. +

+
+

+ async_connect +

+
+

+ Start an asynchronous connect. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_receive +

+
+

+ Start an asynchronous receive. +

+
+

+ async_send +

+
+

+ Start an asynchronous send. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the socket to become ready to read, ready + to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ at_mark +

+
+

+ Determine whether the socket is at the out-of-band data mark. +

+
+

+ available +

+
+

+ Determine the number of bytes available for reading. +

+
+

+ basic_stream_socket [constructor] +

+
+

+ Construct a basic_stream_socket without opening it.
—
+ Construct and open a basic_stream_socket.
—
Construct + a basic_stream_socket, opening it and binding it to the given + local endpoint.
—
Construct a basic_stream_socket + on an existing native socket.
—
Move-construct a + basic_stream_socket from another.
—
Move-construct + a basic_stream_socket from a socket of another protocol type. +

+
+

+ bind +

+
+

+ Bind the socket to the given local endpoint. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the socket. +

+
+

+ close +

+
+

+ Close the socket. +

+
+

+ connect +

+
+

+ Connect the socket to the specified endpoint. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the socket. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the socket. +

+
+

+ is_open +

+
+

+ Determine whether the socket is open. +

+
+

+ local_endpoint +

+
+

+ Get the local endpoint of the socket. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native socket representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native socket implementation. +
—
Sets the non-blocking mode of the native socket + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the socket.
—
Sets + the non-blocking mode of the socket. +

+
+

+ open +

+
+

+ Open the socket using the specified protocol. +

+
+

+ operator= +

+
+

+ Move-assign a basic_stream_socket from another.
—
+ Move-assign a basic_stream_socket from a socket of another protocol + type. +

+
+

+ read_some +

+
+

+ Read some data from the socket. +

+
+

+ receive +

+
+

+ Receive some data on the socket.
—
Receive some data + on a connected socket. +

+
+

+ release +

+
+

+ Release ownership of the underlying native socket. +

+
+

+ remote_endpoint +

+
+

+ Get the remote endpoint of the socket. +

+
+

+ send +

+
+

+ Send some data on the socket. +

+
+

+ set_option +

+
+

+ Set an option on the socket. +

+
+

+ shutdown +

+
+

+ Disable sends or receives on the socket. +

+
+

+ wait +

+
+

+ Wait for the socket to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the socket. +

+
+

+ ~basic_stream_socket [destructor] +

+
+

+ Destroys the socket. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length + of the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+

+ The basic_stream_socket + class template provides asynchronous and blocking stream-oriented socket + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/local/stream_protocol.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/local__stream_protocol/type.html b/include/asio/doc/asio/reference/local__stream_protocol/type.html new file mode 100644 index 0000000..78cdb5f --- /dev/null +++ b/include/asio/doc/asio/reference/local__stream_protocol/type.html @@ -0,0 +1,44 @@ + + + +local::stream_protocol::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an identifier for the type of the protocol. +

+
int type() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_strand.html b/include/asio/doc/asio/reference/make_strand.html new file mode 100644 index 0000000..6322055 --- /dev/null +++ b/include/asio/doc/asio/reference/make_strand.html @@ -0,0 +1,75 @@ + + + +make_strand + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The asio::make_strand function + creates a strand + object for an executor or execution context. +

+

+ Create a strand + object for an executor. +

+
template<
+    typename Executor>
+strand< Executor > make_strand(
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+

+ Create a strand + object for an execution context. +

+
template<
+    typename ExecutionContext>
+strand< typename ExecutionContext::executor_type > make_strand(
+    ExecutionContext & ctx,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_strand/overload1.html b/include/asio/doc/asio/reference/make_strand/overload1.html new file mode 100644 index 0000000..9ad930a --- /dev/null +++ b/include/asio/doc/asio/reference/make_strand/overload1.html @@ -0,0 +1,48 @@ + + + +make_strand (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a strand + object for an executor. +

+
template<
+    typename Executor>
+strand< Executor > make_strand(
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_strand/overload2.html b/include/asio/doc/asio/reference/make_strand/overload2.html new file mode 100644 index 0000000..f4a3024 --- /dev/null +++ b/include/asio/doc/asio/reference/make_strand/overload2.html @@ -0,0 +1,48 @@ + + + +make_strand (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a strand + object for an execution context. +

+
template<
+    typename ExecutionContext>
+strand< typename ExecutionContext::executor_type > make_strand(
+    ExecutionContext & ctx,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_work_guard.html b/include/asio/doc/asio/reference/make_work_guard.html new file mode 100644 index 0000000..c66faa6 --- /dev/null +++ b/include/asio/doc/asio/reference/make_work_guard.html @@ -0,0 +1,91 @@ + + + +make_work_guard + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create an executor_work_guard + object. +

+
template<
+    typename Executor>
+executor_work_guard< Executor > make_work_guard(
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext>
+executor_work_guard< typename ExecutionContext::executor_type > make_work_guard(
+    ExecutionContext & ctx,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+template<
+    typename T>
+executor_work_guard< typename associated_executor< T >::type > make_work_guard(
+    const T & t,
+    typename enable_if< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value >::type *  = 0);
+  » more...
+
+template<
+    typename T,
+    typename Executor>
+executor_work_guard< typename associated_executor< T, Executor >::type > make_work_guard(
+    const T & t,
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename T,
+    typename ExecutionContext>
+executor_work_guard< typename associated_executor< T, typename ExecutionContext::executor_type >::type > make_work_guard(
+    const T & t,
+    ExecutionContext & ctx,
+    typename enable_if< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value &&is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/executor_work_guard.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_work_guard/overload1.html b/include/asio/doc/asio/reference/make_work_guard/overload1.html new file mode 100644 index 0000000..4620ac4 --- /dev/null +++ b/include/asio/doc/asio/reference/make_work_guard/overload1.html @@ -0,0 +1,48 @@ + + + +make_work_guard (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an executor_work_guard + object. +

+
template<
+    typename Executor>
+executor_work_guard< Executor > make_work_guard(
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_work_guard/overload2.html b/include/asio/doc/asio/reference/make_work_guard/overload2.html new file mode 100644 index 0000000..ed2fd3b --- /dev/null +++ b/include/asio/doc/asio/reference/make_work_guard/overload2.html @@ -0,0 +1,48 @@ + + + +make_work_guard (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an executor_work_guard + object. +

+
template<
+    typename ExecutionContext>
+executor_work_guard< typename ExecutionContext::executor_type > make_work_guard(
+    ExecutionContext & ctx,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_work_guard/overload3.html b/include/asio/doc/asio/reference/make_work_guard/overload3.html new file mode 100644 index 0000000..7b4cf47 --- /dev/null +++ b/include/asio/doc/asio/reference/make_work_guard/overload3.html @@ -0,0 +1,48 @@ + + + +make_work_guard (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an executor_work_guard + object. +

+
template<
+    typename T>
+executor_work_guard< typename associated_executor< T >::type > make_work_guard(
+    const T & t,
+    typename enable_if< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_work_guard/overload4.html b/include/asio/doc/asio/reference/make_work_guard/overload4.html new file mode 100644 index 0000000..2da5268 --- /dev/null +++ b/include/asio/doc/asio/reference/make_work_guard/overload4.html @@ -0,0 +1,50 @@ + + + +make_work_guard (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an executor_work_guard + object. +

+
template<
+    typename T,
+    typename Executor>
+executor_work_guard< typename associated_executor< T, Executor >::type > make_work_guard(
+    const T & t,
+    const Executor & ex,
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/make_work_guard/overload5.html b/include/asio/doc/asio/reference/make_work_guard/overload5.html new file mode 100644 index 0000000..7d7bb7e --- /dev/null +++ b/include/asio/doc/asio/reference/make_work_guard/overload5.html @@ -0,0 +1,50 @@ + + + +make_work_guard (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create an executor_work_guard + object. +

+
template<
+    typename T,
+    typename ExecutionContext>
+executor_work_guard< typename associated_executor< T, typename ExecutionContext::executor_type >::type > make_work_guard(
+    const T & t,
+    ExecutionContext & ctx,
+    typename enable_if< !is_executor< T >::value &&!execution::is_executor< T >::value &&!is_convertible< T &, execution_context & >::value &&is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/multiple_exceptions.html b/include/asio/doc/asio/reference/multiple_exceptions.html new file mode 100644 index 0000000..b7d08ee --- /dev/null +++ b/include/asio/doc/asio/reference/multiple_exceptions.html @@ -0,0 +1,114 @@ + + + +multiple_exceptions + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Exception thrown when there are multiple pending exceptions to rethrow. +

+
class multiple_exceptions :
+  public std::exception
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ first_exception +

+
+

+ Obtain a pointer to the first exception. +

+
+

+ multiple_exceptions [constructor] +

+
+

+ Constructor. +

+
+

+ what +

+
+

+ Obtain message associated with exception. +

+
+
+ + Requirements +
+

+ Header: asio/multiple_exceptions.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/multiple_exceptions/first_exception.html b/include/asio/doc/asio/reference/multiple_exceptions/first_exception.html new file mode 100644 index 0000000..e58f26a --- /dev/null +++ b/include/asio/doc/asio/reference/multiple_exceptions/first_exception.html @@ -0,0 +1,44 @@ + + + +multiple_exceptions::first_exception + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + a pointer to the first exception. +

+
std::exception_ptr first_exception() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/multiple_exceptions/multiple_exceptions.html b/include/asio/doc/asio/reference/multiple_exceptions/multiple_exceptions.html new file mode 100644 index 0000000..31ba1c5 --- /dev/null +++ b/include/asio/doc/asio/reference/multiple_exceptions/multiple_exceptions.html @@ -0,0 +1,44 @@ + + + +multiple_exceptions::multiple_exceptions + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
multiple_exceptions(
+    std::exception_ptr first);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/multiple_exceptions/what.html b/include/asio/doc/asio/reference/multiple_exceptions/what.html new file mode 100644 index 0000000..cd44a04 --- /dev/null +++ b/include/asio/doc/asio/reference/multiple_exceptions/what.html @@ -0,0 +1,44 @@ + + + +multiple_exceptions::what + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain message + associated with exception. +

+
virtual const char * what() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer.html b/include/asio/doc/asio/reference/mutable_buffer.html new file mode 100644 index 0000000..0420c10 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer.html @@ -0,0 +1,184 @@ + + + +mutable_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Holds a buffer that can be modified. +

+
class mutable_buffer
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ mutable_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new modifiable buffer that is offset from the start of + another. +

+
+

+ The mutable_buffer + class provides a safe representation of a buffer that can be modified. It + does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() and + size() member functions: +

+
asio::mutable_buffer b1 = ...;
+std::size_t s1 = b1.size();
+unsigned char* p1 = static_cast<unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/data.html b/include/asio/doc/asio/reference/mutable_buffer/data.html new file mode 100644 index 0000000..8c263d3 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/data.html @@ -0,0 +1,44 @@ + + + +mutable_buffer::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a pointer to the + beginning of the memory range. +

+
void * data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer.html b/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer.html new file mode 100644 index 0000000..20cb856 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer.html @@ -0,0 +1,53 @@ + + + +mutable_buffer::mutable_buffer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an empty buffer. +

+
mutable_buffer();
+  » more...
+
+

+ Construct a buffer to represent a given memory range. +

+
mutable_buffer(
+    void * data,
+    std::size_t size);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer/overload1.html b/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer/overload1.html new file mode 100644 index 0000000..bbb4baa --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer/overload1.html @@ -0,0 +1,43 @@ + + + +mutable_buffer::mutable_buffer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an empty buffer. +

+
mutable_buffer();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer/overload2.html b/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer/overload2.html new file mode 100644 index 0000000..72115f4 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/mutable_buffer/overload2.html @@ -0,0 +1,45 @@ + + + +mutable_buffer::mutable_buffer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a buffer to represent a given memory range. +

+
mutable_buffer(
+    void * data,
+    std::size_t size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/operator_plus_.html b/include/asio/doc/asio/reference/mutable_buffer/operator_plus_.html new file mode 100644 index 0000000..bb75d78 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/operator_plus_.html @@ -0,0 +1,52 @@ + + + +mutable_buffer::operator+ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + a new modifiable buffer that is offset from the start of another. +

+
mutable_buffer operator+(
+    const mutable_buffer & b,
+    std::size_t n);
+  » more...
+
+mutable_buffer operator+(
+    std::size_t n,
+    const mutable_buffer & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/operator_plus_/overload1.html b/include/asio/doc/asio/reference/mutable_buffer/operator_plus_/overload1.html new file mode 100644 index 0000000..7fc23ed --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/operator_plus_/overload1.html @@ -0,0 +1,45 @@ + + + +mutable_buffer::operator+ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that is offset from the start of another. +

+
mutable_buffer operator+(
+    const mutable_buffer & b,
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/operator_plus_/overload2.html b/include/asio/doc/asio/reference/mutable_buffer/operator_plus_/overload2.html new file mode 100644 index 0000000..7759bfd --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/operator_plus_/overload2.html @@ -0,0 +1,45 @@ + + + +mutable_buffer::operator+ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Create a new modifiable buffer that is offset from the start of another. +

+
mutable_buffer operator+(
+    std::size_t n,
+    const mutable_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/operator_plus__eq_.html b/include/asio/doc/asio/reference/mutable_buffer/operator_plus__eq_.html new file mode 100644 index 0000000..cf0d5ef --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/operator_plus__eq_.html @@ -0,0 +1,45 @@ + + + +mutable_buffer::operator+= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move + the start of the buffer by the specified number of bytes. +

+
mutable_buffer & operator+=(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffer/size.html b/include/asio/doc/asio/reference/mutable_buffer/size.html new file mode 100644 index 0000000..75581ac --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffer/size.html @@ -0,0 +1,44 @@ + + + +mutable_buffer::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the size of the + memory range. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1.html b/include/asio/doc/asio/reference/mutable_buffers_1.html new file mode 100644 index 0000000..316e267 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1.html @@ -0,0 +1,237 @@ + + + +mutable_buffers_1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use mutable_buffer.) + Adapts a single modifiable buffer so that it meets the requirements of the + MutableBufferSequence concept. +

+
class mutable_buffers_1 :
+  public mutable_buffer
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_iterator +

+
+

+ A random-access iterator type that may be used to read elements. +

+
+

+ value_type +

+
+

+ The type for each element in the list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ begin +

+
+

+ Get a random-access iterator to the first element. +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ end +

+
+

+ Get a random-access iterator for one past the last element. +

+
+

+ mutable_buffers_1 [constructor] +

+
+

+ Construct to represent a given memory range.
—
Construct + to represent a single modifiable buffer. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new modifiable buffer that is offset from the start of + another. +

+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/begin.html b/include/asio/doc/asio/reference/mutable_buffers_1/begin.html new file mode 100644 index 0000000..6d4040e --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/begin.html @@ -0,0 +1,44 @@ + + + +mutable_buffers_1::begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a random-access + iterator to the first element. +

+
const_iterator begin() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/const_iterator.html b/include/asio/doc/asio/reference/mutable_buffers_1/const_iterator.html new file mode 100644 index 0000000..b3ccd61 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/const_iterator.html @@ -0,0 +1,54 @@ + + + +mutable_buffers_1::const_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + random-access iterator type that may be used to read elements. +

+
typedef const mutable_buffer * const_iterator;
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/data.html b/include/asio/doc/asio/reference/mutable_buffers_1/data.html new file mode 100644 index 0000000..01ea36b --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/data.html @@ -0,0 +1,47 @@ + + + +mutable_buffers_1::data + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from mutable_buffer. +

+

+ +Get a pointer + to the beginning of the memory range. +

+
void * data() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/end.html b/include/asio/doc/asio/reference/mutable_buffers_1/end.html new file mode 100644 index 0000000..6398434 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/end.html @@ -0,0 +1,44 @@ + + + +mutable_buffers_1::end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a random-access + iterator for one past the last element. +

+
const_iterator end() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1.html b/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1.html new file mode 100644 index 0000000..8b73ed9 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1.html @@ -0,0 +1,54 @@ + + + +mutable_buffers_1::mutable_buffers_1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + to represent a given memory range. +

+
mutable_buffers_1(
+    void * data,
+    std::size_t size);
+  » more...
+
+

+ Construct to represent a single modifiable buffer. +

+
explicit mutable_buffers_1(
+    const mutable_buffer & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1/overload1.html b/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1/overload1.html new file mode 100644 index 0000000..40aa264 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1/overload1.html @@ -0,0 +1,45 @@ + + + +mutable_buffers_1::mutable_buffers_1 (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct to represent a given memory range. +

+
mutable_buffers_1(
+    void * data,
+    std::size_t size);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1/overload2.html b/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1/overload2.html new file mode 100644 index 0000000..9b03ac1 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/mutable_buffers_1/overload2.html @@ -0,0 +1,44 @@ + + + +mutable_buffers_1::mutable_buffers_1 (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct to represent a single modifiable buffer. +

+
mutable_buffers_1(
+    const mutable_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_.html b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_.html new file mode 100644 index 0000000..b5e4089 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_.html @@ -0,0 +1,52 @@ + + + +mutable_buffers_1::operator+ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create + a new modifiable buffer that is offset from the start of another. +

+
mutable_buffer operator+(
+    const mutable_buffer & b,
+    std::size_t n);
+  » more...
+
+mutable_buffer operator+(
+    std::size_t n,
+    const mutable_buffer & b);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_/overload1.html b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_/overload1.html new file mode 100644 index 0000000..08fe10f --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_/overload1.html @@ -0,0 +1,48 @@ + + + +mutable_buffers_1::operator+ (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from mutable_buffer. +

+

+ Create a new modifiable buffer that is offset from the start of another. +

+
mutable_buffer operator+(
+    const mutable_buffer & b,
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_/overload2.html b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_/overload2.html new file mode 100644 index 0000000..696114b --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus_/overload2.html @@ -0,0 +1,48 @@ + + + +mutable_buffers_1::operator+ (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from mutable_buffer. +

+

+ Create a new modifiable buffer that is offset from the start of another. +

+
mutable_buffer operator+(
+    std::size_t n,
+    const mutable_buffer & b);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus__eq_.html b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus__eq_.html new file mode 100644 index 0000000..7455362 --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/operator_plus__eq_.html @@ -0,0 +1,48 @@ + + + +mutable_buffers_1::operator+= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from mutable_buffer. +

+

+ +Move + the start of the buffer by the specified number of bytes. +

+
mutable_buffer & operator+=(
+    std::size_t n);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/size.html b/include/asio/doc/asio/reference/mutable_buffers_1/size.html new file mode 100644 index 0000000..81fe78e --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/size.html @@ -0,0 +1,47 @@ + + + +mutable_buffers_1::size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from mutable_buffer. +

+

+ +Get the size + of the memory range. +

+
std::size_t size() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/mutable_buffers_1/value_type.html b/include/asio/doc/asio/reference/mutable_buffers_1/value_type.html new file mode 100644 index 0000000..e6f08fb --- /dev/null +++ b/include/asio/doc/asio/reference/mutable_buffers_1/value_type.html @@ -0,0 +1,186 @@ + + + +mutable_buffers_1::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type for each element in the list of buffers. +

+
typedef mutable_buffer value_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ mutable_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new modifiable buffer that is offset from the start + of another. +

+
+

+ The mutable_buffer + class provides a safe representation of a buffer that can be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() + and size() member functions: +

+
asio::mutable_buffer b1 = ...;
+std::size_t s1 = b1.size();
+unsigned char* p1 = static_cast<unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/null_buffers.html b/include/asio/doc/asio/reference/null_buffers.html new file mode 100644 index 0000000..8de92ce --- /dev/null +++ b/include/asio/doc/asio/reference/null_buffers.html @@ -0,0 +1,151 @@ + + + +null_buffers + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated: Use the socket/descriptor wait() and async_wait() member functions.) + An implementation of both the ConstBufferSequence and MutableBufferSequence + concepts to represent a null buffer sequence. +

+
class null_buffers
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_iterator +

+
+

+ A random-access iterator type that may be used to read elements. +

+
+

+ value_type +

+
+

+ The type for each element in the list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ begin +

+
+

+ Get a random-access iterator to the first element. +

+
+

+ end +

+
+

+ Get a random-access iterator for one past the last element. +

+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/null_buffers/begin.html b/include/asio/doc/asio/reference/null_buffers/begin.html new file mode 100644 index 0000000..fad8562 --- /dev/null +++ b/include/asio/doc/asio/reference/null_buffers/begin.html @@ -0,0 +1,44 @@ + + + +null_buffers::begin + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a random-access iterator + to the first element. +

+
const_iterator begin() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/null_buffers/const_iterator.html b/include/asio/doc/asio/reference/null_buffers/const_iterator.html new file mode 100644 index 0000000..ed726d3 --- /dev/null +++ b/include/asio/doc/asio/reference/null_buffers/const_iterator.html @@ -0,0 +1,54 @@ + + + +null_buffers::const_iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A random-access + iterator type that may be used to read elements. +

+
typedef const mutable_buffer * const_iterator;
+
+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/null_buffers/end.html b/include/asio/doc/asio/reference/null_buffers/end.html new file mode 100644 index 0000000..4d8d133 --- /dev/null +++ b/include/asio/doc/asio/reference/null_buffers/end.html @@ -0,0 +1,44 @@ + + + +null_buffers::end + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a random-access iterator + for one past the last element. +

+
const_iterator end() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/null_buffers/value_type.html b/include/asio/doc/asio/reference/null_buffers/value_type.html new file mode 100644 index 0000000..2da416a --- /dev/null +++ b/include/asio/doc/asio/reference/null_buffers/value_type.html @@ -0,0 +1,186 @@ + + + +null_buffers::value_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type for + each element in the list of buffers. +

+
typedef mutable_buffer value_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ data +

+
+

+ Get a pointer to the beginning of the memory range. +

+
+

+ mutable_buffer [constructor] +

+
+

+ Construct an empty buffer.
—
Construct a buffer to + represent a given memory range. +

+
+

+ operator+= +

+
+

+ Move the start of the buffer by the specified number of bytes. +

+
+

+ size +

+
+

+ Get the size of the memory range. +

+
+
+ + Related + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator+ +

+
+

+ Create a new modifiable buffer that is offset from the start + of another. +

+
+

+ The mutable_buffer + class provides a safe representation of a buffer that can be modified. + It does not own the underlying data, and so is cheap to copy or assign. +

+
+ + Accessing + Buffer Contents +
+

+ The contents of a buffer may be accessed using the data() + and size() member functions: +

+
asio::mutable_buffer b1 = ...;
+std::size_t s1 = b1.size();
+unsigned char* p1 = static_cast<unsigned char*>(b1.data());
+
+

+ The data() member function permits violations of type safety, + so uses of it in application code should be carefully considered. +

+
+ + Requirements +
+

+ Header: asio/buffer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/operator_lt__lt_.html b/include/asio/doc/asio/reference/operator_lt__lt_.html new file mode 100644 index 0000000..78d3146 --- /dev/null +++ b/include/asio/doc/asio/reference/operator_lt__lt_.html @@ -0,0 +1,58 @@ + + + +operator<< + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Output an error code. +

+
template<
+    typename Elem,
+    typename Traits>
+std::basic_ostream< Elem, Traits > & operator<<(
+    std::basic_ostream< Elem, Traits > & os,
+    const error_code & ec);
+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/placeholders__bytes_transferred.html b/include/asio/doc/asio/reference/placeholders__bytes_transferred.html new file mode 100644 index 0000000..ab13a6e --- /dev/null +++ b/include/asio/doc/asio/reference/placeholders__bytes_transferred.html @@ -0,0 +1,56 @@ + + + +placeholders::bytes_transferred + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An + argument placeholder, for use with boost::bind(), that corresponds to the + bytes_transferred argument of a handler for asynchronous functions such as + asio::basic_stream_socket::async_write_some or asio::async_write. +

+
unspecified bytes_transferred;
+
+
+ + Requirements +
+

+ Header: asio/placeholders.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/placeholders__endpoint.html b/include/asio/doc/asio/reference/placeholders__endpoint.html new file mode 100644 index 0000000..4dbdf83 --- /dev/null +++ b/include/asio/doc/asio/reference/placeholders__endpoint.html @@ -0,0 +1,55 @@ + + + +placeholders::endpoint + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An argument placeholder, + for use with boost::bind(), that corresponds to the results argument of a + handler for asynchronous functions such as asio::async_connect. +

+
unspecified endpoint;
+
+
+ + Requirements +
+

+ Header: asio/placeholders.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/placeholders__error.html b/include/asio/doc/asio/reference/placeholders__error.html new file mode 100644 index 0000000..54ab1ee --- /dev/null +++ b/include/asio/doc/asio/reference/placeholders__error.html @@ -0,0 +1,55 @@ + + + +placeholders::error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An argument placeholder, + for use with boost::bind(), that corresponds to the error argument of a handler + for any of the asynchronous functions. +

+
unspecified error;
+
+
+ + Requirements +
+

+ Header: asio/placeholders.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/placeholders__iterator.html b/include/asio/doc/asio/reference/placeholders__iterator.html new file mode 100644 index 0000000..8ad1946 --- /dev/null +++ b/include/asio/doc/asio/reference/placeholders__iterator.html @@ -0,0 +1,55 @@ + + + +placeholders::iterator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An argument placeholder, + for use with boost::bind(), that corresponds to the iterator argument of + a handler for asynchronous functions such as asio::async_connect. +

+
unspecified iterator;
+
+
+ + Requirements +
+

+ Header: asio/placeholders.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/placeholders__results.html b/include/asio/doc/asio/reference/placeholders__results.html new file mode 100644 index 0000000..fecbb94 --- /dev/null +++ b/include/asio/doc/asio/reference/placeholders__results.html @@ -0,0 +1,55 @@ + + + +placeholders::results + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An argument placeholder, + for use with boost::bind(), that corresponds to the results argument of a + handler for asynchronous functions such as asio::basic_resolver::async_resolve. +

+
unspecified results;
+
+
+ + Requirements +
+

+ Header: asio/placeholders.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/placeholders__signal_number.html b/include/asio/doc/asio/reference/placeholders__signal_number.html new file mode 100644 index 0000000..fd04c95 --- /dev/null +++ b/include/asio/doc/asio/reference/placeholders__signal_number.html @@ -0,0 +1,55 @@ + + + +placeholders::signal_number + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An argument + placeholder, for use with boost::bind(), that corresponds to the signal_number + argument of a handler for asynchronous functions such as asio::signal_set::async_wait. +

+
unspecified signal_number;
+
+
+ + Requirements +
+

+ Header: asio/placeholders.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor.html b/include/asio/doc/asio/reference/posix__basic_descriptor.html new file mode 100644 index 0000000..fc41833 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor.html @@ -0,0 +1,414 @@ + + + +posix::basic_descriptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides POSIX descriptor functionality. +

+
template<
+    typename Executor = any_io_executor>
+class basic_descriptor :
+  public posix::descriptor_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_descriptor [constructor] +

+
+

+ Construct a descriptor without opening it.
—
Construct + a descriptor on an existing native descriptor.
—
Move-construct + a descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a descriptor from another. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_descriptor [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The posix::basic_descriptor + class template provides the ability to wrap a POSIX descriptor. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/basic_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/_basic_descriptor.html b/include/asio/doc/asio/reference/posix__basic_descriptor/_basic_descriptor.html new file mode 100644 index 0000000..297e1dd --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/_basic_descriptor.html @@ -0,0 +1,48 @@ + + + +posix::basic_descriptor::~basic_descriptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~basic_descriptor();
+
+

+ This function destroys the descriptor, cancelling any outstanding asynchronous + wait operations associated with the descriptor as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/assign.html b/include/asio/doc/asio/reference/posix__basic_descriptor/assign.html new file mode 100644 index 0000000..f59581e --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/assign.html @@ -0,0 +1,51 @@ + + + +posix::basic_descriptor::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native descriptor to the descriptor. +

+
void assign(
+    const native_handle_type & native_descriptor);
+  » more...
+
+void assign(
+    const native_handle_type & native_descriptor,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/assign/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/assign/overload1.html new file mode 100644 index 0000000..a66dcf5 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/assign/overload1.html @@ -0,0 +1,44 @@ + + + +posix::basic_descriptor::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native descriptor to the descriptor. +

+
void assign(
+    const native_handle_type & native_descriptor);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/assign/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/assign/overload2.html new file mode 100644 index 0000000..5679821 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/assign/overload2.html @@ -0,0 +1,45 @@ + + + +posix::basic_descriptor::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native descriptor to the descriptor. +

+
void assign(
+    const native_handle_type & native_descriptor,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/async_wait.html b/include/asio/doc/asio/reference/posix__basic_descriptor/async_wait.html new file mode 100644 index 0000000..55aa5f6 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/async_wait.html @@ -0,0 +1,104 @@ + + + +posix::basic_descriptor::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Asynchronously + wait for the descriptor to become ready to read, ready to write, or to + have pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for a descriptor + to enter a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired descriptor state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::posix::stream_descriptor descriptor(my_context);
+...
+descriptor.async_wait(
+    asio::posix::stream_descriptor::wait_read,
+    wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor.html b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor.html new file mode 100644 index 0000000..3fc7044 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor.html @@ -0,0 +1,76 @@ + + + +posix::basic_descriptor::basic_descriptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a descriptor without opening it. +

+
explicit basic_descriptor(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_descriptor(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a descriptor on an existing native descriptor. +

+
basic_descriptor(
+    const executor_type & ex,
+    const native_handle_type & native_descriptor);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_descriptor(
+    ExecutionContext & context,
+    const native_handle_type & native_descriptor,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a descriptor from another. +

+
basic_descriptor(
+    basic_descriptor && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload1.html new file mode 100644 index 0000000..374e2e2 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload1.html @@ -0,0 +1,61 @@ + + + +posix::basic_descriptor::basic_descriptor (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a descriptor without opening it. +

+
basic_descriptor(
+    const executor_type & ex);
+
+

+ This constructor creates a descriptor without opening it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the descriptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the descriptor. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload2.html new file mode 100644 index 0000000..7efcc56 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload2.html @@ -0,0 +1,65 @@ + + + +posix::basic_descriptor::basic_descriptor (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a descriptor without opening it. +

+
template<
+    typename ExecutionContext>
+basic_descriptor(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a descriptor without opening it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the descriptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the descriptor. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload3.html b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload3.html new file mode 100644 index 0000000..06ac531 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload3.html @@ -0,0 +1,80 @@ + + + +posix::basic_descriptor::basic_descriptor (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a descriptor on an existing native descriptor. +

+
basic_descriptor(
+    const executor_type & ex,
+    const native_handle_type & native_descriptor);
+
+

+ This constructor creates a descriptor object to hold an existing native + descriptor. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the descriptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the descriptor. +

+
native_descriptor
+

+ A native descriptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload4.html b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload4.html new file mode 100644 index 0000000..2c48750 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload4.html @@ -0,0 +1,84 @@ + + + +posix::basic_descriptor::basic_descriptor (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a descriptor on an existing native descriptor. +

+
template<
+    typename ExecutionContext>
+basic_descriptor(
+    ExecutionContext & context,
+    const native_handle_type & native_descriptor,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a descriptor object to hold an existing native + descriptor. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the descriptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the descriptor. +

+
native_descriptor
+

+ A native descriptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload5.html b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload5.html new file mode 100644 index 0000000..90f862d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/basic_descriptor/overload5.html @@ -0,0 +1,69 @@ + + + +posix::basic_descriptor::basic_descriptor (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a descriptor from another. +

+
basic_descriptor(
+    basic_descriptor && other);
+
+

+ This constructor moves a descriptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other descriptor object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_descriptor(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/bytes_readable.html b/include/asio/doc/asio/reference/posix__basic_descriptor/bytes_readable.html new file mode 100644 index 0000000..2450aa1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/bytes_readable.html @@ -0,0 +1,70 @@ + + + +posix::basic_descriptor::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::descriptor_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::descriptor_base::bytes_readable command(true);
+descriptor.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/posix/basic_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/cancel.html b/include/asio/doc/asio/reference/posix__basic_descriptor/cancel.html new file mode 100644 index 0000000..7c5da76 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/cancel.html @@ -0,0 +1,49 @@ + + + +posix::basic_descriptor::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the descriptor. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/cancel/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/cancel/overload1.html new file mode 100644 index 0000000..9c92f8d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/cancel/overload1.html @@ -0,0 +1,61 @@ + + + +posix::basic_descriptor::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the descriptor. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/cancel/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/cancel/overload2.html new file mode 100644 index 0000000..12796c0 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/cancel/overload2.html @@ -0,0 +1,62 @@ + + + +posix::basic_descriptor::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the descriptor. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/close.html b/include/asio/doc/asio/reference/posix__basic_descriptor/close.html new file mode 100644 index 0000000..b77733a --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/close.html @@ -0,0 +1,49 @@ + + + +posix::basic_descriptor::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the descriptor. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/close/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/close/overload1.html new file mode 100644 index 0000000..ed0d312 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/close/overload1.html @@ -0,0 +1,62 @@ + + + +posix::basic_descriptor::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the descriptor. +

+
void close();
+
+

+ This function is used to close the descriptor. Any asynchronous read + or write operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. Note that, even if the function indicates an + error, the underlying descriptor is closed. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/close/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/close/overload2.html new file mode 100644 index 0000000..b242886 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/close/overload2.html @@ -0,0 +1,63 @@ + + + +posix::basic_descriptor::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the descriptor. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the descriptor. Any asynchronous read + or write operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. Note that, even if + the function indicates an error, the underlying descriptor is closed. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/executor_type.html b/include/asio/doc/asio/reference/posix__basic_descriptor/executor_type.html new file mode 100644 index 0000000..1fa5007 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/executor_type.html @@ -0,0 +1,54 @@ + + + +posix::basic_descriptor::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/posix/basic_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/get_executor.html b/include/asio/doc/asio/reference/posix__basic_descriptor/get_executor.html new file mode 100644 index 0000000..eaef2d1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/get_executor.html @@ -0,0 +1,44 @@ + + + +posix::basic_descriptor::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/io_control.html b/include/asio/doc/asio/reference/posix__basic_descriptor/io_control.html new file mode 100644 index 0000000..9ac804d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/io_control.html @@ -0,0 +1,55 @@ + + + +posix::basic_descriptor::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + an IO control command on the descriptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/io_control/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/io_control/overload1.html new file mode 100644 index 0000000..bc31af5 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/io_control/overload1.html @@ -0,0 +1,88 @@ + + + +posix::basic_descriptor::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform an IO control command on the descriptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the descriptor. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the descriptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::posix::stream_descriptor::bytes_readable command;
+descriptor.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/io_control/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/io_control/overload2.html new file mode 100644 index 0000000..8c3b956 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/io_control/overload2.html @@ -0,0 +1,85 @@ + + + +posix::basic_descriptor::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform an IO control command on the descriptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the descriptor. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the descriptor. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::posix::stream_descriptor::bytes_readable command;
+asio::error_code ec;
+descriptor.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/is_open.html b/include/asio/doc/asio/reference/posix__basic_descriptor/is_open.html new file mode 100644 index 0000000..ace79aa --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/is_open.html @@ -0,0 +1,44 @@ + + + +posix::basic_descriptor::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the descriptor is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer.html b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer.html new file mode 100644 index 0000000..8dca403 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer.html @@ -0,0 +1,51 @@ + + + +posix::basic_descriptor::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer/overload1.html new file mode 100644 index 0000000..54d6c5c --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer/overload1.html @@ -0,0 +1,57 @@ + + + +posix::basic_descriptor::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a descriptor cannot contain any further layers, it simply returns + a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer/overload2.html new file mode 100644 index 0000000..bea2586 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer/overload2.html @@ -0,0 +1,57 @@ + + + +posix::basic_descriptor::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a descriptor cannot contain any further layers, it simply + returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer_type.html b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer_type.html new file mode 100644 index 0000000..80845e9 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/lowest_layer_type.html @@ -0,0 +1,414 @@ + + + +posix::basic_descriptor::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A + descriptor is always the lowest layer. +

+
typedef basic_descriptor lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_descriptor [constructor] +

+
+

+ Construct a descriptor without opening it.
—
Construct + a descriptor on an existing native descriptor.
—
+ Move-construct a descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a descriptor from another. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_descriptor [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The posix::basic_descriptor + class template provides the ability to wrap a POSIX descriptor. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/basic_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/native_handle.html b/include/asio/doc/asio/reference/posix__basic_descriptor/native_handle.html new file mode 100644 index 0000000..7432670 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/native_handle.html @@ -0,0 +1,49 @@ + + + +posix::basic_descriptor::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the native descriptor representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + descriptor. This is intended to allow access to native descriptor functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/native_handle_type.html b/include/asio/doc/asio/reference/posix__basic_descriptor/native_handle_type.html new file mode 100644 index 0000000..eebcea1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/native_handle_type.html @@ -0,0 +1,54 @@ + + + +posix::basic_descriptor::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a descriptor. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/posix/basic_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking.html b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking.html new file mode 100644 index 0000000..d8ddc5f --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +posix::basic_descriptor::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native descriptor implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native descriptor implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload1.html new file mode 100644 index 0000000..25ec0a3 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload1.html @@ -0,0 +1,67 @@ + + + +posix::basic_descriptor::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Gets the non-blocking mode of the native descriptor implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native descriptor. This mode has no effect on the behaviour of the descriptor + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying descriptor is in non-blocking mode + and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the descriptor object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native descriptor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload2.html new file mode 100644 index 0000000..a86c776 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload2.html @@ -0,0 +1,80 @@ + + + +posix::basic_descriptor::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the native descriptor implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native descriptor. It has no effect on the behaviour of the descriptor + object's synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying descriptor is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload3.html new file mode 100644 index 0000000..18b6fd1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/native_non_blocking/overload3.html @@ -0,0 +1,72 @@ + + + +posix::basic_descriptor::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the native descriptor implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native descriptor. It has no effect on the behaviour of the descriptor + object's synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying descriptor is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking.html b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking.html new file mode 100644 index 0000000..dc0903e --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking.html @@ -0,0 +1,57 @@ + + + +posix::basic_descriptor::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the descriptor. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the descriptor. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload1.html new file mode 100644 index 0000000..378d0b1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload1.html @@ -0,0 +1,62 @@ + + + +posix::basic_descriptor::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Gets the non-blocking mode of the descriptor. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the descriptor's synchronous operations will fail + with asio::error::would_block if they are unable to perform + the requested operation immediately. If false, synchronous + operations will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload2.html new file mode 100644 index 0000000..13dd1b0 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload2.html @@ -0,0 +1,81 @@ + + + +posix::basic_descriptor::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the descriptor. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the descriptor's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload3.html b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload3.html new file mode 100644 index 0000000..35a7562 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/non_blocking/overload3.html @@ -0,0 +1,73 @@ + + + +posix::basic_descriptor::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Sets the non-blocking mode of the descriptor. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the descriptor's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/operator_eq_.html b/include/asio/doc/asio/reference/posix__basic_descriptor/operator_eq_.html new file mode 100644 index 0000000..6012cde --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/operator_eq_.html @@ -0,0 +1,69 @@ + + + +posix::basic_descriptor::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a descriptor from another. +

+
basic_descriptor & operator=(
+    basic_descriptor && other);
+
+

+ This assignment operator moves a descriptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other descriptor object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_descriptor(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/release.html b/include/asio/doc/asio/reference/posix__basic_descriptor/release.html new file mode 100644 index 0000000..ac70683 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/release.html @@ -0,0 +1,54 @@ + + + +posix::basic_descriptor::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release + ownership of the native descriptor implementation. +

+
native_handle_type release();
+
+

+ This function may be used to obtain the underlying representation of the + descriptor. After calling this function, is_open() returns + false. The caller is responsible for closing the descriptor. +

+

+ All outstanding asynchronous read or write operations will finish immediately, + and the handlers for cancelled operations will be passed the asio::error::operation_aborted + error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/wait.html b/include/asio/doc/asio/reference/posix__basic_descriptor/wait.html new file mode 100644 index 0000000..dd4b5b2 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/wait.html @@ -0,0 +1,52 @@ + + + +posix::basic_descriptor::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait + for the descriptor to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/wait/overload1.html b/include/asio/doc/asio/reference/posix__basic_descriptor/wait/overload1.html new file mode 100644 index 0000000..ce7bf7d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/wait/overload1.html @@ -0,0 +1,73 @@ + + + +posix::basic_descriptor::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wait for the descriptor to become ready to read, ready to write, or to + have pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for a descriptor to + enter a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired descriptor state. +

+
+
+
+ + Example +
+

+ Waiting for a descriptor to become readable. +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+descriptor.wait(asio::posix::stream_descriptor::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/wait/overload2.html b/include/asio/doc/asio/reference/posix__basic_descriptor/wait/overload2.html new file mode 100644 index 0000000..cd2cbf1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/wait/overload2.html @@ -0,0 +1,79 @@ + + + +posix::basic_descriptor::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wait for the descriptor to become ready to read, ready to write, or to + have pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for a descriptor to + enter a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired descriptor state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for a descriptor to become readable. +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::error_code ec;
+descriptor.wait(asio::posix::stream_descriptor::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor/wait_type.html b/include/asio/doc/asio/reference/posix__basic_descriptor/wait_type.html new file mode 100644 index 0000000..133c58d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor/wait_type.html @@ -0,0 +1,76 @@ + + + +posix::basic_descriptor::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::descriptor_base. +

+

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a descriptor to become ready to read. +

+
wait_write
+

+ Wait for a descriptor to become ready to write. +

+
wait_error
+

+ Wait for a descriptor to have error conditions pending. +

+
+
+

+ For use with descriptor::wait() and descriptor::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor__rebind_executor.html b/include/asio/doc/asio/reference/posix__basic_descriptor__rebind_executor.html new file mode 100644 index 0000000..80b5e8b --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor__rebind_executor.html @@ -0,0 +1,88 @@ + + + +posix::basic_descriptor::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the descriptor type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The descriptor type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/posix/basic_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_descriptor__rebind_executor/other.html b/include/asio/doc/asio/reference/posix__basic_descriptor__rebind_executor/other.html new file mode 100644 index 0000000..40af3db --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_descriptor__rebind_executor/other.html @@ -0,0 +1,414 @@ + + + +posix::basic_descriptor::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + descriptor type when rebound to the specified executor. +

+
typedef basic_descriptor< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_descriptor [constructor] +

+
+

+ Construct a descriptor without opening it.
—
Construct + a descriptor on an existing native descriptor.
—
+ Move-construct a descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a descriptor from another. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_descriptor [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The posix::basic_descriptor + class template provides the ability to wrap a POSIX descriptor. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/basic_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor.html new file mode 100644 index 0000000..4c7e25d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor.html @@ -0,0 +1,429 @@ + + + +posix::basic_stream_descriptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides stream-oriented descriptor functionality. +

+
template<
+    typename Executor = any_io_executor>
+class basic_stream_descriptor :
+  public posix::basic_descriptor< Executor >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_stream_descriptor [constructor] +

+
+

+ Construct a stream descriptor without opening it.
—
+ Construct a stream descriptor on an existing native descriptor. +
—
Move-construct a stream descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a stream descriptor from another. +

+
+

+ read_some +

+
+

+ Read some data from the descriptor. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the descriptor. +

+
+

+ The posix::basic_stream_descriptor + class template provides asynchronous and blocking stream-oriented descriptor + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/basic_stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign.html new file mode 100644 index 0000000..a7dfb53 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign.html @@ -0,0 +1,51 @@ + + + +posix::basic_stream_descriptor::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native descriptor to the descriptor. +

+
void assign(
+    const native_handle_type & native_descriptor);
+  » more...
+
+void assign(
+    const native_handle_type & native_descriptor,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign/overload1.html new file mode 100644 index 0000000..af5c3bf --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign/overload1.html @@ -0,0 +1,47 @@ + + + +posix::basic_stream_descriptor::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Assign an existing native descriptor to the descriptor. +

+
void assign(
+    const native_handle_type & native_descriptor);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign/overload2.html new file mode 100644 index 0000000..44e4575 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/assign/overload2.html @@ -0,0 +1,48 @@ + + + +posix::basic_stream_descriptor::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Assign an existing native descriptor to the descriptor. +

+
void assign(
+    const native_handle_type & native_descriptor,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_read_some.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_read_some.html new file mode 100644 index 0000000..fd7b371 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_read_some.html @@ -0,0 +1,113 @@ + + + +posix::basic_stream_descriptor::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data from the stream descriptor. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes read.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The read operation may not read all of the requested number of bytes. Consider + using the async_read + function if you need to ensure that the requested amount of data is read + before the asynchronous operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
descriptor.async_read_some(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_wait.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_wait.html new file mode 100644 index 0000000..8fbf95b --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_wait.html @@ -0,0 +1,107 @@ + + + +posix::basic_stream_descriptor::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ +Asynchronously + wait for the descriptor to become ready to read, ready to write, or to + have pending error conditions. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    wait_type w,
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is used to perform an asynchronous wait for a descriptor + to enter a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired descriptor state. +

+
handler
+
+

+ The handler to be called when the wait operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Example +
+
void wait_handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Wait succeeded.
+  }
+}
+
+...
+
+asio::posix::stream_descriptor descriptor(my_context);
+...
+descriptor.async_wait(
+    asio::posix::stream_descriptor::wait_read,
+    wait_handler);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_write_some.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_write_some.html new file mode 100644 index 0000000..0cf2882 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/async_write_some.html @@ -0,0 +1,113 @@ + + + +posix::basic_stream_descriptor::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write data to the stream descriptor. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the descriptor. Although + the buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes written.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The write operation may not transmit all of the data to the peer. Consider + using the async_write + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
descriptor.async_write_some(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor.html new file mode 100644 index 0000000..4b299af --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor.html @@ -0,0 +1,76 @@ + + + +posix::basic_stream_descriptor::basic_stream_descriptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a stream descriptor without opening it. +

+
explicit basic_stream_descriptor(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_stream_descriptor(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Construct a stream descriptor on an existing native descriptor. +

+
basic_stream_descriptor(
+    const executor_type & ex,
+    const native_handle_type & native_descriptor);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_stream_descriptor(
+    ExecutionContext & context,
+    const native_handle_type & native_descriptor,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a stream descriptor from another. +

+
basic_stream_descriptor(
+    basic_stream_descriptor && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload1.html new file mode 100644 index 0000000..b139125 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload1.html @@ -0,0 +1,63 @@ + + + +posix::basic_stream_descriptor::basic_stream_descriptor (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream descriptor without opening it. +

+
basic_stream_descriptor(
+    const executor_type & ex);
+
+

+ This constructor creates a stream descriptor without opening it. The + descriptor needs to be opened and then connected or accepted before data + can be sent or received on it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the descriptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the descriptor. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload2.html new file mode 100644 index 0000000..7d9cf25 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload2.html @@ -0,0 +1,67 @@ + + + +posix::basic_stream_descriptor::basic_stream_descriptor (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream descriptor without opening it. +

+
template<
+    typename ExecutionContext>
+basic_stream_descriptor(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a stream descriptor without opening it. The + descriptor needs to be opened and then connected or accepted before data + can be sent or received on it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the descriptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the descriptor. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload3.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload3.html new file mode 100644 index 0000000..099ce54 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload3.html @@ -0,0 +1,80 @@ + + + +posix::basic_stream_descriptor::basic_stream_descriptor (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream descriptor on an existing native descriptor. +

+
basic_stream_descriptor(
+    const executor_type & ex,
+    const native_handle_type & native_descriptor);
+
+

+ This constructor creates a stream descriptor object to hold an existing + native descriptor. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the descriptor will use, by default, to dispatch + handlers for any asynchronous operations performed on the descriptor. +

+
native_descriptor
+

+ The new underlying descriptor implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload4.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload4.html new file mode 100644 index 0000000..5bd68a1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload4.html @@ -0,0 +1,84 @@ + + + +posix::basic_stream_descriptor::basic_stream_descriptor (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream descriptor on an existing native descriptor. +

+
template<
+    typename ExecutionContext>
+basic_stream_descriptor(
+    ExecutionContext & context,
+    const native_handle_type & native_descriptor,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a stream descriptor object to hold an existing + native descriptor. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the descriptor + will use, by default, to dispatch handlers for any asynchronous + operations performed on the descriptor. +

+
native_descriptor
+

+ The new underlying descriptor implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload5.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload5.html new file mode 100644 index 0000000..8c58dc6 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload5.html @@ -0,0 +1,69 @@ + + + +posix::basic_stream_descriptor::basic_stream_descriptor (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a stream descriptor from another. +

+
basic_stream_descriptor(
+    basic_stream_descriptor && other);
+
+

+ This constructor moves a stream descriptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other stream descriptor object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_stream_descriptor(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/bytes_readable.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/bytes_readable.html new file mode 100644 index 0000000..23256f7 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/bytes_readable.html @@ -0,0 +1,70 @@ + + + +posix::basic_stream_descriptor::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::descriptor_base. +

+

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::descriptor_base::bytes_readable command(true);
+descriptor.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/posix/basic_stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel.html new file mode 100644 index 0000000..42acf75 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel.html @@ -0,0 +1,49 @@ + + + +posix::basic_stream_descriptor::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the descriptor. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel/overload1.html new file mode 100644 index 0000000..0eca07d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel/overload1.html @@ -0,0 +1,64 @@ + + + +posix::basic_stream_descriptor::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Cancel all asynchronous operations associated with the descriptor. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel/overload2.html new file mode 100644 index 0000000..11c9652 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/cancel/overload2.html @@ -0,0 +1,65 @@ + + + +posix::basic_stream_descriptor::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Cancel all asynchronous operations associated with the descriptor. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close.html new file mode 100644 index 0000000..563c8a5 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close.html @@ -0,0 +1,49 @@ + + + +posix::basic_stream_descriptor::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the descriptor. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close/overload1.html new file mode 100644 index 0000000..bff3c03 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close/overload1.html @@ -0,0 +1,65 @@ + + + +posix::basic_stream_descriptor::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Close the descriptor. +

+
void close();
+
+

+ This function is used to close the descriptor. Any asynchronous read + or write operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. Note that, even if the function indicates an + error, the underlying descriptor is closed. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close/overload2.html new file mode 100644 index 0000000..5cdfa12 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/close/overload2.html @@ -0,0 +1,66 @@ + + + +posix::basic_stream_descriptor::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Close the descriptor. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the descriptor. Any asynchronous read + or write operations will be cancelled immediately, and will complete + with the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. Note that, even if + the function indicates an error, the underlying descriptor is closed. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/executor_type.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/executor_type.html new file mode 100644 index 0000000..d407bd8 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/executor_type.html @@ -0,0 +1,54 @@ + + + +posix::basic_stream_descriptor::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/posix/basic_stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/get_executor.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/get_executor.html new file mode 100644 index 0000000..1013cec --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/get_executor.html @@ -0,0 +1,47 @@ + + + +posix::basic_stream_descriptor::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control.html new file mode 100644 index 0000000..b9fdb4b --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control.html @@ -0,0 +1,55 @@ + + + +posix::basic_stream_descriptor::io_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + an IO control command on the descriptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+  » more...
+
+template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control/overload1.html new file mode 100644 index 0000000..dc6c81f --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control/overload1.html @@ -0,0 +1,91 @@ + + + +posix::basic_stream_descriptor::io_control (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Perform an IO control command on the descriptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command);
+
+

+ This function is used to execute an IO control command on the descriptor. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the descriptor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::posix::stream_descriptor::bytes_readable command;
+descriptor.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control/overload2.html new file mode 100644 index 0000000..c6de907 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/io_control/overload2.html @@ -0,0 +1,88 @@ + + + +posix::basic_stream_descriptor::io_control (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Perform an IO control command on the descriptor. +

+
template<
+    typename IoControlCommand>
+void io_control(
+    IoControlCommand & command,
+    asio::error_code & ec);
+
+

+ This function is used to execute an IO control command on the descriptor. +

+
+ + Parameters +
+
+

+
+
command
+

+ The IO control command to be performed on the descriptor. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Getting the number of bytes ready to read: +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::posix::stream_descriptor::bytes_readable command;
+asio::error_code ec;
+descriptor.io_control(command, ec);
+if (ec)
+{
+  // An error occurred.
+}
+std::size_t bytes_readable = command.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/is_open.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/is_open.html new file mode 100644 index 0000000..1162aef --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/is_open.html @@ -0,0 +1,47 @@ + + + +posix::basic_stream_descriptor::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ +Determine + whether the descriptor is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer.html new file mode 100644 index 0000000..d59fbe2 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer.html @@ -0,0 +1,51 @@ + + + +posix::basic_stream_descriptor::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer/overload1.html new file mode 100644 index 0000000..351f2b2 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer/overload1.html @@ -0,0 +1,60 @@ + + + +posix::basic_stream_descriptor::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since a descriptor cannot contain any further layers, it simply returns + a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer/overload2.html new file mode 100644 index 0000000..d3e787a --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer/overload2.html @@ -0,0 +1,60 @@ + + + +posix::basic_stream_descriptor::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since a descriptor cannot contain any further layers, it simply + returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer_type.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer_type.html new file mode 100644 index 0000000..9d15974 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/lowest_layer_type.html @@ -0,0 +1,417 @@ + + + +posix::basic_stream_descriptor::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ +A + descriptor is always the lowest layer. +

+
typedef basic_descriptor lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_descriptor [constructor] +

+
+

+ Construct a descriptor without opening it.
—
Construct + a descriptor on an existing native descriptor.
—
+ Move-construct a descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a descriptor from another. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_descriptor [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The posix::basic_descriptor + class template provides the ability to wrap a POSIX descriptor. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/basic_stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_handle.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_handle.html new file mode 100644 index 0000000..d85e6b7 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_handle.html @@ -0,0 +1,52 @@ + + + +posix::basic_stream_descriptor::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ +Get + the native descriptor representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + descriptor. This is intended to allow access to native descriptor functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_handle_type.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_handle_type.html new file mode 100644 index 0000000..6dba6a3 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_handle_type.html @@ -0,0 +1,414 @@ + + + +posix::basic_stream_descriptor::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a descriptor. +

+
typedef basic_descriptor< Executor >::native_handle_type native_handle_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_descriptor [constructor] +

+
+

+ Construct a descriptor without opening it.
—
Construct + a descriptor on an existing native descriptor.
—
+ Move-construct a descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a descriptor from another. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_descriptor [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The posix::basic_descriptor + class template provides the ability to wrap a POSIX descriptor. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/basic_stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking.html new file mode 100644 index 0000000..eb2d84e --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking.html @@ -0,0 +1,57 @@ + + + +posix::basic_stream_descriptor::native_non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the native descriptor implementation. +

+
bool native_non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the native descriptor implementation. +

+
void native_non_blocking(
+    bool mode);
+  » more...
+
+void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload1.html new file mode 100644 index 0000000..22bc742 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload1.html @@ -0,0 +1,70 @@ + + + +posix::basic_stream_descriptor::native_non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Gets the non-blocking mode of the native descriptor implementation. +

+
bool native_non_blocking() const;
+
+

+ This function is used to retrieve the non-blocking mode of the underlying + native descriptor. This mode has no effect on the behaviour of the descriptor + object's synchronous operations. +

+
+ + Return + Value +
+

+ true if the underlying descriptor is in non-blocking mode + and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+ + Remarks +
+

+ The current non-blocking mode is cached by the descriptor object. Consequently, + the return value may be incorrect if the non-blocking mode was set directly + on the native descriptor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload2.html new file mode 100644 index 0000000..f40c0a0 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload2.html @@ -0,0 +1,83 @@ + + + +posix::basic_stream_descriptor::native_non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Sets the non-blocking mode of the native descriptor implementation. +

+
void native_non_blocking(
+    bool mode);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native descriptor. It has no effect on the behaviour of the descriptor + object's synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying descriptor is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the mode is false, + but the current value of non_blocking() is true, + this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload3.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload3.html new file mode 100644 index 0000000..a0f60a1 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload3.html @@ -0,0 +1,75 @@ + + + +posix::basic_stream_descriptor::native_non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Sets the non-blocking mode of the native descriptor implementation. +

+
void native_non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+

+ This function is used to modify the non-blocking mode of the underlying + native descriptor. It has no effect on the behaviour of the descriptor + object's synchronous operations. +

+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the underlying descriptor is put into non-blocking + mode and direct system calls may fail with asio::error::would_block + (or the equivalent system error). +

+
ec
+

+ Set to indicate what error occurred, if any. If the mode + is false, but the current value of non_blocking() + is true, this function fails with asio::error::invalid_argument, + as the combination does not make sense. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking.html new file mode 100644 index 0000000..2c45c78 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking.html @@ -0,0 +1,57 @@ + + + +posix::basic_stream_descriptor::non_blocking + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Gets + the non-blocking mode of the descriptor. +

+
bool non_blocking() const;
+  » more...
+
+

+ Sets the non-blocking mode of the descriptor. +

+
void non_blocking(
+    bool mode);
+  » more...
+
+void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload1.html new file mode 100644 index 0000000..710b31b --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload1.html @@ -0,0 +1,65 @@ + + + +posix::basic_stream_descriptor::non_blocking (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Gets the non-blocking mode of the descriptor. +

+
bool non_blocking() const;
+
+
+ + Return + Value +
+

+ true if the descriptor's synchronous operations will fail + with asio::error::would_block if they are unable to perform + the requested operation immediately. If false, synchronous + operations will block until complete. +

+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload2.html new file mode 100644 index 0000000..f48ae78 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload2.html @@ -0,0 +1,84 @@ + + + +posix::basic_stream_descriptor::non_blocking (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Sets the non-blocking mode of the descriptor. +

+
void non_blocking(
+    bool mode);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the descriptor's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload3.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload3.html new file mode 100644 index 0000000..56cf454 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/non_blocking/overload3.html @@ -0,0 +1,76 @@ + + + +posix::basic_stream_descriptor::non_blocking (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Sets the non-blocking mode of the descriptor. +

+
void non_blocking(
+    bool mode,
+    asio::error_code & ec);
+
+
+ + Parameters +
+
+

+
+
mode
+

+ If true, the descriptor's synchronous operations will + fail with asio::error::would_block if they are unable + to perform the requested operation immediately. If false, + synchronous operations will block until complete. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ The non-blocking mode has no effect on the behaviour of asynchronous + operations. Asynchronous operations will never fail with the error asio::error::would_block. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/operator_eq_.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/operator_eq_.html new file mode 100644 index 0000000..cf0d26e --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/operator_eq_.html @@ -0,0 +1,70 @@ + + + +posix::basic_stream_descriptor::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a stream descriptor from another. +

+
basic_stream_descriptor & operator=(
+    basic_stream_descriptor && other);
+
+

+ This assignment operator moves a stream descriptor from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other stream descriptor object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_stream_descriptor(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some.html new file mode 100644 index 0000000..e430e98 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some.html @@ -0,0 +1,55 @@ + + + +posix::basic_stream_descriptor::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read + some data from the descriptor. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload1.html new file mode 100644 index 0000000..71cb944 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload1.html @@ -0,0 +1,111 @@ + + + +posix::basic_stream_descriptor::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the descriptor. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to read data from the stream descriptor. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
descriptor.read_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload2.html new file mode 100644 index 0000000..db61924 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload2.html @@ -0,0 +1,87 @@ + + + +posix::basic_stream_descriptor::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the descriptor. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to read data from the stream descriptor. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/release.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/release.html new file mode 100644 index 0000000..0382f12 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/release.html @@ -0,0 +1,57 @@ + + + +posix::basic_stream_descriptor::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ +Release + ownership of the native descriptor implementation. +

+
native_handle_type release();
+
+

+ This function may be used to obtain the underlying representation of the + descriptor. After calling this function, is_open() returns + false. The caller is responsible for closing the descriptor. +

+

+ All outstanding asynchronous read or write operations will finish immediately, + and the handlers for cancelled operations will be passed the asio::error::operation_aborted + error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait.html new file mode 100644 index 0000000..c3de8d5 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait.html @@ -0,0 +1,52 @@ + + + +posix::basic_stream_descriptor::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait + for the descriptor to become ready to read, ready to write, or to have + pending error conditions. +

+
void wait(
+    wait_type w);
+  » more...
+
+void wait(
+    wait_type w,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait/overload1.html new file mode 100644 index 0000000..caab1bd --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait/overload1.html @@ -0,0 +1,76 @@ + + + +posix::basic_stream_descriptor::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Wait for the descriptor to become ready to read, ready to write, or to + have pending error conditions. +

+
void wait(
+    wait_type w);
+
+

+ This function is used to perform a blocking wait for a descriptor to + enter a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired descriptor state. +

+
+
+
+ + Example +
+

+ Waiting for a descriptor to become readable. +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+descriptor.wait(asio::posix::stream_descriptor::wait_read);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait/overload2.html new file mode 100644 index 0000000..d7d28cf --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait/overload2.html @@ -0,0 +1,82 @@ + + + +posix::basic_stream_descriptor::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::basic_descriptor. +

+

+ Wait for the descriptor to become ready to read, ready to write, or to + have pending error conditions. +

+
void wait(
+    wait_type w,
+    asio::error_code & ec);
+
+

+ This function is used to perform a blocking wait for a descriptor to + enter a ready to read, write or error condition state. +

+
+ + Parameters +
+
+

+
+
w
+

+ Specifies the desired descriptor state. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Example +
+

+ Waiting for a descriptor to become readable. +

+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::error_code ec;
+descriptor.wait(asio::posix::stream_descriptor::wait_read, ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait_type.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait_type.html new file mode 100644 index 0000000..1585444 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/wait_type.html @@ -0,0 +1,76 @@ + + + +posix::basic_stream_descriptor::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from posix::descriptor_base. +

+

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a descriptor to become ready to read. +

+
wait_write
+

+ Wait for a descriptor to become ready to write. +

+
wait_error
+

+ Wait for a descriptor to have error conditions pending. +

+
+
+

+ For use with descriptor::wait() and descriptor::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some.html new file mode 100644 index 0000000..9495cf8 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some.html @@ -0,0 +1,55 @@ + + + +posix::basic_stream_descriptor::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + some data to the descriptor. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some/overload1.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some/overload1.html new file mode 100644 index 0000000..d07cb11 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some/overload1.html @@ -0,0 +1,111 @@ + + + +posix::basic_stream_descriptor::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the descriptor. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to write data to the stream descriptor. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the descriptor. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
descriptor.write_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some/overload2.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some/overload2.html new file mode 100644 index 0000000..753389d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor/write_some/overload2.html @@ -0,0 +1,87 @@ + + + +posix::basic_stream_descriptor::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the descriptor. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to write data to the stream descriptor. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the descriptor. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor.html new file mode 100644 index 0000000..59383e0 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor.html @@ -0,0 +1,88 @@ + + + +posix::basic_stream_descriptor::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the descriptor type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The descriptor type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/posix/basic_stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor/other.html b/include/asio/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor/other.html new file mode 100644 index 0000000..2aaabf7 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor/other.html @@ -0,0 +1,428 @@ + + + +posix::basic_stream_descriptor::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + descriptor type when rebound to the specified executor. +

+
typedef basic_stream_descriptor< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read + without blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_stream_descriptor [constructor] +

+
+

+ Construct a stream descriptor without opening it.
—
+ Construct a stream descriptor on an existing native descriptor. +
—
Move-construct a stream descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a stream descriptor from another. +

+
+

+ read_some +

+
+

+ Read some data from the descriptor. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the descriptor. +

+
+

+ The posix::basic_stream_descriptor + class template provides asynchronous and blocking stream-oriented descriptor + functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/basic_stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__descriptor.html b/include/asio/doc/asio/reference/posix__descriptor.html new file mode 100644 index 0000000..025a55d --- /dev/null +++ b/include/asio/doc/asio/reference/posix__descriptor.html @@ -0,0 +1,414 @@ + + + +posix::descriptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for the typical + usage of posix::basic_descriptor. +

+
typedef basic_descriptor descriptor;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ basic_descriptor [constructor] +

+
+

+ Construct a descriptor without opening it.
—
Construct + a descriptor on an existing native descriptor.
—
Move-construct + a descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a descriptor from another. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_descriptor [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The posix::basic_descriptor + class template provides the ability to wrap a POSIX descriptor. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__descriptor_base.html b/include/asio/doc/asio/reference/posix__descriptor_base.html new file mode 100644 index 0000000..b9d9088 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__descriptor_base.html @@ -0,0 +1,138 @@ + + + +posix::descriptor_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The posix::descriptor_base + class is used as a base for the descriptor class as a place to define the + associated IO control commands. +

+
class descriptor_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~descriptor_base [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Requirements +
+

+ Header: asio/posix/descriptor_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__descriptor_base/_descriptor_base.html b/include/asio/doc/asio/reference/posix__descriptor_base/_descriptor_base.html new file mode 100644 index 0000000..96d2f18 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__descriptor_base/_descriptor_base.html @@ -0,0 +1,44 @@ + + + +posix::descriptor_base::~descriptor_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~descriptor_base();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__descriptor_base/bytes_readable.html b/include/asio/doc/asio/reference/posix__descriptor_base/bytes_readable.html new file mode 100644 index 0000000..9539c97 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__descriptor_base/bytes_readable.html @@ -0,0 +1,67 @@ + + + +posix::descriptor_base::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +IO + control command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::posix::stream_descriptor descriptor(my_context);
+...
+asio::descriptor_base::bytes_readable command(true);
+descriptor.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/posix/descriptor_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__descriptor_base/wait_type.html b/include/asio/doc/asio/reference/posix__descriptor_base/wait_type.html new file mode 100644 index 0000000..1ebda3c --- /dev/null +++ b/include/asio/doc/asio/reference/posix__descriptor_base/wait_type.html @@ -0,0 +1,73 @@ + + + +posix::descriptor_base::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait + types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a descriptor to become ready to read. +

+
wait_write
+

+ Wait for a descriptor to become ready to write. +

+
wait_error
+

+ Wait for a descriptor to have error conditions pending. +

+
+
+

+ For use with descriptor::wait() and descriptor::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/posix__stream_descriptor.html b/include/asio/doc/asio/reference/posix__stream_descriptor.html new file mode 100644 index 0000000..4037078 --- /dev/null +++ b/include/asio/doc/asio/reference/posix__stream_descriptor.html @@ -0,0 +1,427 @@ + + + +posix::stream_descriptor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for + the typical usage of a stream-oriented descriptor. +

+
typedef basic_stream_descriptor stream_descriptor;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the descriptor type to another executor. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A descriptor is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a descriptor. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native descriptor to the descriptor. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_wait +

+
+

+ Asynchronously wait for the descriptor to become ready to read, + ready to write, or to have pending error conditions. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_stream_descriptor [constructor] +

+
+

+ Construct a stream descriptor without opening it.
—
+ Construct a stream descriptor on an existing native descriptor. +
—
Move-construct a stream descriptor from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the descriptor. +

+
+

+ close +

+
+

+ Close the descriptor. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ io_control +

+
+

+ Perform an IO control command on the descriptor. +

+
+

+ is_open +

+
+

+ Determine whether the descriptor is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native descriptor representation. +

+
+

+ native_non_blocking +

+
+

+ Gets the non-blocking mode of the native descriptor implementation. +
—
Sets the non-blocking mode of the native descriptor + implementation. +

+
+

+ non_blocking +

+
+

+ Gets the non-blocking mode of the descriptor.
—
Sets + the non-blocking mode of the descriptor. +

+
+

+ operator= +

+
+

+ Move-assign a stream descriptor from another. +

+
+

+ read_some +

+
+

+ Read some data from the descriptor. +

+
+

+ release +

+
+

+ Release ownership of the native descriptor implementation. +

+
+

+ wait +

+
+

+ Wait for the descriptor to become ready to read, ready to write, + or to have pending error conditions. +

+
+

+ write_some +

+
+

+ Write some data to the descriptor. +

+
+

+ The posix::basic_stream_descriptor + class template provides asynchronous and blocking stream-oriented descriptor + functionality. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/posix/stream_descriptor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/post.html b/include/asio/doc/asio/reference/post.html new file mode 100644 index 0000000..0e1e895 --- /dev/null +++ b/include/asio/doc/asio/reference/post.html @@ -0,0 +1,76 @@ + + + +post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+post +

+

+ +Submits a completion token or function object for + execution. +

+
template<
+    typename CompletionToken>
+DEDUCED post(
+    CompletionToken && token);
+  » more...
+
+template<
+    typename Executor,
+    typename CompletionToken = DEFAULT>
+DEDUCED post(
+    const Executor & ex,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+template<
+    typename ExecutionContext,
+    typename CompletionToken = DEFAULT>
+DEDUCED post(
+    ExecutionContext & ctx,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/post.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/post/overload1.html b/include/asio/doc/asio/reference/post/overload1.html new file mode 100644 index 0000000..ed4d6ef --- /dev/null +++ b/include/asio/doc/asio/reference/post/overload1.html @@ -0,0 +1,82 @@ + + + +post (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename CompletionToken>
+DEDUCED post(
+    CompletionToken && token);
+
+

+ This function submits an object for execution using the object's associated + executor. The function object is queued for execution, and is never called + from the current thread prior to returning from post(). +

+

+ The use of post(), rather than defer + , indicates the caller's preference that the function object be eagerly + queued for execution. +

+

+ This function has the following effects: +

+
    +
  • + Constructs a function object handler of type Handler, + initialized with handler(forward<CompletionToken>(token)). +
  • +
  • + Constructs an object result of type async_result<Handler>, + initializing the object as result(handler). +
  • +
  • + Obtains the handler's associated executor object ex by + performing get_associated_executor(handler). +
  • +
  • + Obtains the handler's associated allocator object alloc + by performing get_associated_allocator(handler). +
  • +
  • + Performs ex.post(std::move(handler), alloc). +
  • +
  • + Returns result.get(). +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/post/overload2.html b/include/asio/doc/asio/reference/post/overload2.html new file mode 100644 index 0000000..50faf4c --- /dev/null +++ b/include/asio/doc/asio/reference/post/overload2.html @@ -0,0 +1,93 @@ + + + +post (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename Executor,
+    typename CompletionToken = DEFAULT>
+DEDUCED post(
+    const Executor & ex,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+
+

+ This function submits an object for execution using the specified executor. + The function object is queued for execution, and is never called from the + current thread prior to returning from post(). +

+

+ The use of post(), rather than defer + , indicates the caller's preference that the function object be eagerly + queued for execution. +

+

+ This function has the following effects: +

+
    +
  • + Constructs a function object handler of type Handler, + initialized with handler(forward<CompletionToken>(token)). +
  • +
  • + Constructs an object result of type async_result<Handler>, + initializing the object as result(handler). +
  • +
  • + Obtains the handler's associated executor object ex1 by + performing get_associated_executor(handler). +
  • +
  • + Creates a work object w by performing make_work(ex1). +
  • +
  • + Obtains the handler's associated allocator object alloc + by performing get_associated_allocator(handler). +
  • +
  • + Constructs a function object f with a function call operator + that performs ex1.dispatch(std::move(handler), alloc) + followed by w.reset(). +
  • +
  • + Performs Executor(ex).post(std::move(f), alloc). +
  • +
  • + Returns result.get(). +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/post/overload3.html b/include/asio/doc/asio/reference/post/overload3.html new file mode 100644 index 0000000..3b44e15 --- /dev/null +++ b/include/asio/doc/asio/reference/post/overload3.html @@ -0,0 +1,56 @@ + + + +post (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Submits a completion token or function object for execution. +

+
template<
+    typename ExecutionContext,
+    typename CompletionToken = DEFAULT>
+DEDUCED post(
+    ExecutionContext & ctx,
+    CompletionToken && token = DEFAULT,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + Return + Value +
+

+ post(ctx.get_executor(), forward<CompletionToken>(token)). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/prefer.html b/include/asio/doc/asio/reference/prefer.html new file mode 100644 index 0000000..5d047f1 --- /dev/null +++ b/include/asio/doc/asio/reference/prefer.html @@ -0,0 +1,105 @@ + + + +prefer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+prefer +

+

+ +A customisation point that attempts to apply a + property to an object. +

+
constexpr unspecified prefer = unspecified;
+
+

+ The name prefer denotes a customisation point object. The expression + asio::prefer(E, P0, Pn...) for some subexpressions E + and P0, and where Pn... represents N + subexpressions (where N is 0 or more, and with types T + = decay_t<decltype(E)> and Prop0 = decay_t<decltype(P0)>) + is expression-equivalent to: +

+
    +
  • + If is_applicable_property_v<T, Prop0> && Prop0::is_preferable + is not a well-formed constant expression with value true, + asio::prefer(E, P0, Pn...) is ill-formed. +
  • +
  • + Otherwise, E if N == 0 and the expression + Prop0::template static_query_v<T> == Prop0::value() + is a well-formed constant expression with value true. +
  • +
  • + Otherwise, (E).require(P0) if N == 0 and the + expression (E).require(P0) is a valid expression. +
  • +
  • + Otherwise, require(E, P0) if N == 0 and the + expression require(E, P0) is a valid expression with overload + resolution performed in a context that does not include the declaration + of the require customization point object. +
  • +
  • + Otherwise, (E).prefer(P0) if N == 0 and the + expression (E).prefer(P0) is a valid expression. +
  • +
  • + Otherwise, prefer(E, P0) if N == 0 and the + expression prefer(E, P0) is a valid expression with overload + resolution performed in a context that does not include the declaration + of the prefer customization point object. +
  • +
  • + Otherwise, E if N == 0. +
  • +
  • + Otherwise, asio::prefer(asio::prefer(E, P0), Pn...) if + N > 0 and the expression asio::prefer(asio::prefer(E, + P0), Pn...) is a valid expression. +
  • +
  • + Otherwise, asio::prefer(E, P0, Pn...) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/prefer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/prefer_result.html b/include/asio/doc/asio/reference/prefer_result.html new file mode 100644 index 0000000..521ddc0 --- /dev/null +++ b/include/asio/doc/asio/reference/prefer_result.html @@ -0,0 +1,94 @@ + + + +prefer_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines the result type of a prefer expression. +

+
template<
+    typename T,
+    typename... Properties>
+struct prefer_result
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ The result of the prefer expression. +

+
+

+ Class template prefer_result is a trait that determines the + result type of the expression asio::prefer(std::declval<T>(), + std::declval<Properties>()...). +

+
+ + Requirements +
+

+ Header: asio/prefer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/prefer_result/type.html b/include/asio/doc/asio/reference/prefer_result/type.html new file mode 100644 index 0000000..53b40f2 --- /dev/null +++ b/include/asio/doc/asio/reference/prefer_result/type.html @@ -0,0 +1,54 @@ + + + +prefer_result::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The result of the prefer + expression. +

+
typedef automatically_determined type;
+
+
+ + Requirements +
+

+ Header: asio/prefer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/query.html b/include/asio/doc/asio/reference/query.html new file mode 100644 index 0000000..5a023cc --- /dev/null +++ b/include/asio/doc/asio/reference/query.html @@ -0,0 +1,86 @@ + + + +query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+query +

+

+ +A customisation point that queries the value of + a property. +

+
constexpr unspecified query = unspecified;
+
+

+ The name query denotes a customization point object. The expression + asio::query(E, P) for some subexpressions E and + P (with types T = decay_t<decltype(E)> and + Prop = decay_t<decltype(P)>) is expression-equivalent + to: +

+
    +
  • + If is_applicable_property_v<T, Prop> is not a well-formed + constant expression with value true, asio::query(E, + P) is ill-formed. +
  • +
  • + Otherwise, Prop::template static_query_v<T> if the + expression Prop::template static_query_v<T> is a well-formed + constant expression. +
  • +
  • + Otherwise, (E).query(P) if the expression (E).query(P) + is well-formed. +
  • +
  • + Otherwise, query(E, P) if the expression query(E, + P) is a valid expression with overload resolution performed in + a context that does not include the declaration of the query + customization point object. +
  • +
  • + Otherwise, asio::query(E, P) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/query_result.html b/include/asio/doc/asio/reference/query_result.html new file mode 100644 index 0000000..4b95e5c --- /dev/null +++ b/include/asio/doc/asio/reference/query_result.html @@ -0,0 +1,93 @@ + + + +query_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines the result type of a query expression. +

+
template<
+    typename T,
+    typename Property>
+struct query_result
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ The result of the query expression. +

+
+

+ Class template query_result is a trait that determines the result + type of the expression asio::query(std::declval<T>(), std::declval<Property>()). +

+
+ + Requirements +
+

+ Header: asio/query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/query_result/type.html b/include/asio/doc/asio/reference/query_result/type.html new file mode 100644 index 0000000..02b0ee4 --- /dev/null +++ b/include/asio/doc/asio/reference/query_result/type.html @@ -0,0 +1,54 @@ + + + +query_result::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The result of the query + expression. +

+
typedef automatically_determined type;
+
+
+ + Requirements +
+

+ Header: asio/query.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read.html b/include/asio/doc/asio/reference/read.html new file mode 100644 index 0000000..5d0cdbd --- /dev/null +++ b/include/asio/doc/asio/reference/read.html @@ -0,0 +1,219 @@ + + + +read + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+read +

+

+ +The read function is a composed operation + that reads a certain amount of data from a stream before returning. +

+

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename MutableBufferSequence>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename MutableBufferSequence>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/read.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload1.html b/include/asio/doc/asio/reference/read/overload1.html new file mode 100644 index 0000000..98ee66e --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload1.html @@ -0,0 +1,132 @@ + + + +read (1 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename MutableBufferSequence>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the stream. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::read(s, asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload10.html b/include/asio/doc/asio/reference/read/overload10.html new file mode 100644 index 0000000..900d950 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload10.html @@ -0,0 +1,106 @@ + + + +read (10 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, b,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload11.html b/include/asio/doc/asio/reference/read/overload11.html new file mode 100644 index 0000000..c3d020f --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload11.html @@ -0,0 +1,125 @@ + + + +read (11 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload12.html b/include/asio/doc/asio/reference/read/overload12.html new file mode 100644 index 0000000..23d623b --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload12.html @@ -0,0 +1,118 @@ + + + +read (12 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload13.html b/include/asio/doc/asio/reference/read/overload13.html new file mode 100644 index 0000000..0d0ac1c --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload13.html @@ -0,0 +1,115 @@ + + + +read (13 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload14.html b/include/asio/doc/asio/reference/read/overload14.html new file mode 100644 index 0000000..8034393 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload14.html @@ -0,0 +1,106 @@ + + + +read (14 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload15.html b/include/asio/doc/asio/reference/read/overload15.html new file mode 100644 index 0000000..0e188ca --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload15.html @@ -0,0 +1,126 @@ + + + +read (15 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload16.html b/include/asio/doc/asio/reference/read/overload16.html new file mode 100644 index 0000000..612ea1c --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload16.html @@ -0,0 +1,119 @@ + + + +read (16 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload2.html b/include/asio/doc/asio/reference/read/overload2.html new file mode 100644 index 0000000..03d3dc7 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload2.html @@ -0,0 +1,124 @@ + + + +read (2 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename MutableBufferSequence>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the stream. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::read(s, asio::buffer(data, size), ec);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload3.html b/include/asio/doc/asio/reference/read/overload3.html new file mode 100644 index 0000000..86c1279 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload3.html @@ -0,0 +1,144 @@ + + + +read (3 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the stream. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::read(s, asio::buffer(data, size),
+    asio::transfer_at_least(32));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload4.html b/include/asio/doc/asio/reference/read/overload4.html new file mode 100644 index 0000000..467d2e7 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload4.html @@ -0,0 +1,121 @@ + + + +read (4 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the stream. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload5.html b/include/asio/doc/asio/reference/read/overload5.html new file mode 100644 index 0000000..4c6e573 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload5.html @@ -0,0 +1,115 @@ + + + +read (5 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload6.html b/include/asio/doc/asio/reference/read/overload6.html new file mode 100644 index 0000000..161b312 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload6.html @@ -0,0 +1,106 @@ + + + +read (6 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload7.html b/include/asio/doc/asio/reference/read/overload7.html new file mode 100644 index 0000000..82bd960 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload7.html @@ -0,0 +1,126 @@ + + + +read (7 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload8.html b/include/asio/doc/asio/reference/read/overload8.html new file mode 100644 index 0000000..6d0ec38 --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload8.html @@ -0,0 +1,119 @@ + + + +read (8 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t read(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The specified dynamic buffer sequence is full (that is, it has reached + maximum size). +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the stream's read_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read/overload9.html b/include/asio/doc/asio/reference/read/overload9.html new file mode 100644 index 0000000..86db43b --- /dev/null +++ b/include/asio/doc/asio/reference/read/overload9.html @@ -0,0 +1,114 @@ + + + +read (9 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data from a stream before returning. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read(
+    SyncReadStream & s,
+    basic_streambuf< Allocator > & b);
+
+

+ This function is used to read a certain number of bytes of data from a + stream. The call will block until one of the following conditions is true: +

+
    +
  • + The supplied buffer is full (that is, it has reached maximum size). +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read(
+    s, b,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at.html b/include/asio/doc/asio/reference/read_at.html new file mode 100644 index 0000000..d3964e4 --- /dev/null +++ b/include/asio/doc/asio/reference/read_at.html @@ -0,0 +1,140 @@ + + + +read_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The read_at function is a composed + operation that reads a certain amount of data at the specified offset before + returning. +

+

+ Attempt to read a certain amount of data at the specified offset before returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition);
+  » more...
+
+template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b);
+  » more...
+
+template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+  » more...
+
+template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/read_at.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload1.html b/include/asio/doc/asio/reference/read_at/overload1.html new file mode 100644 index 0000000..7da91f7 --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload1.html @@ -0,0 +1,138 @@ + + + +read_at (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the device. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::read_at(d, 42, asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read_at(
+    d, 42, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload2.html b/include/asio/doc/asio/reference/read_at/overload2.html new file mode 100644 index 0000000..e461c80 --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload2.html @@ -0,0 +1,131 @@ + + + +read_at (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the device. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::read_at(d, 42,
+    asio::buffer(data, size), ec);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read_at(
+    d, 42, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload3.html b/include/asio/doc/asio/reference/read_at/overload3.html new file mode 100644 index 0000000..281fc5e --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload3.html @@ -0,0 +1,150 @@ + + + +read_at (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the device. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the device's read_some_at function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
asio::read_at(d, 42, asio::buffer(data, size),
+    asio::transfer_at_least(32));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload4.html b/include/asio/doc/asio/reference/read_at/overload4.html new file mode 100644 index 0000000..0c2dbca --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload4.html @@ -0,0 +1,127 @@ + + + +read_at (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename MutableBufferSequence,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
    +
  • + The supplied buffers are full. That is, the bytes transferred is equal + to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. The sum of + the buffer sizes indicates the maximum number of bytes to read from + the device. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the device's read_some_at function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload5.html b/include/asio/doc/asio/reference/read_at/overload5.html new file mode 100644 index 0000000..c0b75a4 --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload5.html @@ -0,0 +1,116 @@ + + + +read_at (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
  • + An error occurred. +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read_at(
+    d, 42, b,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload6.html b/include/asio/doc/asio/reference/read_at/overload6.html new file mode 100644 index 0000000..8e902d3 --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload6.html @@ -0,0 +1,108 @@ + + + +read_at (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
  • + An error occurred. +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::read_at(
+    d, 42, b,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload7.html b/include/asio/doc/asio/reference/read_at/overload7.html new file mode 100644 index 0000000..00a504a --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload7.html @@ -0,0 +1,127 @@ + + + +read_at (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
  • + The completion_condition function object returns 0. +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the device's read_some_at function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_at/overload8.html b/include/asio/doc/asio/reference/read_at/overload8.html new file mode 100644 index 0000000..e1bd20f --- /dev/null +++ b/include/asio/doc/asio/reference/read_at/overload8.html @@ -0,0 +1,120 @@ + + + +read_at (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Attempt to read a certain amount of data at the specified offset before + returning. +

+
template<
+    typename SyncRandomAccessReadDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t read_at(
+    SyncRandomAccessReadDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+
+

+ This function is used to read a certain number of bytes of data from a + random access device at the specified offset. The call will block until + one of the following conditions is true: +

+
  • + The completion_condition function object returns 0. +
+

+ This operation is implemented in terms of zero or more calls to the device's + read_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device from which the data is to be read. The type must support + the SyncRandomAccessReadDevice concept. +

+
offset
+

+ The offset at which the data will be read. +

+
b
+

+ The basic_streambuf + object into which the data will be read. +

+
completion_condition
+
+

+ The function object to be called to determine whether the read operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest read_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the read operation is complete. + A non-zero return value indicates the maximum number of bytes to + be read on the next call to the device's read_some_at function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until.html b/include/asio/doc/asio/reference/read_until.html new file mode 100644 index 0000000..219949c --- /dev/null +++ b/include/asio/doc/asio/reference/read_until.html @@ -0,0 +1,338 @@ + + + +read_until + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The read_until function is + a composed operation that reads data into a dynamic buffer sequence, or into + a streambuf, until it contains a delimiter, matches a regular expression, + or a function object indicates a match. +

+

+ Read data into a dynamic buffer sequence until it contains a specified delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    char delim,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    char delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    string_view delim,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    string_view delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Read data into a dynamic buffer sequence until some part of the data it contains + matches a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    const boost::regex & expr,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    const boost::regex & expr,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Read data into a dynamic buffer sequence until a function object indicates + a match. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    MatchCondition match_condition,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    MatchCondition match_condition,
+    asio::error_code & ec,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Read data into a streambuf until it contains a specified delimiter. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    char delim);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    char delim,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    string_view delim);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    string_view delim,
+    asio::error_code & ec);
+  » more...
+
+

+ Read data into a streambuf until some part of the data it contains matches + a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    const boost::regex & expr);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    const boost::regex & expr,
+    asio::error_code & ec);
+  » more...
+
+

+ Read data into a streambuf until a function object indicates a match. +

+
template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    MatchCondition match_condition,
+    typename enable_if< is_match_condition< MatchCondition >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    MatchCondition match_condition,
+    asio::error_code & ec,
+    typename enable_if< is_match_condition< MatchCondition >::value >::type *  = 0);
+  » more...
+
+

+ Read data into a dynamic buffer sequence until it contains a specified delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    char delim,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    char delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    string_view delim,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    string_view delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+

+ Read data into a dynamic buffer sequence until some part of the data it contains + matches a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    const boost::regex & expr,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    const boost::regex & expr,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+

+ Read data into a dynamic buffer sequence until a function object indicates + a match. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    MatchCondition match_condition,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    MatchCondition match_condition,
+    asio::error_code & ec,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/read_until.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload1.html b/include/asio/doc/asio/reference/read_until/overload1.html new file mode 100644 index 0000000..82a1e2a --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload1.html @@ -0,0 +1,159 @@ + + + +read_until (1 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    char delim,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter character. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + Example +
+

+ To read data into a std::string until a newline is encountered: +

+
std::string data;
+std::size_t n = asio::read_until(s,
+    asio::dynamic_buffer(data), '\n');
+std::string line = data.substr(0, n);
+data.erase(0, n);
+
+

+ After the read_until operation completes successfully, the + string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload10.html b/include/asio/doc/asio/reference/read_until/overload10.html new file mode 100644 index 0000000..484aa56 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload10.html @@ -0,0 +1,112 @@ + + + +read_until (10 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until it contains a specified delimiter. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    char delim,
+    asio::error_code & ec);
+
+

+ This function is used to read data into the specified streambuf until the + streambuf's get area contains the specified delimiter. The call will block + until one of the following conditions is true: +

+
    +
  • + The get area of the streambuf contains the specified delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the streambuf's get area already contains the delimiter, + the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
delim
+

+ The delimiter character. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area up to and including the + delimiter. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond the delimiter. An application will typically leave that data + in the streambuf for a subsequent read_until operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload11.html b/include/asio/doc/asio/reference/read_until/overload11.html new file mode 100644 index 0000000..d2f5b64 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload11.html @@ -0,0 +1,155 @@ + + + +read_until (11 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until it contains a specified delimiter. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    string_view delim);
+
+

+ This function is used to read data into the specified streambuf until the + streambuf's get area contains the specified delimiter. The call will block + until one of the following conditions is true: +

+
    +
  • + The get area of the streambuf contains the specified delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the streambuf's get area already contains the delimiter, + the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
delim
+

+ The delimiter string. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area up to and including the + delimiter. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond the delimiter. An application will typically leave that data + in the streambuf for a subsequent read_until operation to examine. +

+
+ + Example +
+

+ To read data into a streambuf until a newline is encountered: +

+
asio::streambuf b;
+asio::read_until(s, b, "\r\n");
+std::istream is(&b);
+std::string line;
+std::getline(is, line);
+
+

+ After the read_until operation completes successfully, the + buffer b contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to std::getline then extracts the data up to and + including the newline (which is discarded), so that the string line + contains: +

+
{ 'a', 'b', ..., 'c', '\r' }
+
+

+ The remaining data is left in the buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload12.html b/include/asio/doc/asio/reference/read_until/overload12.html new file mode 100644 index 0000000..b3317eb --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload12.html @@ -0,0 +1,112 @@ + + + +read_until (12 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until it contains a specified delimiter. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    string_view delim,
+    asio::error_code & ec);
+
+

+ This function is used to read data into the specified streambuf until the + streambuf's get area contains the specified delimiter. The call will block + until one of the following conditions is true: +

+
    +
  • + The get area of the streambuf contains the specified delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the streambuf's get area already contains the delimiter, + the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
delim
+

+ The delimiter string. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area up to and including the + delimiter. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond the delimiter. An application will typically leave that data + in the streambuf for a subsequent read_until operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload13.html b/include/asio/doc/asio/reference/read_until/overload13.html new file mode 100644 index 0000000..4fdcecc --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload13.html @@ -0,0 +1,157 @@ + + + +read_until (13 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until some part of the data it contains matches + a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    const boost::regex & expr);
+
+

+ This function is used to read data into the specified streambuf until the + streambuf's get area contains some data that matches a regular expression. + The call will block until one of the following conditions is true: +

+
    +
  • + A substring of the streambuf's get area matches the regular expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the streambuf's get area already contains data that + matches the regular expression, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
expr
+

+ The regular expression. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area up to and including the + substring that matches the regular expression. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond that which matched the regular expression. An application will + typically leave that data in the streambuf for a subsequent read_until + operation to examine. +

+
+ + Example +
+

+ To read data into a streambuf until a CR-LF sequence is encountered: +

+
asio::streambuf b;
+asio::read_until(s, b, boost::regex("\r\n"));
+std::istream is(&b);
+std::string line;
+std::getline(is, line);
+
+

+ After the read_until operation completes successfully, the + buffer b contains the data which matched the regular expression: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to std::getline then extracts the data up to and + including the newline (which is discarded), so that the string line + contains: +

+
{ 'a', 'b', ..., 'c', '\r' }
+
+

+ The remaining data is left in the buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload14.html b/include/asio/doc/asio/reference/read_until/overload14.html new file mode 100644 index 0000000..9c2f839 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload14.html @@ -0,0 +1,114 @@ + + + +read_until (14 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until some part of the data it contains matches + a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    const boost::regex & expr,
+    asio::error_code & ec);
+
+

+ This function is used to read data into the specified streambuf until the + streambuf's get area contains some data that matches a regular expression. + The call will block until one of the following conditions is true: +

+
    +
  • + A substring of the streambuf's get area matches the regular expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the streambuf's get area already contains data that + matches the regular expression, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
expr
+

+ The regular expression. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area up to and including the + substring that matches the regular expression. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond that which matched the regular expression. An application will + typically leave that data in the streambuf for a subsequent read_until + operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload15.html b/include/asio/doc/asio/reference/read_until/overload15.html new file mode 100644 index 0000000..9fd723b --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload15.html @@ -0,0 +1,205 @@ + + + +read_until (15 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until a function object indicates a match. +

+
template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    MatchCondition match_condition,
+    typename enable_if< is_match_condition< MatchCondition >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified streambuf until a + user-defined match condition function object, when applied to the data + contained in the streambuf, indicates a successful match. The call will + block until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the match condition function object already indicates + a match, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area that have been fully consumed + by the match function. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond that which matched the function object. An application will + typically leave that data in the streambuf for a subsequent read_until + operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + Examples +
+

+ To read data into a streambuf until whitespace is encountered: +

+
typedef asio::buffers_iterator<
+    asio::streambuf::const_buffers_type> iterator;
+
+std::pair<iterator, bool>
+match_whitespace(iterator begin, iterator end)
+{
+  iterator i = begin;
+  while (i != end)
+    if (std::isspace(*i++))
+      return std::make_pair(i, true);
+  return std::make_pair(i, false);
+}
+...
+asio::streambuf b;
+asio::read_until(s, b, match_whitespace);
+
+

+ To read data into a streambuf until a matching character is found: +

+
class match_char
+{
+public:
+  explicit match_char(char c) : c_(c) {}
+
+  template <typename Iterator>
+  std::pair<Iterator, bool> operator()(
+      Iterator begin, Iterator end) const
+  {
+    Iterator i = begin;
+    while (i != end)
+      if (c_ == *i++)
+        return std::make_pair(i, true);
+    return std::make_pair(i, false);
+  }
+
+private:
+  char c_;
+};
+
+namespace asio {
+  template <> struct is_match_condition<match_char>
+    : public boost::true_type {};
+} // namespace asio
+...
+asio::streambuf b;
+asio::read_until(s, b, match_char('a'));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload16.html b/include/asio/doc/asio/reference/read_until/overload16.html new file mode 100644 index 0000000..e9d377a --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload16.html @@ -0,0 +1,143 @@ + + + +read_until (16 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until a function object indicates a match. +

+
template<
+    typename SyncReadStream,
+    typename Allocator,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    MatchCondition match_condition,
+    asio::error_code & ec,
+    typename enable_if< is_match_condition< MatchCondition >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified streambuf until a + user-defined match condition function object, when applied to the data + contained in the streambuf, indicates a successful match. The call will + block until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the match condition function object already indicates + a match, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area that have been fully consumed + by the match function. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond that which matched the function object. An application will + typically leave that data in the streambuf for a subsequent read_until + operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload17.html b/include/asio/doc/asio/reference/read_until/overload17.html new file mode 100644 index 0000000..17adc74 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload17.html @@ -0,0 +1,159 @@ + + + +read_until (17 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    char delim,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter character. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + Example +
+

+ To read data into a std::string until a newline is encountered: +

+
std::string data;
+std::size_t n = asio::read_until(s,
+    asio::dynamic_buffer(data), '\n');
+std::string line = data.substr(0, n);
+data.erase(0, n);
+
+

+ After the read_until operation completes successfully, the + string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload18.html b/include/asio/doc/asio/reference/read_until/overload18.html new file mode 100644 index 0000000..992af50 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload18.html @@ -0,0 +1,116 @@ + + + +read_until (18 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    char delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter character. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload19.html b/include/asio/doc/asio/reference/read_until/overload19.html new file mode 100644 index 0000000..9654866 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload19.html @@ -0,0 +1,147 @@ + + + +read_until (19 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    string_view delim,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter string. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + Example +
+

+ To read data into a std::string until a CR-LF sequence is + encountered: +

+
std::string data;
+std::size_t n = asio::read_until(s,
+    asio::dynamic_buffer(data), "\r\n");
+std::string line = data.substr(0, n);
+data.erase(0, n);
+
+

+ After the read_until operation completes successfully, the + string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload2.html b/include/asio/doc/asio/reference/read_until/overload2.html new file mode 100644 index 0000000..d88bdf8 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload2.html @@ -0,0 +1,116 @@ + + + +read_until (2 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    char delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter character. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload20.html b/include/asio/doc/asio/reference/read_until/overload20.html new file mode 100644 index 0000000..b7e9f9c --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload20.html @@ -0,0 +1,116 @@ + + + +read_until (20 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    string_view delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter string. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload21.html b/include/asio/doc/asio/reference/read_until/overload21.html new file mode 100644 index 0000000..0e5cdd0 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload21.html @@ -0,0 +1,161 @@ + + + +read_until (21 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until some part of the data it + contains matches a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    const boost::regex & expr,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains some data that matches + a regular expression. The call will block until one of the following conditions + is true: +

+
    +
  • + A substring of the dynamic buffer sequence's get area matches the regular + expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + data that matches the regular expression, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
expr
+

+ The regular expression. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the substring that matches the regular expression. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the regular expression. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+
+ + Example +
+

+ To read data into a std::string until a CR-LF sequence is + encountered: +

+
std::string data;
+std::size_t n = asio::read_until(s,
+    asio::dynamic_buffer(data), boost::regex("\r\n"));
+std::string line = data.substr(0, n);
+data.erase(0, n);
+
+

+ After the read_until operation completes successfully, the + string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload22.html b/include/asio/doc/asio/reference/read_until/overload22.html new file mode 100644 index 0000000..4d7bda8 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload22.html @@ -0,0 +1,118 @@ + + + +read_until (22 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until some part of the data it + contains matches a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    const boost::regex & expr,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains some data that matches + a regular expression. The call will block until one of the following conditions + is true: +

+
    +
  • + A substring of the dynamic buffer sequence's get area matches the regular + expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + data that matches the regular expression, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
expr
+

+ The regular expression. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the substring that matches the regular expression. Returns 0 + if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the regular expression. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload23.html b/include/asio/doc/asio/reference/read_until/overload23.html new file mode 100644 index 0000000..e9188bc --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload23.html @@ -0,0 +1,207 @@ + + + +read_until (23 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until a function object indicates + a match. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    MatchCondition match_condition,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until a user-defined match condition function object, when applied to the + data contained in the dynamic buffer sequence, indicates a successful match. + The call will block until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the match condition function object already indicates + a match, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<typename DynamicBuffer_v2::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic_buffer's get area that have been fully + consumed by the match function. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the function object. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + Examples +
+

+ To read data into a dynamic buffer sequence until whitespace is encountered: +

+
typedef asio::buffers_iterator<
+    asio::const_buffers_1> iterator;
+
+std::pair<iterator, bool>
+match_whitespace(iterator begin, iterator end)
+{
+  iterator i = begin;
+  while (i != end)
+    if (std::isspace(*i++))
+      return std::make_pair(i, true);
+  return std::make_pair(i, false);
+}
+...
+std::string data;
+asio::read_until(s, data, match_whitespace);
+
+

+ To read data into a std::string until a matching character + is found: +

+
class match_char
+{
+public:
+  explicit match_char(char c) : c_(c) {}
+
+  template <typename Iterator>
+  std::pair<Iterator, bool> operator()(
+      Iterator begin, Iterator end) const
+  {
+    Iterator i = begin;
+    while (i != end)
+      if (c_ == *i++)
+        return std::make_pair(i, true);
+    return std::make_pair(i, false);
+  }
+
+private:
+  char c_;
+};
+
+namespace asio {
+  template <> struct is_match_condition<match_char>
+    : public boost::true_type {};
+} // namespace asio
+...
+std::string data;
+asio::read_until(s, data, match_char('a'));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload24.html b/include/asio/doc/asio/reference/read_until/overload24.html new file mode 100644 index 0000000..613d5db --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload24.html @@ -0,0 +1,144 @@ + + + +read_until (24 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until a function object indicates + a match. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v2,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v2 buffers,
+    MatchCondition match_condition,
+    asio::error_code & ec,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until a user-defined match condition function object, when applied to the + data contained in the dynamic buffer sequence, indicates a successful match. + The call will block until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the match condition function object already indicates + a match, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<DynamicBuffer_v2::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area that have + been fully consumed by the match function. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the function object. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload3.html b/include/asio/doc/asio/reference/read_until/overload3.html new file mode 100644 index 0000000..056d691 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload3.html @@ -0,0 +1,147 @@ + + + +read_until (3 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    string_view delim,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter string. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + Example +
+

+ To read data into a std::string until a CR-LF sequence is + encountered: +

+
std::string data;
+std::size_t n = asio::read_until(s,
+    asio::dynamic_buffer(data), "\r\n");
+std::string line = data.substr(0, n);
+data.erase(0, n);
+
+

+ After the read_until operation completes successfully, the + string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload4.html b/include/asio/doc/asio/reference/read_until/overload4.html new file mode 100644 index 0000000..32eb362 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload4.html @@ -0,0 +1,116 @@ + + + +read_until (4 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until it contains a specified + delimiter. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    string_view delim,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains the specified delimiter. + The call will block until one of the following conditions is true: +

+
    +
  • + The get area of the dynamic buffer sequence contains the specified + delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + the delimiter, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ The dynamic buffer sequence into which the data will be read. +

+
delim
+

+ The delimiter string. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the delimiter. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond the delimiter. An application will typically + leave that data in the dynamic buffer sequence for a subsequent read_until + operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload5.html b/include/asio/doc/asio/reference/read_until/overload5.html new file mode 100644 index 0000000..a343b65 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload5.html @@ -0,0 +1,161 @@ + + + +read_until (5 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until some part of the data it + contains matches a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    const boost::regex & expr,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains some data that matches + a regular expression. The call will block until one of the following conditions + is true: +

+
    +
  • + A substring of the dynamic buffer sequence's get area matches the regular + expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + data that matches the regular expression, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
expr
+

+ The regular expression. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the substring that matches the regular expression. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the regular expression. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+
+ + Example +
+

+ To read data into a std::string until a CR-LF sequence is + encountered: +

+
std::string data;
+std::size_t n = asio::read_until(s,
+    asio::dynamic_buffer(data), boost::regex("\r\n"));
+std::string line = data.substr(0, n);
+data.erase(0, n);
+
+

+ After the read_until operation completes successfully, the + string data contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+

+ The call to substr then extracts the data up to and including + the delimiter, so that the string line contains: +

+
{ 'a', 'b', ..., 'c', '\r', '\n' }
+
+

+ After the call to erase, the remaining data is left in the + buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload6.html b/include/asio/doc/asio/reference/read_until/overload6.html new file mode 100644 index 0000000..ef1a7b3 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload6.html @@ -0,0 +1,118 @@ + + + +read_until (6 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until some part of the data it + contains matches a regular expression. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    const boost::regex & expr,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until the dynamic buffer sequence's get area contains some data that matches + a regular expression. The call will block until one of the following conditions + is true: +

+
    +
  • + A substring of the dynamic buffer sequence's get area matches the regular + expression. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the dynamic buffer sequence's get area already contains + data that matches the regular expression, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
expr
+

+ The regular expression. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area up to and + including the substring that matches the regular expression. Returns 0 + if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the regular expression. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload7.html b/include/asio/doc/asio/reference/read_until/overload7.html new file mode 100644 index 0000000..10f14e6 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload7.html @@ -0,0 +1,207 @@ + + + +read_until (7 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until a function object indicates + a match. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    MatchCondition match_condition,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until a user-defined match condition function object, when applied to the + data contained in the dynamic buffer sequence, indicates a successful match. + The call will block until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the match condition function object already indicates + a match, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<typename DynamicBuffer_v1::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic_buffer's get area that have been fully + consumed by the match function. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the function object. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + Examples +
+

+ To read data into a dynamic buffer sequence until whitespace is encountered: +

+
typedef asio::buffers_iterator<
+    asio::const_buffers_1> iterator;
+
+std::pair<iterator, bool>
+match_whitespace(iterator begin, iterator end)
+{
+  iterator i = begin;
+  while (i != end)
+    if (std::isspace(*i++))
+      return std::make_pair(i, true);
+  return std::make_pair(i, false);
+}
+...
+std::string data;
+asio::read_until(s, data, match_whitespace);
+
+

+ To read data into a std::string until a matching character + is found: +

+
class match_char
+{
+public:
+  explicit match_char(char c) : c_(c) {}
+
+  template <typename Iterator>
+  std::pair<Iterator, bool> operator()(
+      Iterator begin, Iterator end) const
+  {
+    Iterator i = begin;
+    while (i != end)
+      if (c_ == *i++)
+        return std::make_pair(i, true);
+    return std::make_pair(i, false);
+  }
+
+private:
+  char c_;
+};
+
+namespace asio {
+  template <> struct is_match_condition<match_char>
+    : public boost::true_type {};
+} // namespace asio
+...
+std::string data;
+asio::read_until(s, data, match_char('a'));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload8.html b/include/asio/doc/asio/reference/read_until/overload8.html new file mode 100644 index 0000000..538505e --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload8.html @@ -0,0 +1,144 @@ + + + +read_until (8 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a dynamic buffer sequence until a function object indicates + a match. +

+
template<
+    typename SyncReadStream,
+    typename DynamicBuffer_v1,
+    typename MatchCondition>
+std::size_t read_until(
+    SyncReadStream & s,
+    DynamicBuffer_v1 && buffers,
+    MatchCondition match_condition,
+    asio::error_code & ec,
+    typename enable_if< is_match_condition< MatchCondition >::value &&is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to read data into the specified dynamic buffer sequence + until a user-defined match condition function object, when applied to the + data contained in the dynamic buffer sequence, indicates a successful match. + The call will block until one of the following conditions is true: +

+
    +
  • + The match condition function object returns a std::pair where the second + element evaluates to true. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the match condition function object already indicates + a match, the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
buffers
+

+ A dynamic buffer sequence into which the data will be read. +

+
match_condition
+
+

+ The function object to be called to determine whether a match exists. + The signature of the function object must be: +

+
pair<iterator, bool> match_condition(iterator begin, iterator end);
+
+

+ where iterator represents the type: +

+
buffers_iterator<DynamicBuffer_v1::const_buffers_type>
+
+

+ The iterator parameters begin and end define + the range of bytes to be scanned to determine whether there is a + match. The first member of the return value is an iterator + marking one-past-the-end of the bytes that have been consumed by + the match function. This iterator is used to calculate the begin + parameter for any subsequent invocation of the match condition. The + second member of the return value is true if a match + has been found, false otherwise. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the dynamic buffer sequence's get area that have + been fully consumed by the match function. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ After a successful read_until operation, the dynamic buffer sequence may + contain additional data beyond that which matched the function object. + An application will typically leave that data in the dynamic buffer sequence + for a subsequent read_until operation to examine. +

+

+ The default implementation of the is_match_condition type + trait evaluates to true for function pointers and function objects with + a result_type typedef. It must be specialised for other user-defined + function objects. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_until/overload9.html b/include/asio/doc/asio/reference/read_until/overload9.html new file mode 100644 index 0000000..381db38 --- /dev/null +++ b/include/asio/doc/asio/reference/read_until/overload9.html @@ -0,0 +1,155 @@ + + + +read_until (9 of 24 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read data into a streambuf until it contains a specified delimiter. +

+
template<
+    typename SyncReadStream,
+    typename Allocator>
+std::size_t read_until(
+    SyncReadStream & s,
+    asio::basic_streambuf< Allocator > & b,
+    char delim);
+
+

+ This function is used to read data into the specified streambuf until the + streambuf's get area contains the specified delimiter. The call will block + until one of the following conditions is true: +

+
    +
  • + The get area of the streambuf contains the specified delimiter. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + read_some function. If the streambuf's get area already contains the delimiter, + the function returns immediately. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream from which the data is to be read. The type must support + the SyncReadStream concept. +

+
b
+

+ A streambuf object into which the data will be read. +

+
delim
+

+ The delimiter character. +

+
+
+
+ + Return + Value +
+

+ The number of bytes in the streambuf's get area up to and including the + delimiter. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ After a successful read_until operation, the streambuf may contain additional + data beyond the delimiter. An application will typically leave that data + in the streambuf for a subsequent read_until operation to examine. +

+
+ + Example +
+

+ To read data into a streambuf until a newline is encountered: +

+
asio::streambuf b;
+asio::read_until(s, b, '\n');
+std::istream is(&b);
+std::string line;
+std::getline(is, line);
+
+

+ After the read_until operation completes successfully, the + buffer b contains the delimiter: +

+
{ 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
+
+

+ The call to std::getline then extracts the data up to and + including the newline (which is discarded), so that the string line + contains: +

+
{ 'a', 'b', ..., 'c' }
+
+

+ The remaining data is left in the buffer b as follows: +

+
{ 'd', 'e', ... }
+
+

+ This data may be the start of a new line, to be extracted by a subsequent + read_until operation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/read_write_operations.html b/include/asio/doc/asio/reference/read_write_operations.html new file mode 100644 index 0000000..179e030 --- /dev/null +++ b/include/asio/doc/asio/reference/read_write_operations.html @@ -0,0 +1,68 @@ + + + +Requirements on read and write operations + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A read operation is an operation that reads data into + a mutable buffer sequence argument of a type meeting MutableBufferSequence + requirements. The mutable buffer sequence specifies memory where the data + should be placed. A read operation shall always fill a buffer in the sequence + completely before proceeding to the next. +

+

+ A write operation is an operation that writes data from + a constant buffer sequence argument of a type meeting ConstBufferSequence + requirements. The constant buffer sequence specifies memory where the data + to be written is located. A write operation shall always write a buffer in + the sequence completely before proceeding to the next. +

+

+ If a read or write operation is also an asynchronous + operation, the operation shall maintain one or more copies of the + buffer sequence until such time as the operation no longer requires access + to the memory specified by the buffers in the sequence. The program shall + ensure the memory remains valid until: +

+

+ — the last copy of the buffer sequence is destroyed, or +

+

+ — the completion handler for the asynchronous operation is invoked, +

+

+ whichever comes first. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/redirect_error.html b/include/asio/doc/asio/reference/redirect_error.html new file mode 100644 index 0000000..e2165b0 --- /dev/null +++ b/include/asio/doc/asio/reference/redirect_error.html @@ -0,0 +1,59 @@ + + + +redirect_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Create a completion token to capture + error_code + values to a variable. +

+
template<
+    typename CompletionToken>
+redirect_error_t< typename decay< CompletionToken >::type > redirect_error(
+    CompletionToken && completion_token,
+    asio::error_code & ec);
+
+
+ + Requirements +
+

+ Header: asio/redirect_error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/redirect_error_t.html b/include/asio/doc/asio/reference/redirect_error_t.html new file mode 100644 index 0000000..78f4bd0 --- /dev/null +++ b/include/asio/doc/asio/reference/redirect_error_t.html @@ -0,0 +1,139 @@ + + + +redirect_error_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Completion token type used to specify that an error produced by an asynchronous + operation is captured to an error_code + variable. +

+
template<
+    typename CompletionToken>
+class redirect_error_t
+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ redirect_error_t [constructor] +

+
+

+ Constructor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ec_ +

+
+
+

+ token_ +

+
+
+

+ The redirect_error_t + class is used to indicate that any error_code + produced by an asynchronous operation is captured to a specified variable. +

+
+ + Requirements +
+

+ Header: asio/redirect_error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/redirect_error_t/ec_.html b/include/asio/doc/asio/reference/redirect_error_t/ec_.html new file mode 100644 index 0000000..5b6847d --- /dev/null +++ b/include/asio/doc/asio/reference/redirect_error_t/ec_.html @@ -0,0 +1,42 @@ + + + +redirect_error_t::ec_ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
asio::error_code & ec_;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/redirect_error_t/redirect_error_t.html b/include/asio/doc/asio/reference/redirect_error_t/redirect_error_t.html new file mode 100644 index 0000000..3ed991f --- /dev/null +++ b/include/asio/doc/asio/reference/redirect_error_t/redirect_error_t.html @@ -0,0 +1,47 @@ + + + +redirect_error_t::redirect_error_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
template<
+    typename T>
+redirect_error_t(
+    T && completion_token,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/redirect_error_t/token_.html b/include/asio/doc/asio/reference/redirect_error_t/token_.html new file mode 100644 index 0000000..1b314c1 --- /dev/null +++ b/include/asio/doc/asio/reference/redirect_error_t/token_.html @@ -0,0 +1,42 @@ + + + +redirect_error_t::token_ + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
CompletionToken token_;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/require.html b/include/asio/doc/asio/reference/require.html new file mode 100644 index 0000000..0437bf0 --- /dev/null +++ b/include/asio/doc/asio/reference/require.html @@ -0,0 +1,92 @@ + + + +require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point that applies a concept-preserving + property to an object. +

+
constexpr unspecified require = unspecified;
+
+

+ The name require denotes a customisation point object. The expression + asio::require(E, P0, Pn...) for some subexpressions E + and P0, and where Pn... represents N + subexpressions (where N is 0 or more, and with types T + = decay_t<decltype(E)> and Prop0 = decay_t<decltype(P0)>) + is expression-equivalent to: +

+
    +
  • + If is_applicable_property_v<T, Prop0> && Prop0::is_requirable + is not a well-formed constant expression with value true, + asio::require(E, P0, Pn...) is ill-formed. +
  • +
  • + Otherwise, E if N == 0 and the expression + Prop0::template static_query_v<T> == Prop0::value() + is a well-formed constant expression with value true. +
  • +
  • + Otherwise, (E).require(P0) if N == 0 and the + expression (E).require(P0) is a valid expression. +
  • +
  • + Otherwise, require(E, P0) if N == 0 and the + expression require(E, P0) is a valid expression with overload + resolution performed in a context that does not include the declaration + of the require customization point object. +
  • +
  • + Otherwise, asio::require(asio::require(E, P0), Pn...) if + N > 0 and the expression asio::require(asio::require(E, + P0), Pn...) is a valid expression. +
  • +
  • + Otherwise, asio::require(E, P0, Pn...) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/require.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/require_concept.html b/include/asio/doc/asio/reference/require_concept.html new file mode 100644 index 0000000..34b85c2 --- /dev/null +++ b/include/asio/doc/asio/reference/require_concept.html @@ -0,0 +1,86 @@ + + + +require_concept + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A customisation point that applies + a concept-enforcing property to an object. +

+
constexpr unspecified require_concept = unspecified;
+
+

+ The name require_concept denotes a customization point object. + The expression asio::require_concept(E, P) for some subexpressions + E and P (with types T = decay_t<decltype(E)> + and Prop = decay_t<decltype(P)>) is expression-equivalent + to: +

+
    +
  • + If is_applicable_property_v<T, Prop> && Prop::is_requirable_concept + is not a well-formed constant expression with value true, + asio::require_concept(E, P) is ill-formed. +
  • +
  • + Otherwise, E if the expression Prop::template static_query_v<T> + == Prop::value() is a well-formed constant expression with value + true. +
  • +
  • + Otherwise, (E).require_concept(P) if the expression (E).require_concept(P) + is well-formed. +
  • +
  • + Otherwise, require_concept(E, P) if the expression require_concept(E, + P) is a valid expression with overload resolution performed in + a context that does not include the declaration of the require_concept + customization point object. +
  • +
  • + Otherwise, asio::require_concept(E, P) is ill-formed. +
  • +
+
+ + Requirements +
+

+ Header: asio/require_concept.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/require_concept_result.html b/include/asio/doc/asio/reference/require_concept_result.html new file mode 100644 index 0000000..1af3b0f --- /dev/null +++ b/include/asio/doc/asio/reference/require_concept_result.html @@ -0,0 +1,95 @@ + + + +require_concept_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines the result type of a require_concept + expression. +

+
template<
+    typename T,
+    typename Property>
+struct require_concept_result
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ The result of the require_concept expression. +

+
+

+ Class template require_concept_result is a trait that determines + the result type of the expression asio::require_concept(std::declval<T>(), + std::declval<Property>()). +

+
+ + Requirements +
+

+ Header: asio/require_concept.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/require_concept_result/type.html b/include/asio/doc/asio/reference/require_concept_result/type.html new file mode 100644 index 0000000..d38af39 --- /dev/null +++ b/include/asio/doc/asio/reference/require_concept_result/type.html @@ -0,0 +1,54 @@ + + + +require_concept_result::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + result of the require_concept expression. +

+
typedef automatically_determined type;
+
+
+ + Requirements +
+

+ Header: asio/require_concept.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/require_result.html b/include/asio/doc/asio/reference/require_result.html new file mode 100644 index 0000000..80d70f9 --- /dev/null +++ b/include/asio/doc/asio/reference/require_result.html @@ -0,0 +1,94 @@ + + + +require_result + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A type trait that determines the result type of a require expression. +

+
template<
+    typename T,
+    typename... Properties>
+struct require_result
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+

+ The result of the require expression. +

+
+

+ Class template require_result is a trait that determines the + result type of the expression asio::require(std::declval<T>(), + std::declval<Properties>()...). +

+
+ + Requirements +
+

+ Header: asio/require.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/require_result/type.html b/include/asio/doc/asio/reference/require_result/type.html new file mode 100644 index 0000000..0415f74 --- /dev/null +++ b/include/asio/doc/asio/reference/require_result/type.html @@ -0,0 +1,54 @@ + + + +require_result::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The result of the + require expression. +

+
typedef automatically_determined type;
+
+
+ + Requirements +
+

+ Header: asio/require.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/resolver_errc__try_again.html b/include/asio/doc/asio/reference/resolver_errc__try_again.html new file mode 100644 index 0000000..dc9bbc3 --- /dev/null +++ b/include/asio/doc/asio/reference/resolver_errc__try_again.html @@ -0,0 +1,52 @@ + + + +resolver_errc::try_again + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const error::netdb_errors try_again = error::host_not_found_try_again;
+
+
+ + Requirements +
+

+ Header: asio/error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port.html b/include/asio/doc/asio/reference/serial_port.html new file mode 100644 index 0000000..2c81635 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port.html @@ -0,0 +1,386 @@ + + + +serial_port + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for the typical usage of a serial + port. +

+
typedef basic_serial_port serial_port;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the serial port type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ A basic_basic_serial_port is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a serial port. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native serial port to the serial port. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_serial_port [constructor] +

+
+

+ Construct a basic_serial_port without opening it.
—
+ Construct and open a basic_serial_port.
—
Construct + a basic_serial_port on an existing native serial port.
— +
Move-construct a basic_serial_port from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the serial port. +

+
+

+ close +

+
+

+ Close the serial port. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ get_option +

+
+

+ Get an option from the serial port. +

+
+

+ is_open +

+
+

+ Determine whether the serial port is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native serial port representation. +

+
+

+ open +

+
+

+ Open the serial port using the specified device name. +

+
+

+ operator= +

+
+

+ Move-assign a basic_serial_port from another. +

+
+

+ read_some +

+
+

+ Read some data from the serial port. +

+
+

+ send_break +

+
+

+ Send a break sequence to the serial port. +

+
+

+ set_option +

+
+

+ Set an option on the serial port. +

+
+

+ write_some +

+
+

+ Write some data to the serial port. +

+
+

+ ~basic_serial_port [destructor] +

+
+

+ Destroys the serial port. +

+
+

+ The basic_serial_port + class provides a wrapper over serial port functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/serial_port.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base.html b/include/asio/doc/asio/reference/serial_port_base.html new file mode 100644 index 0000000..42758fe --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base.html @@ -0,0 +1,173 @@ + + + +serial_port_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The serial_port_base + class is used as a base for the basic_serial_port + class template so that we have a common place to define the serial port options. +

+
class serial_port_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ baud_rate +

+
+

+ Serial port option to permit changing the baud rate. +

+
+

+ character_size +

+
+

+ Serial port option to permit changing the character size. +

+
+

+ flow_control +

+
+

+ Serial port option to permit changing the flow control. +

+
+

+ parity +

+
+

+ Serial port option to permit changing the parity. +

+
+

+ stop_bits +

+
+

+ Serial port option to permit changing the number of stop bits. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~serial_port_base [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Requirements +
+

+ Header: asio/serial_port_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base/_serial_port_base.html b/include/asio/doc/asio/reference/serial_port_base/_serial_port_base.html new file mode 100644 index 0000000..392ca2c --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base/_serial_port_base.html @@ -0,0 +1,44 @@ + + + +serial_port_base::~serial_port_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~serial_port_base();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__baud_rate.html b/include/asio/doc/asio/reference/serial_port_base__baud_rate.html new file mode 100644 index 0000000..a2b774b --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__baud_rate.html @@ -0,0 +1,116 @@ + + + +serial_port_base::baud_rate + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Serial port option to permit changing the baud rate. +

+
class baud_rate
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ baud_rate [constructor] +

+
+
+

+ load +

+
+
+

+ store +

+
+
+

+ value +

+
+
+

+ Implements changing the baud rate for a given serial port. +

+
+ + Requirements +
+

+ Header: asio/serial_port_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__baud_rate/baud_rate.html b/include/asio/doc/asio/reference/serial_port_base__baud_rate/baud_rate.html new file mode 100644 index 0000000..c7178b2 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__baud_rate/baud_rate.html @@ -0,0 +1,43 @@ + + + +serial_port_base::baud_rate::baud_rate + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
baud_rate(
+    unsigned int rate = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__baud_rate/load.html b/include/asio/doc/asio/reference/serial_port_base__baud_rate/load.html new file mode 100644 index 0000000..d57f492 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__baud_rate/load.html @@ -0,0 +1,44 @@ + + + +serial_port_base::baud_rate::load + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void load(
+    const ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__baud_rate/store.html b/include/asio/doc/asio/reference/serial_port_base__baud_rate/store.html new file mode 100644 index 0000000..db492a2 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__baud_rate/store.html @@ -0,0 +1,44 @@ + + + +serial_port_base::baud_rate::store + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void store(
+    ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__baud_rate/value.html b/include/asio/doc/asio/reference/serial_port_base__baud_rate/value.html new file mode 100644 index 0000000..a514270 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__baud_rate/value.html @@ -0,0 +1,42 @@ + + + +serial_port_base::baud_rate::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
unsigned int value() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__character_size.html b/include/asio/doc/asio/reference/serial_port_base__character_size.html new file mode 100644 index 0000000..e48e920 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__character_size.html @@ -0,0 +1,116 @@ + + + +serial_port_base::character_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Serial port option to permit changing the character size. +

+
class character_size
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ character_size [constructor] +

+
+
+

+ load +

+
+
+

+ store +

+
+
+

+ value +

+
+
+

+ Implements changing the character size for a given serial port. +

+
+ + Requirements +
+

+ Header: asio/serial_port_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__character_size/character_size.html b/include/asio/doc/asio/reference/serial_port_base__character_size/character_size.html new file mode 100644 index 0000000..99b15c4 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__character_size/character_size.html @@ -0,0 +1,43 @@ + + + +serial_port_base::character_size::character_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
character_size(
+    unsigned int t = 8);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__character_size/load.html b/include/asio/doc/asio/reference/serial_port_base__character_size/load.html new file mode 100644 index 0000000..1c62419 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__character_size/load.html @@ -0,0 +1,44 @@ + + + +serial_port_base::character_size::load + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void load(
+    const ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__character_size/store.html b/include/asio/doc/asio/reference/serial_port_base__character_size/store.html new file mode 100644 index 0000000..15bff5d --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__character_size/store.html @@ -0,0 +1,44 @@ + + + +serial_port_base::character_size::store + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void store(
+    ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__character_size/value.html b/include/asio/doc/asio/reference/serial_port_base__character_size/value.html new file mode 100644 index 0000000..d7accc2 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__character_size/value.html @@ -0,0 +1,42 @@ + + + +serial_port_base::character_size::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
unsigned int value() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__flow_control.html b/include/asio/doc/asio/reference/serial_port_base__flow_control.html new file mode 100644 index 0000000..080c5d9 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__flow_control.html @@ -0,0 +1,147 @@ + + + +serial_port_base::flow_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Serial port option to permit changing the flow control. +

+
class flow_control
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ flow_control [constructor] +

+
+
+

+ load +

+
+
+

+ store +

+
+
+

+ value +

+
+
+

+ Implements changing the flow control for a given serial port. +

+
+ + Requirements +
+

+ Header: asio/serial_port_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__flow_control/flow_control.html b/include/asio/doc/asio/reference/serial_port_base__flow_control/flow_control.html new file mode 100644 index 0000000..ddcd4c6 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__flow_control/flow_control.html @@ -0,0 +1,43 @@ + + + +serial_port_base::flow_control::flow_control + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
flow_control(
+    type t = none);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__flow_control/load.html b/include/asio/doc/asio/reference/serial_port_base__flow_control/load.html new file mode 100644 index 0000000..5fa5d0f --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__flow_control/load.html @@ -0,0 +1,44 @@ + + + +serial_port_base::flow_control::load + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void load(
+    const ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__flow_control/store.html b/include/asio/doc/asio/reference/serial_port_base__flow_control/store.html new file mode 100644 index 0000000..1bd6c1c --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__flow_control/store.html @@ -0,0 +1,44 @@ + + + +serial_port_base::flow_control::store + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void store(
+    ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__flow_control/type.html b/include/asio/doc/asio/reference/serial_port_base__flow_control/type.html new file mode 100644 index 0000000..4cb90b2 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__flow_control/type.html @@ -0,0 +1,62 @@ + + + +serial_port_base::flow_control::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum type
+
+

+ + + +

+
+ + Values +
+
+

+
+
none
+
+
software
+
+
hardware
+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__flow_control/value.html b/include/asio/doc/asio/reference/serial_port_base__flow_control/value.html new file mode 100644 index 0000000..31449c6 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__flow_control/value.html @@ -0,0 +1,42 @@ + + + +serial_port_base::flow_control::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
type value() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__parity.html b/include/asio/doc/asio/reference/serial_port_base__parity.html new file mode 100644 index 0000000..d2f2bee --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__parity.html @@ -0,0 +1,147 @@ + + + +serial_port_base::parity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Serial port option to permit changing the parity. +

+
class parity
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ load +

+
+
+

+ parity [constructor] +

+
+
+

+ store +

+
+
+

+ value +

+
+
+

+ Implements changing the parity for a given serial port. +

+
+ + Requirements +
+

+ Header: asio/serial_port_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__parity/load.html b/include/asio/doc/asio/reference/serial_port_base__parity/load.html new file mode 100644 index 0000000..bc4ad3d --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__parity/load.html @@ -0,0 +1,44 @@ + + + +serial_port_base::parity::load + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void load(
+    const ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__parity/parity.html b/include/asio/doc/asio/reference/serial_port_base__parity/parity.html new file mode 100644 index 0000000..6c9f0f8 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__parity/parity.html @@ -0,0 +1,43 @@ + + + +serial_port_base::parity::parity + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
parity(
+    type t = none);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__parity/store.html b/include/asio/doc/asio/reference/serial_port_base__parity/store.html new file mode 100644 index 0000000..3a15619 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__parity/store.html @@ -0,0 +1,44 @@ + + + +serial_port_base::parity::store + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void store(
+    ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__parity/type.html b/include/asio/doc/asio/reference/serial_port_base__parity/type.html new file mode 100644 index 0000000..78673d1 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__parity/type.html @@ -0,0 +1,62 @@ + + + +serial_port_base::parity::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum type
+
+

+ + + +

+
+ + Values +
+
+

+
+
none
+
+
odd
+
+
even
+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__parity/value.html b/include/asio/doc/asio/reference/serial_port_base__parity/value.html new file mode 100644 index 0000000..e4183c4 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__parity/value.html @@ -0,0 +1,42 @@ + + + +serial_port_base::parity::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
type value() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__stop_bits.html b/include/asio/doc/asio/reference/serial_port_base__stop_bits.html new file mode 100644 index 0000000..bcc1429 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__stop_bits.html @@ -0,0 +1,147 @@ + + + +serial_port_base::stop_bits + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Serial port option to permit changing the number of stop bits. +

+
class stop_bits
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ type +

+
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ load +

+
+
+

+ stop_bits [constructor] +

+
+
+

+ store +

+
+
+

+ value +

+
+
+

+ Implements changing the number of stop bits for a given serial port. +

+
+ + Requirements +
+

+ Header: asio/serial_port_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__stop_bits/load.html b/include/asio/doc/asio/reference/serial_port_base__stop_bits/load.html new file mode 100644 index 0000000..4b9eeec --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__stop_bits/load.html @@ -0,0 +1,44 @@ + + + +serial_port_base::stop_bits::load + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void load(
+    const ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__stop_bits/stop_bits.html b/include/asio/doc/asio/reference/serial_port_base__stop_bits/stop_bits.html new file mode 100644 index 0000000..668acbe --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__stop_bits/stop_bits.html @@ -0,0 +1,43 @@ + + + +serial_port_base::stop_bits::stop_bits + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
stop_bits(
+    type t = one);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__stop_bits/store.html b/include/asio/doc/asio/reference/serial_port_base__stop_bits/store.html new file mode 100644 index 0000000..0d7b17d --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__stop_bits/store.html @@ -0,0 +1,44 @@ + + + +serial_port_base::stop_bits::store + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
void store(
+    ASIO_OPTION_STORAGE & storage,
+    asio::error_code & ec) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__stop_bits/type.html b/include/asio/doc/asio/reference/serial_port_base__stop_bits/type.html new file mode 100644 index 0000000..7d61973 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__stop_bits/type.html @@ -0,0 +1,62 @@ + + + +serial_port_base::stop_bits::type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum type
+
+

+ + + +

+
+ + Values +
+
+

+
+
one
+
+
onepointfive
+
+
two
+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/serial_port_base__stop_bits/value.html b/include/asio/doc/asio/reference/serial_port_base__stop_bits/value.html new file mode 100644 index 0000000..7ed7db5 --- /dev/null +++ b/include/asio/doc/asio/reference/serial_port_base__stop_bits/value.html @@ -0,0 +1,42 @@ + + + +serial_port_base::stop_bits::value + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
type value() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/service_already_exists.html b/include/asio/doc/asio/reference/service_already_exists.html new file mode 100644 index 0000000..fa5a155 --- /dev/null +++ b/include/asio/doc/asio/reference/service_already_exists.html @@ -0,0 +1,83 @@ + + + +service_already_exists + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Exception thrown when trying to add a duplicate service to an execution_context. +

+
class service_already_exists
+
+
+ + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ service_already_exists [constructor] +

+
+
+
+ + Requirements +
+

+ Header: asio/execution_context.hpp +

+

+ Convenience header: asio/execution.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/service_already_exists/service_already_exists.html b/include/asio/doc/asio/reference/service_already_exists/service_already_exists.html new file mode 100644 index 0000000..857ad75 --- /dev/null +++ b/include/asio/doc/asio/reference/service_already_exists/service_already_exists.html @@ -0,0 +1,42 @@ + + + +service_already_exists::service_already_exists + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
service_already_exists();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/signal_set.html b/include/asio/doc/asio/reference/signal_set.html new file mode 100644 index 0000000..15f132e --- /dev/null +++ b/include/asio/doc/asio/reference/signal_set.html @@ -0,0 +1,310 @@ + + + +signal_set + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for the typical usage of a signal + set. +

+
typedef basic_signal_set signal_set;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the signal set type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add +

+
+

+ Add a signal to a signal_set. +

+
+

+ async_wait +

+
+

+ Start an asynchronous operation to wait for a signal to be delivered. +

+
+

+ basic_signal_set [constructor] +

+
+

+ Construct a signal set without adding any signals.
—
+ Construct a signal set and add one signal.
—
Construct + a signal set and add two signals.
—
Construct a signal + set and add three signals. +

+
+

+ cancel +

+
+

+ Cancel all operations associated with the signal set. +

+
+

+ clear +

+
+

+ Remove all signals from a signal_set. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ remove +

+
+

+ Remove a signal from a signal_set. +

+
+

+ ~basic_signal_set [destructor] +

+
+

+ Destroys the signal set. +

+
+

+ The basic_signal_set + class provides the ability to perform an asynchronous wait for one or more + signals to occur. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ Performing an asynchronous wait: +

+
void handler(
+    const asio::error_code& error,
+    int signal_number)
+{
+  if (!error)
+  {
+    // A signal occurred.
+  }
+}
+
+...
+
+// Construct a signal set registered for process termination.
+asio::signal_set signals(my_context, SIGINT, SIGTERM);
+
+// Start an asynchronous wait for one of the signals to occur.
+signals.async_wait(handler);
+
+
+ + Queueing + of signal notifications +
+

+ If a signal is registered with a signal_set, and the signal occurs when there + are no waiting handlers, then the signal notification is queued. The next + async_wait operation on that signal_set will dequeue the notification. If + multiple notifications are queued, subsequent async_wait operations dequeue + them one at a time. Signal notifications are dequeued in order of ascending + signal number. +

+

+ If a signal number is removed from a signal_set (using the remove + or erase member functions) then any queued notifications for + that signal are discarded. +

+
+ + Multiple + registration of signals +
+

+ The same signal number may be registered with different signal_set objects. + When the signal occurs, one handler is called for each signal_set object. +

+

+ Note that multiple registration only works for signals that are registered + using Asio. The application must not also register a signal handler using + functions such as signal() or sigaction(). +

+
+ + Signal + masking on POSIX platforms +
+

+ POSIX allows signals to be blocked using functions such as sigprocmask() + and pthread_sigmask(). For signals to be delivered, programs + must ensure that any signals registered using signal_set objects are unblocked + in at least one thread. +

+
+ + Requirements +
+

+ Header: asio/signal_set.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base.html b/include/asio/doc/asio/reference/socket_base.html new file mode 100644 index 0000000..0b2b405 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base.html @@ -0,0 +1,408 @@ + + + +socket_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The socket_base + class is used as a base for the basic_stream_socket + and basic_datagram_socket + class templates so that we have a common place to define the shutdown_type + and enum. +

+
class socket_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ broadcast +

+
+

+ Socket option to permit sending of broadcast messages. +

+
+

+ bytes_readable +

+
+

+ IO control command to get the amount of data that can be read without + blocking. +

+
+

+ debug +

+
+

+ Socket option to enable socket-level debugging. +

+
+

+ do_not_route +

+
+

+ Socket option to prevent routing, use local interfaces only. +

+
+

+ enable_connection_aborted +

+
+

+ Socket option to report aborted connections on accept. +

+
+

+ keep_alive +

+
+

+ Socket option to send keep-alives. +

+
+

+ linger +

+
+

+ Socket option to specify whether the socket lingers on close if + unsent data is present. +

+
+

+ message_flags +

+
+

+ Bitmask type for flags that can be passed to send and receive operations. +

+
+

+ out_of_band_inline +

+
+

+ Socket option for putting received out-of-band data inline. +

+
+

+ receive_buffer_size +

+
+

+ Socket option for the receive buffer size of a socket. +

+
+

+ receive_low_watermark +

+
+

+ Socket option for the receive low watermark. +

+
+

+ reuse_address +

+
+

+ Socket option to allow the socket to be bound to an address that + is already in use. +

+
+

+ send_buffer_size +

+
+

+ Socket option for the send buffer size of a socket. +

+
+

+ send_low_watermark +

+
+

+ Socket option for the send low watermark. +

+
+

+ shutdown_type +

+
+

+ Different ways a socket may be shutdown. +

+
+

+ wait_type +

+
+

+ Wait types. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~socket_base [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ max_connections [static] +

+
+

+ (Deprecated: Use max_listen_connections.) The maximum length of + the queue of pending incoming connections. +

+
+

+ max_listen_connections [static] +

+
+

+ The maximum length of the queue of pending incoming connections. +

+
+

+ message_do_not_route [static] +

+
+

+ Specify that the data should not be subject to routing. +

+
+

+ message_end_of_record [static] +

+
+

+ Specifies that the data marks the end of a record. +

+
+

+ message_out_of_band [static] +

+
+

+ Process out-of-band data. +

+
+

+ message_peek [static] +

+
+

+ Peek at incoming data without removing it from the input queue. +

+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/_socket_base.html b/include/asio/doc/asio/reference/socket_base/_socket_base.html new file mode 100644 index 0000000..5f9a61c --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/_socket_base.html @@ -0,0 +1,44 @@ + + + +socket_base::~socket_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~socket_base();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/broadcast.html b/include/asio/doc/asio/reference/socket_base/broadcast.html new file mode 100644 index 0000000..ece5ab0 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/broadcast.html @@ -0,0 +1,78 @@ + + + +socket_base::broadcast + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option to + permit sending of broadcast messages. +

+
typedef implementation_defined broadcast;
+
+

+ Implements the SOL_SOCKET/SO_BROADCAST socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::broadcast option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/bytes_readable.html b/include/asio/doc/asio/reference/socket_base/bytes_readable.html new file mode 100644 index 0000000..4c7fdf5 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/bytes_readable.html @@ -0,0 +1,67 @@ + + + +socket_base::bytes_readable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +IO control + command to get the amount of data that can be read without blocking. +

+
typedef implementation_defined bytes_readable;
+
+

+ Implements the FIONREAD IO control command. +

+
+ + Example +
+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::bytes_readable command(true);
+socket.io_control(command);
+std::size_t bytes_readable = command.get();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/debug.html b/include/asio/doc/asio/reference/socket_base/debug.html new file mode 100644 index 0000000..7f65646 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/debug.html @@ -0,0 +1,78 @@ + + + +socket_base::debug + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option to enable + socket-level debugging. +

+
typedef implementation_defined debug;
+
+

+ Implements the SOL_SOCKET/SO_DEBUG socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::debug option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/do_not_route.html b/include/asio/doc/asio/reference/socket_base/do_not_route.html new file mode 100644 index 0000000..b9b1a10 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/do_not_route.html @@ -0,0 +1,78 @@ + + + +socket_base::do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option + to prevent routing, use local interfaces only. +

+
typedef implementation_defined do_not_route;
+
+

+ Implements the SOL_SOCKET/SO_DONTROUTE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::udp::socket socket(my_context);
+...
+asio::socket_base::do_not_route option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/enable_connection_aborted.html b/include/asio/doc/asio/reference/socket_base/enable_connection_aborted.html new file mode 100644 index 0000000..c93310d --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/enable_connection_aborted.html @@ -0,0 +1,80 @@ + + + +socket_base::enable_connection_aborted + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option to report aborted connections on accept. +

+
typedef implementation_defined enable_connection_aborted;
+
+

+ Implements a custom socket option that determines whether or not an accept + operation is permitted to fail with asio::error::connection_aborted. + By default the option is false. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::enable_connection_aborted option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/keep_alive.html b/include/asio/doc/asio/reference/socket_base/keep_alive.html new file mode 100644 index 0000000..15e1937 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/keep_alive.html @@ -0,0 +1,78 @@ + + + +socket_base::keep_alive + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option + to send keep-alives. +

+
typedef implementation_defined keep_alive;
+
+

+ Implements the SOL_SOCKET/SO_KEEPALIVE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::keep_alive option;
+socket.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/linger.html b/include/asio/doc/asio/reference/socket_base/linger.html new file mode 100644 index 0000000..971da39 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/linger.html @@ -0,0 +1,79 @@ + + + +socket_base::linger + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket option to specify + whether the socket lingers on close if unsent data is present. +

+
typedef implementation_defined linger;
+
+

+ Implements the SOL_SOCKET/SO_LINGER socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option(true, 30);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::linger option;
+socket.get_option(option);
+bool is_set = option.enabled();
+unsigned short timeout = option.timeout();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/max_connections.html b/include/asio/doc/asio/reference/socket_base/max_connections.html new file mode 100644 index 0000000..6bf57da --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/max_connections.html @@ -0,0 +1,45 @@ + + + +socket_base::max_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use max_listen_connections.) The maximum length of the queue of pending + incoming connections. +

+
static const int max_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/max_listen_connections.html b/include/asio/doc/asio/reference/socket_base/max_listen_connections.html new file mode 100644 index 0000000..9fe714c --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/max_listen_connections.html @@ -0,0 +1,44 @@ + + + +socket_base::max_listen_connections + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + maximum length of the queue of pending incoming connections. +

+
static const int max_listen_connections = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/message_do_not_route.html b/include/asio/doc/asio/reference/socket_base/message_do_not_route.html new file mode 100644 index 0000000..2226b8c --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/message_do_not_route.html @@ -0,0 +1,44 @@ + + + +socket_base::message_do_not_route + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Specify + that the data should not be subject to routing. +

+
static const int message_do_not_route = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/message_end_of_record.html b/include/asio/doc/asio/reference/socket_base/message_end_of_record.html new file mode 100644 index 0000000..44d2a2c --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/message_end_of_record.html @@ -0,0 +1,44 @@ + + + +socket_base::message_end_of_record + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Specifies + that the data marks the end of a record. +

+
static const int message_end_of_record = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/message_flags.html b/include/asio/doc/asio/reference/socket_base/message_flags.html new file mode 100644 index 0000000..85418bd --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/message_flags.html @@ -0,0 +1,54 @@ + + + +socket_base::message_flags + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bitmask + type for flags that can be passed to send and receive operations. +

+
typedef int message_flags;
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/message_out_of_band.html b/include/asio/doc/asio/reference/socket_base/message_out_of_band.html new file mode 100644 index 0000000..0d399ec --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/message_out_of_band.html @@ -0,0 +1,44 @@ + + + +socket_base::message_out_of_band + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Process + out-of-band data. +

+
static const int message_out_of_band = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/message_peek.html b/include/asio/doc/asio/reference/socket_base/message_peek.html new file mode 100644 index 0000000..0316fd7 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/message_peek.html @@ -0,0 +1,44 @@ + + + +socket_base::message_peek + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Peek at incoming + data without removing it from the input queue. +

+
static const int message_peek = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/out_of_band_inline.html b/include/asio/doc/asio/reference/socket_base/out_of_band_inline.html new file mode 100644 index 0000000..d6355ac --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/out_of_band_inline.html @@ -0,0 +1,78 @@ + + + +socket_base::out_of_band_inline + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option for putting received out-of-band data inline. +

+
typedef implementation_defined out_of_band_inline;
+
+

+ Implements the SOL_SOCKET/SO_OOBINLINE socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option(true);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::out_of_band_inline option;
+socket.get_option(option);
+bool value = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/receive_buffer_size.html b/include/asio/doc/asio/reference/socket_base/receive_buffer_size.html new file mode 100644 index 0000000..498b410 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/receive_buffer_size.html @@ -0,0 +1,78 @@ + + + +socket_base::receive_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option for the receive buffer size of a socket. +

+
typedef implementation_defined receive_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_RCVBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/receive_low_watermark.html b/include/asio/doc/asio/reference/socket_base/receive_low_watermark.html new file mode 100644 index 0000000..ca5208c --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/receive_low_watermark.html @@ -0,0 +1,78 @@ + + + +socket_base::receive_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option for the receive low watermark. +

+
typedef implementation_defined receive_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_RCVLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::receive_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/reuse_address.html b/include/asio/doc/asio/reference/socket_base/reuse_address.html new file mode 100644 index 0000000..18511de --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/reuse_address.html @@ -0,0 +1,79 @@ + + + +socket_base::reuse_address + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option to allow the socket to be bound to an address that is already in + use. +

+
typedef implementation_defined reuse_address;
+
+

+ Implements the SOL_SOCKET/SO_REUSEADDR socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option(true);
+acceptor.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::acceptor acceptor(my_context);
+...
+asio::socket_base::reuse_address option;
+acceptor.get_option(option);
+bool is_set = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/send_buffer_size.html b/include/asio/doc/asio/reference/socket_base/send_buffer_size.html new file mode 100644 index 0000000..0bbc0b1 --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/send_buffer_size.html @@ -0,0 +1,78 @@ + + + +socket_base::send_buffer_size + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option for the send buffer size of a socket. +

+
typedef implementation_defined send_buffer_size;
+
+

+ Implements the SOL_SOCKET/SO_SNDBUF socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option(8192);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_buffer_size option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/send_low_watermark.html b/include/asio/doc/asio/reference/socket_base/send_low_watermark.html new file mode 100644 index 0000000..6a0133d --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/send_low_watermark.html @@ -0,0 +1,78 @@ + + + +socket_base::send_low_watermark + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Socket + option for the send low watermark. +

+
typedef implementation_defined send_low_watermark;
+
+

+ Implements the SOL_SOCKET/SO_SNDLOWAT socket option. +

+
+ + Examples +
+

+ Setting the option: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option(1024);
+socket.set_option(option);
+
+

+ Getting the current option value: +

+
asio::ip::tcp::socket socket(my_context);
+...
+asio::socket_base::send_low_watermark option;
+socket.get_option(option);
+int size = option.value();
+
+
+ + Requirements +
+

+ Header: asio/socket_base.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/shutdown_type.html b/include/asio/doc/asio/reference/socket_base/shutdown_type.html new file mode 100644 index 0000000..c80da1a --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/shutdown_type.html @@ -0,0 +1,70 @@ + + + +socket_base::shutdown_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Different + ways a socket may be shutdown. +

+
enum shutdown_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
shutdown_receive
+

+ Shutdown the receive side of the socket. +

+
shutdown_send
+

+ Shutdown the send side of the socket. +

+
shutdown_both
+

+ Shutdown both send and receive on the socket. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/socket_base/wait_type.html b/include/asio/doc/asio/reference/socket_base/wait_type.html new file mode 100644 index 0000000..a17d88a --- /dev/null +++ b/include/asio/doc/asio/reference/socket_base/wait_type.html @@ -0,0 +1,72 @@ + + + +socket_base::wait_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait types. +

+
enum wait_type
+
+

+ + + +

+
+ + Values +
+
+

+
+
wait_read
+

+ Wait for a socket to become ready to read. +

+
wait_write
+

+ Wait for a socket to become ready to write. +

+
wait_error
+

+ Wait for a socket to have error conditions pending. +

+
+
+

+ For use with basic_socket::wait() and basic_socket::async_wait(). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn.html b/include/asio/doc/asio/reference/spawn.html new file mode 100644 index 0000000..75ddc0f --- /dev/null +++ b/include/asio/doc/asio/reference/spawn.html @@ -0,0 +1,162 @@ + + + +spawn + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+spawn +

+

+ +Start a new stackful coroutine. +

+

+ Start a new stackful coroutine, calling the specified handler when it completes. +

+
template<
+    typename Function>
+void spawn(
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+  » more...
+
+template<
+    typename Handler,
+    typename Function>
+void spawn(
+    Handler && handler,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes(),
+    typename enable_if< !is_executor< typename decay< Handler >::type >::value &&!execution::is_executor< typename decay< Handler >::type >::value &&!is_convertible< Handler &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Start a new stackful coroutine, inheriting the execution context of another. +

+
template<
+    typename Handler,
+    typename Function>
+void spawn(
+    basic_yield_context< Handler > ctx,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+  » more...
+
+

+ Start a new stackful coroutine that executes on a given executor. +

+
template<
+    typename Function,
+    typename Executor>
+void spawn(
+    const Executor & ex,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes(),
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+

+ Start a new stackful coroutine that executes on a given strand. +

+
template<
+    typename Function,
+    typename Executor>
+void spawn(
+    const strand< Executor > & ex,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+  » more...
+
+

+ Start a new stackful coroutine that executes in the context of a strand. +

+
template<
+    typename Function>
+void spawn(
+    const asio::io_context::strand & s,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+  » more...
+
+

+ Start a new stackful coroutine that executes on a given execution context. +

+
template<
+    typename Function,
+    typename ExecutionContext>
+void spawn(
+    ExecutionContext & ctx,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes(),
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ The spawn() function is a high-level wrapper over the Boost.Coroutine + library. This function enables programs to implement asynchronous logic in + a synchronous manner, as illustrated by the following example: +

+
asio::spawn(my_strand, do_echo);
+
+// ...
+
+void do_echo(asio::yield_context yield)
+{
+  try
+  {
+    char data[128];
+    for (;;)
+    {
+      std::size_t length =
+        my_socket.async_read_some(
+          asio::buffer(data), yield);
+
+      asio::async_write(my_socket,
+          asio::buffer(data, length), yield);
+    }
+  }
+  catch (std::exception& e)
+  {
+    // ...
+  }
+}
+
+
+ + Requirements +
+

+ Header: asio/spawn.hpp +

+

+ Convenience header: None +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn/overload1.html b/include/asio/doc/asio/reference/spawn/overload1.html new file mode 100644 index 0000000..86ad9fa --- /dev/null +++ b/include/asio/doc/asio/reference/spawn/overload1.html @@ -0,0 +1,72 @@ + + + +spawn (1 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start a new stackful coroutine, calling the specified handler when it completes. +

+
template<
+    typename Function>
+void spawn(
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+
+

+ This function is used to launch a new coroutine. +

+
+ + Parameters +
+
+

+
+
function
+
+

+ The coroutine function. The function must have the signature: +

+
void function(basic_yield_context<Handler> yield);
+
+

+

+
+
attributes
+

+ Boost.Coroutine attributes used to customise the coroutine. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn/overload2.html b/include/asio/doc/asio/reference/spawn/overload2.html new file mode 100644 index 0000000..e2a7768 --- /dev/null +++ b/include/asio/doc/asio/reference/spawn/overload2.html @@ -0,0 +1,87 @@ + + + +spawn (2 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start a new stackful coroutine, calling the specified handler when it completes. +

+
template<
+    typename Handler,
+    typename Function>
+void spawn(
+    Handler && handler,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes(),
+    typename enable_if< !is_executor< typename decay< Handler >::type >::value &&!execution::is_executor< typename decay< Handler >::type >::value &&!is_convertible< Handler &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to launch a new coroutine. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ A handler to be called when the coroutine exits. More importantly, + the handler provides an execution context (via the the handler invocation + hook) for the coroutine. The handler must have the signature: +

+
void handler();
+
+

+

+
+
function
+
+

+ The coroutine function. The function must have the signature: +

+
void function(basic_yield_context<Handler> yield);
+
+

+

+
+
attributes
+

+ Boost.Coroutine attributes used to customise the coroutine. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn/overload3.html b/include/asio/doc/asio/reference/spawn/overload3.html new file mode 100644 index 0000000..0010538 --- /dev/null +++ b/include/asio/doc/asio/reference/spawn/overload3.html @@ -0,0 +1,82 @@ + + + +spawn (3 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start a new stackful coroutine, inheriting the execution context of another. +

+
template<
+    typename Handler,
+    typename Function>
+void spawn(
+    basic_yield_context< Handler > ctx,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+
+

+ This function is used to launch a new coroutine. +

+
+ + Parameters +
+
+

+
+
ctx
+

+ Identifies the current coroutine as a parent of the new coroutine. + This specifies that the new coroutine should inherit the execution + context of the parent. For example, if the parent coroutine is executing + in a particular strand, then the new coroutine will execute in the + same strand. +

+
function
+
+

+ The coroutine function. The function must have the signature: +

+
void function(basic_yield_context<Handler> yield);
+
+

+

+
+
attributes
+

+ Boost.Coroutine attributes used to customise the coroutine. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn/overload4.html b/include/asio/doc/asio/reference/spawn/overload4.html new file mode 100644 index 0000000..f2d4d1a --- /dev/null +++ b/include/asio/doc/asio/reference/spawn/overload4.html @@ -0,0 +1,80 @@ + + + +spawn (4 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start a new stackful coroutine that executes on a given executor. +

+
template<
+    typename Function,
+    typename Executor>
+void spawn(
+    const Executor & ex,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes(),
+    typename enable_if< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type *  = 0);
+
+

+ This function is used to launch a new coroutine. +

+
+ + Parameters +
+
+

+
+
ex
+

+ Identifies the executor that will run the coroutine. The new coroutine + is implicitly given its own strand within this executor. +

+
function
+
+

+ The coroutine function. The function must have the signature: +

+
void function(yield_context yield);
+
+

+

+
+
attributes
+

+ Boost.Coroutine attributes used to customise the coroutine. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn/overload5.html b/include/asio/doc/asio/reference/spawn/overload5.html new file mode 100644 index 0000000..ddd2eb5 --- /dev/null +++ b/include/asio/doc/asio/reference/spawn/overload5.html @@ -0,0 +1,78 @@ + + + +spawn (5 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start a new stackful coroutine that executes on a given strand. +

+
template<
+    typename Function,
+    typename Executor>
+void spawn(
+    const strand< Executor > & ex,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+
+

+ This function is used to launch a new coroutine. +

+
+ + Parameters +
+
+

+
+
ex
+

+ Identifies the strand that will run the coroutine. +

+
function
+
+

+ The coroutine function. The function must have the signature: +

+
void function(yield_context yield);
+
+

+

+
+
attributes
+

+ Boost.Coroutine attributes used to customise the coroutine. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn/overload6.html b/include/asio/doc/asio/reference/spawn/overload6.html new file mode 100644 index 0000000..774b708 --- /dev/null +++ b/include/asio/doc/asio/reference/spawn/overload6.html @@ -0,0 +1,79 @@ + + + +spawn (6 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start a new stackful coroutine that executes in the context of a strand. +

+
template<
+    typename Function>
+void spawn(
+    const asio::io_context::strand & s,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes());
+
+

+ This function is used to launch a new coroutine. +

+
+ + Parameters +
+
+

+
+
s
+

+ Identifies a strand. By starting multiple coroutines on the same + strand, the implementation ensures that none of those coroutines + can execute simultaneously. +

+
function
+
+

+ The coroutine function. The function must have the signature: +

+
void function(yield_context yield);
+
+

+

+
+
attributes
+

+ Boost.Coroutine attributes used to customise the coroutine. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/spawn/overload7.html b/include/asio/doc/asio/reference/spawn/overload7.html new file mode 100644 index 0000000..a8540d2 --- /dev/null +++ b/include/asio/doc/asio/reference/spawn/overload7.html @@ -0,0 +1,81 @@ + + + +spawn (7 of 7 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start a new stackful coroutine that executes on a given execution context. +

+
template<
+    typename Function,
+    typename ExecutionContext>
+void spawn(
+    ExecutionContext & ctx,
+    Function && function,
+    const boost::coroutines::attributes & attributes = boost::coroutines::attributes(),
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This function is used to launch a new coroutine. +

+
+ + Parameters +
+
+

+
+
ctx
+

+ Identifies the execution context that will run the coroutine. The + new coroutine is implicitly given its own strand within this execution + context. +

+
function
+
+

+ The coroutine function. The function must have the signature: +

+
void function(yield_context yield);
+
+

+

+
+
attributes
+

+ Boost.Coroutine attributes used to customise the coroutine. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context.html b/include/asio/doc/asio/reference/ssl__context.html new file mode 100644 index 0000000..2513984 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context.html @@ -0,0 +1,586 @@ + + + +ssl::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
class context :
+  public ssl::context_base,
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ file_format +

+
+

+ File format types. +

+
+

+ method +

+
+

+ Different methods supported by a context. +

+
+

+ native_handle_type +

+
+

+ The native handle type of the SSL context. +

+
+

+ options +

+
+

+ Bitmask type for SSL options. +

+
+

+ password_purpose +

+
+

+ Purpose of PEM password. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add_certificate_authority +

+
+

+ Add certification authority for performing verification. +

+
+

+ add_verify_path +

+
+

+ Add a directory containing certificate authority files to be used + for performing verification. +

+
+

+ clear_options +

+
+

+ Clear options on the context. +

+
+

+ context + [constructor] +

+
+

+ Constructor.
—
Construct to take ownership of a native + handle.
—
Move-construct a context from another. +

+
+

+ load_verify_file +

+
+

+ Load a certification authority file for performing verification. +

+
+

+ native_handle +

+
+

+ Get the underlying implementation in the native type. +

+
+

+ operator= +

+
+

+ Move-assign a context from another. +

+
+

+ set_default_verify_paths +

+
+

+ Configures the context to use the default directories for finding + certification authority certificates. +

+
+

+ set_options +

+
+

+ Set options on the context. +

+
+

+ set_password_callback +

+
+

+ Set the password callback. +

+
+

+ set_verify_callback +

+
+

+ Set the callback used to verify peer certificates. +

+
+

+ set_verify_depth +

+
+

+ Set the peer verification depth. +

+
+

+ set_verify_mode +

+
+

+ Set the peer verification mode. +

+
+

+ use_certificate +

+
+

+ Use a certificate from a memory buffer. +

+
+

+ use_certificate_chain +

+
+

+ Use a certificate chain from a memory buffer. +

+
+

+ use_certificate_chain_file +

+
+

+ Use a certificate chain from a file. +

+
+

+ use_certificate_file +

+
+

+ Use a certificate from a file. +

+
+

+ use_private_key +

+
+

+ Use a private key from a memory buffer. +

+
+

+ use_private_key_file +

+
+

+ Use a private key from a file. +

+
+

+ use_rsa_private_key +

+
+

+ Use an RSA private key from a memory buffer. +

+
+

+ use_rsa_private_key_file +

+
+

+ Use an RSA private key from a file. +

+
+

+ use_tmp_dh +

+
+

+ Use the specified memory buffer to obtain the temporary Diffie-Hellman + parameters. +

+
+

+ use_tmp_dh_file +

+
+

+ Use the specified file to obtain the temporary Diffie-Hellman parameters. +

+
+

+ ~context [destructor] +

+
+

+ Destructor. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ default_workarounds [static] +

+
+

+ Implement various bug workarounds. +

+
+

+ no_compression [static] +

+
+

+ Disable compression. Compression is disabled by default. +

+
+

+ no_sslv2 [static] +

+
+

+ Disable SSL v2. +

+
+

+ no_sslv3 [static] +

+
+

+ Disable SSL v3. +

+
+

+ no_tlsv1 [static] +

+
+

+ Disable TLS v1. +

+
+

+ no_tlsv1_1 [static] +

+
+

+ Disable TLS v1.1. +

+
+

+ no_tlsv1_2 [static] +

+
+

+ Disable TLS v1.2. +

+
+

+ no_tlsv1_3 [static] +

+
+

+ Disable TLS v1.3. +

+
+

+ single_dh_use [static] +

+
+

+ Always create a new key when using tmp_dh parameters. +

+
+
+ + Requirements +
+

+ Header: asio/ssl/context.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/_context.html b/include/asio/doc/asio/reference/ssl__context/_context.html new file mode 100644 index 0000000..2cb50ce --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/_context.html @@ -0,0 +1,43 @@ + + + +ssl::context::~context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/add_certificate_authority.html b/include/asio/doc/asio/reference/ssl__context/add_certificate_authority.html new file mode 100644 index 0000000..c164ae9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/add_certificate_authority.html @@ -0,0 +1,51 @@ + + + +ssl::context::add_certificate_authority + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Add + certification authority for performing verification. +

+
void add_certificate_authority(
+    const const_buffer & ca);
+  » more...
+
+void add_certificate_authority(
+    const const_buffer & ca,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/add_certificate_authority/overload1.html b/include/asio/doc/asio/reference/ssl__context/add_certificate_authority/overload1.html new file mode 100644 index 0000000..4a96dfd --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/add_certificate_authority/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::context::add_certificate_authority (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Add certification authority for performing verification. +

+
void add_certificate_authority(
+    const const_buffer & ca);
+
+

+ This function is used to add one trusted certification authority from + a memory buffer. +

+
+ + Parameters +
+
+

+
+
ca
+

+ The buffer containing the certification authority certificate. + The certificate must use the PEM format. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_get_cert_store and X509_STORE_add_cert. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/add_certificate_authority/overload2.html b/include/asio/doc/asio/reference/ssl__context/add_certificate_authority/overload2.html new file mode 100644 index 0000000..4b3480f --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/add_certificate_authority/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::context::add_certificate_authority (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Add certification authority for performing verification. +

+
void add_certificate_authority(
+    const const_buffer & ca,
+    asio::error_code & ec);
+
+

+ This function is used to add one trusted certification authority from + a memory buffer. +

+
+ + Parameters +
+
+

+
+
ca
+

+ The buffer containing the certification authority certificate. + The certificate must use the PEM format. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_get_cert_store and X509_STORE_add_cert. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/add_verify_path.html b/include/asio/doc/asio/reference/ssl__context/add_verify_path.html new file mode 100644 index 0000000..a326c72 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/add_verify_path.html @@ -0,0 +1,52 @@ + + + +ssl::context::add_verify_path + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Add + a directory containing certificate authority files to be used for performing + verification. +

+
void add_verify_path(
+    const std::string & path);
+  » more...
+
+void add_verify_path(
+    const std::string & path,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/add_verify_path/overload1.html b/include/asio/doc/asio/reference/ssl__context/add_verify_path/overload1.html new file mode 100644 index 0000000..a05e3f9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/add_verify_path/overload1.html @@ -0,0 +1,84 @@ + + + +ssl::context::add_verify_path (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Add a directory containing certificate authority files to be used for + performing verification. +

+
void add_verify_path(
+    const std::string & path);
+
+

+ This function is used to specify the name of a directory containing certification + authority certificates. Each file in the directory must contain a single + certificate. The files must be named using the subject name's hash and + an extension of ".0". +

+
+ + Parameters +
+
+

+
+
path
+

+ The name of a directory containing the certificates. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_load_verify_locations. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/add_verify_path/overload2.html b/include/asio/doc/asio/reference/ssl__context/add_verify_path/overload2.html new file mode 100644 index 0000000..c092383 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/add_verify_path/overload2.html @@ -0,0 +1,76 @@ + + + +ssl::context::add_verify_path (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Add a directory containing certificate authority files to be used for + performing verification. +

+
void add_verify_path(
+    const std::string & path,
+    asio::error_code & ec);
+
+

+ This function is used to specify the name of a directory containing certification + authority certificates. Each file in the directory must contain a single + certificate. The files must be named using the subject name's hash and + an extension of ".0". +

+
+ + Parameters +
+
+

+
+
path
+

+ The name of a directory containing the certificates. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_load_verify_locations. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/clear_options.html b/include/asio/doc/asio/reference/ssl__context/clear_options.html new file mode 100644 index 0000000..a6c39ad --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/clear_options.html @@ -0,0 +1,51 @@ + + + +ssl::context::clear_options + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Clear + options on the context. +

+
void clear_options(
+    options o);
+  » more...
+
+void clear_options(
+    options o,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/clear_options/overload1.html b/include/asio/doc/asio/reference/ssl__context/clear_options/overload1.html new file mode 100644 index 0000000..830d36a --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/clear_options/overload1.html @@ -0,0 +1,83 @@ + + + +ssl::context::clear_options (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Clear options on the context. +

+
void clear_options(
+    options o);
+
+

+ This function may be used to configure the SSL options used by the context. +

+
+ + Parameters +
+
+

+
+
o
+

+ A bitmask of options. The available option values are defined in + the ssl::context_base + class. The specified options, if currently enabled on the context, + are cleared. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_clear_options. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/clear_options/overload2.html b/include/asio/doc/asio/reference/ssl__context/clear_options/overload2.html new file mode 100644 index 0000000..14c9052 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/clear_options/overload2.html @@ -0,0 +1,75 @@ + + + +ssl::context::clear_options (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Clear options on the context. +

+
void clear_options(
+    options o,
+    asio::error_code & ec);
+
+

+ This function may be used to configure the SSL options used by the context. +

+
+ + Parameters +
+
+

+
+
o
+

+ A bitmask of options. The available option values are defined in + the ssl::context_base + class. The specified options, if currently enabled on the context, + are cleared. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_clear_options. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/context.html b/include/asio/doc/asio/reference/ssl__context/context.html new file mode 100644 index 0000000..d763869 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/context.html @@ -0,0 +1,59 @@ + + + +ssl::context::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
explicit context(
+    method m);
+  » more...
+
+

+ Construct to take ownership of a native handle. +

+
explicit context(
+    native_handle_type native_handle);
+  » more...
+
+

+ Move-construct a context from another. +

+
context(
+    context && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/context/overload1.html b/include/asio/doc/asio/reference/ssl__context/context/overload1.html new file mode 100644 index 0000000..e93e87a --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/context/overload1.html @@ -0,0 +1,44 @@ + + + +ssl::context::context (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor. +

+
context(
+    method m);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/context/overload2.html b/include/asio/doc/asio/reference/ssl__context/context/overload2.html new file mode 100644 index 0000000..12f1441 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/context/overload2.html @@ -0,0 +1,44 @@ + + + +ssl::context::context (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct to take ownership of a native handle. +

+
context(
+    native_handle_type native_handle);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/context/overload3.html b/include/asio/doc/asio/reference/ssl__context/context/overload3.html new file mode 100644 index 0000000..9f282be --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/context/overload3.html @@ -0,0 +1,71 @@ + + + +ssl::context::context (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a context from another. +

+
context(
+    context && other);
+
+

+ This constructor moves an SSL context from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other context object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the following operations only are valid for the moved-from + object: * Destruction. +

+
  • + As a target for move-assignment. +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/default_workarounds.html b/include/asio/doc/asio/reference/ssl__context/default_workarounds.html new file mode 100644 index 0000000..6a8b6f5 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/default_workarounds.html @@ -0,0 +1,44 @@ + + + +ssl::context::default_workarounds + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Implement + various bug workarounds. +

+
static const long default_workarounds = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/file_format.html b/include/asio/doc/asio/reference/ssl__context/file_format.html new file mode 100644 index 0000000..af885bf --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/file_format.html @@ -0,0 +1,65 @@ + + + +ssl::context::file_format + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +File format + types. +

+
enum file_format
+
+

+ + +

+
+ + Values +
+
+

+
+
asn1
+

+ ASN.1 file. +

+
pem
+

+ PEM file. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/load_verify_file.html b/include/asio/doc/asio/reference/ssl__context/load_verify_file.html new file mode 100644 index 0000000..7902642 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/load_verify_file.html @@ -0,0 +1,51 @@ + + + +ssl::context::load_verify_file + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Load + a certification authority file for performing verification. +

+
void load_verify_file(
+    const std::string & filename);
+  » more...
+
+void load_verify_file(
+    const std::string & filename,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/load_verify_file/overload1.html b/include/asio/doc/asio/reference/ssl__context/load_verify_file/overload1.html new file mode 100644 index 0000000..68ce5c0 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/load_verify_file/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::context::load_verify_file (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Load a certification authority file for performing verification. +

+
void load_verify_file(
+    const std::string & filename);
+
+

+ This function is used to load one or more trusted certification authorities + from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of a file containing certification authority certificates + in PEM format. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_load_verify_locations. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/load_verify_file/overload2.html b/include/asio/doc/asio/reference/ssl__context/load_verify_file/overload2.html new file mode 100644 index 0000000..664124a --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/load_verify_file/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::context::load_verify_file (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Load a certification authority file for performing verification. +

+
void load_verify_file(
+    const std::string & filename,
+    asio::error_code & ec);
+
+

+ This function is used to load the certificates for one or more trusted + certification authorities from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of a file containing certification authority certificates + in PEM format. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_load_verify_locations. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/method.html b/include/asio/doc/asio/reference/ssl__context/method.html new file mode 100644 index 0000000..f93f6d9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/method.html @@ -0,0 +1,175 @@ + + + +ssl::context::method + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Different methods supported + by a context. +

+
enum method
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + +

+
+ + Values +
+
+

+
+
sslv2
+

+ Generic SSL version 2. +

+
sslv2_client
+

+ SSL version 2 client. +

+
sslv2_server
+

+ SSL version 2 server. +

+
sslv3
+

+ Generic SSL version 3. +

+
sslv3_client
+

+ SSL version 3 client. +

+
sslv3_server
+

+ SSL version 3 server. +

+
tlsv1
+

+ Generic TLS version 1. +

+
tlsv1_client
+

+ TLS version 1 client. +

+
tlsv1_server
+

+ TLS version 1 server. +

+
sslv23
+

+ Generic SSL/TLS. +

+
sslv23_client
+

+ SSL/TLS client. +

+
sslv23_server
+

+ SSL/TLS server. +

+
tlsv11
+

+ Generic TLS version 1.1. +

+
tlsv11_client
+

+ TLS version 1.1 client. +

+
tlsv11_server
+

+ TLS version 1.1 server. +

+
tlsv12
+

+ Generic TLS version 1.2. +

+
tlsv12_client
+

+ TLS version 1.2 client. +

+
tlsv12_server
+

+ TLS version 1.2 server. +

+
tlsv13
+

+ Generic TLS version 1.3. +

+
tlsv13_client
+

+ TLS version 1.3 client. +

+
tlsv13_server
+

+ TLS version 1.3 server. +

+
tls
+

+ Generic TLS. +

+
tls_client
+

+ TLS client. +

+
tls_server
+

+ TLS server. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/native_handle.html b/include/asio/doc/asio/reference/ssl__context/native_handle.html new file mode 100644 index 0000000..8ce9e4e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/native_handle.html @@ -0,0 +1,49 @@ + + + +ssl::context::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + underlying implementation in the native type. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying implementation of the + context. This is intended to allow access to context functionality that + is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/native_handle_type.html b/include/asio/doc/asio/reference/ssl__context/native_handle_type.html new file mode 100644 index 0000000..0219602 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/native_handle_type.html @@ -0,0 +1,54 @@ + + + +ssl::context::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native handle type of the SSL context. +

+
typedef SSL_CTX * native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/context.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/no_compression.html b/include/asio/doc/asio/reference/ssl__context/no_compression.html new file mode 100644 index 0000000..90e8c08 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/no_compression.html @@ -0,0 +1,44 @@ + + + +ssl::context::no_compression + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + compression. Compression is disabled by default. +

+
static const long no_compression = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/no_sslv2.html b/include/asio/doc/asio/reference/ssl__context/no_sslv2.html new file mode 100644 index 0000000..9324491 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/no_sslv2.html @@ -0,0 +1,43 @@ + + + +ssl::context::no_sslv2 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable SSL v2. +

+
static const long no_sslv2 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/no_sslv3.html b/include/asio/doc/asio/reference/ssl__context/no_sslv3.html new file mode 100644 index 0000000..0e141ab --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/no_sslv3.html @@ -0,0 +1,43 @@ + + + +ssl::context::no_sslv3 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable SSL v3. +

+
static const long no_sslv3 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/no_tlsv1.html b/include/asio/doc/asio/reference/ssl__context/no_tlsv1.html new file mode 100644 index 0000000..ce4fae4 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/no_tlsv1.html @@ -0,0 +1,43 @@ + + + +ssl::context::no_tlsv1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable TLS v1. +

+
static const long no_tlsv1 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/no_tlsv1_1.html b/include/asio/doc/asio/reference/ssl__context/no_tlsv1_1.html new file mode 100644 index 0000000..3b16486 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/no_tlsv1_1.html @@ -0,0 +1,44 @@ + + + +ssl::context::no_tlsv1_1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable TLS + v1.1. +

+
static const long no_tlsv1_1 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/no_tlsv1_2.html b/include/asio/doc/asio/reference/ssl__context/no_tlsv1_2.html new file mode 100644 index 0000000..5cba81f --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/no_tlsv1_2.html @@ -0,0 +1,44 @@ + + + +ssl::context::no_tlsv1_2 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable TLS + v1.2. +

+
static const long no_tlsv1_2 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/no_tlsv1_3.html b/include/asio/doc/asio/reference/ssl__context/no_tlsv1_3.html new file mode 100644 index 0000000..6429025 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/no_tlsv1_3.html @@ -0,0 +1,44 @@ + + + +ssl::context::no_tlsv1_3 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable TLS + v1.3. +

+
static const long no_tlsv1_3 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/operator_eq_.html b/include/asio/doc/asio/reference/ssl__context/operator_eq_.html new file mode 100644 index 0000000..9b64e42 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/operator_eq_.html @@ -0,0 +1,72 @@ + + + +ssl::context::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a context from another. +

+
context & operator=(
+    context && other);
+
+

+ This assignment operator moves an SSL context from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other context object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the following operations only are valid for the moved-from + object: * Destruction. +

+
  • + As a target for move-assignment. +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/options.html b/include/asio/doc/asio/reference/ssl__context/options.html new file mode 100644 index 0000000..eb7aac0 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/options.html @@ -0,0 +1,54 @@ + + + +ssl::context::options + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bitmask type for + SSL options. +

+
typedef long options;
+
+
+ + Requirements +
+

+ Header: asio/ssl/context.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/password_purpose.html b/include/asio/doc/asio/reference/ssl__context/password_purpose.html new file mode 100644 index 0000000..1beba2f --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/password_purpose.html @@ -0,0 +1,65 @@ + + + +ssl::context::password_purpose + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Purpose + of PEM password. +

+
enum password_purpose
+
+

+ + +

+
+ + Values +
+
+

+
+
for_reading
+

+ The password is needed for reading/decryption. +

+
for_writing
+

+ The password is needed for writing/encryption. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths.html b/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths.html new file mode 100644 index 0000000..cb27bd7 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths.html @@ -0,0 +1,50 @@ + + + +ssl::context::set_default_verify_paths + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Configures + the context to use the default directories for finding certification authority + certificates. +

+
void set_default_verify_paths();
+  » more...
+
+void set_default_verify_paths(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths/overload1.html b/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths/overload1.html new file mode 100644 index 0000000..68ca11b --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths/overload1.html @@ -0,0 +1,68 @@ + + + +ssl::context::set_default_verify_paths (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Configures the context to use the default directories for finding certification + authority certificates. +

+
void set_default_verify_paths();
+
+

+ This function specifies that the context should use the default, system-dependent + directories for locating certification authority certificates. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_default_verify_paths. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths/overload2.html b/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths/overload2.html new file mode 100644 index 0000000..8184a1f --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_default_verify_paths/overload2.html @@ -0,0 +1,69 @@ + + + +ssl::context::set_default_verify_paths (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Configures the context to use the default directories for finding certification + authority certificates. +

+
void set_default_verify_paths(
+    asio::error_code & ec);
+
+

+ This function specifies that the context should use the default, system-dependent + directories for locating certification authority certificates. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_default_verify_paths. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_options.html b/include/asio/doc/asio/reference/ssl__context/set_options.html new file mode 100644 index 0000000..5bf07fc --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_options.html @@ -0,0 +1,51 @@ + + + +ssl::context::set_options + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set options + on the context. +

+
void set_options(
+    options o);
+  » more...
+
+void set_options(
+    options o,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_options/overload1.html b/include/asio/doc/asio/reference/ssl__context/set_options/overload1.html new file mode 100644 index 0000000..59cc451 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_options/overload1.html @@ -0,0 +1,83 @@ + + + +ssl::context::set_options (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set options on the context. +

+
void set_options(
+    options o);
+
+

+ This function may be used to configure the SSL options used by the context. +

+
+ + Parameters +
+
+

+
+
o
+

+ A bitmask of options. The available option values are defined in + the ssl::context_base + class. The options are bitwise-ored with any existing value for + the options. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_options. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_options/overload2.html b/include/asio/doc/asio/reference/ssl__context/set_options/overload2.html new file mode 100644 index 0000000..490efbf --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_options/overload2.html @@ -0,0 +1,75 @@ + + + +ssl::context::set_options (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set options on the context. +

+
void set_options(
+    options o,
+    asio::error_code & ec);
+
+

+ This function may be used to configure the SSL options used by the context. +

+
+ + Parameters +
+
+

+
+
o
+

+ A bitmask of options. The available option values are defined in + the ssl::context_base + class. The options are bitwise-ored with any existing value for + the options. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_options. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_password_callback.html b/include/asio/doc/asio/reference/ssl__context/set_password_callback.html new file mode 100644 index 0000000..0204155 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_password_callback.html @@ -0,0 +1,55 @@ + + + +ssl::context::set_password_callback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the password callback. +

+
template<
+    typename PasswordCallback>
+void set_password_callback(
+    PasswordCallback callback);
+  » more...
+
+template<
+    typename PasswordCallback>
+void set_password_callback(
+    PasswordCallback callback,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_password_callback/overload1.html b/include/asio/doc/asio/reference/ssl__context/set_password_callback/overload1.html new file mode 100644 index 0000000..33c344e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_password_callback/overload1.html @@ -0,0 +1,94 @@ + + + +ssl::context::set_password_callback (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the password callback. +

+
template<
+    typename PasswordCallback>
+void set_password_callback(
+    PasswordCallback callback);
+
+

+ This function is used to specify a callback function to obtain password + information about an encrypted key in PEM format. +

+
+ + Parameters +
+
+

+
+
callback
+
+

+ The function object to be used for obtaining the password. The + function signature of the handler must be: +

+
std::string password_callback(
+  std::size_t max_length,  // The maximum size for a password.
+  password_purpose purpose // Whether password is for reading or writing.
+);
+
+

+ The return value of the callback is a string containing the password. +

+
+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_default_passwd_cb. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_password_callback/overload2.html b/include/asio/doc/asio/reference/ssl__context/set_password_callback/overload2.html new file mode 100644 index 0000000..66ac40b --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_password_callback/overload2.html @@ -0,0 +1,86 @@ + + + +ssl::context::set_password_callback (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the password callback. +

+
template<
+    typename PasswordCallback>
+void set_password_callback(
+    PasswordCallback callback,
+    asio::error_code & ec);
+
+

+ This function is used to specify a callback function to obtain password + information about an encrypted key in PEM format. +

+
+ + Parameters +
+
+

+
+
callback
+
+

+ The function object to be used for obtaining the password. The + function signature of the handler must be: +

+
std::string password_callback(
+  std::size_t max_length,  // The maximum size for a password.
+  password_purpose purpose // Whether password is for reading or writing.
+);
+
+

+ The return value of the callback is a string containing the password. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_default_passwd_cb. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_callback.html b/include/asio/doc/asio/reference/ssl__context/set_verify_callback.html new file mode 100644 index 0000000..676f706 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_callback.html @@ -0,0 +1,55 @@ + + + +ssl::context::set_verify_callback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the callback used to verify peer certificates. +

+
template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback);
+  » more...
+
+template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_callback/overload1.html b/include/asio/doc/asio/reference/ssl__context/set_verify_callback/overload1.html new file mode 100644 index 0000000..cb7ab94 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_callback/overload1.html @@ -0,0 +1,95 @@ + + + +ssl::context::set_verify_callback (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the callback used to verify peer certificates. +

+
template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback);
+
+

+ This function is used to specify a callback function that will be called + by the implementation when it needs to verify a peer certificate. +

+
+ + Parameters +
+
+

+
+
callback
+
+

+ The function object to be used for verifying a certificate. The + function signature of the handler must be: +

+
bool verify_callback(
+  bool preverified, // True if the certificate passed pre-verification.
+  verify_context& ctx // The peer certificate and other context.
+);
+
+

+ The return value of the callback is true if the certificate has + passed verification, false otherwise. +

+
+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_callback/overload2.html b/include/asio/doc/asio/reference/ssl__context/set_verify_callback/overload2.html new file mode 100644 index 0000000..37e1dd9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_callback/overload2.html @@ -0,0 +1,87 @@ + + + +ssl::context::set_verify_callback (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the callback used to verify peer certificates. +

+
template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback,
+    asio::error_code & ec);
+
+

+ This function is used to specify a callback function that will be called + by the implementation when it needs to verify a peer certificate. +

+
+ + Parameters +
+
+

+
+
callback
+
+

+ The function object to be used for verifying a certificate. The + function signature of the handler must be: +

+
bool verify_callback(
+  bool preverified, // True if the certificate passed pre-verification.
+  verify_context& ctx // The peer certificate and other context.
+);
+
+

+ The return value of the callback is true if the certificate has + passed verification, false otherwise. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_depth.html b/include/asio/doc/asio/reference/ssl__context/set_verify_depth.html new file mode 100644 index 0000000..3b47971 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_depth.html @@ -0,0 +1,51 @@ + + + +ssl::context::set_verify_depth + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the peer verification depth. +

+
void set_verify_depth(
+    int depth);
+  » more...
+
+void set_verify_depth(
+    int depth,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_depth/overload1.html b/include/asio/doc/asio/reference/ssl__context/set_verify_depth/overload1.html new file mode 100644 index 0000000..f38a930 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_depth/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::context::set_verify_depth (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification depth. +

+
void set_verify_depth(
+    int depth);
+
+

+ This function may be used to configure the maximum verification depth + allowed by the context. +

+
+ + Parameters +
+
+

+
+
depth
+

+ Maximum depth for the certificate chain verification that shall + be allowed. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_verify_depth. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_depth/overload2.html b/include/asio/doc/asio/reference/ssl__context/set_verify_depth/overload2.html new file mode 100644 index 0000000..86c9668 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_depth/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::context::set_verify_depth (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification depth. +

+
void set_verify_depth(
+    int depth,
+    asio::error_code & ec);
+
+

+ This function may be used to configure the maximum verification depth + allowed by the context. +

+
+ + Parameters +
+
+

+
+
depth
+

+ Maximum depth for the certificate chain verification that shall + be allowed. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_verify_depth. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_mode.html b/include/asio/doc/asio/reference/ssl__context/set_verify_mode.html new file mode 100644 index 0000000..208d243 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_mode.html @@ -0,0 +1,51 @@ + + + +ssl::context::set_verify_mode + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the peer verification mode. +

+
void set_verify_mode(
+    verify_mode v);
+  » more...
+
+void set_verify_mode(
+    verify_mode v,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_mode/overload1.html b/include/asio/doc/asio/reference/ssl__context/set_verify_mode/overload1.html new file mode 100644 index 0000000..bf9e314 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_mode/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::context::set_verify_mode (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification mode. +

+
void set_verify_mode(
+    verify_mode v);
+
+

+ This function may be used to configure the peer verification mode used + by the context. +

+
+ + Parameters +
+
+

+
+
v
+

+ A bitmask of peer verification modes. See ssl::verify_mode + for available values. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/set_verify_mode/overload2.html b/include/asio/doc/asio/reference/ssl__context/set_verify_mode/overload2.html new file mode 100644 index 0000000..6288e65 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/set_verify_mode/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::context::set_verify_mode (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification mode. +

+
void set_verify_mode(
+    verify_mode v,
+    asio::error_code & ec);
+
+

+ This function may be used to configure the peer verification mode used + by the context. +

+
+ + Parameters +
+
+

+
+
v
+

+ A bitmask of peer verification modes. See ssl::verify_mode + for available values. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/single_dh_use.html b/include/asio/doc/asio/reference/ssl__context/single_dh_use.html new file mode 100644 index 0000000..d08b763 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/single_dh_use.html @@ -0,0 +1,44 @@ + + + +ssl::context::single_dh_use + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Always + create a new key when using tmp_dh parameters. +

+
static const long single_dh_use = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate.html b/include/asio/doc/asio/reference/ssl__context/use_certificate.html new file mode 100644 index 0000000..709c2da --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate.html @@ -0,0 +1,53 @@ + + + +ssl::context::use_certificate + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + a certificate from a memory buffer. +

+
void use_certificate(
+    const const_buffer & certificate,
+    file_format format);
+  » more...
+
+void use_certificate(
+    const const_buffer & certificate,
+    file_format format,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_certificate/overload1.html new file mode 100644 index 0000000..815b052 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate/overload1.html @@ -0,0 +1,85 @@ + + + +ssl::context::use_certificate (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate from a memory buffer. +

+
void use_certificate(
+    const const_buffer & certificate,
+    file_format format);
+
+

+ This function is used to load a certificate into the context from a buffer. +

+
+ + Parameters +
+
+

+
+
certificate
+

+ The buffer containing the certificate. +

+
format
+

+ The certificate format (ASN.1 or PEM). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate or SSL_CTX_use_certificate_ASN1. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_certificate/overload2.html new file mode 100644 index 0000000..8e38ea5 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate/overload2.html @@ -0,0 +1,77 @@ + + + +ssl::context::use_certificate (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate from a memory buffer. +

+
void use_certificate(
+    const const_buffer & certificate,
+    file_format format,
+    asio::error_code & ec);
+
+

+ This function is used to load a certificate into the context from a buffer. +

+
+ + Parameters +
+
+

+
+
certificate
+

+ The buffer containing the certificate. +

+
format
+

+ The certificate format (ASN.1 or PEM). +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate or SSL_CTX_use_certificate_ASN1. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_chain.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain.html new file mode 100644 index 0000000..a6b7227 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain.html @@ -0,0 +1,51 @@ + + + +ssl::context::use_certificate_chain + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + a certificate chain from a memory buffer. +

+
void use_certificate_chain(
+    const const_buffer & chain);
+  » more...
+
+void use_certificate_chain(
+    const const_buffer & chain,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_chain/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain/overload1.html new file mode 100644 index 0000000..b06b723 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::context::use_certificate_chain (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate chain from a memory buffer. +

+
void use_certificate_chain(
+    const const_buffer & chain);
+
+

+ This function is used to load a certificate chain into the context from + a buffer. +

+
+ + Parameters +
+
+

+
+
chain
+

+ The buffer containing the certificate chain. The certificate chain + must use the PEM format. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate and SSL_CTX_add_extra_chain_cert. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_chain/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain/overload2.html new file mode 100644 index 0000000..7e32ac4 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::context::use_certificate_chain (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate chain from a memory buffer. +

+
void use_certificate_chain(
+    const const_buffer & chain,
+    asio::error_code & ec);
+
+

+ This function is used to load a certificate chain into the context from + a buffer. +

+
+ + Parameters +
+
+

+
+
chain
+

+ The buffer containing the certificate chain. The certificate chain + must use the PEM format. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate and SSL_CTX_add_extra_chain_cert. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file.html new file mode 100644 index 0000000..4f92e66 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file.html @@ -0,0 +1,51 @@ + + + +ssl::context::use_certificate_chain_file + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + a certificate chain from a file. +

+
void use_certificate_chain_file(
+    const std::string & filename);
+  » more...
+
+void use_certificate_chain_file(
+    const std::string & filename,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file/overload1.html new file mode 100644 index 0000000..85d6b4d --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::context::use_certificate_chain_file (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate chain from a file. +

+
void use_certificate_chain_file(
+    const std::string & filename);
+
+

+ This function is used to load a certificate chain into the context from + a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the certificate. The file must + use the PEM format. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate_chain_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file/overload2.html new file mode 100644 index 0000000..942b092 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_chain_file/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::context::use_certificate_chain_file (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate chain from a file. +

+
void use_certificate_chain_file(
+    const std::string & filename,
+    asio::error_code & ec);
+
+

+ This function is used to load a certificate chain into the context from + a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the certificate. The file must + use the PEM format. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate_chain_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_file.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_file.html new file mode 100644 index 0000000..7baab44 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_file.html @@ -0,0 +1,53 @@ + + + +ssl::context::use_certificate_file + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + a certificate from a file. +

+
void use_certificate_file(
+    const std::string & filename,
+    file_format format);
+  » more...
+
+void use_certificate_file(
+    const std::string & filename,
+    file_format format,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_file/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_file/overload1.html new file mode 100644 index 0000000..5332162 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_file/overload1.html @@ -0,0 +1,85 @@ + + + +ssl::context::use_certificate_file (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate from a file. +

+
void use_certificate_file(
+    const std::string & filename,
+    file_format format);
+
+

+ This function is used to load a certificate into the context from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the certificate. +

+
format
+

+ The file format (ASN.1 or PEM). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_certificate_file/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_certificate_file/overload2.html new file mode 100644 index 0000000..710d996 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_certificate_file/overload2.html @@ -0,0 +1,77 @@ + + + +ssl::context::use_certificate_file (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a certificate from a file. +

+
void use_certificate_file(
+    const std::string & filename,
+    file_format format,
+    asio::error_code & ec);
+
+

+ This function is used to load a certificate into the context from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the certificate. +

+
format
+

+ The file format (ASN.1 or PEM). +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_certificate_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_private_key.html b/include/asio/doc/asio/reference/ssl__context/use_private_key.html new file mode 100644 index 0000000..aede6e8 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_private_key.html @@ -0,0 +1,53 @@ + + + +ssl::context::use_private_key + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + a private key from a memory buffer. +

+
void use_private_key(
+    const const_buffer & private_key,
+    file_format format);
+  » more...
+
+void use_private_key(
+    const const_buffer & private_key,
+    file_format format,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_private_key/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_private_key/overload1.html new file mode 100644 index 0000000..9ba4e38 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_private_key/overload1.html @@ -0,0 +1,85 @@ + + + +ssl::context::use_private_key (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a private key from a memory buffer. +

+
void use_private_key(
+    const const_buffer & private_key,
+    file_format format);
+
+

+ This function is used to load a private key into the context from a buffer. +

+
+ + Parameters +
+
+

+
+
private_key
+

+ The buffer containing the private key. +

+
format
+

+ The private key format (ASN.1 or PEM). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_PrivateKey or SSL_CTX_use_PrivateKey_ASN1. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_private_key/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_private_key/overload2.html new file mode 100644 index 0000000..8ad6e80 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_private_key/overload2.html @@ -0,0 +1,77 @@ + + + +ssl::context::use_private_key (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a private key from a memory buffer. +

+
void use_private_key(
+    const const_buffer & private_key,
+    file_format format,
+    asio::error_code & ec);
+
+

+ This function is used to load a private key into the context from a buffer. +

+
+ + Parameters +
+
+

+
+
private_key
+

+ The buffer containing the private key. +

+
format
+

+ The private key format (ASN.1 or PEM). +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_PrivateKey or SSL_CTX_use_PrivateKey_ASN1. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_private_key_file.html b/include/asio/doc/asio/reference/ssl__context/use_private_key_file.html new file mode 100644 index 0000000..1fc1045 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_private_key_file.html @@ -0,0 +1,53 @@ + + + +ssl::context::use_private_key_file + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + a private key from a file. +

+
void use_private_key_file(
+    const std::string & filename,
+    file_format format);
+  » more...
+
+void use_private_key_file(
+    const std::string & filename,
+    file_format format,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_private_key_file/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_private_key_file/overload1.html new file mode 100644 index 0000000..c589b4e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_private_key_file/overload1.html @@ -0,0 +1,85 @@ + + + +ssl::context::use_private_key_file (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a private key from a file. +

+
void use_private_key_file(
+    const std::string & filename,
+    file_format format);
+
+

+ This function is used to load a private key into the context from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the private key. +

+
format
+

+ The file format (ASN.1 or PEM). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_PrivateKey_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_private_key_file/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_private_key_file/overload2.html new file mode 100644 index 0000000..7fc67ea --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_private_key_file/overload2.html @@ -0,0 +1,77 @@ + + + +ssl::context::use_private_key_file (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use a private key from a file. +

+
void use_private_key_file(
+    const std::string & filename,
+    file_format format,
+    asio::error_code & ec);
+
+

+ This function is used to load a private key into the context from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the private key. +

+
format
+

+ The file format (ASN.1 or PEM). +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_PrivateKey_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key.html b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key.html new file mode 100644 index 0000000..5453ec9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key.html @@ -0,0 +1,53 @@ + + + +ssl::context::use_rsa_private_key + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + an RSA private key from a memory buffer. +

+
void use_rsa_private_key(
+    const const_buffer & private_key,
+    file_format format);
+  » more...
+
+void use_rsa_private_key(
+    const const_buffer & private_key,
+    file_format format,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key/overload1.html new file mode 100644 index 0000000..8434143 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key/overload1.html @@ -0,0 +1,86 @@ + + + +ssl::context::use_rsa_private_key (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use an RSA private key from a memory buffer. +

+
void use_rsa_private_key(
+    const const_buffer & private_key,
+    file_format format);
+
+

+ This function is used to load an RSA private key into the context from + a buffer. +

+
+ + Parameters +
+
+

+
+
private_key
+

+ The buffer containing the RSA private key. +

+
format
+

+ The private key format (ASN.1 or PEM). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_RSAPrivateKey or SSL_CTX_use_RSAPrivateKey_ASN1. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key/overload2.html new file mode 100644 index 0000000..df5b900 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key/overload2.html @@ -0,0 +1,78 @@ + + + +ssl::context::use_rsa_private_key (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use an RSA private key from a memory buffer. +

+
void use_rsa_private_key(
+    const const_buffer & private_key,
+    file_format format,
+    asio::error_code & ec);
+
+

+ This function is used to load an RSA private key into the context from + a buffer. +

+
+ + Parameters +
+
+

+
+
private_key
+

+ The buffer containing the RSA private key. +

+
format
+

+ The private key format (ASN.1 or PEM). +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_RSAPrivateKey or SSL_CTX_use_RSAPrivateKey_ASN1. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file.html b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file.html new file mode 100644 index 0000000..21d427f --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file.html @@ -0,0 +1,53 @@ + + + +ssl::context::use_rsa_private_key_file + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + an RSA private key from a file. +

+
void use_rsa_private_key_file(
+    const std::string & filename,
+    file_format format);
+  » more...
+
+void use_rsa_private_key_file(
+    const std::string & filename,
+    file_format format,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file/overload1.html new file mode 100644 index 0000000..b523e0b --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file/overload1.html @@ -0,0 +1,86 @@ + + + +ssl::context::use_rsa_private_key_file (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use an RSA private key from a file. +

+
void use_rsa_private_key_file(
+    const std::string & filename,
+    file_format format);
+
+

+ This function is used to load an RSA private key into the context from + a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the RSA private key. +

+
format
+

+ The file format (ASN.1 or PEM). +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_RSAPrivateKey_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file/overload2.html new file mode 100644 index 0000000..f936484 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_rsa_private_key_file/overload2.html @@ -0,0 +1,78 @@ + + + +ssl::context::use_rsa_private_key_file (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use an RSA private key from a file. +

+
void use_rsa_private_key_file(
+    const std::string & filename,
+    file_format format,
+    asio::error_code & ec);
+
+

+ This function is used to load an RSA private key into the context from + a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the RSA private key. +

+
format
+

+ The file format (ASN.1 or PEM). +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_use_RSAPrivateKey_file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_tmp_dh.html b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh.html new file mode 100644 index 0000000..5ad3987 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh.html @@ -0,0 +1,51 @@ + + + +ssl::context::use_tmp_dh + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use the specified + memory buffer to obtain the temporary Diffie-Hellman parameters. +

+
void use_tmp_dh(
+    const const_buffer & dh);
+  » more...
+
+void use_tmp_dh(
+    const const_buffer & dh,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_tmp_dh/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh/overload1.html new file mode 100644 index 0000000..dbadf18 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh/overload1.html @@ -0,0 +1,83 @@ + + + +ssl::context::use_tmp_dh (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use the specified memory buffer to obtain the temporary Diffie-Hellman + parameters. +

+
void use_tmp_dh(
+    const const_buffer & dh);
+
+

+ This function is used to load Diffie-Hellman parameters into the context + from a buffer. +

+
+ + Parameters +
+
+

+
+
dh
+

+ The memory buffer containing the Diffie-Hellman parameters. The + buffer must use the PEM format. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_tmp_dh. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_tmp_dh/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh/overload2.html new file mode 100644 index 0000000..e760ed9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh/overload2.html @@ -0,0 +1,75 @@ + + + +ssl::context::use_tmp_dh (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use the specified memory buffer to obtain the temporary Diffie-Hellman + parameters. +

+
void use_tmp_dh(
+    const const_buffer & dh,
+    asio::error_code & ec);
+
+

+ This function is used to load Diffie-Hellman parameters into the context + from a buffer. +

+
+ + Parameters +
+
+

+
+
dh
+

+ The memory buffer containing the Diffie-Hellman parameters. The + buffer must use the PEM format. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_tmp_dh. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file.html b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file.html new file mode 100644 index 0000000..0409629 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file.html @@ -0,0 +1,51 @@ + + + +ssl::context::use_tmp_dh_file + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Use + the specified file to obtain the temporary Diffie-Hellman parameters. +

+
void use_tmp_dh_file(
+    const std::string & filename);
+  » more...
+
+void use_tmp_dh_file(
+    const std::string & filename,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file/overload1.html b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file/overload1.html new file mode 100644 index 0000000..4b08f81 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::context::use_tmp_dh_file (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use the specified file to obtain the temporary Diffie-Hellman parameters. +

+
void use_tmp_dh_file(
+    const std::string & filename);
+
+

+ This function is used to load Diffie-Hellman parameters into the context + from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the Diffie-Hellman parameters. + The file must use the PEM format. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_tmp_dh. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file/overload2.html b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file/overload2.html new file mode 100644 index 0000000..a187ff6 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context/use_tmp_dh_file/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::context::use_tmp_dh_file (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Use the specified file to obtain the temporary Diffie-Hellman parameters. +

+
void use_tmp_dh_file(
+    const std::string & filename,
+    asio::error_code & ec);
+
+

+ This function is used to load Diffie-Hellman parameters into the context + from a file. +

+
+ + Parameters +
+
+

+
+
filename
+

+ The name of the file containing the Diffie-Hellman parameters. + The file must use the PEM format. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_CTX_set_tmp_dh. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base.html b/include/asio/doc/asio/reference/ssl__context_base.html new file mode 100644 index 0000000..f941465 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base.html @@ -0,0 +1,294 @@ + + + +ssl::context_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The ssl::context_base + class is used as a base for the basic_context class template so that we have + a common place to define various enums. +

+
class context_base
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ file_format +

+
+

+ File format types. +

+
+

+ method +

+
+

+ Different methods supported by a context. +

+
+

+ options +

+
+

+ Bitmask type for SSL options. +

+
+

+ password_purpose +

+
+

+ Purpose of PEM password. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~context_base [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Data + Members +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ default_workarounds [static] +

+
+

+ Implement various bug workarounds. +

+
+

+ no_compression [static] +

+
+

+ Disable compression. Compression is disabled by default. +

+
+

+ no_sslv2 [static] +

+
+

+ Disable SSL v2. +

+
+

+ no_sslv3 [static] +

+
+

+ Disable SSL v3. +

+
+

+ no_tlsv1 [static] +

+
+

+ Disable TLS v1. +

+
+

+ no_tlsv1_1 [static] +

+
+

+ Disable TLS v1.1. +

+
+

+ no_tlsv1_2 [static] +

+
+

+ Disable TLS v1.2. +

+
+

+ no_tlsv1_3 [static] +

+
+

+ Disable TLS v1.3. +

+
+

+ single_dh_use [static] +

+
+

+ Always create a new key when using tmp_dh parameters. +

+
+
+ + Requirements +
+

+ Header: asio/ssl/context_base.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/_context_base.html b/include/asio/doc/asio/reference/ssl__context_base/_context_base.html new file mode 100644 index 0000000..ec4ee35 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/_context_base.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::~context_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~context_base();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/default_workarounds.html b/include/asio/doc/asio/reference/ssl__context_base/default_workarounds.html new file mode 100644 index 0000000..cb68245 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/default_workarounds.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::default_workarounds + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Implement + various bug workarounds. +

+
static const long default_workarounds = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/file_format.html b/include/asio/doc/asio/reference/ssl__context_base/file_format.html new file mode 100644 index 0000000..4ef7b12 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/file_format.html @@ -0,0 +1,65 @@ + + + +ssl::context_base::file_format + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +File + format types. +

+
enum file_format
+
+

+ + +

+
+ + Values +
+
+

+
+
asn1
+

+ ASN.1 file. +

+
pem
+

+ PEM file. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/method.html b/include/asio/doc/asio/reference/ssl__context_base/method.html new file mode 100644 index 0000000..7f8b16a --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/method.html @@ -0,0 +1,175 @@ + + + +ssl::context_base::method + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Different + methods supported by a context. +

+
enum method
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + +

+
+ + Values +
+
+

+
+
sslv2
+

+ Generic SSL version 2. +

+
sslv2_client
+

+ SSL version 2 client. +

+
sslv2_server
+

+ SSL version 2 server. +

+
sslv3
+

+ Generic SSL version 3. +

+
sslv3_client
+

+ SSL version 3 client. +

+
sslv3_server
+

+ SSL version 3 server. +

+
tlsv1
+

+ Generic TLS version 1. +

+
tlsv1_client
+

+ TLS version 1 client. +

+
tlsv1_server
+

+ TLS version 1 server. +

+
sslv23
+

+ Generic SSL/TLS. +

+
sslv23_client
+

+ SSL/TLS client. +

+
sslv23_server
+

+ SSL/TLS server. +

+
tlsv11
+

+ Generic TLS version 1.1. +

+
tlsv11_client
+

+ TLS version 1.1 client. +

+
tlsv11_server
+

+ TLS version 1.1 server. +

+
tlsv12
+

+ Generic TLS version 1.2. +

+
tlsv12_client
+

+ TLS version 1.2 client. +

+
tlsv12_server
+

+ TLS version 1.2 server. +

+
tlsv13
+

+ Generic TLS version 1.3. +

+
tlsv13_client
+

+ TLS version 1.3 client. +

+
tlsv13_server
+

+ TLS version 1.3 server. +

+
tls
+

+ Generic TLS. +

+
tls_client
+

+ TLS client. +

+
tls_server
+

+ TLS server. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/no_compression.html b/include/asio/doc/asio/reference/ssl__context_base/no_compression.html new file mode 100644 index 0000000..552cc80 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/no_compression.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::no_compression + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + compression. Compression is disabled by default. +

+
static const long no_compression = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/no_sslv2.html b/include/asio/doc/asio/reference/ssl__context_base/no_sslv2.html new file mode 100644 index 0000000..8e8c9a8 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/no_sslv2.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::no_sslv2 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + SSL v2. +

+
static const long no_sslv2 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/no_sslv3.html b/include/asio/doc/asio/reference/ssl__context_base/no_sslv3.html new file mode 100644 index 0000000..f5310ad --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/no_sslv3.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::no_sslv3 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + SSL v3. +

+
static const long no_sslv3 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1.html b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1.html new file mode 100644 index 0000000..3a7a756 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::no_tlsv1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + TLS v1. +

+
static const long no_tlsv1 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_1.html b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_1.html new file mode 100644 index 0000000..3ceb9ee --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_1.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::no_tlsv1_1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + TLS v1.1. +

+
static const long no_tlsv1_1 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_2.html b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_2.html new file mode 100644 index 0000000..ad69654 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_2.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::no_tlsv1_2 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + TLS v1.2. +

+
static const long no_tlsv1_2 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_3.html b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_3.html new file mode 100644 index 0000000..d550011 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/no_tlsv1_3.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::no_tlsv1_3 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Disable + TLS v1.3. +

+
static const long no_tlsv1_3 = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/options.html b/include/asio/doc/asio/reference/ssl__context_base/options.html new file mode 100644 index 0000000..ba87894 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/options.html @@ -0,0 +1,54 @@ + + + +ssl::context_base::options + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bitmask + type for SSL options. +

+
typedef long options;
+
+
+ + Requirements +
+

+ Header: asio/ssl/context_base.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/password_purpose.html b/include/asio/doc/asio/reference/ssl__context_base/password_purpose.html new file mode 100644 index 0000000..4a03903 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/password_purpose.html @@ -0,0 +1,65 @@ + + + +ssl::context_base::password_purpose + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Purpose + of PEM password. +

+
enum password_purpose
+
+

+ + +

+
+ + Values +
+
+

+
+
for_reading
+

+ The password is needed for reading/decryption. +

+
for_writing
+

+ The password is needed for writing/encryption. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__context_base/single_dh_use.html b/include/asio/doc/asio/reference/ssl__context_base/single_dh_use.html new file mode 100644 index 0000000..7d06bc2 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__context_base/single_dh_use.html @@ -0,0 +1,44 @@ + + + +ssl::context_base::single_dh_use + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Always + create a new key when using tmp_dh parameters. +

+
static const long single_dh_use = implementation_defined;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__error__get_stream_category.html b/include/asio/doc/asio/reference/ssl__error__get_stream_category.html new file mode 100644 index 0000000..10bd35e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__error__get_stream_category.html @@ -0,0 +1,52 @@ + + + +ssl::error::get_stream_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
const asio::error_category & get_stream_category();
+
+
+ + Requirements +
+

+ Header: asio/ssl/error.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__error__make_error_code.html b/include/asio/doc/asio/reference/ssl__error__make_error_code.html new file mode 100644 index 0000000..a704ffb --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__error__make_error_code.html @@ -0,0 +1,53 @@ + + + +ssl::error::make_error_code + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
asio::error_code make_error_code(
+    stream_errors e);
+
+
+ + Requirements +
+

+ Header: asio/ssl/error.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__error__stream_category.html b/include/asio/doc/asio/reference/ssl__error__stream_category.html new file mode 100644 index 0000000..17c7aaf --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__error__stream_category.html @@ -0,0 +1,52 @@ + + + +ssl::error::stream_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
static const asio::error_category & stream_category = asio::ssl::error::get_stream_category();
+
+
+ + Requirements +
+

+ Header: asio/ssl/error.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__error__stream_errors.html b/include/asio/doc/asio/reference/ssl__error__stream_errors.html new file mode 100644 index 0000000..db6c74b --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__error__stream_errors.html @@ -0,0 +1,81 @@ + + + +ssl::error::stream_errors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
enum stream_errors
+
+

+ + + +

+
+ + Values +
+
+

+
+
stream_truncated
+

+ The underlying stream closed before the ssl stream gracefully shut + down. +

+
unspecified_system_error
+

+ The underlying SSL library returned a system error without providing + further information. +

+
unexpected_result
+

+ The underlying SSL library generated an unexpected result from a function + call. +

+
+
+
+ + Requirements +
+

+ Header: asio/ssl/error.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__host_name_verification.html b/include/asio/doc/asio/reference/ssl__host_name_verification.html new file mode 100644 index 0000000..fa8ec43 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__host_name_verification.html @@ -0,0 +1,167 @@ + + + +ssl::host_name_verification + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Verifies a certificate against a host_name according to the rules described + in RFC 6125. +

+
class host_name_verification
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ result_type +

+
+

+ The type of the function object's result. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ host_name_verification [constructor] +

+
+

+ Constructor. +

+
+

+ operator() +

+
+

+ Perform certificate verification. +

+
+
+ + Example +
+

+ The following example shows how to synchronously open a secure connection + to a given host name: +

+
using asio::ip::tcp;
+namespace ssl = asio::ssl;
+typedef ssl::stream<tcp::socket> ssl_socket;
+
+// Create a context that uses the default paths for finding CA certificates.
+ssl::context ctx(ssl::context::sslv23);
+ctx.set_default_verify_paths();
+
+// Open a socket and connect it to the remote host.
+asio::io_context io_context;
+ssl_socket sock(io_context, ctx);
+tcp::resolver resolver(io_context);
+tcp::resolver::query query("host.name", "https");
+asio::connect(sock.lowest_layer(), resolver.resolve(query));
+sock.lowest_layer().set_option(tcp::no_delay(true));
+
+// Perform SSL handshake and verify the remote host's certificate.
+sock.set_verify_mode(ssl::verify_peer);
+sock.set_verify_callback(ssl::host_name_verification("host.name"));
+sock.handshake(ssl_socket::client);
+
+// ... read and write as normal ...
+
+
+ + Requirements +
+

+ Header: asio/ssl/host_name_verification.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__host_name_verification/host_name_verification.html b/include/asio/doc/asio/reference/ssl__host_name_verification/host_name_verification.html new file mode 100644 index 0000000..19e2ea3 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__host_name_verification/host_name_verification.html @@ -0,0 +1,44 @@ + + + +ssl::host_name_verification::host_name_verification + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
host_name_verification(
+    const std::string & host);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__host_name_verification/operator_lp__rp_.html b/include/asio/doc/asio/reference/ssl__host_name_verification/operator_lp__rp_.html new file mode 100644 index 0000000..6afda4c --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__host_name_verification/operator_lp__rp_.html @@ -0,0 +1,46 @@ + + + +ssl::host_name_verification::operator() + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + certificate verification. +

+
bool operator()(
+    bool preverified,
+    verify_context & ctx) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__host_name_verification/result_type.html b/include/asio/doc/asio/reference/ssl__host_name_verification/result_type.html new file mode 100644 index 0000000..b704773 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__host_name_verification/result_type.html @@ -0,0 +1,54 @@ + + + +ssl::host_name_verification::result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the function object's result. +

+
typedef bool result_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/host_name_verification.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__rfc2818_verification.html b/include/asio/doc/asio/reference/ssl__rfc2818_verification.html new file mode 100644 index 0000000..19471ca --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__rfc2818_verification.html @@ -0,0 +1,168 @@ + + + +ssl::rfc2818_verification + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ (Deprecated. Use ssl::host_name_verification.) + Verifies a certificate against a hostname according to the rules described + in RFC 2818. +

+
class rfc2818_verification
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ result_type +

+
+

+ The type of the function object's result. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator() +

+
+

+ Perform certificate verification. +

+
+

+ rfc2818_verification [constructor] +

+
+

+ Constructor. +

+
+
+ + Example +
+

+ The following example shows how to synchronously open a secure connection + to a given host name: +

+
using asio::ip::tcp;
+namespace ssl = asio::ssl;
+typedef ssl::stream<tcp::socket> ssl_socket;
+
+// Create a context that uses the default paths for finding CA certificates.
+ssl::context ctx(ssl::context::sslv23);
+ctx.set_default_verify_paths();
+
+// Open a socket and connect it to the remote host.
+asio::io_context io_context;
+ssl_socket sock(io_context, ctx);
+tcp::resolver resolver(io_context);
+tcp::resolver::query query("host.name", "https");
+asio::connect(sock.lowest_layer(), resolver.resolve(query));
+sock.lowest_layer().set_option(tcp::no_delay(true));
+
+// Perform SSL handshake and verify the remote host's certificate.
+sock.set_verify_mode(ssl::verify_peer);
+sock.set_verify_callback(ssl::rfc2818_verification("host.name"));
+sock.handshake(ssl_socket::client);
+
+// ... read and write as normal ...
+
+
+ + Requirements +
+

+ Header: asio/ssl/rfc2818_verification.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__rfc2818_verification/operator_lp__rp_.html b/include/asio/doc/asio/reference/ssl__rfc2818_verification/operator_lp__rp_.html new file mode 100644 index 0000000..9021428 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__rfc2818_verification/operator_lp__rp_.html @@ -0,0 +1,46 @@ + + + +ssl::rfc2818_verification::operator() + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + certificate verification. +

+
bool operator()(
+    bool preverified,
+    verify_context & ctx) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__rfc2818_verification/result_type.html b/include/asio/doc/asio/reference/ssl__rfc2818_verification/result_type.html new file mode 100644 index 0000000..7e73754 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__rfc2818_verification/result_type.html @@ -0,0 +1,54 @@ + + + +ssl::rfc2818_verification::result_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the function object's result. +

+
typedef bool result_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/rfc2818_verification.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__rfc2818_verification/rfc2818_verification.html b/include/asio/doc/asio/reference/ssl__rfc2818_verification/rfc2818_verification.html new file mode 100644 index 0000000..59d3ebc --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__rfc2818_verification/rfc2818_verification.html @@ -0,0 +1,44 @@ + + + +ssl::rfc2818_verification::rfc2818_verification + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
rfc2818_verification(
+    const std::string & host);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream.html b/include/asio/doc/asio/reference/ssl__stream.html new file mode 100644 index 0000000..7e23df3 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream.html @@ -0,0 +1,413 @@ + + + +ssl::stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides stream-oriented functionality using SSL. +

+
template<
+    typename Stream>
+class stream :
+  public ssl::stream_base,
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ impl_struct +

+
+

+ Structure for use with deprecated impl_type. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ handshake_type +

+
+

+ Different handshake types. +

+
+

+ lowest_layer_type +

+
+

+ The type of the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native handle type of the SSL stream. +

+
+

+ next_layer_type +

+
+

+ The type of the next layer. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_handshake +

+
+

+ Start an asynchronous SSL handshake. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_shutdown +

+
+

+ Asynchronously shut down SSL on the stream. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ handshake +

+
+

+ Perform SSL handshaking. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the underlying implementation in the native type. +

+
+

+ next_layer +

+
+

+ Get a reference to the next layer. +

+
+

+ read_some +

+
+

+ Read some data from the stream. +

+
+

+ set_verify_callback +

+
+

+ Set the callback used to verify peer certificates. +

+
+

+ set_verify_depth +

+
+

+ Set the peer verification depth. +

+
+

+ set_verify_mode +

+
+

+ Set the peer verification mode. +

+
+

+ shutdown +

+
+

+ Shut down SSL on the stream. +

+
+

+ stream + [constructor] +

+
+

+ Construct a stream.
—
Move-construct a stream from + another. +

+
+

+ write_some +

+
+

+ Write some data to the stream. +

+
+

+ ~stream + [destructor] +

+
+

+ Destructor. +

+
+

+ The stream class template provides asynchronous and blocking stream-oriented + functionality using SSL. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. The application + must also ensure that all asynchronous operations are performed within the + same implicit or explicit strand. +

+
+ + Example +
+

+ To use the SSL stream template with an ip::tcp::socket, you + would write: +

+
asio::io_context my_context;
+asio::ssl::context ctx(asio::ssl::context::sslv23);
+asio::ssl::stream<asio:ip::tcp::socket> sock(my_context, ctx);
+
+
+ + Requirements +
+

+ Header: asio/ssl/stream.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/_stream.html b/include/asio/doc/asio/reference/ssl__stream/_stream.html new file mode 100644 index 0000000..b99e2e9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/_stream.html @@ -0,0 +1,51 @@ + + + +ssl::stream::~stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~stream();
+
+
+ + Remarks +
+

+ A stream object must not be destroyed while there are pending + asynchronous operations associated with it. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/async_handshake.html b/include/asio/doc/asio/reference/ssl__stream/async_handshake.html new file mode 100644 index 0000000..13f1080 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/async_handshake.html @@ -0,0 +1,58 @@ + + + +ssl::stream::async_handshake + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous SSL handshake. +

+
template<
+    typename HandshakeHandler = DEFAULT>
+DEDUCED async_handshake(
+    handshake_type type,
+    HandshakeHandler && handler = DEFAULT);
+  » more...
+
+template<
+    typename ConstBufferSequence,
+    typename BufferedHandshakeHandler = DEFAULT>
+DEDUCED async_handshake(
+    handshake_type type,
+    const ConstBufferSequence & buffers,
+    BufferedHandshakeHandler && handler = DEFAULT);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/async_handshake/overload1.html b/include/asio/doc/asio/reference/ssl__stream/async_handshake/overload1.html new file mode 100644 index 0000000..18a114c --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/async_handshake/overload1.html @@ -0,0 +1,79 @@ + + + +ssl::stream::async_handshake (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous SSL handshake. +

+
template<
+    typename HandshakeHandler = DEFAULT>
+DEDUCED async_handshake(
+    handshake_type type,
+    HandshakeHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously perform an SSL handshake on the + stream. This function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
type
+

+ The type of handshaking to be performed, i.e. as a client or as + a server. +

+
handler
+
+

+ The handler to be called when the handshake operation completes. + Copies will be made of the handler as required. The equivalent + function signature of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation.
+);
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/async_handshake/overload2.html b/include/asio/doc/asio/reference/ssl__stream/async_handshake/overload2.html new file mode 100644 index 0000000..26286d7 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/async_handshake/overload2.html @@ -0,0 +1,89 @@ + + + +ssl::stream::async_handshake (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Start an asynchronous SSL handshake. +

+
template<
+    typename ConstBufferSequence,
+    typename BufferedHandshakeHandler = DEFAULT>
+DEDUCED async_handshake(
+    handshake_type type,
+    const ConstBufferSequence & buffers,
+    BufferedHandshakeHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously perform an SSL handshake on the + stream. This function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
type
+

+ The type of handshaking to be performed, i.e. as a client or as + a server. +

+
buffers
+

+ The buffered data to be reused for the handshake. Although the + buffers object may be copied as necessary, ownership of the underlying + buffers is retained by the caller, which must guarantee that they + remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the handshake operation completes. + Copies will be made of the handler as required. The equivalent + function signature of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred // Amount of buffers used in handshake.
+);
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/async_read_some.html b/include/asio/doc/asio/reference/ssl__stream/async_read_some.html new file mode 100644 index 0000000..70ce854 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/async_read_some.html @@ -0,0 +1,94 @@ + + + +ssl::stream::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read one or more bytes of data + from the stream. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ The buffers into which the data will be read. Although the buffers + object may be copied as necessary, ownership of the underlying buffers + is retained by the caller, which must guarantee that they remain + valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The equivalent function + signature of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes read.
+);
+
+

+

+
+
+
+
+ + Remarks +
+

+ The async_read_some operation may not read all of the requested number + of bytes. Consider using the async_read + function if you need to ensure that the requested amount of data is read + before the asynchronous operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/async_shutdown.html b/include/asio/doc/asio/reference/ssl__stream/async_shutdown.html new file mode 100644 index 0000000..364a230 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/async_shutdown.html @@ -0,0 +1,74 @@ + + + +ssl::stream::async_shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Asynchronously + shut down SSL on the stream. +

+
template<
+    typename ShutdownHandler = DEFAULT>
+DEDUCED async_shutdown(
+    ShutdownHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously shut down SSL on the stream. This + function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called when the handshake operation completes. + Copies will be made of the handler as required. The equivalent function + signature of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation.
+);
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/async_write_some.html b/include/asio/doc/asio/reference/ssl__stream/async_write_some.html new file mode 100644 index 0000000..7a6f509 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/async_write_some.html @@ -0,0 +1,94 @@ + + + +ssl::stream::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write one or more bytes of data + to the stream. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ The data to be written to the stream. Although the buffers object + may be copied as necessary, ownership of the underlying buffers is + retained by the caller, which must guarantee that they remain valid + until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The equivalent function + signature of the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes written.
+);
+
+

+

+
+
+
+
+ + Remarks +
+

+ The async_write_some operation may not transmit all of the data to the + peer. Consider using the async_write + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/executor_type.html b/include/asio/doc/asio/reference/ssl__stream/executor_type.html new file mode 100644 index 0000000..ea12471 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/executor_type.html @@ -0,0 +1,54 @@ + + + +ssl::stream::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + of the executor associated with the object. +

+
typedef lowest_layer_type::executor_type executor_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/stream.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/get_executor.html b/include/asio/doc/asio/reference/ssl__stream/get_executor.html new file mode 100644 index 0000000..726d309 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/get_executor.html @@ -0,0 +1,55 @@ + + + +ssl::stream::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the executor + associated with the object. +

+
executor_type get_executor();
+
+

+ This function may be used to obtain the executor object that the stream + uses to dispatch handlers for asynchronous operations. +

+
+ + Return Value +
+

+ A copy of the executor that stream will use to dispatch handlers. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/handshake.html b/include/asio/doc/asio/reference/ssl__stream/handshake.html new file mode 100644 index 0000000..83ccab2 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/handshake.html @@ -0,0 +1,65 @@ + + + +ssl::stream::handshake + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform SSL handshaking. +

+
void handshake(
+    handshake_type type);
+  » more...
+
+void handshake(
+    handshake_type type,
+    asio::error_code & ec);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+void handshake(
+    handshake_type type,
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+void handshake(
+    handshake_type type,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/handshake/overload1.html b/include/asio/doc/asio/reference/ssl__stream/handshake/overload1.html new file mode 100644 index 0000000..69cdc0a --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/handshake/overload1.html @@ -0,0 +1,75 @@ + + + +ssl::stream::handshake (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform SSL handshaking. +

+
void handshake(
+    handshake_type type);
+
+

+ This function is used to perform SSL handshaking on the stream. The function + call will block until handshaking is complete or an error occurs. +

+
+ + Parameters +
+
+

+
+
type
+

+ The type of handshaking to be performed, i.e. as a client or as + a server. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/handshake/overload2.html b/include/asio/doc/asio/reference/ssl__stream/handshake/overload2.html new file mode 100644 index 0000000..fa1ea45 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/handshake/overload2.html @@ -0,0 +1,67 @@ + + + +ssl::stream::handshake (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform SSL handshaking. +

+
void handshake(
+    handshake_type type,
+    asio::error_code & ec);
+
+

+ This function is used to perform SSL handshaking on the stream. The function + call will block until handshaking is complete or an error occurs. +

+
+ + Parameters +
+
+

+
+
type
+

+ The type of handshaking to be performed, i.e. as a client or as + a server. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/handshake/overload3.html b/include/asio/doc/asio/reference/ssl__stream/handshake/overload3.html new file mode 100644 index 0000000..38e0f2a --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/handshake/overload3.html @@ -0,0 +1,82 @@ + + + +ssl::stream::handshake (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform SSL handshaking. +

+
template<
+    typename ConstBufferSequence>
+void handshake(
+    handshake_type type,
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to perform SSL handshaking on the stream. The function + call will block until handshaking is complete or an error occurs. +

+
+ + Parameters +
+
+

+
+
type
+

+ The type of handshaking to be performed, i.e. as a client or as + a server. +

+
buffers
+

+ The buffered data to be reused for the handshake. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/handshake/overload4.html b/include/asio/doc/asio/reference/ssl__stream/handshake/overload4.html new file mode 100644 index 0000000..0cb0de9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/handshake/overload4.html @@ -0,0 +1,74 @@ + + + +ssl::stream::handshake (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform SSL handshaking. +

+
template<
+    typename ConstBufferSequence>
+void handshake(
+    handshake_type type,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to perform SSL handshaking on the stream. The function + call will block until handshaking is complete or an error occurs. +

+
+ + Parameters +
+
+

+
+
type
+

+ The type of handshaking to be performed, i.e. as a client or as + a server. +

+
buffers
+

+ The buffered data to be reused for the handshake. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/handshake_type.html b/include/asio/doc/asio/reference/ssl__stream/handshake_type.html new file mode 100644 index 0000000..c7a9e9e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/handshake_type.html @@ -0,0 +1,65 @@ + + + +ssl::stream::handshake_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Different + handshake types. +

+
enum handshake_type
+
+

+ + +

+
+ + Values +
+
+

+
+
client
+

+ Perform handshaking as a client. +

+
server
+

+ Perform handshaking as a server. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/lowest_layer.html b/include/asio/doc/asio/reference/ssl__stream/lowest_layer.html new file mode 100644 index 0000000..90fdaa2 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/lowest_layer.html @@ -0,0 +1,48 @@ + + + +ssl::stream::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a reference + to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/lowest_layer/overload1.html b/include/asio/doc/asio/reference/ssl__stream/lowest_layer/overload1.html new file mode 100644 index 0000000..bf32a37 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/lowest_layer/overload1.html @@ -0,0 +1,56 @@ + + + +ssl::stream::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of stream + layers. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of stream layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/lowest_layer/overload2.html b/include/asio/doc/asio/reference/ssl__stream/lowest_layer/overload2.html new file mode 100644 index 0000000..c3cd965 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/lowest_layer/overload2.html @@ -0,0 +1,56 @@ + + + +ssl::stream::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a reference to the lowest layer in a stack of stream + layers. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of stream layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/lowest_layer_type.html b/include/asio/doc/asio/reference/ssl__stream/lowest_layer_type.html new file mode 100644 index 0000000..c999397 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/lowest_layer_type.html @@ -0,0 +1,54 @@ + + + +ssl::stream::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the lowest layer. +

+
typedef next_layer_type::lowest_layer_type lowest_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/stream.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/native_handle.html b/include/asio/doc/asio/reference/ssl__stream/native_handle.html new file mode 100644 index 0000000..09ca193 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/native_handle.html @@ -0,0 +1,70 @@ + + + +ssl::stream::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the + underlying implementation in the native type. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying implementation of the + context. This is intended to allow access to context functionality that + is not otherwise provided. +

+
+ + Example +
+

+ The native_handle() function returns a pointer of type SSL* + that is suitable for passing to functions such as SSL_get_verify_result + and SSL_get_peer_certificate: +

+
asio::ssl::stream<asio:ip::tcp::socket> sock(my_context, ctx);
+
+// ... establish connection and perform handshake ...
+
+if (X509* cert = SSL_get_peer_certificate(sock.native_handle()))
+{
+  if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK)
+  {
+    // ...
+  }
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/native_handle_type.html b/include/asio/doc/asio/reference/ssl__stream/native_handle_type.html new file mode 100644 index 0000000..b929f65 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/native_handle_type.html @@ -0,0 +1,54 @@ + + + +ssl::stream::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native handle type of the SSL stream. +

+
typedef SSL * native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/stream.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/next_layer.html b/include/asio/doc/asio/reference/ssl__stream/next_layer.html new file mode 100644 index 0000000..844c0bb --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/next_layer.html @@ -0,0 +1,48 @@ + + + +ssl::stream::next_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a reference + to the next layer. +

+
const next_layer_type & next_layer() const;
+  » more...
+
+next_layer_type & next_layer();
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/next_layer/overload1.html b/include/asio/doc/asio/reference/ssl__stream/next_layer/overload1.html new file mode 100644 index 0000000..e361269 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/next_layer/overload1.html @@ -0,0 +1,56 @@ + + + +ssl::stream::next_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the next layer. +

+
const next_layer_type & next_layer() const;
+
+

+ This function returns a reference to the next layer in a stack of stream + layers. +

+
+ + Return + Value +
+

+ A reference to the next layer in the stack of stream layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/next_layer/overload2.html b/include/asio/doc/asio/reference/ssl__stream/next_layer/overload2.html new file mode 100644 index 0000000..6c612e7 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/next_layer/overload2.html @@ -0,0 +1,56 @@ + + + +ssl::stream::next_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the next layer. +

+
next_layer_type & next_layer();
+
+

+ This function returns a reference to the next layer in a stack of stream + layers. +

+
+ + Return + Value +
+

+ A reference to the next layer in the stack of stream layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/next_layer_type.html b/include/asio/doc/asio/reference/ssl__stream/next_layer_type.html new file mode 100644 index 0000000..87fe0c2 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/next_layer_type.html @@ -0,0 +1,54 @@ + + + +ssl::stream::next_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the next layer. +

+
typedef remove_reference< Stream >::type next_layer_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/stream.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/read_some.html b/include/asio/doc/asio/reference/ssl__stream/read_some.html new file mode 100644 index 0000000..89aba8b --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/read_some.html @@ -0,0 +1,55 @@ + + + +ssl::stream::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read some data + from the stream. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/read_some/overload1.html b/include/asio/doc/asio/reference/ssl__stream/read_some/overload1.html new file mode 100644 index 0000000..f9825f1 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/read_some/overload1.html @@ -0,0 +1,95 @@ + + + +ssl::stream::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to read data from the stream. The function call + will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ The buffers into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/read_some/overload2.html b/include/asio/doc/asio/reference/ssl__stream/read_some/overload2.html new file mode 100644 index 0000000..fcca692 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/read_some/overload2.html @@ -0,0 +1,87 @@ + + + +ssl::stream::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the stream. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to read data from the stream. The function call + will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ The buffers into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_callback.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_callback.html new file mode 100644 index 0000000..8776d02 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_callback.html @@ -0,0 +1,55 @@ + + + +ssl::stream::set_verify_callback + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the callback used to verify peer certificates. +

+
template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback);
+  » more...
+
+template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_callback/overload1.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_callback/overload1.html new file mode 100644 index 0000000..7dd0099 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_callback/overload1.html @@ -0,0 +1,95 @@ + + + +ssl::stream::set_verify_callback (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the callback used to verify peer certificates. +

+
template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback);
+
+

+ This function is used to specify a callback function that will be called + by the implementation when it needs to verify a peer certificate. +

+
+ + Parameters +
+
+

+
+
callback
+
+

+ The function object to be used for verifying a certificate. The + function signature of the handler must be: +

+
bool verify_callback(
+  bool preverified, // True if the certificate passed pre-verification.
+  verify_context& ctx // The peer certificate and other context.
+);
+
+

+ The return value of the callback is true if the certificate has + passed verification, false otherwise. +

+
+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_callback/overload2.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_callback/overload2.html new file mode 100644 index 0000000..16a6b5e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_callback/overload2.html @@ -0,0 +1,87 @@ + + + +ssl::stream::set_verify_callback (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the callback used to verify peer certificates. +

+
template<
+    typename VerifyCallback>
+void set_verify_callback(
+    VerifyCallback callback,
+    asio::error_code & ec);
+
+

+ This function is used to specify a callback function that will be called + by the implementation when it needs to verify a peer certificate. +

+
+ + Parameters +
+
+

+
+
callback
+
+

+ The function object to be used for verifying a certificate. The + function signature of the handler must be: +

+
bool verify_callback(
+  bool preverified, // True if the certificate passed pre-verification.
+  verify_context& ctx // The peer certificate and other context.
+);
+
+

+ The return value of the callback is true if the certificate has + passed verification, false otherwise. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_depth.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_depth.html new file mode 100644 index 0000000..57ee6a4 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_depth.html @@ -0,0 +1,51 @@ + + + +ssl::stream::set_verify_depth + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the peer verification depth. +

+
void set_verify_depth(
+    int depth);
+  » more...
+
+void set_verify_depth(
+    int depth,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_depth/overload1.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_depth/overload1.html new file mode 100644 index 0000000..6b79166 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_depth/overload1.html @@ -0,0 +1,82 @@ + + + +ssl::stream::set_verify_depth (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification depth. +

+
void set_verify_depth(
+    int depth);
+
+

+ This function may be used to configure the maximum verification depth + allowed by the stream. +

+
+ + Parameters +
+
+

+
+
depth
+

+ Maximum depth for the certificate chain verification that shall + be allowed. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_set_verify_depth. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_depth/overload2.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_depth/overload2.html new file mode 100644 index 0000000..e0da0c6 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_depth/overload2.html @@ -0,0 +1,74 @@ + + + +ssl::stream::set_verify_depth (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification depth. +

+
void set_verify_depth(
+    int depth,
+    asio::error_code & ec);
+
+

+ This function may be used to configure the maximum verification depth + allowed by the stream. +

+
+ + Parameters +
+
+

+
+
depth
+

+ Maximum depth for the certificate chain verification that shall + be allowed. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_set_verify_depth. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_mode.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_mode.html new file mode 100644 index 0000000..2376900 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_mode.html @@ -0,0 +1,51 @@ + + + +ssl::stream::set_verify_mode + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Set + the peer verification mode. +

+
void set_verify_mode(
+    verify_mode v);
+  » more...
+
+void set_verify_mode(
+    verify_mode v,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_mode/overload1.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_mode/overload1.html new file mode 100644 index 0000000..7c08ad9 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_mode/overload1.html @@ -0,0 +1,83 @@ + + + +ssl::stream::set_verify_mode (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification mode. +

+
void set_verify_mode(
+    verify_mode v);
+
+

+ This function may be used to configure the peer verification mode used + by the stream. The new mode will override the mode inherited from the + context. +

+
+ + Parameters +
+
+

+
+
v
+

+ A bitmask of peer verification modes. See ssl::verify_mode + for available values. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ Calls SSL_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/set_verify_mode/overload2.html b/include/asio/doc/asio/reference/ssl__stream/set_verify_mode/overload2.html new file mode 100644 index 0000000..1444ec6 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/set_verify_mode/overload2.html @@ -0,0 +1,75 @@ + + + +ssl::stream::set_verify_mode (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Set the peer verification mode. +

+
void set_verify_mode(
+    verify_mode v,
+    asio::error_code & ec);
+
+

+ This function may be used to configure the peer verification mode used + by the stream. The new mode will override the mode inherited from the + context. +

+
+ + Parameters +
+
+

+
+
v
+

+ A bitmask of peer verification modes. See ssl::verify_mode + for available values. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Remarks +
+

+ Calls SSL_set_verify. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/shutdown.html b/include/asio/doc/asio/reference/ssl__stream/shutdown.html new file mode 100644 index 0000000..3af0f24 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/shutdown.html @@ -0,0 +1,49 @@ + + + +ssl::stream::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Shut down SSL on + the stream. +

+
void shutdown();
+  » more...
+
+void shutdown(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/shutdown/overload1.html b/include/asio/doc/asio/reference/ssl__stream/shutdown/overload1.html new file mode 100644 index 0000000..182784f --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/shutdown/overload1.html @@ -0,0 +1,60 @@ + + + +ssl::stream::shutdown (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Shut down SSL on the stream. +

+
void shutdown();
+
+

+ This function is used to shut down SSL on the stream. The function call + will block until SSL has been shut down or an error occurs. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/shutdown/overload2.html b/include/asio/doc/asio/reference/ssl__stream/shutdown/overload2.html new file mode 100644 index 0000000..593de63 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/shutdown/overload2.html @@ -0,0 +1,61 @@ + + + +ssl::stream::shutdown (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Shut down SSL on the stream. +

+
void shutdown(
+    asio::error_code & ec);
+
+

+ This function is used to shut down SSL on the stream. The function call + will block until SSL has been shut down or an error occurs. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/stream.html b/include/asio/doc/asio/reference/ssl__stream/stream.html new file mode 100644 index 0000000..ccf2175 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/stream.html @@ -0,0 +1,55 @@ + + + +ssl::stream::stream + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct a stream. +

+
template<
+    typename Arg>
+stream(
+    Arg && arg,
+    context & ctx);
+  » more...
+
+

+ Move-construct a stream from another. +

+
stream(
+    stream && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/stream/overload1.html b/include/asio/doc/asio/reference/ssl__stream/stream/overload1.html new file mode 100644 index 0000000..57bab8d --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/stream/overload1.html @@ -0,0 +1,68 @@ + + + +ssl::stream::stream (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream. +

+
template<
+    typename Arg>
+stream(
+    Arg && arg,
+    context & ctx);
+
+

+ This constructor creates a stream and initialises the underlying stream + object. +

+
+ + Parameters +
+
+

+
+
arg
+

+ The argument to be passed to initialise the underlying stream. +

+
ctx
+

+ The SSL context to be used for the stream. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/stream/overload2.html b/include/asio/doc/asio/reference/ssl__stream/stream/overload2.html new file mode 100644 index 0000000..85d968e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/stream/overload2.html @@ -0,0 +1,60 @@ + + + +ssl::stream::stream (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a stream from another. +

+
stream(
+    stream && other);
+
+
+ + Parameters +
+
+

+
+
other
+

+ The other stream object from which the move will occur. Must have + no outstanding asynchronous operations associated with it. Following + the move, other has a valid but unspecified state + where the only safe operation is destruction. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/write_some.html b/include/asio/doc/asio/reference/ssl__stream/write_some.html new file mode 100644 index 0000000..5b2bc75 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/write_some.html @@ -0,0 +1,55 @@ + + + +ssl::stream::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write some data + to the stream. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/write_some/overload1.html b/include/asio/doc/asio/reference/ssl__stream/write_some/overload1.html new file mode 100644 index 0000000..fc8f8d2 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/write_some/overload1.html @@ -0,0 +1,95 @@ + + + +ssl::stream::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the stream. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to write data on the stream. The function call + will block until one or more bytes of data has been written successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ The data to be written. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream/write_some/overload2.html b/include/asio/doc/asio/reference/ssl__stream/write_some/overload2.html new file mode 100644 index 0000000..c8c0497 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream/write_some/overload2.html @@ -0,0 +1,87 @@ + + + +ssl::stream::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the stream. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to write data on the stream. The function call + will block until one or more bytes of data has been written successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ The data to be written to the stream. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream__impl_struct.html b/include/asio/doc/asio/reference/ssl__stream__impl_struct.html new file mode 100644 index 0000000..04f1a98 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream__impl_struct.html @@ -0,0 +1,83 @@ + + + +ssl::stream::impl_struct + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Structure for use with deprecated impl_type. +

+
struct impl_struct
+
+
+ + Data Members +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ssl +

+
+
+
+ + Requirements +
+

+ Header: asio/ssl/stream.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream__impl_struct/ssl.html b/include/asio/doc/asio/reference/ssl__stream__impl_struct/ssl.html new file mode 100644 index 0000000..a6c37f8 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream__impl_struct/ssl.html @@ -0,0 +1,42 @@ + + + +ssl::stream::impl_struct::ssl + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
SSL * ssl;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream_base.html b/include/asio/doc/asio/reference/ssl__stream_base.html new file mode 100644 index 0000000..fcd8c19 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream_base.html @@ -0,0 +1,123 @@ + + + +ssl::stream_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The ssl::stream_base + class is used as a base for the ssl::stream + class template so that we have a common place to define various enums. +

+
class stream_base
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ handshake_type +

+
+

+ Different handshake types. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~stream_base [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+
+ + Requirements +
+

+ Header: asio/ssl/stream_base.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream_base/_stream_base.html b/include/asio/doc/asio/reference/ssl__stream_base/_stream_base.html new file mode 100644 index 0000000..d5e1c12 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream_base/_stream_base.html @@ -0,0 +1,44 @@ + + + +ssl::stream_base::~stream_base + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~stream_base();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__stream_base/handshake_type.html b/include/asio/doc/asio/reference/ssl__stream_base/handshake_type.html new file mode 100644 index 0000000..9e0507a --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__stream_base/handshake_type.html @@ -0,0 +1,65 @@ + + + +ssl::stream_base::handshake_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Different + handshake types. +

+
enum handshake_type
+
+

+ + +

+
+ + Values +
+
+

+
+
client
+

+ Perform handshaking as a client. +

+
server
+

+ Perform handshaking as a server. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_client_once.html b/include/asio/doc/asio/reference/ssl__verify_client_once.html new file mode 100644 index 0000000..9bbc05b --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_client_once.html @@ -0,0 +1,55 @@ + + + +ssl::verify_client_once + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Do not request + client certificate on renegotiation. Ignored unless ssl::verify_peer + is set. +

+
const int verify_client_once = implementation_defined;
+
+
+ + Requirements +
+

+ Header: asio/ssl/verify_mode.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_context.html b/include/asio/doc/asio/reference/ssl__verify_context.html new file mode 100644 index 0000000..5717048 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_context.html @@ -0,0 +1,145 @@ + + + +ssl::verify_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A simple wrapper around the X509_STORE_CTX type, used during verification + of a peer certificate. +

+
class verify_context :
+  noncopyable
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ native_handle_type +

+
+

+ The native handle type of the verification context. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ native_handle +

+
+

+ Get the underlying implementation in the native type. +

+
+

+ verify_context [constructor] +

+
+

+ Constructor. +

+
+
+ + Remarks +
+

+ The ssl::verify_context + does not own the underlying X509_STORE_CTX object. +

+
+ + Requirements +
+

+ Header: asio/ssl/verify_context.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_context/native_handle.html b/include/asio/doc/asio/reference/ssl__verify_context/native_handle.html new file mode 100644 index 0000000..c88e7a0 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_context/native_handle.html @@ -0,0 +1,49 @@ + + + +ssl::verify_context::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the underlying implementation in the native type. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying implementation of the + context. This is intended to allow access to context functionality that + is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_context/native_handle_type.html b/include/asio/doc/asio/reference/ssl__verify_context/native_handle_type.html new file mode 100644 index 0000000..5e245c3 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_context/native_handle_type.html @@ -0,0 +1,54 @@ + + + +ssl::verify_context::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native handle type of the verification context. +

+
typedef X509_STORE_CTX * native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/ssl/verify_context.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_context/verify_context.html b/include/asio/doc/asio/reference/ssl__verify_context/verify_context.html new file mode 100644 index 0000000..47476ec --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_context/verify_context.html @@ -0,0 +1,44 @@ + + + +ssl::verify_context::verify_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructor. +

+
verify_context(
+    native_handle_type handle);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_fail_if_no_peer_cert.html b/include/asio/doc/asio/reference/ssl__verify_fail_if_no_peer_cert.html new file mode 100644 index 0000000..199216e --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_fail_if_no_peer_cert.html @@ -0,0 +1,55 @@ + + + +ssl::verify_fail_if_no_peer_cert + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Fail + verification if the peer has no certificate. Ignored unless ssl::verify_peer + is set. +

+
const int verify_fail_if_no_peer_cert = implementation_defined;
+
+
+ + Requirements +
+

+ Header: asio/ssl/verify_mode.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_mode.html b/include/asio/doc/asio/reference/ssl__verify_mode.html new file mode 100644 index 0000000..418db9c --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_mode.html @@ -0,0 +1,70 @@ + + + +ssl::verify_mode + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bitmask type for peer verification. +

+
typedef int verify_mode;
+
+

+ Possible values are: +

+ +
+ + Requirements +
+

+ Header: asio/ssl/verify_mode.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_none.html b/include/asio/doc/asio/reference/ssl__verify_none.html new file mode 100644 index 0000000..ca4f0e5 --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_none.html @@ -0,0 +1,53 @@ + + + +ssl::verify_none + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +No verification. +

+
const int verify_none = implementation_defined;
+
+
+ + Requirements +
+

+ Header: asio/ssl/verify_mode.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/ssl__verify_peer.html b/include/asio/doc/asio/reference/ssl__verify_peer.html new file mode 100644 index 0000000..347d27c --- /dev/null +++ b/include/asio/doc/asio/reference/ssl__verify_peer.html @@ -0,0 +1,53 @@ + + + +ssl::verify_peer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Verify the peer. +

+
const int verify_peer = implementation_defined;
+
+
+ + Requirements +
+

+ Header: asio/ssl/verify_mode.hpp +

+

+ Convenience header: asio/ssl.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/static_thread_pool.html b/include/asio/doc/asio/reference/static_thread_pool.html new file mode 100644 index 0000000..146e07e --- /dev/null +++ b/include/asio/doc/asio/reference/static_thread_pool.html @@ -0,0 +1,433 @@ + + + +static_thread_pool + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
typedef thread_pool static_thread_pool;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type +

+
+

+ Executor implementation type used to submit functions to a thread + pool. +

+
+

+ executor_type +

+
+

+ Executor used to submit functions to a thread pool. +

+
+

+ fork_event +

+
+

+ Fork-related event notifications. +

+
+

+ scheduler_type +

+
+

+ Scheduler used to schedule receivers on a thread pool. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ attach +

+
+

+ Attaches the current thread to the pool. +

+
+

+ executor +

+
+

+ Obtains the executor associated with the pool. +

+
+

+ get_executor +

+
+

+ Obtains the executor associated with the pool. +

+
+

+ join +

+
+

+ Joins the threads. +

+
+

+ notify_fork +

+
+

+ Notify the execution_context of a fork-related event. +

+
+

+ scheduler +

+
+

+ Obtains the scheduler associated with the pool. +

+
+

+ stop +

+
+

+ Stops the threads. +

+
+

+ thread_pool [constructor] +

+
+

+ Constructs a pool with an automatically determined number of threads. +
—
Constructs a pool with a specified number of threads. +

+
+

+ wait +

+
+

+ Waits for threads to complete. +

+
+

+ ~thread_pool [destructor] +

+
+

+ Destructor. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ destroy +

+
+

+ Destroys all services in the context. +

+
+

+ shutdown +

+
+

+ Shuts down all services in the context. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add_service +

+
+

+ (Deprecated: Use make_service().) Add a service object to the execution_context. +

+
+

+ has_service +

+
+

+ Determine if an execution_context contains a specified service + type. +

+
+

+ make_service +

+
+

+ Creates a service object and adds it to the execution_context. +

+
+

+ use_service +

+
+

+ Obtain the service object corresponding to the given type. +

+
+

+ The thread pool class is an execution context where functions are permitted + to run on one of a fixed number of threads. +

+
+ + Submitting + tasks to the pool +
+

+ To submit functions to the thread pool, use the dispatch + , post or defer + free functions. +

+

+ For example: +

+
void my_task()
+{
+  ...
+}
+
+...
+
+// Launch the pool with four threads.
+asio::thread_pool pool(4);
+
+// Submit a function to the pool.
+asio::post(pool, my_task);
+
+// Submit a lambda object to the pool.
+asio::post(pool,
+    []()
+    {
+      ...
+    });
+
+// Wait for all tasks in the pool to complete.
+pool.join();
+
+
+ + Requirements +
+

+ Header: asio/static_thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/steady_timer.html b/include/asio/doc/asio/reference/steady_timer.html new file mode 100644 index 0000000..7cb88f8 --- /dev/null +++ b/include/asio/doc/asio/reference/steady_timer.html @@ -0,0 +1,455 @@ + + + +steady_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for a timer based on the steady + clock. +

+
typedef basic_waitable_timer< chrono::steady_clock > steady_timer;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type of the clock. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_point +

+
+

+ The time point type of the clock. +

+
+

+ traits_type +

+
+

+ The wait traits type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_waitable_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a particular + expiry time relative to now.
—
Move-construct a basic_waitable_timer + from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancel + any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancels + one asynchronous operation that is waiting on the timer. +

+
+

+ expires_after +

+
+

+ Set the timer's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time as an absolute + time.
—
Set the timer's expiry time as an absolute + time.
—
(Deprecated: Use non-error_code overload.) + Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set the + timer's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the timer's expiry time as an absolute time. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_waitable_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_waitable_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_waitable_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A waitable timer is always in one of two states: "expired" or "not + expired". If the wait() or async_wait() function + is called on an expired timer, the wait operation will complete immediately. +

+

+ Most applications will use one of the steady_timer, + system_timer + or high_resolution_timer + typedefs. +

+
+ + Remarks +
+

+ This waitable timer functionality is for use with the C++11 standard library's + <chrono> facility, or with the Boost.Chrono library. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait (C++11): +

+
// Construct a timer without setting an expiry time.
+asio::steady_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_after(std::chrono::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait (C++11): +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::steady_timer timer(my_context,
+    std::chrono::steady_clock::now() + std::chrono::seconds(60));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active waitable timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the action + associated with the timer is performed only once, use something like this: + used: +

+
void on_some_event()
+{
+  if (my_timer.expires_after(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_waitable_timer::expires_after() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+

+ This typedef uses the C++11 <chrono> standard library + facility, if available. Otherwise, it may use the Boost.Chrono library. To + explicitly utilise Boost.Chrono, use the basic_waitable_timer + template directly: +

+
typedef basic_waitable_timer<boost::chrono::steady_clock> timer;
+
+
+ + Requirements +
+

+ Header: asio/steady_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand.html b/include/asio/doc/asio/reference/strand.html new file mode 100644 index 0000000..db844bf --- /dev/null +++ b/include/asio/doc/asio/reference/strand.html @@ -0,0 +1,303 @@ + + + +strand + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+strand +

+

+ Provides serialised function invocation for any executor type. +

+
template<
+    typename Executor>
+class strand
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ inner_executor_type +

+
+

+ The type of the underlying executor. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ defer +

+
+

+ Request the strand to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the strand to invoke the given function object. +

+
+

+ execute +

+
+
+

+ get_inner_executor +

+
+

+ Obtain the underlying executor. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Converting assignment operator. +
—
Move assignment operator.
—
Converting + move assignment operator. +

+
+

+ post +

+
+

+ Request the strand to invoke the given function object. +

+
+

+ prefer +

+
+
+

+ query +

+
+

+ Forward a query to the underlying executor. +

+
+

+ require +

+
+
+

+ running_in_this_thread +

+
+

+ Determine whether the strand is running in the current thread. +

+
+

+ strand + [constructor] +

+
+

+ Default constructor.
—
Construct a strand for the specified + executor.
—
Copy constructor.
—
Converting + constructor.
—
Move constructor.
—
Converting + move constructor. +

+
+

+ ~strand + [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two strands for inequality. +

+
+

+ operator== +

+
+

+ Compare two strands for equality. +

+
+
+ + Requirements +
+

+ Header: asio/strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/_strand.html b/include/asio/doc/asio/reference/strand/_strand.html new file mode 100644 index 0000000..e45940d --- /dev/null +++ b/include/asio/doc/asio/reference/strand/_strand.html @@ -0,0 +1,43 @@ + + + +strand::~strand + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~strand();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/defer.html b/include/asio/doc/asio/reference/strand/defer.html new file mode 100644 index 0000000..cd6f731 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/defer.html @@ -0,0 +1,80 @@ + + + +strand::defer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the strand to invoke the + given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void defer(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object will never be executed inside this function. + Instead, it will be scheduled by the underlying executor's defer function. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/dispatch.html b/include/asio/doc/asio/reference/strand/dispatch.html new file mode 100644 index 0000000..c3e7e10 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/dispatch.html @@ -0,0 +1,82 @@ + + + +strand::dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the strand to invoke + the given function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void dispatch(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the strand to execute the given function object + on its underlying executor. The function object will be executed inside + this function if the strand is not otherwise busy and if the underlying + executor's dispatch() function is also able to execute the + function before returning. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/execute.html b/include/asio/doc/asio/reference/strand/execute.html new file mode 100644 index 0000000..e16156e --- /dev/null +++ b/include/asio/doc/asio/reference/strand/execute.html @@ -0,0 +1,43 @@ + + + +strand::execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
Function::value::type execute(
+    Function && f) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/get_inner_executor.html b/include/asio/doc/asio/reference/strand/get_inner_executor.html new file mode 100644 index 0000000..4883c68 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/get_inner_executor.html @@ -0,0 +1,44 @@ + + + +strand::get_inner_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the underlying executor. +

+
inner_executor_type get_inner_executor() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/inner_executor_type.html b/include/asio/doc/asio/reference/strand/inner_executor_type.html new file mode 100644 index 0000000..573d6f4 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/inner_executor_type.html @@ -0,0 +1,54 @@ + + + +strand::inner_executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The type + of the underlying executor. +

+
typedef Executor inner_executor_type;
+
+
+ + Requirements +
+

+ Header: asio/strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/operator_eq_.html b/include/asio/doc/asio/reference/strand/operator_eq_.html new file mode 100644 index 0000000..910f832 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/operator_eq_.html @@ -0,0 +1,70 @@ + + + +strand::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment operator. +

+
strand & operator=(
+    const strand & other);
+  » more...
+
+

+ Converting assignment operator. +

+
template<
+    class OtherExecutor>
+strand & operator=(
+    const strand< OtherExecutor > & other);
+  » more...
+
+

+ Move assignment operator. +

+
strand & operator=(
+    strand && other);
+  » more...
+
+

+ Converting move assignment operator. +

+
template<
+    class OtherExecutor>
+strand & operator=(
+    strand< OtherExecutor > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/operator_eq_/overload1.html b/include/asio/doc/asio/reference/strand/operator_eq_/overload1.html new file mode 100644 index 0000000..da48b24 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +strand::operator= (1 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator. +

+
strand & operator=(
+    const strand & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/operator_eq_/overload2.html b/include/asio/doc/asio/reference/strand/operator_eq_/overload2.html new file mode 100644 index 0000000..10a526b --- /dev/null +++ b/include/asio/doc/asio/reference/strand/operator_eq_/overload2.html @@ -0,0 +1,50 @@ + + + +strand::operator= (2 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Converting assignment operator. +

+
template<
+    class OtherExecutor>
+strand & operator=(
+    const strand< OtherExecutor > & other);
+
+

+ This assignment operator is only valid if the OtherExecutor + type is convertible to Executor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/operator_eq_/overload3.html b/include/asio/doc/asio/reference/strand/operator_eq_/overload3.html new file mode 100644 index 0000000..d0deaf4 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/operator_eq_/overload3.html @@ -0,0 +1,44 @@ + + + +strand::operator= (3 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move assignment operator. +

+
strand & operator=(
+    strand && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/operator_eq_/overload4.html b/include/asio/doc/asio/reference/strand/operator_eq_/overload4.html new file mode 100644 index 0000000..eea066e --- /dev/null +++ b/include/asio/doc/asio/reference/strand/operator_eq_/overload4.html @@ -0,0 +1,50 @@ + + + +strand::operator= (4 of 4 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Converting move assignment operator. +

+
template<
+    class OtherExecutor>
+strand & operator=(
+    strand< OtherExecutor > && other);
+
+

+ This assignment operator is only valid if the OtherExecutor + type is convertible to Executor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/operator_eq__eq_.html b/include/asio/doc/asio/reference/strand/operator_eq__eq_.html new file mode 100644 index 0000000..1cdeb3e --- /dev/null +++ b/include/asio/doc/asio/reference/strand/operator_eq__eq_.html @@ -0,0 +1,60 @@ + + + +strand::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two strands + for equality. +

+
friend bool operator==(
+    const strand & a,
+    const strand & b);
+
+

+ Two strands are equal if they refer to the same ordered, non-concurrent + state. +

+
+ + Requirements +
+

+ Header: asio/strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/operator_not__eq_.html b/include/asio/doc/asio/reference/strand/operator_not__eq_.html new file mode 100644 index 0000000..3f6f81d --- /dev/null +++ b/include/asio/doc/asio/reference/strand/operator_not__eq_.html @@ -0,0 +1,60 @@ + + + +strand::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare two strands + for inequality. +

+
friend bool operator!=(
+    const strand & a,
+    const strand & b);
+
+

+ Two strands are equal if they refer to the same ordered, non-concurrent + state. +

+
+ + Requirements +
+

+ Header: asio/strand.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/post.html b/include/asio/doc/asio/reference/strand/post.html new file mode 100644 index 0000000..9bd72d3 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/post.html @@ -0,0 +1,80 @@ + + + +strand::post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request the strand to invoke the given + function object. +

+
template<
+    typename Function,
+    typename Allocator>
+void post(
+    Function && f,
+    const Allocator & a) const;
+
+

+ This function is used to ask the executor to execute the given function + object. The function object will never be executed inside this function. + Instead, it will be scheduled by the underlying executor's defer function. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/prefer.html b/include/asio/doc/asio/reference/strand/prefer.html new file mode 100644 index 0000000..ac1aa55 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/prefer.html @@ -0,0 +1,43 @@ + + + +strand::prefer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
Property strand< typename decay< typename prefer_result< const Executor &, Property >::type >::type >::type prefer(
+    const Property & p) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/query.html b/include/asio/doc/asio/reference/strand/query.html new file mode 100644 index 0000000..e015d96 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/query.html @@ -0,0 +1,59 @@ + + + +strand::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Forward a query to the underlying + executor. +

+
template<
+    typename Property>
+enable_if< can_query< const Executor &, Property >::value, typename query_result< const Executor &, Property >::type >::type query(
+    const Property & p) const;
+
+

+ Do not call this function directly. It is intended for use with the execution::execute + customisation point. +

+

+ For example: +

+
asio::strand<my_executor_type> ex = ...;
+if (asio::query(ex, asio::execution::blocking)
+      == asio::execution::blocking.never)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/require.html b/include/asio/doc/asio/reference/strand/require.html new file mode 100644 index 0000000..430c3ca --- /dev/null +++ b/include/asio/doc/asio/reference/strand/require.html @@ -0,0 +1,43 @@ + + + +strand::require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
Property strand< typename decay< typename require_result< const Executor &, Property >::type >::type >::type require(
+    const Property & p) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/running_in_this_thread.html b/include/asio/doc/asio/reference/strand/running_in_this_thread.html new file mode 100644 index 0000000..2b049bd --- /dev/null +++ b/include/asio/doc/asio/reference/strand/running_in_this_thread.html @@ -0,0 +1,54 @@ + + + +strand::running_in_this_thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the strand is running in the current thread. +

+
bool running_in_this_thread() const;
+
+
+ + Return + Value +
+

+ true if the current thread is executing a function that was + submitted to the strand using post(), dispatch() + or defer(). Otherwise returns false. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/strand.html b/include/asio/doc/asio/reference/strand/strand.html new file mode 100644 index 0000000..3bd2ef1 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/strand.html @@ -0,0 +1,86 @@ + + + +strand::strand + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default constructor. +

+
strand();
+  » more...
+
+

+ Construct a strand for the specified executor. +

+
template<
+    typename Executor1>
+explicit strand(
+    const Executor1 & e,
+    typename enable_if< conditional< !is_same< Executor1, strand >::value, is_convertible< Executor1, Executor >, false_type >::type::value >::type *  = 0);
+  » more...
+
+

+ Copy constructor. +

+
strand(
+    const strand & other);
+  » more...
+
+

+ Converting constructor. +

+
template<
+    class OtherExecutor>
+strand(
+    const strand< OtherExecutor > & other);
+  » more...
+
+

+ Move constructor. +

+
strand(
+    strand && other);
+  » more...
+
+

+ Converting move constructor. +

+
template<
+    class OtherExecutor>
+strand(
+    strand< OtherExecutor > && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/strand/overload1.html b/include/asio/doc/asio/reference/strand/strand/overload1.html new file mode 100644 index 0000000..509f857 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/strand/overload1.html @@ -0,0 +1,47 @@ + + + +strand::strand (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
strand();
+
+

+ This constructor is only valid if the underlying executor type is default + constructible. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/strand/overload2.html b/include/asio/doc/asio/reference/strand/strand/overload2.html new file mode 100644 index 0000000..5a4f7cb --- /dev/null +++ b/include/asio/doc/asio/reference/strand/strand/overload2.html @@ -0,0 +1,47 @@ + + + +strand::strand (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a strand for the specified executor. +

+
template<
+    typename Executor1>
+strand(
+    const Executor1 & e,
+    typename enable_if< conditional< !is_same< Executor1, strand >::value, is_convertible< Executor1, Executor >, false_type >::type::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/strand/overload3.html b/include/asio/doc/asio/reference/strand/strand/overload3.html new file mode 100644 index 0000000..71efd79 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/strand/overload3.html @@ -0,0 +1,44 @@ + + + +strand::strand (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
strand(
+    const strand & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/strand/overload4.html b/include/asio/doc/asio/reference/strand/strand/overload4.html new file mode 100644 index 0000000..b3f4f0d --- /dev/null +++ b/include/asio/doc/asio/reference/strand/strand/overload4.html @@ -0,0 +1,50 @@ + + + +strand::strand (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Converting constructor. +

+
template<
+    class OtherExecutor>
+strand(
+    const strand< OtherExecutor > & other);
+
+

+ This constructor is only valid if the OtherExecutor type + is convertible to Executor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/strand/overload5.html b/include/asio/doc/asio/reference/strand/strand/overload5.html new file mode 100644 index 0000000..7db2d83 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/strand/overload5.html @@ -0,0 +1,44 @@ + + + +strand::strand (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
strand(
+    strand && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/strand/strand/overload6.html b/include/asio/doc/asio/reference/strand/strand/overload6.html new file mode 100644 index 0000000..ddddf78 --- /dev/null +++ b/include/asio/doc/asio/reference/strand/strand/overload6.html @@ -0,0 +1,50 @@ + + + +strand::strand (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Converting move constructor. +

+
template<
+    class OtherExecutor>
+strand(
+    strand< OtherExecutor > && other);
+
+

+ This constructor is only valid if the OtherExecutor type + is convertible to Executor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/streambuf.html b/include/asio/doc/asio/reference/streambuf.html new file mode 100644 index 0000000..fea7d80 --- /dev/null +++ b/include/asio/doc/asio/reference/streambuf.html @@ -0,0 +1,362 @@ + + + +streambuf + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for the typical usage of basic_streambuf. +

+
typedef basic_streambuf streambuf;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ const_buffers_type +

+
+

+ The type used to represent the input sequence as a list of buffers. +

+
+

+ mutable_buffers_type +

+
+

+ The type used to represent the output sequence as a list of buffers. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_streambuf [constructor] +

+
+

+ Construct a basic_streambuf object. +

+
+

+ capacity +

+
+

+ Get the current capacity of the basic_streambuf. +

+
+

+ commit +

+
+

+ Move characters from the output sequence to the input sequence. +

+
+

+ consume +

+
+

+ Remove characters from the input sequence. +

+
+

+ data +

+
+

+ Get a list of buffers that represents the input sequence. +

+
+

+ max_size +

+
+

+ Get the maximum size of the basic_streambuf. +

+
+

+ prepare +

+
+

+ Get a list of buffers that represents the output sequence, with + the given size. +

+
+

+ size +

+
+

+ Get the size of the input sequence. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ overflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ reserve +

+
+
+

+ underflow +

+
+

+ Override std::streambuf behaviour. +

+
+

+ The basic_streambuf class is derived from std::streambuf + to associate the streambuf's input and output sequences with one or more + character arrays. These character arrays are internal to the basic_streambuf + object, but direct access to the array elements is provided to permit them + to be used efficiently with I/O operations. Characters written to the output + sequence of a basic_streambuf object are appended to the input + sequence of the same object. +

+

+ The basic_streambuf class's public interface is intended to + permit the following implementation strategies: +

+
    +
  • + A single contiguous character array, which is reallocated as necessary + to accommodate changes in the size of the character sequence. This is + the implementation approach currently used in Asio. +
  • +
  • + A sequence of one or more character arrays, where each array is of the + same size. Additional character array objects are appended to the sequence + to accommodate changes in the size of the character sequence. +
  • +
  • + A sequence of one or more character arrays of varying sizes. Additional + character array objects are appended to the sequence to accommodate changes + in the size of the character sequence. +
  • +
+

+ The constructor for basic_streambuf + accepts a size_t argument specifying the maximum of the sum + of the sizes of the input sequence and output sequence. During the lifetime + of the basic_streambuf object, the following invariant holds: +

+
size() <= max_size()
+
+

+ Any member function that would, if successful, cause the invariant to be + violated shall throw an exception of class std::length_error. +

+

+ The constructor for basic_streambuf takes an Allocator argument. + A copy of this argument is used for any memory allocation performed, by the + constructor and by all member functions, during the lifetime of each basic_streambuf + object. +

+
+ + Examples +
+

+ Writing directly from an streambuf to a socket: +

+
asio::streambuf b;
+std::ostream os(&b);
+os << "Hello, World!\n";
+
+// try sending some data in input sequence
+size_t n = sock.send(b.data());
+
+b.consume(n); // sent data is removed from input sequence
+
+

+ Reading from a socket directly into a streambuf: +

+
asio::streambuf b;
+
+// reserve 512 bytes in output sequence
+asio::streambuf::mutable_buffers_type bufs = b.prepare(512);
+
+size_t n = sock.receive(bufs);
+
+// received data is "committed" from output sequence to input sequence
+b.commit(n);
+
+std::istream is(&b);
+std::string s;
+is >> s;
+
+
+ + Requirements +
+

+ Header: asio/streambuf.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/synchronous_socket_operations.html b/include/asio/doc/asio/reference/synchronous_socket_operations.html new file mode 100644 index 0000000..3b2595a --- /dev/null +++ b/include/asio/doc/asio/reference/synchronous_socket_operations.html @@ -0,0 +1,77 @@ + + + +Requirements on synchronous socket operations + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In this section, synchronous socket operations are those + member functions specified as two overloads, with and without an argument + of type error_code&: +

+
R f(A1 a1, A2 a2, ..., AN aN);
+R f(A1 a1, A2 a2, ..., AN aN, error_code& ec);
+
+

+ For an object s, the conditions under which its synchronous + socket operations may block the calling thread (C++Std [defns.block]) are + determined as follows. +

+

+ If: +

+

+ — s.non_blocking() == true, +

+

+ — the synchronous socket operation is specified in terms of a POSIX + function other than poll(), +

+

+ — that POSIX function lists EWOULDBLOCK or + EAGAIN in its failure conditions, and +

+

+ — the effects of the operation cannot be established immediately +

+

+ then the synchronous socket operation shall not block the calling thread. + [Note: And the effects of the operation are not established. + —end note] +

+

+ Otherwise, the synchronous socket operation shall block the calling thread + until the effects are established. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_category.html b/include/asio/doc/asio/reference/system_category.html new file mode 100644 index 0000000..c229922 --- /dev/null +++ b/include/asio/doc/asio/reference/system_category.html @@ -0,0 +1,54 @@ + + + +system_category + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Returns the error category used + for the system errors produced by asio. +

+
const error_category & system_category();
+
+
+ + Requirements +
+

+ Header: asio/error_code.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context.html b/include/asio/doc/asio/reference/system_context.html new file mode 100644 index 0000000..707f0fd --- /dev/null +++ b/include/asio/doc/asio/reference/system_context.html @@ -0,0 +1,320 @@ + + + +system_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The executor context for the system executor. +

+
class system_context :
+  public execution_context
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_type +

+
+

+ The executor type associated with the context. +

+
+

+ fork_event +

+
+

+ Fork-related event notifications. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ get_executor +

+
+

+ Obtain an executor for the context. +

+
+

+ join +

+
+

+ Join all threads in the system thread pool. +

+
+

+ notify_fork +

+
+

+ Notify the execution_context of a fork-related event. +

+
+

+ stop +

+
+

+ Signal all threads in the system thread pool to stop. +

+
+

+ stopped +

+
+

+ Determine whether the system thread pool has been stopped. +

+
+

+ ~system_context [destructor] +

+
+

+ Destructor shuts down all threads in the system thread pool. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ destroy +

+
+

+ Destroys all services in the context. +

+
+

+ shutdown +

+
+

+ Shuts down all services in the context. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add_service +

+
+

+ (Deprecated: Use make_service().) Add a service object to the execution_context. +

+
+

+ has_service +

+
+

+ Determine if an execution_context contains a specified service + type. +

+
+

+ make_service +

+
+

+ Creates a service object and adds it to the execution_context. +

+
+

+ use_service +

+
+

+ Obtain the service object corresponding to the given type. +

+
+
+ + Requirements +
+

+ Header: asio/system_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/_system_context.html b/include/asio/doc/asio/reference/system_context/_system_context.html new file mode 100644 index 0000000..174bd4e --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/_system_context.html @@ -0,0 +1,44 @@ + + + +system_context::~system_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor + shuts down all threads in the system thread pool. +

+
~system_context();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/add_service.html b/include/asio/doc/asio/reference/system_context/add_service.html new file mode 100644 index 0000000..1683b59 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/add_service.html @@ -0,0 +1,111 @@ + + + +system_context::add_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +(Deprecated: + Use make_service().) Add a service object to the execution_context. +

+
template<
+    typename Service>
+friend void add_service(
+    execution_context & e,
+    Service * svc);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
svc
+
+

+ The service object. On success, ownership of the service object is + transferred to the execution_context. + When the execution_context + object is destroyed, it will destroy the service object by performing: +

+
delete static_cast<execution_context::service*>(svc)
+
+

+

+
+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
asio::invalid_service_owner
+

+ Thrown if the service's owning execution_context + is not the execution_context + object specified by the e parameter. +

+
+
+
+ + Requirements +
+

+ Header: asio/system_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/destroy.html b/include/asio/doc/asio/reference/system_context/destroy.html new file mode 100644 index 0000000..42c2575 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/destroy.html @@ -0,0 +1,55 @@ + + + +system_context::destroy + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Destroys all + services in the context. +

+
void destroy();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order * of the beginning of service object lifetime, + performs delete static_cast<execution_context::service*>(svc). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/executor_type.html b/include/asio/doc/asio/reference/system_context/executor_type.html new file mode 100644 index 0000000..1eae5b2 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/executor_type.html @@ -0,0 +1,278 @@ + + + +system_context::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + executor type associated with the context. +

+
typedef basic_system_executor< execution::blocking_t::possibly_t, execution::relationship_t::fork_t, std::allocator< void > > executor_type;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_system_executor [constructor] +

+
+

+ Default constructor. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the executor that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the executor that it has some outstanding work to do. +

+
+

+ post +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the allocator property.
—
+ Query the occupancy (recommended number of work items) for the + system context. +

+
+

+ query [static] +

+
+

+ Query the current value of the mapping property.
—
+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.always property. +
—
Obtain an executor with the blocking.never property. +
—
Obtain an executor with the relationship.continuation + property.
—
Obtain an executor with the relationship.fork + property.
—
Obtain an executor with the specified + allocator property.
—
Obtain an executor with the + default allocator property. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+

+ The system executor represents an execution context where functions are + permitted to run on arbitrary threads. When the blocking.never property + is established, the system executor will schedule the function to run on + an unspecified system thread pool. When either blocking.possibly or blocking.always + is established, the executor invokes the function immediately. +

+
+ + Requirements +
+

+ Header: asio/system_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/fork_event.html b/include/asio/doc/asio/reference/system_context/fork_event.html new file mode 100644 index 0000000..2d423ff --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/fork_event.html @@ -0,0 +1,73 @@ + + + +system_context::fork_event + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Fork-related + event notifications. +

+
enum fork_event
+
+

+ + + +

+
+ + Values +
+
+

+
+
fork_prepare
+

+ Notify the context that the process is about to fork. +

+
fork_parent
+

+ Notify the context that the process has forked and is the parent. +

+
fork_child
+

+ Notify the context that the process has forked and is the child. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/get_executor.html b/include/asio/doc/asio/reference/system_context/get_executor.html new file mode 100644 index 0000000..cd1ea4a --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/get_executor.html @@ -0,0 +1,44 @@ + + + +system_context::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an executor for the context. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/has_service.html b/include/asio/doc/asio/reference/system_context/has_service.html new file mode 100644 index 0000000..e41afef --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/has_service.html @@ -0,0 +1,88 @@ + + + +system_context::has_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Determine + if an execution_context + contains a specified service type. +

+
template<
+    typename Service>
+friend bool has_service(
+    execution_context & e);
+
+

+ This function is used to determine whether the execution_context + contains a service object corresponding to the given service type. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ A boolean indicating whether the execution_context + contains the service. +

+
+ + Requirements +
+

+ Header: asio/system_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/join.html b/include/asio/doc/asio/reference/system_context/join.html new file mode 100644 index 0000000..9f40b06 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/join.html @@ -0,0 +1,44 @@ + + + +system_context::join + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Join all threads in + the system thread pool. +

+
void join();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/make_service.html b/include/asio/doc/asio/reference/system_context/make_service.html new file mode 100644 index 0000000..3e06dbd --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/make_service.html @@ -0,0 +1,97 @@ + + + +system_context::make_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Creates + a service object and adds it to the execution_context. +

+
template<
+    typename Service,
+    typename... Args>
+friend Service & make_service(
+    execution_context & e,
+    Args &&... args);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
args
+

+ Zero or more arguments to be passed to the service constructor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
+
+
+ + Requirements +
+

+ Header: asio/system_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/notify_fork.html b/include/asio/doc/asio/reference/system_context/notify_fork.html new file mode 100644 index 0000000..396772c --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/notify_fork.html @@ -0,0 +1,122 @@ + + + +system_context::notify_fork + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Notify + the execution_context + of a fork-related event. +

+
void notify_fork(
+    fork_event event);
+
+

+ This function is used to inform the execution_context + that the process is about to fork, or has just forked. This allows the + execution_context, + and the services it contains, to perform any necessary housekeeping to + ensure correct operation following a fork. +

+

+ This function must not be called while any other execution_context + function, or any function associated with the execution_context's derived + class, is being called in another thread. It is, however, safe to call + this function from within a completion handler, provided no other thread + is accessing the execution_context + or its derived class. +

+
+ + Parameters +
+
+

+
+
event
+

+ A fork-related event. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the notification fails the execution_context + object should no longer be used and should be destroyed. +

+
+
+
+ + Example +
+

+ The following code illustrates how to incorporate the notify_fork() + function: +

+
my_execution_context.notify_fork(execution_context::fork_prepare);
+if (fork() == 0)
+{
+  // This is the child process.
+  my_execution_context.notify_fork(execution_context::fork_child);
+}
+else
+{
+  // This is the parent process.
+  my_execution_context.notify_fork(execution_context::fork_parent);
+}
+
+
+ + Remarks +
+

+ For each service object svc in the execution_context + set, performs svc->notify_fork();. When processing the + fork_prepare event, services are visited in reverse order of the beginning + of service object lifetime. Otherwise, services are visited in order of + the beginning of service object lifetime. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/shutdown.html b/include/asio/doc/asio/reference/system_context/shutdown.html new file mode 100644 index 0000000..0b94ffe --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/shutdown.html @@ -0,0 +1,55 @@ + + + +system_context::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Shuts down + all services in the context. +

+
void shutdown();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order of the beginning of service object lifetime, + performs svc->shutdown(). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/stop.html b/include/asio/doc/asio/reference/system_context/stop.html new file mode 100644 index 0000000..629b2f5 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/stop.html @@ -0,0 +1,44 @@ + + + +system_context::stop + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Signal all threads + in the system thread pool to stop. +

+
void stop();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/stopped.html b/include/asio/doc/asio/reference/system_context/stopped.html new file mode 100644 index 0000000..f1726c4 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/stopped.html @@ -0,0 +1,44 @@ + + + +system_context::stopped + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine whether + the system thread pool has been stopped. +

+
bool stopped() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/use_service.html b/include/asio/doc/asio/reference/system_context/use_service.html new file mode 100644 index 0000000..b72c081 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/use_service.html @@ -0,0 +1,54 @@ + + + +system_context::use_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+  » more...
+
+template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/use_service/overload1.html b/include/asio/doc/asio/reference/system_context/use_service/overload1.html new file mode 100644 index 0000000..591dc82 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/use_service/overload1.html @@ -0,0 +1,88 @@ + + + +system_context::use_service (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+
+

+ This function is used to locate a service object that corresponds to + the given service type. If there is no existing implementation of the + service, then the execution_context + will create a new instance of the service. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ The service interface implementing the specified service type. Ownership + of the service interface is not transferred to the caller. +

+
+ + Requirements +
+

+ Header: asio/system_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_context/use_service/overload2.html b/include/asio/doc/asio/reference/system_context/use_service/overload2.html new file mode 100644 index 0000000..a1f1b24 --- /dev/null +++ b/include/asio/doc/asio/reference/system_context/use_service/overload2.html @@ -0,0 +1,96 @@ + + + +system_context::use_service (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+
+

+ This function is used to locate a service object that corresponds to + the given service type. If there is no existing implementation of the + service, then the io_context + will create a new instance of the service. +

+
+ + Parameters +
+
+

+
+
ioc
+

+ The io_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ The service interface implementing the specified service type. Ownership + of the service interface is not transferred to the caller. +

+
+ + Remarks +
+

+ This overload is preserved for backwards compatibility with services + that inherit from io_context::service. +

+
+ + Requirements +
+

+ Header: asio/system_context.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error.html b/include/asio/doc/asio/reference/system_error.html new file mode 100644 index 0000000..183d5c3 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error.html @@ -0,0 +1,141 @@ + + + +system_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The system_error + class is used to represent system conditions that prevent the library from + operating correctly. +

+
class system_error :
+  public std::exception
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ code +

+
+

+ Get the error code associated with the exception. +

+
+

+ operator= +

+
+

+ Assignment operator. +

+
+

+ system_error [constructor] +

+
+

+ Construct with an error code.
—
Construct with an error + code and context.
—
Copy constructor. +

+
+

+ what +

+
+

+ Get a string representation of the exception. +

+
+

+ ~system_error [destructor] +

+
+

+ Destructor. +

+
+
+ + Requirements +
+

+ Header: asio/system_error.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/_system_error.html b/include/asio/doc/asio/reference/system_error/_system_error.html new file mode 100644 index 0000000..4d2e201 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/_system_error.html @@ -0,0 +1,43 @@ + + + +system_error::~system_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
virtual ~system_error();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/code.html b/include/asio/doc/asio/reference/system_error/code.html new file mode 100644 index 0000000..77d11b2 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/code.html @@ -0,0 +1,44 @@ + + + +system_error::code + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the error code associated + with the exception. +

+
error_code code() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/operator_eq_.html b/include/asio/doc/asio/reference/system_error/operator_eq_.html new file mode 100644 index 0000000..3d5bca5 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/operator_eq_.html @@ -0,0 +1,45 @@ + + + +system_error::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment + operator. +

+
system_error & operator=(
+    const system_error & e);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/system_error.html b/include/asio/doc/asio/reference/system_error/system_error.html new file mode 100644 index 0000000..ada5383 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/system_error.html @@ -0,0 +1,61 @@ + + + +system_error::system_error + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + with an error code. +

+
system_error(
+    const error_code & ec);
+  » more...
+
+

+ Construct with an error code and context. +

+
system_error(
+    const error_code & ec,
+    const std::string & context);
+  » more...
+
+

+ Copy constructor. +

+
system_error(
+    const system_error & other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/system_error/overload1.html b/include/asio/doc/asio/reference/system_error/system_error/overload1.html new file mode 100644 index 0000000..9b684f1 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/system_error/overload1.html @@ -0,0 +1,44 @@ + + + +system_error::system_error (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with an error code. +

+
system_error(
+    const error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/system_error/overload2.html b/include/asio/doc/asio/reference/system_error/system_error/overload2.html new file mode 100644 index 0000000..07eb771 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/system_error/overload2.html @@ -0,0 +1,45 @@ + + + +system_error::system_error (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct with an error code and context. +

+
system_error(
+    const error_code & ec,
+    const std::string & context);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/system_error/overload3.html b/include/asio/doc/asio/reference/system_error/system_error/overload3.html new file mode 100644 index 0000000..e9315d1 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/system_error/overload3.html @@ -0,0 +1,44 @@ + + + +system_error::system_error (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
system_error(
+    const system_error & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_error/what.html b/include/asio/doc/asio/reference/system_error/what.html new file mode 100644 index 0000000..31db314 --- /dev/null +++ b/include/asio/doc/asio/reference/system_error/what.html @@ -0,0 +1,44 @@ + + + +system_error::what + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get a string representation + of the exception. +

+
virtual const char * what() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_executor.html b/include/asio/doc/asio/reference/system_executor.html new file mode 100644 index 0000000..4e4f2b6 --- /dev/null +++ b/include/asio/doc/asio/reference/system_executor.html @@ -0,0 +1,284 @@ + + + +system_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An executor that uses arbitrary + threads. +

+
typedef basic_system_executor< execution::blocking_t::possibly_t, execution::relationship_t::fork_t, std::allocator< void > > system_executor;
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_system_executor [constructor] +

+
+

+ Default constructor. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the executor that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the executor that it has some outstanding work to do. +

+
+

+ post +

+
+

+ Request the system executor to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the allocator property.
—
+ Query the occupancy (recommended number of work items) for the + system context. +

+
+

+ query [static] +

+
+

+ Query the current value of the mapping property.
—
+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.always property.
+ —
Obtain an executor with the blocking.never property.
+ —
Obtain an executor with the relationship.continuation property. +
—
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the specified allocator property. +
—
Obtain an executor with the default allocator property. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+

+ The system executor represents an execution context where functions are permitted + to run on arbitrary threads. When the blocking.never property is established, + the system executor will schedule the function to run on an unspecified system + thread pool. When either blocking.possibly or blocking.always is established, + the executor invokes the function immediately. +

+

+ The system executor represents an execution context where functions are permitted + to run on arbitrary threads. When the blocking.never property is established, + the system executor will schedule the function to run on an unspecified system + thread pool. When either blocking.possibly or blocking.always is established, + the executor invokes the function immediately. +

+
+ + Requirements +
+

+ Header: asio/system_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/system_timer.html b/include/asio/doc/asio/reference/system_timer.html new file mode 100644 index 0000000..5fec0c9 --- /dev/null +++ b/include/asio/doc/asio/reference/system_timer.html @@ -0,0 +1,455 @@ + + + +system_timer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for a timer based on the system + clock. +

+
typedef basic_waitable_timer< chrono::system_clock > system_timer;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the timer type to another executor. +

+
+

+ clock_type +

+
+

+ The clock type. +

+
+

+ duration +

+
+

+ The duration type of the clock. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ time_point +

+
+

+ The time point type of the clock. +

+
+

+ traits_type +

+
+

+ The wait traits type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the timer. +

+
+

+ basic_waitable_timer [constructor] +

+
+

+ Constructor.
—
Constructor to set a particular expiry + time as an absolute time.
—
Constructor to set a particular + expiry time relative to now.
—
Move-construct a basic_waitable_timer + from another. +

+
+

+ cancel +

+
+

+ Cancel any asynchronous operations that are waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancel + any asynchronous operations that are waiting on the timer. +

+
+

+ cancel_one +

+
+

+ Cancels one asynchronous operation that is waiting on the timer. +
—
(Deprecated: Use non-error_code overload.) Cancels + one asynchronous operation that is waiting on the timer. +

+
+

+ expires_after +

+
+

+ Set the timer's expiry time relative to now. +

+
+

+ expires_at +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time as an absolute + time.
—
Set the timer's expiry time as an absolute + time.
—
(Deprecated: Use non-error_code overload.) + Set the timer's expiry time as an absolute time. +

+
+

+ expires_from_now +

+
+

+ (Deprecated: Use expiry().) Get the timer's expiry time relative + to now.
—
(Deprecated: Use expires_after().) Set the + timer's expiry time relative to now. +

+
+

+ expiry +

+
+

+ Get the timer's expiry time as an absolute time. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ operator= +

+
+

+ Move-assign a basic_waitable_timer from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the timer. +

+
+

+ ~basic_waitable_timer [destructor] +

+
+

+ Destroys the timer. +

+
+

+ The basic_waitable_timer + class template provides the ability to perform a blocking or asynchronous + wait for a timer to expire. +

+

+ A waitable timer is always in one of two states: "expired" or "not + expired". If the wait() or async_wait() function + is called on an expired timer, the wait operation will complete immediately. +

+

+ Most applications will use one of the steady_timer, + system_timer + or high_resolution_timer + typedefs. +

+
+ + Remarks +
+

+ This waitable timer functionality is for use with the C++11 standard library's + <chrono> facility, or with the Boost.Chrono library. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Examples +
+

+ Performing a blocking wait (C++11): +

+
// Construct a timer without setting an expiry time.
+asio::steady_timer timer(my_context);
+
+// Set an expiry time relative to now.
+timer.expires_after(std::chrono::seconds(5));
+
+// Wait for the timer to expire.
+timer.wait();
+
+

+ Performing an asynchronous wait (C++11): +

+
void handler(const asio::error_code& error)
+{
+  if (!error)
+  {
+    // Timer expired.
+  }
+}
+
+...
+
+// Construct a timer with an absolute expiry time.
+asio::steady_timer timer(my_context,
+    std::chrono::steady_clock::now() + std::chrono::seconds(60));
+
+// Start an asynchronous wait.
+timer.async_wait(handler);
+
+
+ + Changing + an active waitable timer's expiry time +
+

+ Changing the expiry time of a timer while there are pending asynchronous + waits causes those wait operations to be cancelled. To ensure that the action + associated with the timer is performed only once, use something like this: + used: +

+
void on_some_event()
+{
+  if (my_timer.expires_after(seconds(5)) > 0)
+  {
+    // We managed to cancel the timer. Start new asynchronous wait.
+    my_timer.async_wait(on_timeout);
+  }
+  else
+  {
+    // Too late, timer has already expired!
+  }
+}
+
+void on_timeout(const asio::error_code& e)
+{
+  if (e != asio::error::operation_aborted)
+  {
+    // Timer was not cancelled, take necessary action.
+  }
+}
+
+
    +
  • + The asio::basic_waitable_timer::expires_after() function + cancels any pending asynchronous waits, and returns the number of asynchronous + waits that were cancelled. If it returns 0 then you were too late and + the wait handler has already been executed, or will soon be executed. + If it returns 1 then the wait handler was successfully cancelled. +
  • +
  • + If a wait handler is cancelled, the error_code + passed to it contains the value asio::error::operation_aborted. +
  • +
+

+ This typedef uses the C++11 <chrono> standard library + facility, if available. Otherwise, it may use the Boost.Chrono library. To + explicitly utilise Boost.Chrono, use the basic_waitable_timer + template directly: +

+
typedef basic_waitable_timer<boost::chrono::system_clock> timer;
+
+
+ + Requirements +
+

+ Header: asio/system_timer.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/this_coro__executor.html b/include/asio/doc/asio/reference/this_coro__executor.html new file mode 100644 index 0000000..87cc6b6 --- /dev/null +++ b/include/asio/doc/asio/reference/this_coro__executor.html @@ -0,0 +1,54 @@ + + + +this_coro::executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Awaitable object that + returns the executor of the current coroutine. +

+
constexpr executor_t executor;
+
+
+ + Requirements +
+

+ Header: asio/this_coro.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/this_coro__executor_t.html b/include/asio/doc/asio/reference/this_coro__executor_t.html new file mode 100644 index 0000000..41fcff0 --- /dev/null +++ b/include/asio/doc/asio/reference/this_coro__executor_t.html @@ -0,0 +1,83 @@ + + + +this_coro::executor_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Awaitable type that returns the executor of the current coroutine. +

+
struct executor_t
+
+
+ + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_t [constructor] +

+
+
+
+ + Requirements +
+

+ Header: asio/this_coro.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/this_coro__executor_t/executor_t.html b/include/asio/doc/asio/reference/this_coro__executor_t/executor_t.html new file mode 100644 index 0000000..e874d69 --- /dev/null +++ b/include/asio/doc/asio/reference/this_coro__executor_t/executor_t.html @@ -0,0 +1,42 @@ + + + +this_coro::executor_t::executor_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +

+
constexpr executor_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread.html b/include/asio/doc/asio/reference/thread.html new file mode 100644 index 0000000..67144c0 --- /dev/null +++ b/include/asio/doc/asio/reference/thread.html @@ -0,0 +1,148 @@ + + + +thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+thread +

+

+ A simple abstraction for starting threads. +

+
class thread :
+  noncopyable
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ join +

+
+

+ Wait for the thread to exit. +

+
+

+ thread + [constructor] +

+
+

+ Start a new thread that executes the supplied function. +

+
+

+ ~thread + [destructor] +

+
+

+ Destructor. +

+
+

+ The thread class + implements the smallest possible subset of the functionality of boost::thread. + It is intended to be used only for starting a thread and waiting for it to + exit. If more extensive threading capabilities are required, you are strongly + advised to use something else. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Example +
+

+ A typical use of thread + would be to launch a thread to run an io_context's event processing loop: +

+
asio::io_context io_context;
+// ...
+asio::thread t(boost::bind(&asio::io_context::run, &io_context));
+// ...
+t.join();
+
+
+ + Requirements +
+

+ Header: asio/thread.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread/_thread.html b/include/asio/doc/asio/reference/thread/_thread.html new file mode 100644 index 0000000..44e10d8 --- /dev/null +++ b/include/asio/doc/asio/reference/thread/_thread.html @@ -0,0 +1,43 @@ + + + +thread::~thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~thread();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread/join.html b/include/asio/doc/asio/reference/thread/join.html new file mode 100644 index 0000000..d6fa2a5 --- /dev/null +++ b/include/asio/doc/asio/reference/thread/join.html @@ -0,0 +1,51 @@ + + + +thread::join + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wait for the thread to exit. +

+
void join();
+
+

+ This function will block until the thread has exited. +

+

+ If this function is not called before the thread object is destroyed, the + thread itself will continue to run until completion. You will, however, + no longer have the ability to wait for it to exit. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread/thread.html b/include/asio/doc/asio/reference/thread/thread.html new file mode 100644 index 0000000..22d89cf --- /dev/null +++ b/include/asio/doc/asio/reference/thread/thread.html @@ -0,0 +1,71 @@ + + + +thread::thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start a new thread that executes + the supplied function. +

+
template<
+    typename Function>
+thread(
+    Function f);
+
+

+ This constructor creates a new thread that will execute the given function + or function object. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function or function object to be run in the thread. The function + signature must be: +

+
void f();
+
+

+

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool.html b/include/asio/doc/asio/reference/thread_pool.html new file mode 100644 index 0000000..3b6253e --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool.html @@ -0,0 +1,434 @@ + + + +thread_pool + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A simple fixed-size thread pool. +

+
class thread_pool :
+  public execution_context
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type +

+
+

+ Executor implementation type used to submit functions to a thread + pool. +

+
+

+ executor_type +

+
+

+ Executor used to submit functions to a thread pool. +

+
+

+ fork_event +

+
+

+ Fork-related event notifications. +

+
+

+ scheduler_type +

+
+

+ Scheduler used to schedule receivers on a thread pool. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ attach +

+
+

+ Attaches the current thread to the pool. +

+
+

+ executor +

+
+

+ Obtains the executor associated with the pool. +

+
+

+ get_executor +

+
+

+ Obtains the executor associated with the pool. +

+
+

+ join +

+
+

+ Joins the threads. +

+
+

+ notify_fork +

+
+

+ Notify the execution_context of a fork-related event. +

+
+

+ scheduler +

+
+

+ Obtains the scheduler associated with the pool. +

+
+

+ stop +

+
+

+ Stops the threads. +

+
+

+ thread_pool [constructor] +

+
+

+ Constructs a pool with an automatically determined number of threads. +
—
Constructs a pool with a specified number of threads. +

+
+

+ wait +

+
+

+ Waits for threads to complete. +

+
+

+ ~thread_pool [destructor] +

+
+

+ Destructor. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ destroy +

+
+

+ Destroys all services in the context. +

+
+

+ shutdown +

+
+

+ Shuts down all services in the context. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add_service +

+
+

+ (Deprecated: Use make_service().) Add a service object to the execution_context. +

+
+

+ has_service +

+
+

+ Determine if an execution_context contains a specified service + type. +

+
+

+ make_service +

+
+

+ Creates a service object and adds it to the execution_context. +

+
+

+ use_service +

+
+

+ Obtain the service object corresponding to the given type. +

+
+

+ The thread pool class is an execution context where functions are permitted + to run on one of a fixed number of threads. +

+
+ + Submitting + tasks to the pool +
+

+ To submit functions to the thread pool, use the dispatch + , post or defer + free functions. +

+

+ For example: +

+
void my_task()
+{
+  ...
+}
+
+...
+
+// Launch the pool with four threads.
+asio::thread_pool pool(4);
+
+// Submit a function to the pool.
+asio::post(pool, my_task);
+
+// Submit a lambda object to the pool.
+asio::post(pool,
+    []()
+    {
+      ...
+    });
+
+// Wait for all tasks in the pool to complete.
+pool.join();
+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/_thread_pool.html b/include/asio/doc/asio/reference/thread_pool/_thread_pool.html new file mode 100644 index 0000000..dff6322 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/_thread_pool.html @@ -0,0 +1,46 @@ + + + +thread_pool::~thread_pool + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~thread_pool();
+
+

+ Automatically stops and joins the pool, if not explicitly done beforehand. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/add_service.html b/include/asio/doc/asio/reference/thread_pool/add_service.html new file mode 100644 index 0000000..62a6db8 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/add_service.html @@ -0,0 +1,111 @@ + + + +thread_pool::add_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +(Deprecated: + Use make_service().) Add a service object to the execution_context. +

+
template<
+    typename Service>
+friend void add_service(
+    execution_context & e,
+    Service * svc);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
svc
+
+

+ The service object. On success, ownership of the service object is + transferred to the execution_context. + When the execution_context + object is destroyed, it will destroy the service object by performing: +

+
delete static_cast<execution_context::service*>(svc)
+
+

+

+
+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
asio::invalid_service_owner
+

+ Thrown if the service's owning execution_context + is not the execution_context + object specified by the e parameter. +

+
+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/attach.html b/include/asio/doc/asio/reference/thread_pool/attach.html new file mode 100644 index 0000000..8b0041a --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/attach.html @@ -0,0 +1,49 @@ + + + +thread_pool::attach + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Attaches the current + thread to the pool. +

+
void attach();
+
+

+ This function attaches the current thread to the pool so that it may be + used for executing submitted function objects. Blocks the calling thread + until the pool is stopped or joined and has no outstanding work. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/destroy.html b/include/asio/doc/asio/reference/thread_pool/destroy.html new file mode 100644 index 0000000..dcb94b6 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/destroy.html @@ -0,0 +1,55 @@ + + + +thread_pool::destroy + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Destroys all services + in the context. +

+
void destroy();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order * of the beginning of service object lifetime, + performs delete static_cast<execution_context::service*>(svc). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/executor.html b/include/asio/doc/asio/reference/thread_pool/executor.html new file mode 100644 index 0000000..32268a8 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/executor.html @@ -0,0 +1,44 @@ + + + +thread_pool::executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtains the executor + associated with the pool. +

+
executor_type executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/executor_type.html b/include/asio/doc/asio/reference/thread_pool/executor_type.html new file mode 100644 index 0000000..2bde327 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/executor_type.html @@ -0,0 +1,407 @@ + + + +thread_pool::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Executor + used to submit functions to a thread pool. +

+
typedef basic_executor_type< std::allocator< void >, 0 > executor_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_type +

+
+

+ The bulk execution index type. +

+
+

+ sender_type +

+
+

+ The sender type, when this type is used as a scheduler. +

+
+

+ shape_type +

+
+

+ The bulk execution shape type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type [constructor] +

+
+

+ Copy constructor.
—
Move constructor. +

+
+

+ bulk_execute +

+
+

+ Bulk execution function. +

+
+

+ connect +

+
+

+ Connect function. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the thread pool that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the thread pool that it has some outstanding work to do. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator. +

+
+

+ post +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property.
+ —
Query the current value of the allocator property.
+ —
Query the occupancy (recommended number of work items) + for the pool. +

+
+

+ query [static] +

+
+

+ Query the current value of the bulk_guarantee property.
+ —
Query the current value of the mapping property.
+ —
Query the current value of the outstanding_work property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.always property. +
—
Obtain an executor with the blocking.never property. +
—
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the relationship.continuation + property.
—
Obtain an executor with the outstanding_work.tracked + property.
—
Obtain an executor with the outstanding_work.untracked + property.
—
Obtain an executor with the specified + allocator property.
—
Obtain an executor with the + default allocator property. +

+
+

+ running_in_this_thread +

+
+

+ Determine whether the thread pool is running in the current thread. +

+
+

+ schedule +

+
+

+ Schedule function. +

+
+

+ ~basic_executor_type [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/fork_event.html b/include/asio/doc/asio/reference/thread_pool/fork_event.html new file mode 100644 index 0000000..d7f6b2f --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/fork_event.html @@ -0,0 +1,73 @@ + + + +thread_pool::fork_event + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Fork-related + event notifications. +

+
enum fork_event
+
+

+ + + +

+
+ + Values +
+
+

+
+
fork_prepare
+

+ Notify the context that the process is about to fork. +

+
fork_parent
+

+ Notify the context that the process has forked and is the parent. +

+
fork_child
+

+ Notify the context that the process has forked and is the child. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/get_executor.html b/include/asio/doc/asio/reference/thread_pool/get_executor.html new file mode 100644 index 0000000..6a62bcb --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/get_executor.html @@ -0,0 +1,44 @@ + + + +thread_pool::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtains the + executor associated with the pool. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/has_service.html b/include/asio/doc/asio/reference/thread_pool/has_service.html new file mode 100644 index 0000000..ba0e5a1 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/has_service.html @@ -0,0 +1,87 @@ + + + +thread_pool::has_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Determine if + an execution_context + contains a specified service type. +

+
template<
+    typename Service>
+friend bool has_service(
+    execution_context & e);
+
+

+ This function is used to determine whether the execution_context + contains a service object corresponding to the given service type. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return Value +
+

+ A boolean indicating whether the execution_context + contains the service. +

+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/join.html b/include/asio/doc/asio/reference/thread_pool/join.html new file mode 100644 index 0000000..8f6e638 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/join.html @@ -0,0 +1,48 @@ + + + +thread_pool::join + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Joins the threads. +

+
void join();
+
+

+ This function blocks until the threads in the pool have completed. If + stop() is not called prior to join(), the join() + call will wait until the pool has no more outstanding work. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/make_service.html b/include/asio/doc/asio/reference/thread_pool/make_service.html new file mode 100644 index 0000000..8724a4e --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/make_service.html @@ -0,0 +1,97 @@ + + + +thread_pool::make_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Creates a + service object and adds it to the execution_context. +

+
template<
+    typename Service,
+    typename... Args>
+friend Service & make_service(
+    execution_context & e,
+    Args &&... args);
+
+

+ This function is used to add a service to the execution_context. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
args
+

+ Zero or more arguments to be passed to the service constructor. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::service_already_exists
+

+ Thrown if a service of the given type is already present in the + execution_context. +

+
+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/notify_fork.html b/include/asio/doc/asio/reference/thread_pool/notify_fork.html new file mode 100644 index 0000000..fb076d5 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/notify_fork.html @@ -0,0 +1,122 @@ + + + +thread_pool::notify_fork + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Notify the + execution_context + of a fork-related event. +

+
void notify_fork(
+    fork_event event);
+
+

+ This function is used to inform the execution_context + that the process is about to fork, or has just forked. This allows the + execution_context, + and the services it contains, to perform any necessary housekeeping to + ensure correct operation following a fork. +

+

+ This function must not be called while any other execution_context + function, or any function associated with the execution_context's derived + class, is being called in another thread. It is, however, safe to call + this function from within a completion handler, provided no other thread + is accessing the execution_context + or its derived class. +

+
+ + Parameters +
+
+

+
+
event
+

+ A fork-related event. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. If the notification fails the execution_context + object should no longer be used and should be destroyed. +

+
+
+
+ + Example +
+

+ The following code illustrates how to incorporate the notify_fork() + function: +

+
my_execution_context.notify_fork(execution_context::fork_prepare);
+if (fork() == 0)
+{
+  // This is the child process.
+  my_execution_context.notify_fork(execution_context::fork_child);
+}
+else
+{
+  // This is the parent process.
+  my_execution_context.notify_fork(execution_context::fork_parent);
+}
+
+
+ + Remarks +
+

+ For each service object svc in the execution_context + set, performs svc->notify_fork();. When processing the + fork_prepare event, services are visited in reverse order of the beginning + of service object lifetime. Otherwise, services are visited in order of + the beginning of service object lifetime. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/scheduler.html b/include/asio/doc/asio/reference/thread_pool/scheduler.html new file mode 100644 index 0000000..010a00a --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/scheduler.html @@ -0,0 +1,44 @@ + + + +thread_pool::scheduler + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtains the scheduler + associated with the pool. +

+
scheduler_type scheduler();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/scheduler_type.html b/include/asio/doc/asio/reference/thread_pool/scheduler_type.html new file mode 100644 index 0000000..1ba4b6d --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/scheduler_type.html @@ -0,0 +1,407 @@ + + + +thread_pool::scheduler_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Scheduler + used to schedule receivers on a thread pool. +

+
typedef basic_executor_type< std::allocator< void >, 0 > scheduler_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_type +

+
+

+ The bulk execution index type. +

+
+

+ sender_type +

+
+

+ The sender type, when this type is used as a scheduler. +

+
+

+ shape_type +

+
+

+ The bulk execution shape type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type [constructor] +

+
+

+ Copy constructor.
—
Move constructor. +

+
+

+ bulk_execute +

+
+

+ Bulk execution function. +

+
+

+ connect +

+
+

+ Connect function. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the thread pool that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the thread pool that it has some outstanding work to do. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator. +

+
+

+ post +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property.
+ —
Query the current value of the allocator property.
+ —
Query the occupancy (recommended number of work items) + for the pool. +

+
+

+ query [static] +

+
+

+ Query the current value of the bulk_guarantee property.
+ —
Query the current value of the mapping property.
+ —
Query the current value of the outstanding_work property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.always property. +
—
Obtain an executor with the blocking.never property. +
—
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the relationship.continuation + property.
—
Obtain an executor with the outstanding_work.tracked + property.
—
Obtain an executor with the outstanding_work.untracked + property.
—
Obtain an executor with the specified + allocator property.
—
Obtain an executor with the + default allocator property. +

+
+

+ running_in_this_thread +

+
+

+ Determine whether the thread pool is running in the current thread. +

+
+

+ schedule +

+
+

+ Schedule function. +

+
+

+ ~basic_executor_type [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/shutdown.html b/include/asio/doc/asio/reference/thread_pool/shutdown.html new file mode 100644 index 0000000..f7dda0a --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/shutdown.html @@ -0,0 +1,55 @@ + + + +thread_pool::shutdown + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ +Shuts down all services + in the context. +

+
void shutdown();
+
+

+ This function is implemented as follows: +

+
  • + For each service object svc in the execution_context + set, in reverse order of the beginning of service object lifetime, + performs svc->shutdown(). +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/stop.html b/include/asio/doc/asio/reference/thread_pool/stop.html new file mode 100644 index 0000000..2bbfb7a --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/stop.html @@ -0,0 +1,47 @@ + + + +thread_pool::stop + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Stops the threads. +

+
void stop();
+
+

+ This function stops the threads as soon as possible. As a result of calling + stop(), pending function objects may be never be invoked. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/thread_pool.html b/include/asio/doc/asio/reference/thread_pool/thread_pool.html new file mode 100644 index 0000000..536dcc6 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/thread_pool.html @@ -0,0 +1,52 @@ + + + +thread_pool::thread_pool + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Constructs + a pool with an automatically determined number of threads. +

+
thread_pool();
+  » more...
+
+

+ Constructs a pool with a specified number of threads. +

+
thread_pool(
+    std::size_t num_threads);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/thread_pool/overload1.html b/include/asio/doc/asio/reference/thread_pool/thread_pool/overload1.html new file mode 100644 index 0000000..f961e10 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/thread_pool/overload1.html @@ -0,0 +1,43 @@ + + + +thread_pool::thread_pool (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructs a pool with an automatically determined number of threads. +

+
thread_pool();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/thread_pool/overload2.html b/include/asio/doc/asio/reference/thread_pool/thread_pool/overload2.html new file mode 100644 index 0000000..bddbb79 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/thread_pool/overload2.html @@ -0,0 +1,44 @@ + + + +thread_pool::thread_pool (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructs a pool with a specified number of threads. +

+
thread_pool(
+    std::size_t num_threads);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/use_service.html b/include/asio/doc/asio/reference/thread_pool/use_service.html new file mode 100644 index 0000000..bcc2380 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/use_service.html @@ -0,0 +1,54 @@ + + + +thread_pool::use_service + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain the + service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+  » more...
+
+template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/use_service/overload1.html b/include/asio/doc/asio/reference/thread_pool/use_service/overload1.html new file mode 100644 index 0000000..ec48042 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/use_service/overload1.html @@ -0,0 +1,88 @@ + + + +thread_pool::use_service (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    execution_context & e);
+
+

+ This function is used to locate a service object that corresponds to + the given service type. If there is no existing implementation of the + service, then the execution_context + will create a new instance of the service. +

+
+ + Parameters +
+
+

+
+
e
+

+ The execution_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ The service interface implementing the specified service type. Ownership + of the service interface is not transferred to the caller. +

+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/use_service/overload2.html b/include/asio/doc/asio/reference/thread_pool/use_service/overload2.html new file mode 100644 index 0000000..2c77d9b --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/use_service/overload2.html @@ -0,0 +1,96 @@ + + + +thread_pool::use_service (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from execution_context. +

+

+ Obtain the service object corresponding to the given type. +

+
template<
+    typename Service>
+friend Service & use_service(
+    io_context & ioc);
+
+

+ This function is used to locate a service object that corresponds to + the given service type. If there is no existing implementation of the + service, then the io_context + will create a new instance of the service. +

+
+ + Parameters +
+
+

+
+
ioc
+

+ The io_context + object that owns the service. +

+
+
+
+ + Return + Value +
+

+ The service interface implementing the specified service type. Ownership + of the service interface is not transferred to the caller. +

+
+ + Remarks +
+

+ This overload is preserved for backwards compatibility with services + that inherit from io_context::service. +

+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool/wait.html b/include/asio/doc/asio/reference/thread_pool/wait.html new file mode 100644 index 0000000..ce34347 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool/wait.html @@ -0,0 +1,48 @@ + + + +thread_pool::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Waits for threads to complete. +

+
void wait();
+
+

+ This function blocks until the threads in the pool have completed. If + stop() is not called prior to wait(), the wait() + call will wait until the pool has no more outstanding work. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type.html new file mode 100644 index 0000000..eab18b2 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type.html @@ -0,0 +1,408 @@ + + + +thread_pool::basic_executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Executor implementation type used to submit functions to a thread pool. +

+
template<
+    typename Allocator,
+    unsigned int Bits>
+class basic_executor_type
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_type +

+
+

+ The bulk execution index type. +

+
+

+ sender_type +

+
+

+ The sender type, when this type is used as a scheduler. +

+
+

+ shape_type +

+
+

+ The bulk execution shape type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type [constructor] +

+
+

+ Copy constructor.
—
Move constructor. +

+
+

+ bulk_execute +

+
+

+ Bulk execution function. +

+
+

+ connect +

+
+

+ Connect function. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the thread pool that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the thread pool that it has some outstanding work to do. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator. +

+
+

+ post +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property.
—
+ Query the current value of the allocator property.
—
+ Query the occupancy (recommended number of work items) for the + pool. +

+
+

+ query [static] +

+
+

+ Query the current value of the bulk_guarantee property.
+ —
Query the current value of the mapping property.
+ —
Query the current value of the outstanding_work property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.always property.
+ —
Obtain an executor with the blocking.never property.
+ —
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the relationship.continuation + property.
—
Obtain an executor with the outstanding_work.tracked + property.
—
Obtain an executor with the outstanding_work.untracked + property.
—
Obtain an executor with the specified allocator + property.
—
Obtain an executor with the default allocator + property. +

+
+

+ running_in_this_thread +

+
+

+ Determine whether the thread pool is running in the current thread. +

+
+

+ schedule +

+
+

+ Schedule function. +

+
+

+ ~basic_executor_type [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/_basic_executor_type.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/_basic_executor_type.html new file mode 100644 index 0000000..f90b570 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/_basic_executor_type.html @@ -0,0 +1,43 @@ + + + +thread_pool::basic_executor_type::~basic_executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor. +

+
~basic_executor_type();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type.html new file mode 100644 index 0000000..7d55503 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type.html @@ -0,0 +1,53 @@ + + + +thread_pool::basic_executor_type::basic_executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Copy + constructor. +

+
basic_executor_type(
+    const basic_executor_type & other);
+  » more...
+
+

+ Move constructor. +

+
basic_executor_type(
+    basic_executor_type && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload1.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload1.html new file mode 100644 index 0000000..e96d8f0 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload1.html @@ -0,0 +1,44 @@ + + + +thread_pool::basic_executor_type::basic_executor_type (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Copy constructor. +

+
basic_executor_type(
+    const basic_executor_type & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload2.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload2.html new file mode 100644 index 0000000..9573b9c --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload2.html @@ -0,0 +1,44 @@ + + + +thread_pool::basic_executor_type::basic_executor_type (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move constructor. +

+
basic_executor_type(
+    basic_executor_type && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/bulk_execute.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/bulk_execute.html new file mode 100644 index 0000000..b0cd0ba --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/bulk_execute.html @@ -0,0 +1,48 @@ + + + +thread_pool::basic_executor_type::bulk_execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Bulk + execution function. +

+
template<
+    typename Function>
+void bulk_execute(
+    Function && f,
+    std::size_t n) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/connect.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/connect.html new file mode 100644 index 0000000..e9c66be --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/connect.html @@ -0,0 +1,60 @@ + + + +thread_pool::basic_executor_type::connect + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Connect + function. +

+
template<
+    typename Receiver>
+unspecified connect(
+    Receiver && r) const;
+
+

+ Do not call this function directly. It is intended for use with the execution::connect + customisation point. +

+
+ + Return + Value +
+

+ An object of an unspecified type that satisfies the operation_state + concept. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/context.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/context.html new file mode 100644 index 0000000..77cf0da --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/context.html @@ -0,0 +1,44 @@ + + + +thread_pool::basic_executor_type::context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + the underlying execution context. +

+
thread_pool & context() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/defer.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/defer.html new file mode 100644 index 0000000..6f73e4d --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/defer.html @@ -0,0 +1,85 @@ + + + +thread_pool::basic_executor_type::defer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the thread pool to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void defer(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the thread pool to execute the given function + object. The function object will never be executed inside defer(). + Instead, it will be scheduled to run on the thread pool. +

+

+ If the current thread belongs to the thread pool, defer() + will delay scheduling the function object until the current thread returns + control to the pool. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/dispatch.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/dispatch.html new file mode 100644 index 0000000..2004d7e --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/dispatch.html @@ -0,0 +1,81 @@ + + + +thread_pool::basic_executor_type::dispatch + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the thread pool to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void dispatch(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the thread pool to execute the given function + object. If the current thread belongs to the pool, dispatch() + executes the function before returning. Otherwise, the function will be + scheduled to run on the thread pool. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/execute.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/execute.html new file mode 100644 index 0000000..0ed1614 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/execute.html @@ -0,0 +1,57 @@ + + + +thread_pool::basic_executor_type::execute + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Execution + function. +

+
template<
+    typename Function>
+void execute(
+    Function && f) const;
+
+

+ Do not call this function directly. It is intended for use with the execution::execute + customisation point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+execution::execute(ex, my_function_object);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/index_type.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/index_type.html new file mode 100644 index 0000000..eac8f77 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/index_type.html @@ -0,0 +1,54 @@ + + + +thread_pool::basic_executor_type::index_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + bulk execution index type. +

+
typedef std::size_t index_type;
+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/on_work_finished.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/on_work_finished.html new file mode 100644 index 0000000..3fc2f6b --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/on_work_finished.html @@ -0,0 +1,49 @@ + + + +thread_pool::basic_executor_type::on_work_finished + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the thread pool that some work is no longer outstanding. +

+
void on_work_finished() const;
+
+

+ This function is used to inform the thread pool that some work has finished. + Once the count of unfinished work reaches zero, the thread pool's join() + function is permitted to exit. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/on_work_started.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/on_work_started.html new file mode 100644 index 0000000..12d130d --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/on_work_started.html @@ -0,0 +1,49 @@ + + + +thread_pool::basic_executor_type::on_work_started + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Inform + the thread pool that it has some outstanding work to do. +

+
void on_work_started() const;
+
+

+ This function is used to inform the thread pool that some work has begun. + This ensures that the thread pool's join() function will not + return while the work is underway. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_.html new file mode 100644 index 0000000..9ebabcf --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_.html @@ -0,0 +1,53 @@ + + + +thread_pool::basic_executor_type::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assignment + operator. +

+
basic_executor_type & operator=(
+    const basic_executor_type & other);
+  » more...
+
+

+ Move assignment operator. +

+
basic_executor_type & operator=(
+    basic_executor_type && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_/overload1.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_/overload1.html new file mode 100644 index 0000000..07228f8 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_/overload1.html @@ -0,0 +1,44 @@ + + + +thread_pool::basic_executor_type::operator= (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assignment operator. +

+
basic_executor_type & operator=(
+    const basic_executor_type & other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_/overload2.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_/overload2.html new file mode 100644 index 0000000..1fc1256 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq_/overload2.html @@ -0,0 +1,44 @@ + + + +thread_pool::basic_executor_type::operator= (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move assignment operator. +

+
basic_executor_type & operator=(
+    basic_executor_type && other);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq__eq_.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq__eq_.html new file mode 100644 index 0000000..13e41bc --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_eq__eq_.html @@ -0,0 +1,59 @@ + + + +thread_pool::basic_executor_type::operator== + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two executors for equality. +

+
friend bool operator==(
+    const basic_executor_type & a,
+    const basic_executor_type & b);
+
+

+ Two executors are equal if they refer to the same underlying thread pool. +

+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_not__eq_.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_not__eq_.html new file mode 100644 index 0000000..b3f0a69 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/operator_not__eq_.html @@ -0,0 +1,59 @@ + + + +thread_pool::basic_executor_type::operator!= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Compare + two executors for inequality. +

+
friend bool operator!=(
+    const basic_executor_type & a,
+    const basic_executor_type & b);
+
+

+ Two executors are equal if they refer to the same underlying thread pool. +

+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/post.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/post.html new file mode 100644 index 0000000..870b5cd --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/post.html @@ -0,0 +1,80 @@ + + + +thread_pool::basic_executor_type::post + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Request + the thread pool to invoke the given function object. +

+
template<
+    typename Function,
+    typename OtherAllocator>
+void post(
+    Function && f,
+    const OtherAllocator & a) const;
+
+

+ This function is used to ask the thread pool to execute the given function + object. The function object will never be executed inside post(). + Instead, it will be scheduled to run on the thread pool. +

+
+ + Parameters +
+
+

+
+
f
+
+

+ The function object to be called. The executor will make a copy of + the handler object as required. The function signature of the function + object must be: +

+
void function();
+
+

+

+
+
a
+

+ An allocator that may be used by the executor to allocate the internal + storage needed for function invocation. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query.html new file mode 100644 index 0000000..d8bd050 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query.html @@ -0,0 +1,80 @@ + + + +thread_pool::basic_executor_type::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Query + the current value of the context property. +

+
thread_pool & query(
+    execution::context_t ) const;
+  » more...
+
+

+ Query the current value of the blocking property. +

+
constexpr execution::blocking_t query(
+    execution::blocking_t ) const;
+  » more...
+
+

+ Query the current value of the relationship property. +

+
constexpr execution::relationship_t query(
+    execution::relationship_t ) const;
+  » more...
+
+

+ Query the current value of the allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr Allocator query(
+    execution::allocator_t< OtherAllocator > ) const;
+  » more...
+
+constexpr Allocator query(
+    execution::allocator_t< void > ) const;
+  » more...
+
+

+ Query the occupancy (recommended number of work items) for the pool. +

+
std::size_t query(
+    execution::occupancy_t ) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload1.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload1.html new file mode 100644 index 0000000..015d7f5 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload1.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::query (1 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the context property. +

+
thread_pool & query(
+    execution::context_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+asio::thread_pool& pool = asio::query(
+    ex, asio::execution::context);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload2.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload2.html new file mode 100644 index 0000000..4522e5e --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload2.html @@ -0,0 +1,57 @@ + + + +thread_pool::basic_executor_type::query (2 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the blocking property. +

+
constexpr execution::blocking_t query(
+    execution::blocking_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+if (asio::query(ex, asio::execution::blocking)
+      == asio::execution::blocking.always)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload3.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload3.html new file mode 100644 index 0000000..a31dd34 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload3.html @@ -0,0 +1,57 @@ + + + +thread_pool::basic_executor_type::query (3 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the relationship property. +

+
constexpr execution::relationship_t query(
+    execution::relationship_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+if (asio::query(ex, asio::execution::relationship)
+      == asio::execution::relationship.continuation)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload4.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload4.html new file mode 100644 index 0000000..b58e0ec --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload4.html @@ -0,0 +1,58 @@ + + + +thread_pool::basic_executor_type::query (4 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr Allocator query(
+    execution::allocator_t< OtherAllocator > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+auto alloc = asio::query(ex,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload5.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload5.html new file mode 100644 index 0000000..cf8f613 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload5.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::query (5 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the allocator property. +

+
constexpr Allocator query(
+    execution::allocator_t< void > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+auto alloc = asio::query(ex,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload6.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload6.html new file mode 100644 index 0000000..799f500 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query/overload6.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::query (6 of 6 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the occupancy (recommended number of work items) for the pool. +

+
std::size_t query(
+    execution::occupancy_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+std::size_t occupancy = asio::query(
+    ex, asio::execution::occupancy);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static.html new file mode 100644 index 0000000..414ec30 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static.html @@ -0,0 +1,60 @@ + + + +thread_pool::basic_executor_type::query + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Query + the current value of the bulk_guarantee property. +

+
static constexpr execution::bulk_guarantee_t query(
+    execution::bulk_guarantee_t );
+  » more...
+
+

+ Query the current value of the mapping property. +

+
static constexpr execution::mapping_t query(
+    execution::mapping_t );
+  » more...
+
+

+ Query the current value of the outstanding_work property. +

+
static constexpr execution::outstanding_work_t query(
+    execution::outstanding_work_t );
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload1.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload1.html new file mode 100644 index 0000000..8d207f2 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload1.html @@ -0,0 +1,57 @@ + + + +thread_pool::basic_executor_type::query (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the bulk_guarantee property. +

+
static constexpr execution::bulk_guarantee_t query(
+    execution::bulk_guarantee_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+if (asio::query(ex, asio::execution::bulk_guarantee)
+      == asio::execution::bulk_guarantee.parallel)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload2.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload2.html new file mode 100644 index 0000000..5c7ea02 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload2.html @@ -0,0 +1,57 @@ + + + +thread_pool::basic_executor_type::query (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the mapping property. +

+
static constexpr execution::mapping_t query(
+    execution::mapping_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+if (asio::query(ex, asio::execution::mapping)
+      == asio::execution::mapping.thread)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload3.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload3.html new file mode 100644 index 0000000..ec86ed8 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/query__static/overload3.html @@ -0,0 +1,57 @@ + + + +thread_pool::basic_executor_type::query (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Query the current value of the outstanding_work property. +

+
static constexpr execution::outstanding_work_t query(
+    execution::outstanding_work_t );
+
+

+ Do not call this function directly. It is intended for use with the + query customisation + point. +

+

+ For example: +

+
auto ex = my_thread_pool.executor();
+if (asio::query(ex, asio::execution::outstanding_work)
+      == asio::execution::outstanding_work.tracked)
+  ...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require.html new file mode 100644 index 0000000..7e8c718 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require.html @@ -0,0 +1,104 @@ + + + +thread_pool::basic_executor_type::require + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + an executor with the blocking.possibly property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::blocking_t::possibly_t ) const;
+  » more...
+
+

+ Obtain an executor with the blocking.always property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::blocking_t::always_t ) const;
+  » more...
+
+

+ Obtain an executor with the blocking.never property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::blocking_t::never_t ) const;
+  » more...
+
+

+ Obtain an executor with the relationship.fork property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::fork_t ) const;
+  » more...
+
+

+ Obtain an executor with the relationship.continuation property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::continuation_t ) const;
+  » more...
+
+

+ Obtain an executor with the outstanding_work.tracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::tracked_t ) const;
+  » more...
+
+

+ Obtain an executor with the outstanding_work.untracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::untracked_t ) const;
+  » more...
+
+

+ Obtain an executor with the specified allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr basic_executor_type< OtherAllocator, Bits > require(
+    execution::allocator_t< OtherAllocator > a) const;
+  » more...
+
+

+ Obtain an executor with the default allocator property. +

+
constexpr basic_executor_type< std::allocator< void >, Bits > require(
+    execution::allocator_t< void > ) const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload1.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload1.html new file mode 100644 index 0000000..e7922a5 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload1.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (1 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.possibly property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::blocking_t::possibly_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.possibly);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload2.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload2.html new file mode 100644 index 0000000..e0f7d12 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload2.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (2 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.always property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::blocking_t::always_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.always);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload3.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload3.html new file mode 100644 index 0000000..4eac0da --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload3.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (3 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the blocking.never property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::blocking_t::never_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::blocking.never);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload4.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload4.html new file mode 100644 index 0000000..43fd783 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload4.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (4 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the relationship.fork property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::fork_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::relationship.fork);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload5.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload5.html new file mode 100644 index 0000000..d891bd8 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload5.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (5 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the relationship.continuation property. +

+
constexpr basic_executor_type require(
+    execution::relationship_t::continuation_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::relationship.continuation);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload6.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload6.html new file mode 100644 index 0000000..c12f1d2 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload6.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (6 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the outstanding_work.tracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::tracked_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::outstanding_work.tracked);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload7.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload7.html new file mode 100644 index 0000000..23acf9d --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload7.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (7 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the outstanding_work.untracked property. +

+
constexpr basic_executor_type< Allocator, unspecified > require(
+    execution::outstanding_work_t::untracked_t ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::outstanding_work.untracked);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload8.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload8.html new file mode 100644 index 0000000..e5192ff --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload8.html @@ -0,0 +1,58 @@ + + + +thread_pool::basic_executor_type::require (8 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the specified allocator property. +

+
template<
+    typename OtherAllocator>
+constexpr basic_executor_type< OtherAllocator, Bits > require(
+    execution::allocator_t< OtherAllocator > a) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::allocator(my_allocator));
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload9.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload9.html new file mode 100644 index 0000000..caf69c1 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/require/overload9.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::require (9 of 9 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Obtain an executor with the default allocator property. +

+
constexpr basic_executor_type< std::allocator< void >, Bits > require(
+    execution::allocator_t< void > ) const;
+
+

+ Do not call this function directly. It is intended for use with the + require customisation + point. +

+

+ For example: +

+
auto ex1 = my_thread_pool.executor();
+auto ex2 = asio::require(ex1,
+    asio::execution::allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/running_in_this_thread.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/running_in_this_thread.html new file mode 100644 index 0000000..a0cc09c --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/running_in_this_thread.html @@ -0,0 +1,53 @@ + + + +thread_pool::basic_executor_type::running_in_this_thread + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the thread pool is running in the current thread. +

+
bool running_in_this_thread() const;
+
+
+ + Return + Value +
+

+ true if the current thread is running the thread pool. Otherwise + returns false. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/schedule.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/schedule.html new file mode 100644 index 0000000..01daa37 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/schedule.html @@ -0,0 +1,56 @@ + + + +thread_pool::basic_executor_type::schedule + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Schedule + function. +

+
sender_type schedule() const;
+
+

+ Do not call this function directly. It is intended for use with the execution::schedule + customisation point. +

+
+ + Return + Value +
+

+ An object that satisfies the sender concept. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/sender_type.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/sender_type.html new file mode 100644 index 0000000..23dfa3f --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/sender_type.html @@ -0,0 +1,407 @@ + + + +thread_pool::basic_executor_type::sender_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + sender type, when this type is used as a scheduler. +

+
typedef basic_executor_type sender_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ index_type +

+
+

+ The bulk execution index type. +

+
+

+ sender_type +

+
+

+ The sender type, when this type is used as a scheduler. +

+
+

+ shape_type +

+
+

+ The bulk execution shape type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_executor_type [constructor] +

+
+

+ Copy constructor.
—
Move constructor. +

+
+

+ bulk_execute +

+
+

+ Bulk execution function. +

+
+

+ connect +

+
+

+ Connect function. +

+
+

+ context +

+
+

+ Obtain the underlying execution context. +

+
+

+ defer +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ dispatch +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ execute +

+
+

+ Execution function. +

+
+

+ on_work_finished +

+
+

+ Inform the thread pool that some work is no longer outstanding. +

+
+

+ on_work_started +

+
+

+ Inform the thread pool that it has some outstanding work to do. +

+
+

+ operator= +

+
+

+ Assignment operator.
—
Move assignment operator. +

+
+

+ post +

+
+

+ Request the thread pool to invoke the given function object. +

+
+

+ query +

+
+

+ Query the current value of the context property.
—
+ Query the current value of the blocking property.
—
+ Query the current value of the relationship property.
+ —
Query the current value of the allocator property.
+ —
Query the occupancy (recommended number of work items) + for the pool. +

+
+

+ query [static] +

+
+

+ Query the current value of the bulk_guarantee property.
+ —
Query the current value of the mapping property.
+ —
Query the current value of the outstanding_work property. +

+
+

+ require +

+
+

+ Obtain an executor with the blocking.possibly property.
+ —
Obtain an executor with the blocking.always property. +
—
Obtain an executor with the blocking.never property. +
—
Obtain an executor with the relationship.fork property. +
—
Obtain an executor with the relationship.continuation + property.
—
Obtain an executor with the outstanding_work.tracked + property.
—
Obtain an executor with the outstanding_work.untracked + property.
—
Obtain an executor with the specified + allocator property.
—
Obtain an executor with the + default allocator property. +

+
+

+ running_in_this_thread +

+
+

+ Determine whether the thread pool is running in the current thread. +

+
+

+ schedule +

+
+

+ Schedule function. +

+
+

+ ~basic_executor_type [destructor] +

+
+

+ Destructor. +

+
+
+ + Friends +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ operator!= +

+
+

+ Compare two executors for inequality. +

+
+

+ operator== +

+
+

+ Compare two executors for equality. +

+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/thread_pool__basic_executor_type/shape_type.html b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/shape_type.html new file mode 100644 index 0000000..dc0f202 --- /dev/null +++ b/include/asio/doc/asio/reference/thread_pool__basic_executor_type/shape_type.html @@ -0,0 +1,54 @@ + + + +thread_pool::basic_executor_type::shape_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + bulk execution shape type. +

+
typedef std::size_t shape_type;
+
+
+ + Requirements +
+

+ Header: asio/thread_pool.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_.html new file mode 100644 index 0000000..5b7ef5a --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_.html @@ -0,0 +1,187 @@ + + + +time_traits< boost::posix_time::ptime > + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Time traits specialised for posix_time. +

+
template<>
+struct time_traits< boost::posix_time::ptime >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ duration_type +

+
+

+ The duration type. +

+
+

+ time_type +

+
+

+ The time type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ add [static] +

+
+

+ Add a duration to a time. +

+
+

+ less_than [static] +

+
+

+ Test whether one time is less than another. +

+
+

+ now [static] +

+
+

+ Get the current time. +

+
+

+ subtract [static] +

+
+

+ Subtract one time from another. +

+
+

+ to_posix_duration [static] +

+
+

+ Convert to POSIX duration type. +

+
+
+ + Requirements +
+

+ Header: asio/time_traits.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/add.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/add.html new file mode 100644 index 0000000..1a78786 --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/add.html @@ -0,0 +1,46 @@ + + + +time_traits< boost::posix_time::ptime >::add + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Add a duration to a time. +

+
static time_type add(
+    const time_type & t,
+    const duration_type & d);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/duration_type.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/duration_type.html new file mode 100644 index 0000000..efff430 --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/duration_type.html @@ -0,0 +1,54 @@ + + + +time_traits< boost::posix_time::ptime >::duration_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The duration type. +

+
typedef boost::posix_time::time_duration duration_type;
+
+
+ + Requirements +
+

+ Header: asio/time_traits.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/less_than.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/less_than.html new file mode 100644 index 0000000..9ec9f3a --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/less_than.html @@ -0,0 +1,46 @@ + + + +time_traits< boost::posix_time::ptime >::less_than + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Test whether one time is less than another. +

+
static bool less_than(
+    const time_type & t1,
+    const time_type & t2);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/now.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/now.html new file mode 100644 index 0000000..c2b80d2 --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/now.html @@ -0,0 +1,44 @@ + + + +time_traits< boost::posix_time::ptime >::now + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get the current time. +

+
static time_type now();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/subtract.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/subtract.html new file mode 100644 index 0000000..e9538c5 --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/subtract.html @@ -0,0 +1,46 @@ + + + +time_traits< boost::posix_time::ptime >::subtract + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Subtract one time from another. +

+
static duration_type subtract(
+    const time_type & t1,
+    const time_type & t2);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/time_type.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/time_type.html new file mode 100644 index 0000000..edaa266 --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/time_type.html @@ -0,0 +1,54 @@ + + + +time_traits< boost::posix_time::ptime >::time_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The time type. +

+
typedef boost::posix_time::ptime time_type;
+
+
+ + Requirements +
+

+ Header: asio/time_traits.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/to_posix_duration.html b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/to_posix_duration.html new file mode 100644 index 0000000..af39490 --- /dev/null +++ b/include/asio/doc/asio/reference/time_traits_lt__ptime__gt_/to_posix_duration.html @@ -0,0 +1,45 @@ + + + +time_traits< boost::posix_time::ptime >::to_posix_duration + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Convert to POSIX duration type. +

+
static boost::posix_time::time_duration to_posix_duration(
+    const duration_type & d);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/transfer_all.html b/include/asio/doc/asio/reference/transfer_all.html new file mode 100644 index 0000000..5f0d5e1 --- /dev/null +++ b/include/asio/doc/asio/reference/transfer_all.html @@ -0,0 +1,80 @@ + + + +transfer_all + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Return a completion condition function + object that indicates that a read or write operation should continue until + all of the data has been transferred, or until an error occurs. +

+
unspecified transfer_all();
+
+

+ This function is used to create an object, of unspecified type, that meets + CompletionCondition requirements. +

+
+ + Example +
+

+ Reading until a buffer is full: +

+
boost::array<char, 128> buf;
+asio::error_code ec;
+std::size_t n = asio::read(
+    sock, asio::buffer(buf),
+    asio::transfer_all(), ec);
+if (ec)
+{
+  // An error occurred.
+}
+else
+{
+  // n == 128
+}
+
+
+ + Requirements +
+

+ Header: asio/completion_condition.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/transfer_at_least.html b/include/asio/doc/asio/reference/transfer_at_least.html new file mode 100644 index 0000000..51cd0fc --- /dev/null +++ b/include/asio/doc/asio/reference/transfer_at_least.html @@ -0,0 +1,81 @@ + + + +transfer_at_least + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Return a completion condition + function object that indicates that a read or write operation should continue + until a minimum number of bytes has been transferred, or until an error occurs. +

+
unspecified transfer_at_least(
+    std::size_t minimum);
+
+

+ This function is used to create an object, of unspecified type, that meets + CompletionCondition requirements. +

+
+ + Example +
+

+ Reading until a buffer is full or contains at least 64 bytes: +

+
boost::array<char, 128> buf;
+asio::error_code ec;
+std::size_t n = asio::read(
+    sock, asio::buffer(buf),
+    asio::transfer_at_least(64), ec);
+if (ec)
+{
+  // An error occurred.
+}
+else
+{
+  // n >= 64 && n <= 128
+}
+
+
+ + Requirements +
+

+ Header: asio/completion_condition.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/transfer_exactly.html b/include/asio/doc/asio/reference/transfer_exactly.html new file mode 100644 index 0000000..715fd0a --- /dev/null +++ b/include/asio/doc/asio/reference/transfer_exactly.html @@ -0,0 +1,81 @@ + + + +transfer_exactly + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Return a completion condition + function object that indicates that a read or write operation should continue + until an exact number of bytes has been transferred, or until an error occurs. +

+
unspecified transfer_exactly(
+    std::size_t size);
+
+

+ This function is used to create an object, of unspecified type, that meets + CompletionCondition requirements. +

+
+ + Example +
+

+ Reading until a buffer is full or contains exactly 64 bytes: +

+
boost::array<char, 128> buf;
+asio::error_code ec;
+std::size_t n = asio::read(
+    sock, asio::buffer(buf),
+    asio::transfer_exactly(64), ec);
+if (ec)
+{
+  // An error occurred.
+}
+else
+{
+  // n == 64
+}
+
+
+ + Requirements +
+

+ Header: asio/completion_condition.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable.html b/include/asio/doc/asio/reference/use_awaitable.html new file mode 100644 index 0000000..59e448a --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable.html @@ -0,0 +1,58 @@ + + + +use_awaitable + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A completion token object that represents + the currently executing coroutine. +

+
constexpr use_awaitable_t use_awaitable;
+
+

+ See the documentation for use_awaitable_t + for a usage example. +

+
+ + Requirements +
+

+ Header: asio/use_awaitable.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t.html b/include/asio/doc/asio/reference/use_awaitable_t.html new file mode 100644 index 0000000..d2db6d0 --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t.html @@ -0,0 +1,157 @@ + + + +use_awaitable_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ A completion token that represents the currently executing coroutine. +

+
template<
+    typename Executor = any_io_executor>
+struct use_awaitable_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_with_default +

+
+

+ Adapts an executor to add the use_awaitable_t completion token + as the default. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ as_default_on [static] +

+
+

+ Function helper to adapt an I/O object to use use_awaitable_t as + its default completion token type. +

+
+

+ use_awaitable_t [constructor] +

+
+

+ Default constructor.
—
Constructor used to specify + file name, line, and function name. +

+
+

+ The use_awaitable_t class, with its value use_awaitable, + is used to represent the currently executing coroutine. This completion token + may be passed as a handler to an asynchronous operation. For example: +

+
awaitable<void> my_coroutine()
+{
+  std::size_t n = co_await my_socket.async_read_some(buffer, use_awaitable);
+  ...
+}
+
+

+ When used with co_await, the initiating function (async_read_some + in the above example) suspends the current coroutine. The coroutine is resumed + when the asynchronous operation completes, and the result of the operation + is returned. +

+
+ + Requirements +
+

+ Header: asio/use_awaitable.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t/as_default_on.html b/include/asio/doc/asio/reference/use_awaitable_t/as_default_on.html new file mode 100644 index 0000000..f8409d8 --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t/as_default_on.html @@ -0,0 +1,48 @@ + + + +use_awaitable_t::as_default_on + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Function + helper to adapt an I/O object to use use_awaitable_t as its + default completion token type. +

+
template<
+    typename T>
+static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on(
+    T && object);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t.html b/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t.html new file mode 100644 index 0000000..bb10fa5 --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t.html @@ -0,0 +1,54 @@ + + + +use_awaitable_t::use_awaitable_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Default + constructor. +

+
constexpr use_awaitable_t();
+  » more...
+
+

+ Constructor used to specify file name, line, and function name. +

+
constexpr use_awaitable_t(
+    const char * file_name,
+    int line,
+    const char * function_name);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t/overload1.html b/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t/overload1.html new file mode 100644 index 0000000..10b8726 --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t/overload1.html @@ -0,0 +1,43 @@ + + + +use_awaitable_t::use_awaitable_t (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Default constructor. +

+
constexpr use_awaitable_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t/overload2.html b/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t/overload2.html new file mode 100644 index 0000000..955bd4c --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t/use_awaitable_t/overload2.html @@ -0,0 +1,46 @@ + + + +use_awaitable_t::use_awaitable_t (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Constructor used to specify file name, line, and function name. +

+
constexpr use_awaitable_t(
+    const char * file_name,
+    int line,
+    const char * function_name);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default.html b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default.html new file mode 100644 index 0000000..94156fd --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default.html @@ -0,0 +1,126 @@ + + + +use_awaitable_t::executor_with_default + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Adapts an executor to add the use_awaitable_t completion token + as the default. +

+
template<
+    typename InnerExecutor>
+struct executor_with_default
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ default_completion_token_type +

+
+

+ Specify use_awaitable_t as the default completion token type. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_with_default [constructor] +

+
+

+ Construct the adapted executor from the inner executor type.
+ —
Convert the specified executor to the inner executor type, + then use that to construct the adapted executor. +

+
+
+ + Requirements +
+

+ Header: asio/use_awaitable.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/default_completion_token_type.html b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/default_completion_token_type.html new file mode 100644 index 0000000..e840846 --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/default_completion_token_type.html @@ -0,0 +1,157 @@ + + + +use_awaitable_t::executor_with_default::default_completion_token_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Specify + use_awaitable_t as the default completion token type. +

+
typedef use_awaitable_t default_completion_token_type;
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ executor_with_default +

+
+

+ Adapts an executor to add the use_awaitable_t completion token + as the default. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ as_default_on [static] +

+
+

+ Function helper to adapt an I/O object to use use_awaitable_t + as its default completion token type. +

+
+

+ use_awaitable_t [constructor] +

+
+

+ Default constructor.
—
Constructor used to specify + file name, line, and function name. +

+
+

+ The use_awaitable_t class, with its value use_awaitable, + is used to represent the currently executing coroutine. This completion + token may be passed as a handler to an asynchronous operation. For example: +

+
awaitable<void> my_coroutine()
+{
+  std::size_t n = co_await my_socket.async_read_some(buffer, use_awaitable);
+  ...
+}
+
+

+ When used with co_await, the initiating function (async_read_some + in the above example) suspends the current coroutine. The coroutine is + resumed when the asynchronous operation completes, and the result of the + operation is returned. +

+
+ + Requirements +
+

+ Header: asio/use_awaitable.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default.html b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default.html new file mode 100644 index 0000000..c6a9f08 --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default.html @@ -0,0 +1,57 @@ + + + +use_awaitable_t::executor_with_default::executor_with_default + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + the adapted executor from the inner executor type. +

+
executor_with_default(
+    const InnerExecutor & ex);
+  » more...
+
+

+ Convert the specified executor to the inner executor type, then use that + to construct the adapted executor. +

+
template<
+    typename OtherExecutor>
+executor_with_default(
+    const OtherExecutor & ex,
+    typename enable_if< is_convertible< OtherExecutor, InnerExecutor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload1.html b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload1.html new file mode 100644 index 0000000..6f6ef3d --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload1.html @@ -0,0 +1,44 @@ + + + +use_awaitable_t::executor_with_default::executor_with_default (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct the adapted executor from the inner executor type. +

+
executor_with_default(
+    const InnerExecutor & ex);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload2.html b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload2.html new file mode 100644 index 0000000..b56bb23 --- /dev/null +++ b/include/asio/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload2.html @@ -0,0 +1,48 @@ + + + +use_awaitable_t::executor_with_default::executor_with_default (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Convert the specified executor to the inner executor type, then use that + to construct the adapted executor. +

+
template<
+    typename OtherExecutor>
+executor_with_default(
+    const OtherExecutor & ex,
+    typename enable_if< is_convertible< OtherExecutor, InnerExecutor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future.html b/include/asio/doc/asio/reference/use_future.html new file mode 100644 index 0000000..1df3227 --- /dev/null +++ b/include/asio/doc/asio/reference/use_future.html @@ -0,0 +1,57 @@ + + + +use_future + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +A special value, similar to std::nothrow. +

+
constexpr use_future_t use_future;
+
+

+ See the documentation for use_future_t + for a usage example. +

+
+ + Requirements +
+

+ Header: asio/use_future.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t.html b/include/asio/doc/asio/reference/use_future_t.html new file mode 100644 index 0000000..f1759cd --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t.html @@ -0,0 +1,192 @@ + + + +use_future_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Class used to specify that an asynchronous operation should return a future. +

+
template<
+    typename Allocator = std::allocator<void>>
+class use_future_t
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ allocator_type +

+
+

+ The allocator type. The allocator is used when constructing the + std::promise object for a given asynchronous operation. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ get_allocator +

+
+

+ Obtain allocator. +

+
+

+ operator() +

+
+

+ Wrap a function object in a packaged task. +

+
+

+ operator[] +

+
+

+ (Deprecated: Use rebind().) Specify an alternate allocator. +

+
+

+ rebind +

+
+

+ Specify an alternate allocator. +

+
+

+ use_future_t [constructor] +

+
+

+ Construct using default-constructed allocator.
—
Construct + using specified allocator. +

+
+

+ The use_future_t + class is used to indicate that an asynchronous operation should return a + std::future object. A use_future_t + object may be passed as a handler to an asynchronous operation, typically + using the special value asio::use_future. For example: +

+
std::future<std::size_t> my_future
+  = my_socket.async_read_some(my_buffer, asio::use_future);
+
+

+ The initiating function (async_read_some in the above example) returns a + future that will receive the result of the operation. If the operation completes + with an error_code + indicating failure, it is converted into a system_error + and passed back to the caller via the future. +

+
+ + Requirements +
+

+ Header: asio/use_future.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/allocator_type.html b/include/asio/doc/asio/reference/use_future_t/allocator_type.html new file mode 100644 index 0000000..317ba69 --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/allocator_type.html @@ -0,0 +1,55 @@ + + + +use_future_t::allocator_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + allocator type. The allocator is used when constructing the std::promise + object for a given asynchronous operation. +

+
typedef Allocator allocator_type;
+
+
+ + Requirements +
+

+ Header: asio/use_future.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/get_allocator.html b/include/asio/doc/asio/reference/use_future_t/get_allocator.html new file mode 100644 index 0000000..20e9b97 --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/get_allocator.html @@ -0,0 +1,44 @@ + + + +use_future_t::get_allocator + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Obtain + allocator. +

+
allocator_type get_allocator() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/operator_lb__rb_.html b/include/asio/doc/asio/reference/use_future_t/operator_lb__rb_.html new file mode 100644 index 0000000..8d43348 --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/operator_lb__rb_.html @@ -0,0 +1,47 @@ + + + +use_future_t::operator[] + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +(Deprecated: + Use rebind().) Specify an alternate allocator. +

+
template<
+    typename OtherAllocator>
+use_future_t< OtherAllocator > operator[](
+    const OtherAllocator & allocator) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/operator_lp__rp_.html b/include/asio/doc/asio/reference/use_future_t/operator_lp__rp_.html new file mode 100644 index 0000000..c23f30e --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/operator_lp__rp_.html @@ -0,0 +1,66 @@ + + + +use_future_t::operator() + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Wrap + a function object in a packaged task. +

+
template<
+    typename Function>
+unspecified operator()(
+    Function && f) const;
+
+

+ The package function is used to adapt a function object as + a packaged task. When this adapter is passed as a completion token to an + asynchronous operation, the result of the function object is retuned via + a std::future. +

+
+ + Example +
+
std::future<std::size_t> fut =
+  my_socket.async_read_some(buffer,
+    use_future([](asio::error_code ec, std::size_t n)
+      {
+        return ec ? 0 : n;
+      }));
+...
+std::size_t n = fut.get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/rebind.html b/include/asio/doc/asio/reference/use_future_t/rebind.html new file mode 100644 index 0000000..a8776d0 --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/rebind.html @@ -0,0 +1,47 @@ + + + +use_future_t::rebind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Specify an alternate + allocator. +

+
template<
+    typename OtherAllocator>
+use_future_t< OtherAllocator > rebind(
+    const OtherAllocator & allocator) const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/use_future_t.html b/include/asio/doc/asio/reference/use_future_t/use_future_t.html new file mode 100644 index 0000000..9bd93ea --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/use_future_t.html @@ -0,0 +1,52 @@ + + + +use_future_t::use_future_t + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + using default-constructed allocator. +

+
constexpr use_future_t();
+  » more...
+
+

+ Construct using specified allocator. +

+
explicit use_future_t(
+    const Allocator & allocator);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/use_future_t/overload1.html b/include/asio/doc/asio/reference/use_future_t/use_future_t/overload1.html new file mode 100644 index 0000000..35bc720 --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/use_future_t/overload1.html @@ -0,0 +1,43 @@ + + + +use_future_t::use_future_t (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct using default-constructed allocator. +

+
constexpr use_future_t();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/use_future_t/use_future_t/overload2.html b/include/asio/doc/asio/reference/use_future_t/use_future_t/overload2.html new file mode 100644 index 0000000..a243c91 --- /dev/null +++ b/include/asio/doc/asio/reference/use_future_t/use_future_t/overload2.html @@ -0,0 +1,44 @@ + + + +use_future_t::use_future_t (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct using specified allocator. +

+
use_future_t(
+    const Allocator & allocator);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/uses_executor.html b/include/asio/doc/asio/reference/uses_executor.html new file mode 100644 index 0000000..4c5cd9c --- /dev/null +++ b/include/asio/doc/asio/reference/uses_executor.html @@ -0,0 +1,65 @@ + + + +uses_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ The uses_executor + trait detects whether a type T has an associated executor that is convertible + from type Executor. +

+
template<
+    typename T,
+    typename Executor>
+struct uses_executor :
+  public false_type
+
+

+ Meets the BinaryTypeTrait requirements. The Asio library provides a definition + that is derived from false_type. A program may specialize this + template to derive from true_type for a user-defined type T that can be constructed + with an executor, where the first argument of a constructor has type executor_arg_t + and the second argument is convertible from type Executor. +

+
+ + Requirements +
+

+ Header: asio/uses_executor.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/wait_traits.html b/include/asio/doc/asio/reference/wait_traits.html new file mode 100644 index 0000000..7b41b7f --- /dev/null +++ b/include/asio/doc/asio/reference/wait_traits.html @@ -0,0 +1,90 @@ + + + +wait_traits + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wait traits suitable for use with the basic_waitable_timer + class template. +

+
template<
+    typename Clock>
+struct wait_traits
+
+
+ + Member + Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ to_wait_duration [static] +

+
+

+ Convert a clock duration into a duration used for waiting. +

+
+
+ + Requirements +
+

+ Header: asio/wait_traits.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/wait_traits/to_wait_duration.html b/include/asio/doc/asio/reference/wait_traits/to_wait_duration.html new file mode 100644 index 0000000..fbe4104 --- /dev/null +++ b/include/asio/doc/asio/reference/wait_traits/to_wait_duration.html @@ -0,0 +1,50 @@ + + + +wait_traits::to_wait_duration + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Convert + a clock duration into a duration used for waiting. +

+
static Clock::duration to_wait_duration(
+    const typename Clock::duration & d);
+  » more...
+
+static Clock::duration to_wait_duration(
+    const typename Clock::time_point & t);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/wait_traits/to_wait_duration/overload1.html b/include/asio/doc/asio/reference/wait_traits/to_wait_duration/overload1.html new file mode 100644 index 0000000..7ab4571 --- /dev/null +++ b/include/asio/doc/asio/reference/wait_traits/to_wait_duration/overload1.html @@ -0,0 +1,52 @@ + + + +wait_traits::to_wait_duration (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Convert a clock duration into a duration used for waiting. +

+
static Clock::duration to_wait_duration(
+    const typename Clock::duration & d);
+
+
+ + Return + Value +
+

+ d. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/wait_traits/to_wait_duration/overload2.html b/include/asio/doc/asio/reference/wait_traits/to_wait_duration/overload2.html new file mode 100644 index 0000000..ec2f431 --- /dev/null +++ b/include/asio/doc/asio/reference/wait_traits/to_wait_duration/overload2.html @@ -0,0 +1,52 @@ + + + +wait_traits::to_wait_duration (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Convert a clock duration into a duration used for waiting. +

+
static Clock::duration to_wait_duration(
+    const typename Clock::time_point & t);
+
+
+ + Return + Value +
+

+ d. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle.html b/include/asio/doc/asio/reference/windows__basic_object_handle.html new file mode 100644 index 0000000..2c58e54 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle.html @@ -0,0 +1,301 @@ + + + +windows::basic_object_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides object-oriented handle functionality. +

+
template<
+    typename Executor = any_io_executor>
+class basic_object_handle
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An object handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the object handle. +

+
+

+ basic_object_handle [constructor] +

+
+

+ Construct an object handle without opening it.
—
Construct + an object handle on an existing native handle.
—
Move-construct + an object handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an object handle from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the object handle. +

+
+

+ The windows::basic_object_handle + class provides asynchronous and blocking object-oriented handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_object_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/assign.html b/include/asio/doc/asio/reference/windows__basic_object_handle/assign.html new file mode 100644 index 0000000..b516137 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/assign.html @@ -0,0 +1,51 @@ + + + +windows::basic_object_handle::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+  » more...
+
+void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/assign/overload1.html b/include/asio/doc/asio/reference/windows__basic_object_handle/assign/overload1.html new file mode 100644 index 0000000..e280bbc --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/assign/overload1.html @@ -0,0 +1,44 @@ + + + +windows::basic_object_handle::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/assign/overload2.html b/include/asio/doc/asio/reference/windows__basic_object_handle/assign/overload2.html new file mode 100644 index 0000000..c25151b --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/assign/overload2.html @@ -0,0 +1,45 @@ + + + +windows::basic_object_handle::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/async_wait.html b/include/asio/doc/asio/reference/windows__basic_object_handle/async_wait.html new file mode 100644 index 0000000..8137b1d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/async_wait.html @@ -0,0 +1,78 @@ + + + +windows::basic_object_handle::async_wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous wait on the object handle. +

+
template<
+    typename WaitHandler = DEFAULT>
+DEDUCED async_wait(
+    WaitHandler && handler = DEFAULT);
+
+

+ This function is be used to initiate an asynchronous wait against the object + handle. It always returns immediately. +

+
+ + Parameters +
+
+

+
+
handler
+
+

+ The handler to be called when the object handle is set to the signalled + state. Copies will be made of the handler as required. The function + signature of the handler must be: +

+
void handler(
+  const asio::error_code& error // Result of operation.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle.html b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle.html new file mode 100644 index 0000000..bcf285f --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle.html @@ -0,0 +1,76 @@ + + + +windows::basic_object_handle::basic_object_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an object handle without opening it. +

+
explicit basic_object_handle(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_object_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_object_handle >::type *  = 0);
+  » more...
+
+

+ Construct an object handle on an existing native handle. +

+
basic_object_handle(
+    const executor_type & ex,
+    const native_handle_type & native_handle);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_object_handle(
+    ExecutionContext & context,
+    const native_handle_type & native_handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct an object handle from another. +

+
basic_object_handle(
+    basic_object_handle && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload1.html b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload1.html new file mode 100644 index 0000000..0b95b81 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload1.html @@ -0,0 +1,62 @@ + + + +windows::basic_object_handle::basic_object_handle (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an object handle without opening it. +

+
basic_object_handle(
+    const executor_type & ex);
+
+

+ This constructor creates an object handle without opening it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the object handle will use, by default, to + dispatch handlers for any asynchronous operations performed on + the object handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload2.html b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload2.html new file mode 100644 index 0000000..4df960c --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload2.html @@ -0,0 +1,65 @@ + + + +windows::basic_object_handle::basic_object_handle (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an object handle without opening it. +

+
template<
+    typename ExecutionContext>
+basic_object_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_object_handle >::type *  = 0);
+
+

+ This constructor creates an object handle without opening it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the object + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the object handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload3.html b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload3.html new file mode 100644 index 0000000..10b1d7d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload3.html @@ -0,0 +1,81 @@ + + + +windows::basic_object_handle::basic_object_handle (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an object handle on an existing native handle. +

+
basic_object_handle(
+    const executor_type & ex,
+    const native_handle_type & native_handle);
+
+

+ This constructor creates an object handle object to hold an existing + native handle. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the object handle will use, by default, to + dispatch handlers for any asynchronous operations performed on + the object handle. +

+
native_handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload4.html b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload4.html new file mode 100644 index 0000000..e05546d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload4.html @@ -0,0 +1,84 @@ + + + +windows::basic_object_handle::basic_object_handle (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an object handle on an existing native handle. +

+
template<
+    typename ExecutionContext>
+basic_object_handle(
+    ExecutionContext & context,
+    const native_handle_type & native_handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates an object handle object to hold an existing + native handle. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the object + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the object handle. +

+
native_handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload5.html b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload5.html new file mode 100644 index 0000000..8922304 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/basic_object_handle/overload5.html @@ -0,0 +1,69 @@ + + + +windows::basic_object_handle::basic_object_handle (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct an object handle from another. +

+
basic_object_handle(
+    basic_object_handle && other);
+
+

+ This constructor moves an object handle from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other object handle object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_object_handle(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/cancel.html b/include/asio/doc/asio/reference/windows__basic_object_handle/cancel.html new file mode 100644 index 0000000..72f5995 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/cancel.html @@ -0,0 +1,49 @@ + + + +windows::basic_object_handle::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the handle. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/cancel/overload1.html b/include/asio/doc/asio/reference/windows__basic_object_handle/cancel/overload1.html new file mode 100644 index 0000000..0b7aeff --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/cancel/overload1.html @@ -0,0 +1,61 @@ + + + +windows::basic_object_handle::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/cancel/overload2.html b/include/asio/doc/asio/reference/windows__basic_object_handle/cancel/overload2.html new file mode 100644 index 0000000..cc5c12f --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/cancel/overload2.html @@ -0,0 +1,62 @@ + + + +windows::basic_object_handle::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/close.html b/include/asio/doc/asio/reference/windows__basic_object_handle/close.html new file mode 100644 index 0000000..a457161 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/close.html @@ -0,0 +1,49 @@ + + + +windows::basic_object_handle::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the handle. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/close/overload1.html b/include/asio/doc/asio/reference/windows__basic_object_handle/close/overload1.html new file mode 100644 index 0000000..133caf9 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/close/overload1.html @@ -0,0 +1,61 @@ + + + +windows::basic_object_handle::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the handle. +

+
void close();
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/close/overload2.html b/include/asio/doc/asio/reference/windows__basic_object_handle/close/overload2.html new file mode 100644 index 0000000..9b74140 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/close/overload2.html @@ -0,0 +1,62 @@ + + + +windows::basic_object_handle::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the handle. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/executor_type.html b/include/asio/doc/asio/reference/windows__basic_object_handle/executor_type.html new file mode 100644 index 0000000..7172ae4 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/executor_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_object_handle::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_object_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/get_executor.html b/include/asio/doc/asio/reference/windows__basic_object_handle/get_executor.html new file mode 100644 index 0000000..e2671b3 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/get_executor.html @@ -0,0 +1,44 @@ + + + +windows::basic_object_handle::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/is_open.html b/include/asio/doc/asio/reference/windows__basic_object_handle/is_open.html new file mode 100644 index 0000000..78212df --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/is_open.html @@ -0,0 +1,44 @@ + + + +windows::basic_object_handle::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the handle is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer.html b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer.html new file mode 100644 index 0000000..d1497f8 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer.html @@ -0,0 +1,51 @@ + + + +windows::basic_object_handle::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer/overload1.html b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer/overload1.html new file mode 100644 index 0000000..23ff4bc --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer/overload1.html @@ -0,0 +1,57 @@ + + + +windows::basic_object_handle::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since an object handle cannot contain any further layers, it simply returns + a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer/overload2.html b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer/overload2.html new file mode 100644 index 0000000..870dd29 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer/overload2.html @@ -0,0 +1,57 @@ + + + +windows::basic_object_handle::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since an object handle cannot contain any further layers, + it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer_type.html b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer_type.html new file mode 100644 index 0000000..e664fb7 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/lowest_layer_type.html @@ -0,0 +1,301 @@ + + + +windows::basic_object_handle::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An + object handle is always the lowest layer. +

+
typedef basic_object_handle lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An object handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the object handle. +

+
+

+ basic_object_handle [constructor] +

+
+

+ Construct an object handle without opening it.
—
+ Construct an object handle on an existing native handle.
+ —
Move-construct an object handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an object handle from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the object handle. +

+
+

+ The windows::basic_object_handle + class provides asynchronous and blocking object-oriented handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_object_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/native_handle.html b/include/asio/doc/asio/reference/windows__basic_object_handle/native_handle.html new file mode 100644 index 0000000..dfbbb19 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/native_handle.html @@ -0,0 +1,49 @@ + + + +windows::basic_object_handle::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the native handle representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + handle. This is intended to allow access to native handle functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/native_handle_type.html b/include/asio/doc/asio/reference/windows__basic_object_handle/native_handle_type.html new file mode 100644 index 0000000..f20a4c5 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/native_handle_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_object_handle::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a handle. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_object_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/operator_eq_.html b/include/asio/doc/asio/reference/windows__basic_object_handle/operator_eq_.html new file mode 100644 index 0000000..7442514 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/operator_eq_.html @@ -0,0 +1,69 @@ + + + +windows::basic_object_handle::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + an object handle from another. +

+
basic_object_handle & operator=(
+    basic_object_handle && other);
+
+

+ This assignment operator moves an object handle from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other object handle object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_object_handle(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/wait.html b/include/asio/doc/asio/reference/windows__basic_object_handle/wait.html new file mode 100644 index 0000000..bac82e6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/wait.html @@ -0,0 +1,49 @@ + + + +windows::basic_object_handle::wait + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Perform + a blocking wait on the object handle. +

+
void wait();
+  » more...
+
+void wait(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/wait/overload1.html b/include/asio/doc/asio/reference/windows__basic_object_handle/wait/overload1.html new file mode 100644 index 0000000..5b122d0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/wait/overload1.html @@ -0,0 +1,61 @@ + + + +windows::basic_object_handle::wait (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform a blocking wait on the object handle. +

+
void wait();
+
+

+ This function is used to wait for the object handle to be set to the + signalled state. This function blocks and does not return until the object + handle has been set to the signalled state. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle/wait/overload2.html b/include/asio/doc/asio/reference/windows__basic_object_handle/wait/overload2.html new file mode 100644 index 0000000..e778685 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle/wait/overload2.html @@ -0,0 +1,62 @@ + + + +windows::basic_object_handle::wait (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Perform a blocking wait on the object handle. +

+
void wait(
+    asio::error_code & ec);
+
+

+ This function is used to wait for the object handle to be set to the + signalled state. This function blocks and does not return until the object + handle has been set to the signalled state. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle__rebind_executor.html b/include/asio/doc/asio/reference/windows__basic_object_handle__rebind_executor.html new file mode 100644 index 0000000..01e1769 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle__rebind_executor.html @@ -0,0 +1,88 @@ + + + +windows::basic_object_handle::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the handle type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The handle type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/windows/basic_object_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_object_handle__rebind_executor/other.html b/include/asio/doc/asio/reference/windows__basic_object_handle__rebind_executor/other.html new file mode 100644 index 0000000..49bd11e --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_object_handle__rebind_executor/other.html @@ -0,0 +1,301 @@ + + + +windows::basic_object_handle::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + handle type when rebound to the specified executor. +

+
typedef basic_object_handle< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An object handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the object handle. +

+
+

+ basic_object_handle [constructor] +

+
+

+ Construct an object handle without opening it.
—
+ Construct an object handle on an existing native handle.
+ —
Move-construct an object handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an object handle from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the object handle. +

+
+

+ The windows::basic_object_handle + class provides asynchronous and blocking object-oriented handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_object_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle.html new file mode 100644 index 0000000..dcfeaa1 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle.html @@ -0,0 +1,314 @@ + + + +windows::basic_overlapped_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides Windows handle functionality for objects that support overlapped + I/O. +

+
template<
+    typename Executor = any_io_executor>
+class basic_overlapped_handle
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ basic_overlapped_handle [constructor] +

+
+

+ Construct an overlapped handle without opening it.
—
+ Construct an overlapped handle on an existing native handle.
+ —
Move-construct an overlapped handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an overlapped handle from another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_overlapped_handle [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The windows::overlapped_handle + class provides the ability to wrap a Windows handle. The underlying object + referred to by the handle must support overlapped I/O. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_overlapped_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/_basic_overlapped_handle.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/_basic_overlapped_handle.html new file mode 100644 index 0000000..53a78a7 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/_basic_overlapped_handle.html @@ -0,0 +1,48 @@ + + + +windows::basic_overlapped_handle::~basic_overlapped_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Protected + destructor to prevent deletion through this type. +

+
~basic_overlapped_handle();
+
+

+ This function destroys the handle, cancelling any outstanding asynchronous + wait operations associated with the handle as if by calling cancel. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign.html new file mode 100644 index 0000000..7547119 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign.html @@ -0,0 +1,51 @@ + + + +windows::basic_overlapped_handle::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+  » more...
+
+void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign/overload1.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign/overload1.html new file mode 100644 index 0000000..94c53d6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign/overload1.html @@ -0,0 +1,44 @@ + + + +windows::basic_overlapped_handle::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign/overload2.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign/overload2.html new file mode 100644 index 0000000..d5c1ad7 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/assign/overload2.html @@ -0,0 +1,45 @@ + + + +windows::basic_overlapped_handle::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle.html new file mode 100644 index 0000000..2d7fdc4 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle.html @@ -0,0 +1,76 @@ + + + +windows::basic_overlapped_handle::basic_overlapped_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an overlapped handle without opening it. +

+
explicit basic_overlapped_handle(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_overlapped_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_overlapped_handle >::type *  = 0);
+  » more...
+
+

+ Construct an overlapped handle on an existing native handle. +

+
basic_overlapped_handle(
+    const executor_type & ex,
+    const native_handle_type & native_handle);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_overlapped_handle(
+    ExecutionContext & context,
+    const native_handle_type & native_handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct an overlapped handle from another. +

+
basic_overlapped_handle(
+    basic_overlapped_handle && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload1.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload1.html new file mode 100644 index 0000000..61bc2c6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload1.html @@ -0,0 +1,62 @@ + + + +windows::basic_overlapped_handle::basic_overlapped_handle (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an overlapped handle without opening it. +

+
basic_overlapped_handle(
+    const executor_type & ex);
+
+

+ This constructor creates an overlapped handle without opening it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the overlapped handle will use, by default, + to dispatch handlers for any asynchronous operations performed + on the overlapped handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload2.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload2.html new file mode 100644 index 0000000..887b005 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload2.html @@ -0,0 +1,65 @@ + + + +windows::basic_overlapped_handle::basic_overlapped_handle (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an overlapped handle without opening it. +

+
template<
+    typename ExecutionContext>
+basic_overlapped_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_overlapped_handle >::type *  = 0);
+
+

+ This constructor creates an overlapped handle without opening it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the overlapped + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the overlapped handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload3.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload3.html new file mode 100644 index 0000000..9923bda --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload3.html @@ -0,0 +1,81 @@ + + + +windows::basic_overlapped_handle::basic_overlapped_handle (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an overlapped handle on an existing native handle. +

+
basic_overlapped_handle(
+    const executor_type & ex,
+    const native_handle_type & native_handle);
+
+

+ This constructor creates an overlapped handle object to hold an existing + native handle. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the overlapped handle will use, by default, + to dispatch handlers for any asynchronous operations performed + on the overlapped handle. +

+
native_handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload4.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload4.html new file mode 100644 index 0000000..a689607 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload4.html @@ -0,0 +1,84 @@ + + + +windows::basic_overlapped_handle::basic_overlapped_handle (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an overlapped handle on an existing native handle. +

+
template<
+    typename ExecutionContext>
+basic_overlapped_handle(
+    ExecutionContext & context,
+    const native_handle_type & native_handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates an overlapped handle object to hold an existing + native handle. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the overlapped + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the overlapped handle. +

+
native_handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload5.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload5.html new file mode 100644 index 0000000..d3760d0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload5.html @@ -0,0 +1,69 @@ + + + +windows::basic_overlapped_handle::basic_overlapped_handle (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct an overlapped handle from another. +

+
basic_overlapped_handle(
+    basic_overlapped_handle && other);
+
+

+ This constructor moves a handle from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other overlapped handle object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the overlapped_handle(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel.html new file mode 100644 index 0000000..2b369ee --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel.html @@ -0,0 +1,49 @@ + + + +windows::basic_overlapped_handle::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the handle. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel/overload1.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel/overload1.html new file mode 100644 index 0000000..2b30cc4 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel/overload1.html @@ -0,0 +1,61 @@ + + + +windows::basic_overlapped_handle::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel/overload2.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel/overload2.html new file mode 100644 index 0000000..9f18f24 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/cancel/overload2.html @@ -0,0 +1,62 @@ + + + +windows::basic_overlapped_handle::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close.html new file mode 100644 index 0000000..8cfea6a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close.html @@ -0,0 +1,49 @@ + + + +windows::basic_overlapped_handle::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the handle. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close/overload1.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close/overload1.html new file mode 100644 index 0000000..f76e102 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close/overload1.html @@ -0,0 +1,61 @@ + + + +windows::basic_overlapped_handle::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the handle. +

+
void close();
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close/overload2.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close/overload2.html new file mode 100644 index 0000000..4d38942 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/close/overload2.html @@ -0,0 +1,62 @@ + + + +windows::basic_overlapped_handle::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Close the handle. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/executor_type.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/executor_type.html new file mode 100644 index 0000000..c2671ec --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/executor_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_overlapped_handle::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_overlapped_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/get_executor.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/get_executor.html new file mode 100644 index 0000000..87fb1ff --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/get_executor.html @@ -0,0 +1,44 @@ + + + +windows::basic_overlapped_handle::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/is_open.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/is_open.html new file mode 100644 index 0000000..bb684f0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/is_open.html @@ -0,0 +1,44 @@ + + + +windows::basic_overlapped_handle::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Determine + whether the handle is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer.html new file mode 100644 index 0000000..a70c29a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer.html @@ -0,0 +1,51 @@ + + + +windows::basic_overlapped_handle::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer/overload1.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer/overload1.html new file mode 100644 index 0000000..f744d18 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer/overload1.html @@ -0,0 +1,57 @@ + + + +windows::basic_overlapped_handle::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since an overlapped_handle cannot contain any further layers, it simply + returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer/overload2.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer/overload2.html new file mode 100644 index 0000000..f7b4c49 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer/overload2.html @@ -0,0 +1,57 @@ + + + +windows::basic_overlapped_handle::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since an overlapped_handle cannot contain any further layers, + it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer_type.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer_type.html new file mode 100644 index 0000000..b71910c --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/lowest_layer_type.html @@ -0,0 +1,313 @@ + + + +windows::basic_overlapped_handle::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +An + overlapped_handle is always the lowest layer. +

+
typedef basic_overlapped_handle lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ basic_overlapped_handle [constructor] +

+
+

+ Construct an overlapped handle without opening it.
—
+ Construct an overlapped handle on an existing native handle. +
—
Move-construct an overlapped handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an overlapped handle from another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_overlapped_handle [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The windows::overlapped_handle + class provides the ability to wrap a Windows handle. The underlying object + referred to by the handle must support overlapped I/O. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_overlapped_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/native_handle.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/native_handle.html new file mode 100644 index 0000000..0ad977d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/native_handle.html @@ -0,0 +1,49 @@ + + + +windows::basic_overlapped_handle::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the native handle representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + handle. This is intended to allow access to native handle functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/native_handle_type.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/native_handle_type.html new file mode 100644 index 0000000..ae79cc2 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/native_handle_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_overlapped_handle::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a handle. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_overlapped_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle/operator_eq_.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/operator_eq_.html new file mode 100644 index 0000000..70d4fec --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle/operator_eq_.html @@ -0,0 +1,69 @@ + + + +windows::basic_overlapped_handle::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + an overlapped handle from another. +

+
basic_overlapped_handle & operator=(
+    basic_overlapped_handle && other);
+
+

+ This assignment operator moves a handle from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other overlapped handle object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the overlapped_handle(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor.html new file mode 100644 index 0000000..974b3fa --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor.html @@ -0,0 +1,88 @@ + + + +windows::basic_overlapped_handle::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the handle type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The handle type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/windows/basic_overlapped_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor/other.html b/include/asio/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor/other.html new file mode 100644 index 0000000..ef63599 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor/other.html @@ -0,0 +1,313 @@ + + + +windows::basic_overlapped_handle::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + handle type when rebound to the specified executor. +

+
typedef basic_overlapped_handle< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ basic_overlapped_handle [constructor] +

+
+

+ Construct an overlapped handle without opening it.
—
+ Construct an overlapped handle on an existing native handle. +
—
Move-construct an overlapped handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an overlapped handle from another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_overlapped_handle [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The windows::overlapped_handle + class provides the ability to wrap a Windows handle. The underlying object + referred to by the handle must support overlapped I/O. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_overlapped_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle.html new file mode 100644 index 0000000..7508634 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle.html @@ -0,0 +1,326 @@ + + + +windows::basic_random_access_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides random-access handle functionality. +

+
template<
+    typename Executor = any_io_executor>
+class basic_random_access_handle :
+  public windows::basic_overlapped_handle< Executor >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_read_some_at +

+
+

+ Start an asynchronous read at the specified offset. +

+
+

+ async_write_some_at +

+
+

+ Start an asynchronous write at the specified offset. +

+
+

+ basic_random_access_handle [constructor] +

+
+

+ Construct a random-access handle without opening it.
—
+ Construct a random-access handle on an existing native handle. +
—
Move-construct a random-access handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign a random-access handle from another. +

+
+

+ read_some_at +

+
+

+ Read some data from the handle at the specified offset. +

+
+

+ write_some_at +

+
+

+ Write some data to the handle at the specified offset. +

+
+

+ The windows::basic_random_access_handle + class provides asynchronous and blocking random-access handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_random_access_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign.html new file mode 100644 index 0000000..f6bfea0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign.html @@ -0,0 +1,51 @@ + + + +windows::basic_random_access_handle::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+  » more...
+
+void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign/overload1.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign/overload1.html new file mode 100644 index 0000000..303c72e --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign/overload1.html @@ -0,0 +1,47 @@ + + + +windows::basic_random_access_handle::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign/overload2.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign/overload2.html new file mode 100644 index 0000000..a19975b --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/assign/overload2.html @@ -0,0 +1,48 @@ + + + +windows::basic_random_access_handle::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/async_read_some_at.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/async_read_some_at.html new file mode 100644 index 0000000..693497a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/async_read_some_at.html @@ -0,0 +1,118 @@ + + + +windows::basic_random_access_handle::async_read_some_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read at the specified offset. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some_at(
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data from the random-access + handle. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes read.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The read operation may not read all of the requested number of bytes. Consider + using the async_read_at + function if you need to ensure that the requested amount of data is read + before the asynchronous operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
handle.async_read_some_at(42, asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/async_write_some_at.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/async_write_some_at.html new file mode 100644 index 0000000..92b9e33 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/async_write_some_at.html @@ -0,0 +1,118 @@ + + + +windows::basic_random_access_handle::async_write_some_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write at the specified offset. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some_at(
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write data to the random-access + handle. The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more data buffers to be written to the handle. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes written.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The write operation may not transmit all of the data to the peer. Consider + using the async_write_at + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
handle.async_write_some_at(42, asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle.html new file mode 100644 index 0000000..a2807f7 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle.html @@ -0,0 +1,76 @@ + + + +windows::basic_random_access_handle::basic_random_access_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a random-access handle without opening it. +

+
explicit basic_random_access_handle(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_random_access_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_random_access_handle >::type *  = 0);
+  » more...
+
+

+ Construct a random-access handle on an existing native handle. +

+
basic_random_access_handle(
+    const executor_type & ex,
+    const native_handle_type & handle);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_random_access_handle(
+    ExecutionContext & context,
+    const native_handle_type & handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a random-access handle from another. +

+
basic_random_access_handle(
+    basic_random_access_handle && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload1.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload1.html new file mode 100644 index 0000000..beb4c0c --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload1.html @@ -0,0 +1,62 @@ + + + +windows::basic_random_access_handle::basic_random_access_handle (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a random-access handle without opening it. +

+
basic_random_access_handle(
+    const executor_type & ex);
+
+

+ This constructor creates a random-access handle without opening it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the random-access handle will use, by default, + to dispatch handlers for any asynchronous operations performed + on the random-access handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload2.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload2.html new file mode 100644 index 0000000..2bdb66f --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload2.html @@ -0,0 +1,67 @@ + + + +windows::basic_random_access_handle::basic_random_access_handle (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a random-access handle without opening it. +

+
template<
+    typename ExecutionContext>
+basic_random_access_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_random_access_handle >::type *  = 0);
+
+

+ This constructor creates a random-access handle without opening it. The + handle needs to be opened or assigned before data can be sent or received + on it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the random-access + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the random-access handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload3.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload3.html new file mode 100644 index 0000000..53453e6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload3.html @@ -0,0 +1,81 @@ + + + +windows::basic_random_access_handle::basic_random_access_handle (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a random-access handle on an existing native handle. +

+
basic_random_access_handle(
+    const executor_type & ex,
+    const native_handle_type & handle);
+
+

+ This constructor creates a random-access handle object to hold an existing + native handle. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the random-access handle will use, by default, + to dispatch handlers for any asynchronous operations performed + on the random-access handle. +

+
handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload4.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload4.html new file mode 100644 index 0000000..8c76dac --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload4.html @@ -0,0 +1,84 @@ + + + +windows::basic_random_access_handle::basic_random_access_handle (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a random-access handle on an existing native handle. +

+
template<
+    typename ExecutionContext>
+basic_random_access_handle(
+    ExecutionContext & context,
+    const native_handle_type & handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a random-access handle object to hold an existing + native handle. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the random-access + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the random-access handle. +

+
handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload5.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload5.html new file mode 100644 index 0000000..b5f51ac --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload5.html @@ -0,0 +1,70 @@ + + + +windows::basic_random_access_handle::basic_random_access_handle (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a random-access handle from another. +

+
basic_random_access_handle(
+    basic_random_access_handle && other);
+
+

+ This constructor moves a random-access handle from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other random-access handle object from which the move will + occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_random_access_handle(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel.html new file mode 100644 index 0000000..b209e8d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel.html @@ -0,0 +1,49 @@ + + + +windows::basic_random_access_handle::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the handle. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel/overload1.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel/overload1.html new file mode 100644 index 0000000..53d50f6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel/overload1.html @@ -0,0 +1,64 @@ + + + +windows::basic_random_access_handle::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel/overload2.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel/overload2.html new file mode 100644 index 0000000..c4171b8 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/cancel/overload2.html @@ -0,0 +1,65 @@ + + + +windows::basic_random_access_handle::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/close.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/close.html new file mode 100644 index 0000000..c7a7130 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/close.html @@ -0,0 +1,49 @@ + + + +windows::basic_random_access_handle::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the handle. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/close/overload1.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/close/overload1.html new file mode 100644 index 0000000..d9718ec --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/close/overload1.html @@ -0,0 +1,64 @@ + + + +windows::basic_random_access_handle::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Close the handle. +

+
void close();
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/close/overload2.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/close/overload2.html new file mode 100644 index 0000000..c079f19 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/close/overload2.html @@ -0,0 +1,65 @@ + + + +windows::basic_random_access_handle::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Close the handle. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/executor_type.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/executor_type.html new file mode 100644 index 0000000..2d303a5 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/executor_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_random_access_handle::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_random_access_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/get_executor.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/get_executor.html new file mode 100644 index 0000000..028d086 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/get_executor.html @@ -0,0 +1,47 @@ + + + +windows::basic_random_access_handle::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/is_open.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/is_open.html new file mode 100644 index 0000000..0b54d36 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/is_open.html @@ -0,0 +1,47 @@ + + + +windows::basic_random_access_handle::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +Determine + whether the handle is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer.html new file mode 100644 index 0000000..6634ef2 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer.html @@ -0,0 +1,51 @@ + + + +windows::basic_random_access_handle::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer/overload1.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer/overload1.html new file mode 100644 index 0000000..b1d2560 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer/overload1.html @@ -0,0 +1,60 @@ + + + +windows::basic_random_access_handle::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since an overlapped_handle cannot contain any further layers, it simply + returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer/overload2.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer/overload2.html new file mode 100644 index 0000000..f7158ab --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer/overload2.html @@ -0,0 +1,60 @@ + + + +windows::basic_random_access_handle::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since an overlapped_handle cannot contain any further layers, + it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer_type.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer_type.html new file mode 100644 index 0000000..888e687 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/lowest_layer_type.html @@ -0,0 +1,316 @@ + + + +windows::basic_random_access_handle::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +An + overlapped_handle is always the lowest layer. +

+
typedef basic_overlapped_handle lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ basic_overlapped_handle [constructor] +

+
+

+ Construct an overlapped handle without opening it.
—
+ Construct an overlapped handle on an existing native handle. +
—
Move-construct an overlapped handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an overlapped handle from another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_overlapped_handle [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The windows::overlapped_handle + class provides the ability to wrap a Windows handle. The underlying object + referred to by the handle must support overlapped I/O. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_random_access_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/native_handle.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/native_handle.html new file mode 100644 index 0000000..d363bc6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/native_handle.html @@ -0,0 +1,52 @@ + + + +windows::basic_random_access_handle::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +Get + the native handle representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + handle. This is intended to allow access to native handle functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/native_handle_type.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/native_handle_type.html new file mode 100644 index 0000000..62b666a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/native_handle_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_random_access_handle::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a handle. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_random_access_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/operator_eq_.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/operator_eq_.html new file mode 100644 index 0000000..cd2d5ec --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/operator_eq_.html @@ -0,0 +1,71 @@ + + + +windows::basic_random_access_handle::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a random-access handle from another. +

+
basic_random_access_handle & operator=(
+    basic_random_access_handle && other);
+
+

+ This assignment operator moves a random-access handle from one object to + another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other random-access handle object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_random_access_handle(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at.html new file mode 100644 index 0000000..1b6c698 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at.html @@ -0,0 +1,57 @@ + + + +windows::basic_random_access_handle::read_some_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read + some data from the handle at the specified offset. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some_at(
+    uint64_t offset,
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t read_some_at(
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload1.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload1.html new file mode 100644 index 0000000..faad302 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload1.html @@ -0,0 +1,116 @@ + + + +windows::basic_random_access_handle::read_some_at (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the handle at the specified offset. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some_at(
+    uint64_t offset,
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to read data from the random-access handle. The + function call will block until one or more bytes of data has been read + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read_at + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
handle.read_some_at(42, asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload2.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload2.html new file mode 100644 index 0000000..c144cdd --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload2.html @@ -0,0 +1,92 @@ + + + +windows::basic_random_access_handle::read_some_at (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the handle at the specified offset. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some_at(
+    uint64_t offset,
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to read data from the random-access handle. The + function call will block until one or more bytes of data has been read + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
offset
+

+ The offset at which the data will be read. +

+
buffers
+

+ One or more buffers into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read_at + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at.html new file mode 100644 index 0000000..0520f4d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at.html @@ -0,0 +1,57 @@ + + + +windows::basic_random_access_handle::write_some_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + some data to the handle at the specified offset. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some_at(
+    uint64_t offset,
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t write_some_at(
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at/overload1.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at/overload1.html new file mode 100644 index 0000000..1b92549 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at/overload1.html @@ -0,0 +1,116 @@ + + + +windows::basic_random_access_handle::write_some_at (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the handle at the specified offset. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some_at(
+    uint64_t offset,
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to write data to the random-access handle. The + function call will block until one or more bytes of the data has been + written successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more data buffers to be written to the handle. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The write_some_at operation may not write all of the data. Consider using + the write_at + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
handle.write_some_at(42, asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at/overload2.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at/overload2.html new file mode 100644 index 0000000..2bb14ea --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle/write_some_at/overload2.html @@ -0,0 +1,92 @@ + + + +windows::basic_random_access_handle::write_some_at (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the handle at the specified offset. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some_at(
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to write data to the random-access handle. The + function call will block until one or more bytes of the data has been + written successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more data buffers to be written to the handle. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write_at + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle__rebind_executor.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle__rebind_executor.html new file mode 100644 index 0000000..cf862c5 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle__rebind_executor.html @@ -0,0 +1,88 @@ + + + +windows::basic_random_access_handle::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the handle type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The handle type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/windows/basic_random_access_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_random_access_handle__rebind_executor/other.html b/include/asio/doc/asio/reference/windows__basic_random_access_handle__rebind_executor/other.html new file mode 100644 index 0000000..94e945a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_random_access_handle__rebind_executor/other.html @@ -0,0 +1,326 @@ + + + +windows::basic_random_access_handle::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + handle type when rebound to the specified executor. +

+
typedef basic_random_access_handle< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_read_some_at +

+
+

+ Start an asynchronous read at the specified offset. +

+
+

+ async_write_some_at +

+
+

+ Start an asynchronous write at the specified offset. +

+
+

+ basic_random_access_handle [constructor] +

+
+

+ Construct a random-access handle without opening it.
— +
Construct a random-access handle on an existing native + handle.
—
Move-construct a random-access handle from + another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign a random-access handle from another. +

+
+

+ read_some_at +

+
+

+ Read some data from the handle at the specified offset. +

+
+

+ write_some_at +

+
+

+ Write some data to the handle at the specified offset. +

+
+

+ The windows::basic_random_access_handle + class provides asynchronous and blocking random-access handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_random_access_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle.html b/include/asio/doc/asio/reference/windows__basic_stream_handle.html new file mode 100644 index 0000000..7017331 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle.html @@ -0,0 +1,326 @@ + + + +windows::basic_stream_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Provides stream-oriented handle functionality. +

+
template<
+    typename Executor = any_io_executor>
+class basic_stream_handle :
+  public windows::basic_overlapped_handle< Executor >
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_stream_handle [constructor] +

+
+

+ Construct a stream handle without opening it.
—
Construct + a stream handle on an existing native handle.
—
Move-construct + a stream handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign a stream handle from another. +

+
+

+ read_some +

+
+

+ Read some data from the handle. +

+
+

+ write_some +

+
+

+ Write some data to the handle. +

+
+

+ The windows::basic_stream_handle + class provides asynchronous and blocking stream-oriented handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_stream_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/assign.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/assign.html new file mode 100644 index 0000000..dbb25d1 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/assign.html @@ -0,0 +1,51 @@ + + + +windows::basic_stream_handle::assign + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Assign + an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+  » more...
+
+void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/assign/overload1.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/assign/overload1.html new file mode 100644 index 0000000..8552400 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/assign/overload1.html @@ -0,0 +1,47 @@ + + + +windows::basic_stream_handle::assign (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/assign/overload2.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/assign/overload2.html new file mode 100644 index 0000000..5c721d0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/assign/overload2.html @@ -0,0 +1,48 @@ + + + +windows::basic_stream_handle::assign (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Assign an existing native handle to the handle. +

+
void assign(
+    const native_handle_type & handle,
+    asio::error_code & ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/async_read_some.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/async_read_some.html new file mode 100644 index 0000000..ee1b58f --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/async_read_some.html @@ -0,0 +1,113 @@ + + + +windows::basic_stream_handle::async_read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous read. +

+
template<
+    typename MutableBufferSequence,
+    typename ReadHandler = DEFAULT>
+DEDUCED async_read_some(
+    const MutableBufferSequence & buffers,
+    ReadHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously read data from the stream handle. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the read operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes read.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The read operation may not read all of the requested number of bytes. Consider + using the async_read + function if you need to ensure that the requested amount of data is read + before the asynchronous operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
handle.async_read_some(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/async_write_some.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/async_write_some.html new file mode 100644 index 0000000..a16e089 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/async_write_some.html @@ -0,0 +1,113 @@ + + + +windows::basic_stream_handle::async_write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Start + an asynchronous write. +

+
template<
+    typename ConstBufferSequence,
+    typename WriteHandler = DEFAULT>
+DEDUCED async_write_some(
+    const ConstBufferSequence & buffers,
+    WriteHandler && handler = DEFAULT);
+
+

+ This function is used to asynchronously write data to the stream handle. + The function call always returns immediately. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the handle. Although the + buffers object may be copied as necessary, ownership of the underlying + memory blocks is retained by the caller, which must guarantee that + they remain valid until the handler is called. +

+
handler
+
+

+ The handler to be called when the write operation completes. Copies + will be made of the handler as required. The function signature of + the handler must be: +

+
void handler(
+  const asio::error_code& error, // Result of operation.
+  std::size_t bytes_transferred           // Number of bytes written.
+);
+
+

+ Regardless of whether the asynchronous operation completes immediately + or not, the handler will not be invoked from within this function. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using post. +

+
+
+
+
+ + Remarks +
+

+ The write operation may not transmit all of the data to the peer. Consider + using the async_write + function if you need to ensure that all data is written before the asynchronous + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
handle.async_write_some(asio::buffer(data, size), handler);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle.html new file mode 100644 index 0000000..4d6222d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle.html @@ -0,0 +1,76 @@ + + + +windows::basic_stream_handle::basic_stream_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + a stream handle without opening it. +

+
explicit basic_stream_handle(
+    const executor_type & ex);
+  » more...
+
+template<
+    typename ExecutionContext>
+explicit basic_stream_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_stream_handle >::type *  = 0);
+  » more...
+
+

+ Construct a stream handle on an existing native handle. +

+
basic_stream_handle(
+    const executor_type & ex,
+    const native_handle_type & handle);
+  » more...
+
+template<
+    typename ExecutionContext>
+basic_stream_handle(
+    ExecutionContext & context,
+    const native_handle_type & handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+

+ Move-construct a stream handle from another. +

+
basic_stream_handle(
+    basic_stream_handle && other);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload1.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload1.html new file mode 100644 index 0000000..7c394e1 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload1.html @@ -0,0 +1,62 @@ + + + +windows::basic_stream_handle::basic_stream_handle (1 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream handle without opening it. +

+
basic_stream_handle(
+    const executor_type & ex);
+
+

+ This constructor creates a stream handle without opening it. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the stream handle will use, by default, to + dispatch handlers for any asynchronous operations performed on + the stream handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload2.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload2.html new file mode 100644 index 0000000..9f3aef7 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload2.html @@ -0,0 +1,67 @@ + + + +windows::basic_stream_handle::basic_stream_handle (2 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream handle without opening it. +

+
template<
+    typename ExecutionContext>
+basic_stream_handle(
+    ExecutionContext & context,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value, basic_stream_handle >::type *  = 0);
+
+

+ This constructor creates a stream handle without opening it. The handle + needs to be opened or assigned before data can be sent or received on + it. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the stream + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the stream handle. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload3.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload3.html new file mode 100644 index 0000000..bd8bce4 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload3.html @@ -0,0 +1,81 @@ + + + +windows::basic_stream_handle::basic_stream_handle (3 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream handle on an existing native handle. +

+
basic_stream_handle(
+    const executor_type & ex,
+    const native_handle_type & handle);
+
+

+ This constructor creates a stream handle object to hold an existing native + handle. +

+
+ + Parameters +
+
+

+
+
ex
+

+ The I/O executor that the stream handle will use, by default, to + dispatch handlers for any asynchronous operations performed on + the stream handle. +

+
handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload4.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload4.html new file mode 100644 index 0000000..8395cff --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload4.html @@ -0,0 +1,84 @@ + + + +windows::basic_stream_handle::basic_stream_handle (4 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct a stream handle on an existing native handle. +

+
template<
+    typename ExecutionContext>
+basic_stream_handle(
+    ExecutionContext & context,
+    const native_handle_type & handle,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+

+ This constructor creates a stream handle object to hold an existing native + handle. +

+
+ + Parameters +
+
+

+
+
context
+

+ An execution context which provides the I/O executor that the stream + handle will use, by default, to dispatch handlers for any asynchronous + operations performed on the stream handle. +

+
handle
+

+ The new underlying handle implementation. +

+
+
+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload5.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload5.html new file mode 100644 index 0000000..36a5ea7 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/basic_stream_handle/overload5.html @@ -0,0 +1,69 @@ + + + +windows::basic_stream_handle::basic_stream_handle (5 of 5 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Move-construct a stream handle from another. +

+
basic_stream_handle(
+    basic_stream_handle && other);
+
+

+ This constructor moves a stream handle from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other stream handle object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if + constructed using the basic_stream_handle(const executor_type&) + constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel.html new file mode 100644 index 0000000..521dd57 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel.html @@ -0,0 +1,49 @@ + + + +windows::basic_stream_handle::cancel + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Cancel + all asynchronous operations associated with the handle. +

+
void cancel();
+  » more...
+
+void cancel(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel/overload1.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel/overload1.html new file mode 100644 index 0000000..1b3d7d9 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel/overload1.html @@ -0,0 +1,64 @@ + + + +windows::basic_stream_handle::cancel (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel();
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel/overload2.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel/overload2.html new file mode 100644 index 0000000..c26ef07 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/cancel/overload2.html @@ -0,0 +1,65 @@ + + + +windows::basic_stream_handle::cancel (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Cancel all asynchronous operations associated with the handle. +

+
void cancel(
+    asio::error_code & ec);
+
+

+ This function causes all outstanding asynchronous read or write operations + to finish immediately, and the handlers for cancelled operations will + be passed the asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/close.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/close.html new file mode 100644 index 0000000..05a81c1 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/close.html @@ -0,0 +1,49 @@ + + + +windows::basic_stream_handle::close + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Close + the handle. +

+
void close();
+  » more...
+
+void close(
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/close/overload1.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/close/overload1.html new file mode 100644 index 0000000..e5f76d1 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/close/overload1.html @@ -0,0 +1,64 @@ + + + +windows::basic_stream_handle::close (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Close the handle. +

+
void close();
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/close/overload2.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/close/overload2.html new file mode 100644 index 0000000..04711a7 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/close/overload2.html @@ -0,0 +1,65 @@ + + + +windows::basic_stream_handle::close (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Close the handle. +

+
void close(
+    asio::error_code & ec);
+
+

+ This function is used to close the handle. Any asynchronous read or write + operations will be cancelled immediately, and will complete with the + asio::error::operation_aborted error. +

+
+ + Parameters +
+
+

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/executor_type.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/executor_type.html new file mode 100644 index 0000000..3e20440 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/executor_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_stream_handle::executor_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + type of the executor associated with the object. +

+
typedef Executor executor_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_stream_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/get_executor.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/get_executor.html new file mode 100644 index 0000000..47bff7e --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/get_executor.html @@ -0,0 +1,47 @@ + + + +windows::basic_stream_handle::get_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +Get + the executor associated with the object. +

+
executor_type get_executor();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/is_open.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/is_open.html new file mode 100644 index 0000000..e34bbe1 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/is_open.html @@ -0,0 +1,47 @@ + + + +windows::basic_stream_handle::is_open + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +Determine + whether the handle is open. +

+
bool is_open() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer.html new file mode 100644 index 0000000..79bf701 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer.html @@ -0,0 +1,51 @@ + + + +windows::basic_stream_handle::lowest_layer + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+  » more...
+
+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer/overload1.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer/overload1.html new file mode 100644 index 0000000..50df6c6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer/overload1.html @@ -0,0 +1,60 @@ + + + +windows::basic_stream_handle::lowest_layer (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Get a reference to the lowest layer. +

+
lowest_layer_type & lowest_layer();
+
+

+ This function returns a reference to the lowest layer in a stack of layers. + Since an overlapped_handle cannot contain any further layers, it simply + returns a reference to itself. +

+
+ + Return + Value +
+

+ A reference to the lowest layer in the stack of layers. Ownership is + not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer/overload2.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer/overload2.html new file mode 100644 index 0000000..297a17d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer/overload2.html @@ -0,0 +1,60 @@ + + + +windows::basic_stream_handle::lowest_layer (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ Get a const reference to the lowest layer. +

+
const lowest_layer_type & lowest_layer() const;
+
+

+ This function returns a const reference to the lowest layer in a stack + of layers. Since an overlapped_handle cannot contain any further layers, + it simply returns a reference to itself. +

+
+ + Return + Value +
+

+ A const reference to the lowest layer in the stack of layers. Ownership + is not transferred to the caller. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer_type.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer_type.html new file mode 100644 index 0000000..1f9729e --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/lowest_layer_type.html @@ -0,0 +1,316 @@ + + + +windows::basic_stream_handle::lowest_layer_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +An + overlapped_handle is always the lowest layer. +

+
typedef basic_overlapped_handle lowest_layer_type;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ basic_overlapped_handle [constructor] +

+
+

+ Construct an overlapped handle without opening it.
—
+ Construct an overlapped handle on an existing native handle. +
—
Move-construct an overlapped handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an overlapped handle from another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_overlapped_handle [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The windows::overlapped_handle + class provides the ability to wrap a Windows handle. The underlying object + referred to by the handle must support overlapped I/O. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_stream_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/native_handle.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/native_handle.html new file mode 100644 index 0000000..6d3f11e --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/native_handle.html @@ -0,0 +1,52 @@ + + + +windows::basic_stream_handle::native_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Inherited from windows::basic_overlapped_handle. +

+

+ +Get + the native handle representation. +

+
native_handle_type native_handle();
+
+

+ This function may be used to obtain the underlying representation of the + handle. This is intended to allow access to native handle functionality + that is not otherwise provided. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/native_handle_type.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/native_handle_type.html new file mode 100644 index 0000000..46ab57a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/native_handle_type.html @@ -0,0 +1,54 @@ + + + +windows::basic_stream_handle::native_handle_type + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + native representation of a handle. +

+
typedef implementation_defined native_handle_type;
+
+
+ + Requirements +
+

+ Header: asio/windows/basic_stream_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/operator_eq_.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/operator_eq_.html new file mode 100644 index 0000000..65ab95b --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/operator_eq_.html @@ -0,0 +1,69 @@ + + + +windows::basic_stream_handle::operator= + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Move-assign + a stream handle from another. +

+
basic_stream_handle & operator=(
+    basic_stream_handle && other);
+
+

+ This assignment operator moves a stream handle from one object to another. +

+
+ + Parameters +
+
+

+
+
other
+

+ The other stream handle object from which the move will occur. +

+
+
+
+ + Remarks +
+

+ Following the move, the moved-from object is in the same state as if constructed + using the basic_stream_handle(const executor_type&) constructor. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some.html new file mode 100644 index 0000000..35d73b4 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some.html @@ -0,0 +1,55 @@ + + + +windows::basic_stream_handle::read_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Read + some data from the handle. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+  » more...
+
+template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some/overload1.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some/overload1.html new file mode 100644 index 0000000..4a6c187 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some/overload1.html @@ -0,0 +1,111 @@ + + + +windows::basic_stream_handle::read_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the handle. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers);
+
+

+ This function is used to read data from the stream handle. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + Example +
+

+ To read into a single data buffer use the buffer + function as follows: +

+
handle.read_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on reading into multiple buffers in one + go, and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some/overload2.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some/overload2.html new file mode 100644 index 0000000..a2f49e6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/read_some/overload2.html @@ -0,0 +1,87 @@ + + + +windows::basic_stream_handle::read_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Read some data from the handle. +

+
template<
+    typename MutableBufferSequence>
+std::size_t read_some(
+    const MutableBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to read data from the stream handle. The function + call will block until one or more bytes of data has been read successfully, + or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more buffers into which the data will be read. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes read. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The read_some operation may not read all of the requested number of bytes. + Consider using the read + function if you need to ensure that the requested amount of data is read + before the blocking operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some.html new file mode 100644 index 0000000..a9670b5 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some.html @@ -0,0 +1,55 @@ + + + +windows::basic_stream_handle::write_some + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Write + some data to the handle. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some/overload1.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some/overload1.html new file mode 100644 index 0000000..7dde7a9 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some/overload1.html @@ -0,0 +1,111 @@ + + + +windows::basic_stream_handle::write_some (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the handle. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to write data to the stream handle. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the handle. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. An error code of asio::error::eof + indicates that the connection was closed by the peer. +

+
+
+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
handle.write_some(asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, + and how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some/overload2.html b/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some/overload2.html new file mode 100644 index 0000000..af03a1f --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle/write_some/overload2.html @@ -0,0 +1,87 @@ + + + +windows::basic_stream_handle::write_some (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write some data to the handle. +

+
template<
+    typename ConstBufferSequence>
+std::size_t write_some(
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to write data to the stream handle. The function + call will block until one or more bytes of the data has been written + successfully, or until an error occurs. +

+
+ + Parameters +
+
+

+
+
buffers
+

+ One or more data buffers to be written to the handle. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. Returns 0 if an error occurred. +

+
+ + Remarks +
+

+ The write_some operation may not transmit all of the data to the peer. + Consider using the write + function if you need to ensure that all data is written before the blocking + operation completes. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle__rebind_executor.html b/include/asio/doc/asio/reference/windows__basic_stream_handle__rebind_executor.html new file mode 100644 index 0000000..ee9f6fc --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle__rebind_executor.html @@ -0,0 +1,88 @@ + + + +windows::basic_stream_handle::rebind_executor + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Rebinds the handle type to another executor. +

+
template<
+    typename Executor1>
+struct rebind_executor
+
+
+ + Types +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ other +

+
+

+ The handle type when rebound to the specified executor. +

+
+
+ + Requirements +
+

+ Header: asio/windows/basic_stream_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__basic_stream_handle__rebind_executor/other.html b/include/asio/doc/asio/reference/windows__basic_stream_handle__rebind_executor/other.html new file mode 100644 index 0000000..88a1272 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__basic_stream_handle__rebind_executor/other.html @@ -0,0 +1,325 @@ + + + +windows::basic_stream_handle::rebind_executor::other + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The + handle type when rebound to the specified executor. +

+
typedef basic_stream_handle< Executor1 > other;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_stream_handle [constructor] +

+
+

+ Construct a stream handle without opening it.
—
Construct + a stream handle on an existing native handle.
—
Move-construct + a stream handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign a stream handle from another. +

+
+

+ read_some +

+
+

+ Read some data from the handle. +

+
+

+ write_some +

+
+

+ Write some data to the handle. +

+
+

+ The windows::basic_stream_handle + class provides asynchronous and blocking stream-oriented handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/basic_stream_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__object_handle.html b/include/asio/doc/asio/reference/windows__object_handle.html new file mode 100644 index 0000000..7ba73fc --- /dev/null +++ b/include/asio/doc/asio/reference/windows__object_handle.html @@ -0,0 +1,300 @@ + + + +windows::object_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for the + typical usage of an object handle. +

+
typedef basic_object_handle object_handle;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An object handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_wait +

+
+

+ Start an asynchronous wait on the object handle. +

+
+

+ basic_object_handle [constructor] +

+
+

+ Construct an object handle without opening it.
—
Construct + an object handle on an existing native handle.
—
Move-construct + an object handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an object handle from another. +

+
+

+ wait +

+
+

+ Perform a blocking wait on the object handle. +

+
+

+ The windows::basic_object_handle + class provides asynchronous and blocking object-oriented handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/object_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_handle.html b/include/asio/doc/asio/reference/windows__overlapped_handle.html new file mode 100644 index 0000000..166572e --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_handle.html @@ -0,0 +1,313 @@ + + + +windows::overlapped_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef + for the typical usage of an overlapped handle. +

+
typedef basic_overlapped_handle overlapped_handle;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ basic_overlapped_handle [constructor] +

+
+

+ Construct an overlapped handle without opening it.
—
+ Construct an overlapped handle on an existing native handle.
+ —
Move-construct an overlapped handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign an overlapped handle from another. +

+
+
+ + Protected + Member Functions +
+
++++ + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ ~basic_overlapped_handle [destructor] +

+
+

+ Protected destructor to prevent deletion through this type. +

+
+

+ The windows::overlapped_handle + class provides the ability to wrap a Windows handle. The underlying object + referred to by the handle must support overlapped I/O. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/overlapped_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr.html b/include/asio/doc/asio/reference/windows__overlapped_ptr.html new file mode 100644 index 0000000..5d93c8d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr.html @@ -0,0 +1,167 @@ + + + +windows::overlapped_ptr + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Wraps a handler to create an OVERLAPPED object for use with overlapped I/O. +

+
class overlapped_ptr :
+  noncopyable
+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ complete +

+
+

+ Post completion notification for overlapped operation. Releases + ownership. +

+
+

+ get +

+
+

+ Get the contained OVERLAPPED object. +

+
+

+ overlapped_ptr [constructor] +

+
+

+ Construct an empty overlapped_ptr.
—
Construct an overlapped_ptr + to contain the specified handler. +

+
+

+ release +

+
+

+ Release ownership of the OVERLAPPED object. +

+
+

+ reset +

+
+

+ Reset to empty.
—
Reset to contain the specified handler, + freeing any current OVERLAPPED object. +

+
+

+ ~overlapped_ptr [destructor] +

+
+

+ Destructor automatically frees the OVERLAPPED object unless released. +

+
+

+ A special-purpose smart pointer used to wrap an application handler so that + it can be passed as the LPOVERLAPPED argument to overlapped I/O functions. +

+
+ + Thread Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/overlapped_ptr.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/_overlapped_ptr.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/_overlapped_ptr.html new file mode 100644 index 0000000..d5f610c --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/_overlapped_ptr.html @@ -0,0 +1,44 @@ + + + +windows::overlapped_ptr::~overlapped_ptr + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Destructor + automatically frees the OVERLAPPED object unless released. +

+
~overlapped_ptr();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/complete.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/complete.html new file mode 100644 index 0000000..329aee8 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/complete.html @@ -0,0 +1,46 @@ + + + +windows::overlapped_ptr::complete + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Post + completion notification for overlapped operation. Releases ownership. +

+
void complete(
+    const asio::error_code & ec,
+    std::size_t bytes_transferred);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/get.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/get.html new file mode 100644 index 0000000..623b5c0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/get.html @@ -0,0 +1,48 @@ + + + +windows::overlapped_ptr::get + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Get + the contained OVERLAPPED object. +

+
OVERLAPPED * get();
+  » more...
+
+const OVERLAPPED * get() const;
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/get/overload1.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/get/overload1.html new file mode 100644 index 0000000..c13db1d --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/get/overload1.html @@ -0,0 +1,43 @@ + + + +windows::overlapped_ptr::get (1 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the contained OVERLAPPED object. +

+
OVERLAPPED * get();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/get/overload2.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/get/overload2.html new file mode 100644 index 0000000..65d739a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/get/overload2.html @@ -0,0 +1,43 @@ + + + +windows::overlapped_ptr::get (2 of 2 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Get the contained OVERLAPPED object. +

+
const OVERLAPPED * get() const;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr.html new file mode 100644 index 0000000..560531a --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr.html @@ -0,0 +1,67 @@ + + + +windows::overlapped_ptr::overlapped_ptr + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Construct + an empty windows::overlapped_ptr. +

+
overlapped_ptr();
+  » more...
+
+

+ Construct an windows::overlapped_ptr + to contain the specified handler. +

+
template<
+    typename ExecutionContext,
+    typename Handler>
+explicit overlapped_ptr(
+    ExecutionContext & context,
+    Handler && handler,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Executor,
+    typename Handler>
+explicit overlapped_ptr(
+    const Executor & ex,
+    Handler && handler,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload1.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload1.html new file mode 100644 index 0000000..93348c6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload1.html @@ -0,0 +1,43 @@ + + + +windows::overlapped_ptr::overlapped_ptr (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an empty windows::overlapped_ptr. +

+
overlapped_ptr();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload2.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload2.html new file mode 100644 index 0000000..59b57b0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload2.html @@ -0,0 +1,50 @@ + + + +windows::overlapped_ptr::overlapped_ptr (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an windows::overlapped_ptr + to contain the specified handler. +

+
template<
+    typename ExecutionContext,
+    typename Handler>
+overlapped_ptr(
+    ExecutionContext & context,
+    Handler && handler,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload3.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload3.html new file mode 100644 index 0000000..b055c02 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/overlapped_ptr/overload3.html @@ -0,0 +1,50 @@ + + + +windows::overlapped_ptr::overlapped_ptr (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Construct an windows::overlapped_ptr + to contain the specified handler. +

+
template<
+    typename Executor,
+    typename Handler>
+overlapped_ptr(
+    const Executor & ex,
+    Handler && handler,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/release.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/release.html new file mode 100644 index 0000000..e67b831 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/release.html @@ -0,0 +1,44 @@ + + + +windows::overlapped_ptr::release + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Release + ownership of the OVERLAPPED object. +

+
OVERLAPPED * release();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/reset.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset.html new file mode 100644 index 0000000..b3201ae --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset.html @@ -0,0 +1,67 @@ + + + +windows::overlapped_ptr::reset + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Reset + to empty. +

+
void reset();
+  » more...
+
+

+ Reset to contain the specified handler, freeing any current OVERLAPPED + object. +

+
template<
+    typename ExecutionContext,
+    typename Handler>
+void reset(
+    ExecutionContext & context,
+    Handler && handler,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+  » more...
+
+template<
+    typename Executor,
+    typename Handler>
+void reset(
+    const Executor & ex,
+    Handler && handler,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+  » more...
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload1.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload1.html new file mode 100644 index 0000000..7c3ca73 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload1.html @@ -0,0 +1,43 @@ + + + +windows::overlapped_ptr::reset (1 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Reset to empty. +

+
void reset();
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload2.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload2.html new file mode 100644 index 0000000..a0fdea6 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload2.html @@ -0,0 +1,50 @@ + + + +windows::overlapped_ptr::reset (2 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Reset to contain the specified handler, freeing any current OVERLAPPED + object. +

+
template<
+    typename ExecutionContext,
+    typename Handler>
+void reset(
+    ExecutionContext & context,
+    Handler && handler,
+    typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload3.html b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload3.html new file mode 100644 index 0000000..ede6973 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__overlapped_ptr/reset/overload3.html @@ -0,0 +1,50 @@ + + + +windows::overlapped_ptr::reset (3 of 3 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Reset to contain the specified handler, freeing any current OVERLAPPED + object. +

+
template<
+    typename Executor,
+    typename Handler>
+void reset(
+    const Executor & ex,
+    Handler && handler,
+    typename enable_if< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type *  = 0);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__random_access_handle.html b/include/asio/doc/asio/reference/windows__random_access_handle.html new file mode 100644 index 0000000..9c190e9 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__random_access_handle.html @@ -0,0 +1,325 @@ + + + +windows::random_access_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef + for the typical usage of a random-access handle. +

+
typedef basic_random_access_handle random_access_handle;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_read_some_at +

+
+

+ Start an asynchronous read at the specified offset. +

+
+

+ async_write_some_at +

+
+

+ Start an asynchronous write at the specified offset. +

+
+

+ basic_random_access_handle [constructor] +

+
+

+ Construct a random-access handle without opening it.
—
+ Construct a random-access handle on an existing native handle. +
—
Move-construct a random-access handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign a random-access handle from another. +

+
+

+ read_some_at +

+
+

+ Read some data from the handle at the specified offset. +

+
+

+ write_some_at +

+
+

+ Write some data to the handle at the specified offset. +

+
+

+ The windows::basic_random_access_handle + class provides asynchronous and blocking random-access handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/random_access_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/windows__stream_handle.html b/include/asio/doc/asio/reference/windows__stream_handle.html new file mode 100644 index 0000000..61585b0 --- /dev/null +++ b/include/asio/doc/asio/reference/windows__stream_handle.html @@ -0,0 +1,324 @@ + + + +windows::stream_handle + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Typedef for the + typical usage of a stream-oriented handle. +

+
typedef basic_stream_handle stream_handle;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ rebind_executor +

+
+

+ Rebinds the handle type to another executor. +

+
+

+ executor_type +

+
+

+ The type of the executor associated with the object. +

+
+

+ lowest_layer_type +

+
+

+ An overlapped_handle is always the lowest layer. +

+
+

+ native_handle_type +

+
+

+ The native representation of a handle. +

+
+
+ + Member Functions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ assign +

+
+

+ Assign an existing native handle to the handle. +

+
+

+ async_read_some +

+
+

+ Start an asynchronous read. +

+
+

+ async_write_some +

+
+

+ Start an asynchronous write. +

+
+

+ basic_stream_handle [constructor] +

+
+

+ Construct a stream handle without opening it.
—
Construct + a stream handle on an existing native handle.
—
Move-construct + a stream handle from another. +

+
+

+ cancel +

+
+

+ Cancel all asynchronous operations associated with the handle. +

+
+

+ close +

+
+

+ Close the handle. +

+
+

+ get_executor +

+
+

+ Get the executor associated with the object. +

+
+

+ is_open +

+
+

+ Determine whether the handle is open. +

+
+

+ lowest_layer +

+
+

+ Get a reference to the lowest layer.
—
Get a const + reference to the lowest layer. +

+
+

+ native_handle +

+
+

+ Get the native handle representation. +

+
+

+ operator= +

+
+

+ Move-assign a stream handle from another. +

+
+

+ read_some +

+
+

+ Read some data from the handle. +

+
+

+ write_some +

+
+

+ Write some data to the handle. +

+
+

+ The windows::basic_stream_handle + class provides asynchronous and blocking stream-oriented handle functionality. +

+
+ + Thread + Safety +
+

+ Distinct objects: Safe. +

+

+ Shared objects: Unsafe. +

+
+ + Requirements +
+

+ Header: asio/windows/stream_handle.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write.html b/include/asio/doc/asio/reference/write.html new file mode 100644 index 0000000..20220b4 --- /dev/null +++ b/include/asio/doc/asio/reference/write.html @@ -0,0 +1,240 @@ + + + +write + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+

+write +

+

+ +The write function is a composed operation + that writes a certain amount of data to a stream before returning. +

+

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+  » more...
+
+

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+  » more...
+
+

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+  » more...
+
+

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename Allocator>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename Allocator>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+  » more...
+
+

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+  » more...
+
+

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/write.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload1.html b/include/asio/doc/asio/reference/write/overload1.html new file mode 100644 index 0000000..f2dd9f8 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload1.html @@ -0,0 +1,132 @@ + + + +write (1 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the stream. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::write(s, asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload10.html b/include/asio/doc/asio/reference/write/overload10.html new file mode 100644 index 0000000..75ee0ff --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload10.html @@ -0,0 +1,107 @@ + + + +write (10 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename Allocator>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, b,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload11.html b/include/asio/doc/asio/reference/write/overload11.html new file mode 100644 index 0000000..47862c6 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload11.html @@ -0,0 +1,126 @@ + + + +write (11 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload12.html b/include/asio/doc/asio/reference/write/overload12.html new file mode 100644 index 0000000..852736b --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload12.html @@ -0,0 +1,119 @@ + + + +write (12 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload13.html b/include/asio/doc/asio/reference/write/overload13.html new file mode 100644 index 0000000..4a76259 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload13.html @@ -0,0 +1,115 @@ + + + +write (13 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload14.html b/include/asio/doc/asio/reference/write/overload14.html new file mode 100644 index 0000000..c95d5ca --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload14.html @@ -0,0 +1,107 @@ + + + +write (14 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload15.html b/include/asio/doc/asio/reference/write/overload15.html new file mode 100644 index 0000000..35975f1 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload15.html @@ -0,0 +1,126 @@ + + + +write (15 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload16.html b/include/asio/doc/asio/reference/write/overload16.html new file mode 100644 index 0000000..41dd106 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload16.html @@ -0,0 +1,119 @@ + + + +write (16 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v2,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v2 buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload2.html b/include/asio/doc/asio/reference/write/overload2.html new file mode 100644 index 0000000..129de12 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload2.html @@ -0,0 +1,124 @@ + + + +write (2 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the stream. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::write(s, asio::buffer(data, size), ec);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload3.html b/include/asio/doc/asio/reference/write/overload3.html new file mode 100644 index 0000000..02427bf --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload3.html @@ -0,0 +1,144 @@ + + + +write (3 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the stream. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::write(s, asio::buffer(data, size),
+    asio::transfer_at_least(32));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload4.html b/include/asio/doc/asio/reference/write/overload4.html new file mode 100644 index 0000000..68750dd --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload4.html @@ -0,0 +1,121 @@ + + + +write (4 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the stream. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload5.html b/include/asio/doc/asio/reference/write/overload5.html new file mode 100644 index 0000000..1875a62 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload5.html @@ -0,0 +1,115 @@ + + + +write (5 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload6.html b/include/asio/doc/asio/reference/write/overload6.html new file mode 100644 index 0000000..8a2c82e --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload6.html @@ -0,0 +1,107 @@ + + + +write (6 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload7.html b/include/asio/doc/asio/reference/write/overload7.html new file mode 100644 index 0000000..b910034 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload7.html @@ -0,0 +1,126 @@ + + + +write (7 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload8.html b/include/asio/doc/asio/reference/write/overload8.html new file mode 100644 index 0000000..0dab83f --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload8.html @@ -0,0 +1,119 @@ + + + +write (8 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename DynamicBuffer_v1,
+    typename CompletionCondition>
+std::size_t write(
+    SyncWriteStream & s,
+    DynamicBuffer_v1 && buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec,
+    typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type *  = 0);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied dynamic buffer sequence has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
buffers
+

+ The dynamic buffer sequence from which data will be written. Successfully + written data is automatically consumed from the buffers. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the stream's write_some function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write/overload9.html b/include/asio/doc/asio/reference/write/overload9.html new file mode 100644 index 0000000..e997c41 --- /dev/null +++ b/include/asio/doc/asio/reference/write/overload9.html @@ -0,0 +1,115 @@ + + + +write (9 of 16 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data to a stream before returning. +

+
template<
+    typename SyncWriteStream,
+    typename Allocator>
+std::size_t write(
+    SyncWriteStream & s,
+    basic_streambuf< Allocator > & b);
+
+

+ This function is used to write a certain number of bytes of data to a stream. + The call will block until one of the following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the stream's + write_some function. +

+
+ + Parameters +
+
+

+
+
s
+

+ The stream to which the data is to be written. The type must support + the SyncWriteStream concept. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write(
+    s, b,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at.html b/include/asio/doc/asio/reference/write_at.html new file mode 100644 index 0000000..b6b31fd --- /dev/null +++ b/include/asio/doc/asio/reference/write_at.html @@ -0,0 +1,149 @@ + + + +write_at + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +The write_at function is a composed + operation that writes a certain amount of data at a specified offset before + returning. +

+

+ Write all of the supplied data at the specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers);
+  » more...
+
+template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+  » more...
+
+

+ Write a certain amount of data at a specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition);
+  » more...
+
+template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+  » more...
+
+

+ Write all of the supplied data at the specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b);
+  » more...
+
+template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+  » more...
+
+

+ Write a certain amount of data at a specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+  » more...
+
+template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+  » more...
+
+
+ + Requirements +
+

+ Header: asio/write_at.hpp +

+

+ Convenience header: asio.hpp +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload1.html b/include/asio/doc/asio/reference/write_at/overload1.html new file mode 100644 index 0000000..bd05511 --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload1.html @@ -0,0 +1,138 @@ + + + +write_at (1 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data at the specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the device. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::write_at(d, 42, asio::buffer(data, size));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write_at(
+    d, offset, buffers,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload2.html b/include/asio/doc/asio/reference/write_at/overload2.html new file mode 100644 index 0000000..f71231d --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload2.html @@ -0,0 +1,131 @@ + + + +write_at (2 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data at the specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    asio::error_code & ec);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the device. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::write_at(d, 42,
+    asio::buffer(data, size), ec);
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write_at(
+    d, offset, buffers,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload3.html b/include/asio/doc/asio/reference/write_at/overload3.html new file mode 100644 index 0000000..e29b38a --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload3.html @@ -0,0 +1,150 @@ + + + +write_at (3 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data at a specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the device. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the device's write_some_at function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Example +
+

+ To write a single data buffer use the buffer + function as follows: +

+
asio::write_at(d, 42, asio::buffer(data, size),
+    asio::transfer_at_least(32));
+
+

+ See the buffer + documentation for information on writing multiple buffers in one go, and + how to use it with arrays, boost::array or std::vector. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload4.html b/include/asio/doc/asio/reference/write_at/overload4.html new file mode 100644 index 0000000..c52ff0b --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload4.html @@ -0,0 +1,127 @@ + + + +write_at (4 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data at a specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename ConstBufferSequence,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    const ConstBufferSequence & buffers,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied buffers has been written. That is, + the bytes transferred is equal to the sum of the buffer sizes. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
buffers
+

+ One or more buffers containing the data to be written. The sum of + the buffer sizes indicates the maximum number of bytes to write to + the device. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the device's write_some_at function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload5.html b/include/asio/doc/asio/reference/write_at/overload5.html new file mode 100644 index 0000000..572c6c5 --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload5.html @@ -0,0 +1,122 @@ + + + +write_at (5 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data at the specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write_at(
+    d, 42, b,
+    asio::transfer_all());
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload6.html b/include/asio/doc/asio/reference/write_at/overload6.html new file mode 100644 index 0000000..5696c8e --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload6.html @@ -0,0 +1,114 @@ + + + +write_at (6 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write all of the supplied data at the specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    asio::error_code & ec);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + An error occurred. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Remarks +
+

+ This overload is equivalent to calling: +

+
asio::write_at(
+    d, 42, b,
+    asio::transfer_all(), ec);
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload7.html b/include/asio/doc/asio/reference/write_at/overload7.html new file mode 100644 index 0000000..60860b1 --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload7.html @@ -0,0 +1,133 @@ + + + +write_at (7 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data at a specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the device's write_some_at function. +

+
+
+
+
+ + Return + Value +
+

+ The number of bytes transferred. +

+
+ + Exceptions +
+
+

+
+
asio::system_error
+

+ Thrown on failure. +

+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/write_at/overload8.html b/include/asio/doc/asio/reference/write_at/overload8.html new file mode 100644 index 0000000..c5c219c --- /dev/null +++ b/include/asio/doc/asio/reference/write_at/overload8.html @@ -0,0 +1,126 @@ + + + +write_at (8 of 8 overloads) + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Write a certain amount of data at a specified offset before returning. +

+
template<
+    typename SyncRandomAccessWriteDevice,
+    typename Allocator,
+    typename CompletionCondition>
+std::size_t write_at(
+    SyncRandomAccessWriteDevice & d,
+    uint64_t offset,
+    basic_streambuf< Allocator > & b,
+    CompletionCondition completion_condition,
+    asio::error_code & ec);
+
+

+ This function is used to write a certain number of bytes of data to a random + access device at a specified offset. The call will block until one of the + following conditions is true: +

+
    +
  • + All of the data in the supplied basic_streambuf + has been written. +
  • +
  • + The completion_condition function object returns 0. +
  • +
+

+ This operation is implemented in terms of zero or more calls to the device's + write_some_at function. +

+
+ + Parameters +
+
+

+
+
d
+

+ The device to which the data is to be written. The type must support + the SyncRandomAccessWriteDevice concept. +

+
offset
+

+ The offset at which the data will be written. +

+
b
+

+ The basic_streambuf + object from which data will be written. +

+
completion_condition
+
+

+ The function object to be called to determine whether the write operation + is complete. The signature of the function object must be: +

+
std::size_t completion_condition(
+  // Result of latest write_some_at operation.
+  const asio::error_code& error,
+
+  // Number of bytes transferred so far.
+  std::size_t bytes_transferred
+);
+
+

+ A return value of 0 indicates that the write operation is complete. + A non-zero return value indicates the maximum number of bytes to + be written on the next call to the device's write_some_at function. +

+
+
ec
+

+ Set to indicate what error occurred, if any. +

+
+
+
+ + Return + Value +
+

+ The number of bytes written. If an error occurs, returns the total number + of bytes successfully transferred prior to the error. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/reference/yield_context.html b/include/asio/doc/asio/reference/yield_context.html new file mode 100644 index 0000000..0d0492a --- /dev/null +++ b/include/asio/doc/asio/reference/yield_context.html @@ -0,0 +1,172 @@ + + + +yield_context + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ +Context object that represents the + currently executing coroutine. +

+
typedef basic_yield_context< unspecified > yield_context;
+
+
+ + Types +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ callee_type +

+
+

+ The coroutine callee type, used by the implementation. +

+
+

+ caller_type +

+
+

+ The coroutine caller type, used by the implementation. +

+
+
+ + Member + Functions +
+
++++ + + + + + + + + + + + + + + +
+

+ Name +

+
+

+ Description +

+
+

+ basic_yield_context [constructor] +

+
+

+ Construct a yield context to represent the specified coroutine. +
—
Construct a yield context from another yield context + type. +

+
+

+ operator[] +

+
+

+ Return a yield context that sets the specified error_code. +

+
+

+ The basic_yield_context + class is used to represent the currently executing stackful coroutine. A + basic_yield_context + may be passed as a handler to an asynchronous operation. For example: +

+
template <typename Handler>
+void my_coroutine(basic_yield_context<Handler> yield)
+{
+  ...
+  std::size_t n = my_socket.async_read_some(buffer, yield);
+  ...
+}
+
+

+ The initiating function (async_read_some in the above example) suspends the + current coroutine. The coroutine is resumed when the asynchronous operation + completes, and the result of the operation is returned. +

+
+ + Requirements +
+

+ Header: asio/spawn.hpp +

+

+ Convenience header: None +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/std_executors.html b/include/asio/doc/asio/std_executors.html new file mode 100644 index 0000000..f698a98 --- /dev/null +++ b/include/asio/doc/asio/std_executors.html @@ -0,0 +1,287 @@ + + + +Proposed Standard Executors + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ Asio provides a complete implementation of the proposed standard executors, + as described in P0443r13, P1348r0, and P1393r0. +

+

+ Just as with executors under the Networking TS model, a standard executor represents + a policy as to how, when, and where a piece of code should be executed. Most + existing code should continue to work with little or no change. +

+

+ + Standard + Executor Implementations in Asio +

+

+ The io_context::executor_type, + thread_pool::executor_type, + system_executor, + and strand executors + meet the requirements for the proposed standard executors. For compatibility, + these classes also meet the requirements for the Networking TS model of executors. +

+

+ + Standard + Executor Use in Asio +

+

+ All I/O objects such as ip::tcp::socket, + asynchronous operations, and utilities including dispatch, + post, defer, + get_associated_executor, + bind_executor, + make_work_guard, + spawn, co_spawn, + async_compose, + use_future, etc., + can interoperate with both proposed standard executors, and with Networking + TS executors. Asio's implementation determines at compile time which model + a particular executor meets; the proposed standard executor model is used in + preference if both are detected. +

+

+ Support for the existing Networking TS model of executors can be disabled by + defining ASIO_NO_TS_EXECUTORS. +

+

+ + Polymorphic + I/O Executor +

+

+ The any_io_executor + type alias is the default runtime-polymorphic executor for all I/O objects. + This type alias points to the execution::any_executor<> + template with a set of supportable properties specified for use with I/O. +

+

+ This new name may break existing code that directly uses the old polymorphic + wrapper, executor. + If required for backward compatibility, ASIO_USE_TS_EXECUTOR_AS_DEFAULT + can be defined, which changes the any_io_executor type alias to + instead point to the executor polymorphic wrapper. +

+

+ + Implementing + a Minimal I/O Executor +

+

+ Standard executor properties make what were previously hard requirements on + an executor (such as work counting, or the ability to distinguish between + post, dispatch, and defer) into optional + facilities. With this relaxation, the minimal requirements for an I/O executor + are: +

+
+

+ The following example shows a minimal I/O executor. Given a queue submission + operation implemented elsewhere: +

+

+

+
queue_t queue_create();
+template <typename F> void queue_submit(queue_t q, F f);
+
+

+

+

+ the executor may be defined as follows: +

+

+

+
struct minimal_io_executor
+{
+  asio::execution_context* context_;
+  queue_t queue_;
+
+  bool operator==(const minimal_io_executor& other) const noexcept
+  {
+    return context_ == other.context_ && queue_ == other.queue_;
+  }
+
+  bool operator!=(const minimal_io_executor& other) const noexcept
+  {
+    return !(*this == other);
+  }
+
+  asio::execution_context& query(
+      asio::execution::context_t) const noexcept
+  {
+    return *context_;
+  }
+
+  static constexpr asio::execution::blocking_t::never_t query(
+      asio::execution::blocking_t) noexcept
+  {
+    // This executor always has blocking.never semantics.
+    return asio::execution::blocking.never;
+  }
+
+  template <class F>
+  void execute(F f) const
+  {
+    queue_submit(queue_, std::move(f));
+  }
+};
+
+

+

+

+ This executor may be created as follows: +

+

+

+
asio::execution_context context;
+queue_t queue = queue_create();
+minimal_io_executor executor{&context, queue};
+
+

+

+

+ and then used with I/O objects: +

+

+

+
asio::ip::tcp::acceptor acceptor(executor);
+
+

+

+

+ or assigned into the any_io_executor + polymorphic wrapper: +

+

+

+
asio::any_io_executor poly_executor = executor;
+
+

+

+

+ + Traits + for Deducing Conformance to the Executor Concept +

+

+ Older C++ standards and compilers require some assistance to determine whether + an executor implementation conforms to the executor concept and + type requirements. This is achieved through specialisation of traits. The following + code shows a specialisation of these traits for the minimal_io_executor + example from above: +

+

+

+
namespace asio {
+namespace traits {
+
+#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+
+template <typename F>
+struct execute_member<minimal_io_executor, F>
+{
+  static constexpr bool is_valid = true;
+  static constexpr bool is_noexcept = true;
+  typedef void result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+
+template <>
+struct equality_comparable<minimal_io_executor>
+{
+  static constexpr bool is_valid = true;
+  static constexpr bool is_noexcept = true;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
+
+template <>
+struct query_member<minimal_io_executor,
+    asio::execution::context_t>
+{
+  static constexpr bool is_valid = true;
+  static constexpr bool is_noexcept = true;
+  typedef asio::execution_context& result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
+#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
+
+template <typename Property>
+struct query_static_constexpr_member<minimal_io_executor, Property,
+    typename enable_if<
+      std::is_convertible<Property, asio::execution::blocking_t>::value
+    >::type>
+{
+  static constexpr bool is_valid = true;
+  static constexpr bool is_noexcept = true;
+  typedef asio::execution::blocking_t::never_t result_type;
+  static constexpr result_type value() noexcept { return result_type(); }
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
+
+} // namespace traits
+} // namespace asio
+
+

+

+

+ Asio uses an extensive set of traits to implement all of the proposed standard + executor functionality on older C++ standards. These traits may be found under + the asio/traits include directory. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial.html b/include/asio/doc/asio/tutorial.html new file mode 100644 index 0000000..ffddef0 --- /dev/null +++ b/include/asio/doc/asio/tutorial.html @@ -0,0 +1,120 @@ + + + +Tutorial + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ + Basic + Skills +

+

+ The tutorial programs in this first section introduce the fundamental concepts + required to use the asio toolkit. Before plunging into the complex world of + network programming, these tutorial programs illustrate the basic skills using + simple asynchronous timers. +

+ +

+ + Introduction + to Sockets +

+

+ The tutorial programs in this section show how to use asio to develop simple + client and server programs. These tutorial programs are based around the daytime protocol, which supports + both TCP and UDP. +

+

+ The first three tutorial programs implement the daytime protocol using TCP. +

+ +

+ The next three tutorial programs implement the daytime protocol using UDP. +

+ +

+ The last tutorial program in this section demonstrates how asio allows the + TCP and UDP servers to be easily combined into a single program. +

+ +
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/boost_bind.html b/include/asio/doc/asio/tutorial/boost_bind.html new file mode 100644 index 0000000..f76dad0 --- /dev/null +++ b/include/asio/doc/asio/tutorial/boost_bind.html @@ -0,0 +1,41 @@ + + + +boost::bind + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ See the Boost: bind.hpp + documentation for more information on how to use boost::bind. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime1.html b/include/asio/doc/asio/tutorial/tutdaytime1.html new file mode 100644 index 0000000..5581a59 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime1.html @@ -0,0 +1,149 @@ + + + +Daytime.1 - A synchronous TCP daytime client + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial program shows how to use asio to implement a client application + with TCP. +

+

+ We start by including the necessary header files. +

+
#include <iostream>
+#include <boost/array.hpp>
+#include <asio.hpp>
+
+

+ The purpose of this application is to access a daytime service, so we need + the user to specify the server. +

+
using asio::ip::tcp;
+
+int main(int argc, char* argv[])
+{
+  try
+  {
+    if (argc != 2)
+    {
+      std::cerr << "Usage: client <host>" << std::endl;
+      return 1;
+    }
+
+

+ All programs that use asio need to have at least one I/O execution context, + such as an io_context object. +

+
    asio::io_context io_context;
+
+

+ We need to turn the server name that was specified as a parameter to the + application, into a TCP endpoint. To do this we use an ip::tcp::resolver + object. +

+
    tcp::resolver resolver(io_context);
+
+

+ A resolver takes a host name and service name and turns them into a list + of endpoints. We perform a resolve call using the name of the server, specified + in argv[1], and the name of the service, in this case "daytime". +

+

+ The list of endpoints is returned using an object of type ip::tcp::resolver::results_type. + This object is a range, with begin() and end() member functions that may + be used for iterating over the results. +

+
    tcp::resolver::results_type endpoints =
+      resolver.resolve(argv[1], "daytime");
+
+

+ Now we create and connect the socket. The list of endpoints obtained above + may contain both IPv4 and IPv6 endpoints, so we need to try each of them + until we find one that works. This keeps the client program independent of + a specific IP version. The asio::connect() function does this for us automatically. +

+
    tcp::socket socket(io_context);
+    asio::connect(socket, endpoints);
+
+

+ The connection is open. All we need to do now is read the response from the + daytime service. +

+

+ We use a boost::array to hold the received data. The asio::buffer() + function automatically determines the size of the array to help prevent buffer + overruns. Instead of a boost::array, we could have used a char + [] or std::vector. +

+
    for (;;)
+    {
+      boost::array<char, 128> buf;
+      asio::error_code error;
+
+      size_t len = socket.read_some(asio::buffer(buf), error);
+
+

+ When the server closes the connection, the ip::tcp::socket::read_some() + function will exit with the asio::error::eof error, which is how we know + to exit the loop. +

+
      if (error == asio::error::eof)
+        break; // Connection closed cleanly by peer.
+      else if (error)
+        throw asio::system_error(error); // Some other error.
+
+      std::cout.write(buf.data(), len);
+    }
+
+

+ Finally, handle any exceptions that may have been thrown. +

+
  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Next: Daytime.2 - A synchronous + TCP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime1/src.html b/include/asio/doc/asio/tutorial/tutdaytime1/src.html new file mode 100644 index 0000000..27ce4c1 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime1/src.html @@ -0,0 +1,99 @@ + + + +Source listing for Daytime.1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// client.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <boost/array.hpp>
+#include <asio.hpp>
+
+using asio::ip::tcp;
+
+int main(int argc, char* argv[])
+{
+  try
+  {
+    if (argc != 2)
+    {
+      std::cerr << "Usage: client <host>" << std::endl;
+      return 1;
+    }
+
+    asio::io_context io_context;
+
+    tcp::resolver resolver(io_context);
+    tcp::resolver::results_type endpoints =
+      resolver.resolve(argv[1], "daytime");
+
+    tcp::socket socket(io_context);
+    asio::connect(socket, endpoints);
+
+    for (;;)
+    {
+      boost::array<char, 128> buf;
+      asio::error_code error;
+
+      size_t len = socket.read_some(asio::buffer(buf), error);
+
+      if (error == asio::error::eof)
+        break; // Connection closed cleanly by peer.
+      else if (error)
+        throw asio::system_error(error); // Some other error.
+
+      std::cout.write(buf.data(), len);
+    }
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ Return to Daytime.1 - A synchronous + TCP daytime client +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime2.html b/include/asio/doc/asio/tutorial/tutdaytime2.html new file mode 100644 index 0000000..5df7824 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime2.html @@ -0,0 +1,120 @@ + + + +Daytime.2 - A synchronous TCP daytime server + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial program shows how to use asio to implement a server application + with TCP. +

+
#include <ctime>
+#include <iostream>
+#include <string>
+#include <asio.hpp>
+
+using asio::ip::tcp;
+
+

+ We define the function make_daytime_string() to create the string + to be sent back to the client. This function will be reused in all of our + daytime server applications. +

+
std::string make_daytime_string()
+{
+  using namespace std; // For time_t, time and ctime;
+  time_t now = time(0);
+  return ctime(&now);
+}
+
+int main()
+{
+  try
+  {
+    asio::io_context io_context;
+
+

+ A ip::tcp::acceptor + object needs to be created to listen for new connections. It is initialised + to listen on TCP port 13, for IP version 4. +

+
    tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v4(), 13));
+
+

+ This is an iterative server, which means that it will handle one connection + at a time. Create a socket that will represent the connection to the client, + and then wait for a connection. +

+
    for (;;)
+    {
+      tcp::socket socket(io_context);
+      acceptor.accept(socket);
+
+

+ A client is accessing our service. Determine the current time and transfer + this information to the client. +

+
      std::string message = make_daytime_string();
+
+      asio::error_code ignored_error;
+      asio::write(socket, asio::buffer(message), ignored_error);
+    }
+  }
+
+

+ Finally, handle any exceptions. +

+
  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Daytime.1 - A synchronous + TCP daytime client +

+

+ Next: Daytime.3 - An asynchronous + TCP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime2/src.html b/include/asio/doc/asio/tutorial/tutdaytime2/src.html new file mode 100644 index 0000000..5672c19 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime2/src.html @@ -0,0 +1,92 @@ + + + +Source listing for Daytime.2 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// server.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <ctime>
+#include <iostream>
+#include <string>
+#include <asio.hpp>
+
+using asio::ip::tcp;
+
+std::string make_daytime_string()
+{
+  using namespace std; // For time_t, time and ctime;
+  time_t now = time(0);
+  return ctime(&now);
+}
+
+int main()
+{
+  try
+  {
+    asio::io_context io_context;
+
+    tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v4(), 13));
+
+    for (;;)
+    {
+      tcp::socket socket(io_context);
+      acceptor.accept(socket);
+
+      std::string message = make_daytime_string();
+
+      asio::error_code ignored_error;
+      asio::write(socket, asio::buffer(message), ignored_error);
+    }
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ Return to Daytime.2 - A synchronous + TCP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime3.html b/include/asio/doc/asio/tutorial/tutdaytime3.html new file mode 100644 index 0000000..afc4821 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime3.html @@ -0,0 +1,232 @@ + + + +Daytime.3 - An asynchronous TCP daytime server + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ + The + main() function +
+
int main()
+{
+  try
+  {
+
+

+ We need to create a server object to accept incoming client connections. + The io_context object provides + I/O services, such as sockets, that the server object will use. +

+
    asio::io_context io_context;
+    tcp_server server(io_context);
+
+

+ Run the io_context object + so that it will perform asynchronous operations on your behalf. +

+
    io_context.run();
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+
+ + The + tcp_server class +
+
class tcp_server
+{
+public:
+
+

+ The constructor initialises an acceptor to listen on TCP port 13. +

+
  tcp_server(asio::io_context& io_context)
+    : io_context_(io_context),
+      acceptor_(io_context, tcp::endpoint(tcp::v4(), 13))
+  {
+    start_accept();
+  }
+
+private:
+
+

+ The function start_accept() creates a socket and initiates an + asynchronous accept operation to wait for a new connection. +

+
  void start_accept()
+  {
+    tcp_connection::pointer new_connection =
+      tcp_connection::create(io_context_);
+
+    acceptor_.async_accept(new_connection->socket(),
+        boost::bind(&tcp_server::handle_accept, this, new_connection,
+          asio::placeholders::error));
+  }
+
+

+ The function handle_accept() is called when the asynchronous + accept operation initiated by start_accept() finishes. It services + the client request, and then calls start_accept() to initiate + the next accept operation. +

+
  void handle_accept(tcp_connection::pointer new_connection,
+      const asio::error_code& error)
+  {
+    if (!error)
+    {
+      new_connection->start();
+    }
+
+    start_accept();
+  }
+
+
+ + The + tcp_connection class +
+

+ We will use shared_ptr and enable_shared_from_this + because we want to keep the tcp_connection object alive as long + as there is an operation that refers to it. +

+
class tcp_connection
+  : public boost::enable_shared_from_this<tcp_connection>
+{
+public:
+  typedef boost::shared_ptr<tcp_connection> pointer;
+
+  static pointer create(asio::io_context& io_context)
+  {
+    return pointer(new tcp_connection(io_context));
+  }
+
+  tcp::socket& socket()
+  {
+    return socket_;
+  }
+
+

+ In the function start(), we call asio::async_write() to serve + the data to the client. Note that we are using asio::async_write(), rather + than ip::tcp::socket::async_write_some(), + to ensure that the entire block of data is sent. +

+
  void start()
+  {
+
+

+ The data to be sent is stored in the class member message_ as + we need to keep the data valid until the asynchronous operation is complete. +

+
    message_ = make_daytime_string();
+
+

+ When initiating the asynchronous operation, and if using boost::bind + , you must specify only the arguments that match the handler's parameter + list. In this program, both of the argument placeholders (asio::placeholders::error + and asio::placeholders::bytes_transferred) could potentially have been removed, + since they are not being used in handle_write(). +

+
    asio::async_write(socket_, asio::buffer(message_),
+        boost::bind(&tcp_connection::handle_write, shared_from_this(),
+          asio::placeholders::error,
+          asio::placeholders::bytes_transferred));
+
+

+ Any further actions for this client connection are now the responsibility + of handle_write(). +

+
  }
+
+private:
+  tcp_connection(asio::io_context& io_context)
+    : socket_(io_context)
+  {
+  }
+
+  void handle_write(const asio::error_code& /*error*/,
+      size_t /*bytes_transferred*/)
+  {
+  }
+
+  tcp::socket socket_;
+  std::string message_;
+};
+
+
+ + Removing + unused handler parameters +
+

+ You may have noticed that the error, and bytes_transferred + parameters are not used in the body of the handle_write() function. + If parameters are not needed, it is possible to remove them from the function + so that it looks like: +

+
  void handle_write()
+  {
+  }
+
+

+ The asio::async_write() call used to initiate the call can then be changed + to just: +

+
  asio::async_write(socket_, asio::buffer(message_),
+      boost::bind(&tcp_connection::handle_write, shared_from_this()));
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Daytime.2 - A synchronous + TCP daytime server +

+

+ Next: Daytime.4 - A synchronous + UDP daytime client +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime3/src.html b/include/asio/doc/asio/tutorial/tutdaytime3/src.html new file mode 100644 index 0000000..3966652 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime3/src.html @@ -0,0 +1,161 @@ + + + +Source listing for Daytime.3 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// server.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <ctime>
+#include <iostream>
+#include <string>
+#include <boost/bind/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <asio.hpp>
+
+using asio::ip::tcp;
+
+std::string make_daytime_string()
+{
+  using namespace std; // For time_t, time and ctime;
+  time_t now = time(0);
+  return ctime(&now);
+}
+
+class tcp_connection
+  : public boost::enable_shared_from_this<tcp_connection>
+{
+public:
+  typedef boost::shared_ptr<tcp_connection> pointer;
+
+  static pointer create(asio::io_context& io_context)
+  {
+    return pointer(new tcp_connection(io_context));
+  }
+
+  tcp::socket& socket()
+  {
+    return socket_;
+  }
+
+  void start()
+  {
+    message_ = make_daytime_string();
+
+    asio::async_write(socket_, asio::buffer(message_),
+        boost::bind(&tcp_connection::handle_write, shared_from_this(),
+          asio::placeholders::error,
+          asio::placeholders::bytes_transferred));
+  }
+
+private:
+  tcp_connection(asio::io_context& io_context)
+    : socket_(io_context)
+  {
+  }
+
+  void handle_write(const asio::error_code& /*error*/,
+      size_t /*bytes_transferred*/)
+  {
+  }
+
+  tcp::socket socket_;
+  std::string message_;
+};
+
+class tcp_server
+{
+public:
+  tcp_server(asio::io_context& io_context)
+    : io_context_(io_context),
+      acceptor_(io_context, tcp::endpoint(tcp::v4(), 13))
+  {
+    start_accept();
+  }
+
+private:
+  void start_accept()
+  {
+    tcp_connection::pointer new_connection =
+      tcp_connection::create(io_context_);
+
+    acceptor_.async_accept(new_connection->socket(),
+        boost::bind(&tcp_server::handle_accept, this, new_connection,
+          asio::placeholders::error));
+  }
+
+  void handle_accept(tcp_connection::pointer new_connection,
+      const asio::error_code& error)
+  {
+    if (!error)
+    {
+      new_connection->start();
+    }
+
+    start_accept();
+  }
+
+  asio::io_context& io_context_;
+  tcp::acceptor acceptor_;
+};
+
+int main()
+{
+  try
+  {
+    asio::io_context io_context;
+    tcp_server server(io_context);
+    io_context.run();
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ Return to Daytime.3 - An asynchronous + TCP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime4.html b/include/asio/doc/asio/tutorial/tutdaytime4.html new file mode 100644 index 0000000..8da4fd1 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime4.html @@ -0,0 +1,127 @@ + + + +Daytime.4 - A synchronous UDP daytime client + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial program shows how to use asio to implement a client application + with UDP. +

+
#include <iostream>
+#include <boost/array.hpp>
+#include <asio.hpp>
+
+using asio::ip::udp;
+
+

+ The start of the application is essentially the same as for the TCP daytime + client. +

+
int main(int argc, char* argv[])
+{
+  try
+  {
+    if (argc != 2)
+    {
+      std::cerr << "Usage: client <host>" << std::endl;
+      return 1;
+    }
+
+    asio::io_context io_context;
+
+

+ We use an ip::udp::resolver + object to find the correct remote endpoint to use based on the host and service + names. The query is restricted to return only IPv4 endpoints by the ip::udp::v4() argument. +

+
    udp::resolver resolver(io_context);
+    udp::endpoint receiver_endpoint =
+      *resolver.resolve(udp::v4(), argv[1], "daytime").begin();
+
+

+ The ip::udp::resolver::resolve() + function is guaranteed to return at least one endpoint in the list if it + does not fail. This means it is safe to dereference the return value directly. +

+

+ Since UDP is datagram-oriented, we will not be using a stream socket. Create + an ip::udp::socket and + initiate contact with the remote endpoint. +

+
    udp::socket socket(io_context);
+    socket.open(udp::v4());
+
+    boost::array<char, 1> send_buf  = {{ 0 }};
+    socket.send_to(asio::buffer(send_buf), receiver_endpoint);
+
+

+ Now we need to be ready to accept whatever the server sends back to us. The + endpoint on our side that receives the server's response will be initialised + by ip::udp::socket::receive_from(). +

+
    boost::array<char, 128> recv_buf;
+    udp::endpoint sender_endpoint;
+    size_t len = socket.receive_from(
+        asio::buffer(recv_buf), sender_endpoint);
+
+    std::cout.write(recv_buf.data(), len);
+  }
+
+

+ Finally, handle any exceptions that may have been thrown. +

+
  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Daytime.3 - An asynchronous + TCP daytime server +

+

+ Next: Daytime.5 - A synchronous + UDP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime4/src.html b/include/asio/doc/asio/tutorial/tutdaytime4/src.html new file mode 100644 index 0000000..0d00210 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime4/src.html @@ -0,0 +1,94 @@ + + + +Source listing for Daytime.4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// client.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <boost/array.hpp>
+#include <asio.hpp>
+
+using asio::ip::udp;
+
+int main(int argc, char* argv[])
+{
+  try
+  {
+    if (argc != 2)
+    {
+      std::cerr << "Usage: client <host>" << std::endl;
+      return 1;
+    }
+
+    asio::io_context io_context;
+
+    udp::resolver resolver(io_context);
+    udp::endpoint receiver_endpoint =
+      *resolver.resolve(udp::v4(), argv[1], "daytime").begin();
+
+    udp::socket socket(io_context);
+    socket.open(udp::v4());
+
+    boost::array<char, 1> send_buf  = {{ 0 }};
+    socket.send_to(asio::buffer(send_buf), receiver_endpoint);
+
+    boost::array<char, 128> recv_buf;
+    udp::endpoint sender_endpoint;
+    size_t len = socket.receive_from(
+        asio::buffer(recv_buf), sender_endpoint);
+
+    std::cout.write(recv_buf.data(), len);
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ Return to Daytime.4 - A synchronous + UDP daytime client +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime5.html b/include/asio/doc/asio/tutorial/tutdaytime5.html new file mode 100644 index 0000000..5247646 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime5.html @@ -0,0 +1,103 @@ + + + +Daytime.5 - A synchronous UDP daytime server + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial program shows how to use asio to implement a server application + with UDP. +

+
int main()
+{
+  try
+  {
+    asio::io_context io_context;
+
+

+ Create an ip::udp::socket + object to receive requests on UDP port 13. +

+
    udp::socket socket(io_context, udp::endpoint(udp::v4(), 13));
+
+

+ Wait for a client to initiate contact with us. The remote_endpoint object + will be populated by ip::udp::socket::receive_from(). +

+
    for (;;)
+    {
+      boost::array<char, 1> recv_buf;
+      udp::endpoint remote_endpoint;
+      socket.receive_from(asio::buffer(recv_buf), remote_endpoint);
+
+

+ Determine what we are going to send back to the client. +

+
      std::string message = make_daytime_string();
+
+

+ Send the response to the remote_endpoint. +

+
      asio::error_code ignored_error;
+      socket.send_to(asio::buffer(message),
+          remote_endpoint, 0, ignored_error);
+    }
+  }
+
+

+ Finally, handle any exceptions. +

+
  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Daytime.4 - A synchronous + UDP daytime client +

+

+ Next: Daytime.6 - An asynchronous + UDP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime5/src.html b/include/asio/doc/asio/tutorial/tutdaytime5/src.html new file mode 100644 index 0000000..7f01c11 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime5/src.html @@ -0,0 +1,95 @@ + + + +Source listing for Daytime.5 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// server.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <ctime>
+#include <iostream>
+#include <string>
+#include <boost/array.hpp>
+#include <asio.hpp>
+
+using asio::ip::udp;
+
+std::string make_daytime_string()
+{
+  using namespace std; // For time_t, time and ctime;
+  time_t now = time(0);
+  return ctime(&now);
+}
+
+int main()
+{
+  try
+  {
+    asio::io_context io_context;
+
+    udp::socket socket(io_context, udp::endpoint(udp::v4(), 13));
+
+    for (;;)
+    {
+      boost::array<char, 1> recv_buf;
+      udp::endpoint remote_endpoint;
+      socket.receive_from(asio::buffer(recv_buf), remote_endpoint);
+
+      std::string message = make_daytime_string();
+
+      asio::error_code ignored_error;
+      socket.send_to(asio::buffer(message),
+          remote_endpoint, 0, ignored_error);
+    }
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ Return to Daytime.5 - A synchronous + UDP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime6.html b/include/asio/doc/asio/tutorial/tutdaytime6.html new file mode 100644 index 0000000..106f9fa --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime6.html @@ -0,0 +1,180 @@ + + + +Daytime.6 - An asynchronous UDP daytime server + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
+ + The + main() function +
+
int main()
+{
+  try
+  {
+
+

+ Create a server object to accept incoming client requests, and run the io_context object. +

+
    asio::io_context io_context;
+    udp_server server(io_context);
+    io_context.run();
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+
+ + The + udp_server class +
+
class udp_server
+{
+public:
+
+

+ The constructor initialises a socket to listen on UDP port 13. +

+
  udp_server(asio::io_context& io_context)
+    : socket_(io_context, udp::endpoint(udp::v4(), 13))
+  {
+    start_receive();
+  }
+
+private:
+  void start_receive()
+  {
+
+

+ The function ip::udp::socket::async_receive_from() + will cause the application to listen in the background for a new request. + When such a request is received, the io_context + object will invoke the handle_receive() function with two arguments: + a value of type error_code + indicating whether the operation succeeded or failed, and a size_t + value bytes_transferred specifying the number of bytes received. +

+
    socket_.async_receive_from(
+        asio::buffer(recv_buffer_), remote_endpoint_,
+        boost::bind(&udp_server::handle_receive, this,
+          asio::placeholders::error,
+          asio::placeholders::bytes_transferred));
+  }
+
+

+ The function handle_receive() will service the client request. +

+
  void handle_receive(const asio::error_code& error,
+      std::size_t /*bytes_transferred*/)
+  {
+
+

+ The error parameter contains the result of the asynchronous + operation. Since we only provide the 1-byte recv_buffer_ to + contain the client's request, the io_context + object would return an error if the client sent anything larger. We can ignore + such an error if it comes up. +

+
    if (!error)
+    {
+
+

+ Determine what we are going to send. +

+
      boost::shared_ptr<std::string> message(
+          new std::string(make_daytime_string()));
+
+

+ We now call ip::udp::socket::async_send_to() + to serve the data to the client. +

+
      socket_.async_send_to(asio::buffer(*message), remote_endpoint_,
+          boost::bind(&udp_server::handle_send, this, message,
+            asio::placeholders::error,
+            asio::placeholders::bytes_transferred));
+
+

+ When initiating the asynchronous operation, and if using boost::bind + , you must specify only the arguments that match the handler's parameter + list. In this program, both of the argument placeholders (asio::placeholders::error + and asio::placeholders::bytes_transferred) could potentially have been removed. +

+

+ Start listening for the next client request. +

+
      start_receive();
+
+

+ Any further actions for this client request are now the responsibility of + handle_send(). +

+
    }
+  }
+
+

+ The function handle_send() is invoked after the service request + has been completed. +

+
  void handle_send(boost::shared_ptr<std::string> /*message*/,
+      const asio::error_code& /*error*/,
+      std::size_t /*bytes_transferred*/)
+  {
+  }
+
+  udp::socket socket_;
+  udp::endpoint remote_endpoint_;
+  boost::array<char, 1> recv_buffer_;
+};
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Daytime.5 - A synchronous + UDP daytime server +

+

+ Next: Daytime.7 - A combined TCP/UDP + asynchronous server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime6/src.html b/include/asio/doc/asio/tutorial/tutdaytime6/src.html new file mode 100644 index 0000000..a5c744d --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime6/src.html @@ -0,0 +1,131 @@ + + + +Source listing for Daytime.6 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// server.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <ctime>
+#include <iostream>
+#include <string>
+#include <boost/array.hpp>
+#include <boost/bind/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <asio.hpp>
+
+using asio::ip::udp;
+
+std::string make_daytime_string()
+{
+  using namespace std; // For time_t, time and ctime;
+  time_t now = time(0);
+  return ctime(&now);
+}
+
+class udp_server
+{
+public:
+  udp_server(asio::io_context& io_context)
+    : socket_(io_context, udp::endpoint(udp::v4(), 13))
+  {
+    start_receive();
+  }
+
+private:
+  void start_receive()
+  {
+    socket_.async_receive_from(
+        asio::buffer(recv_buffer_), remote_endpoint_,
+        boost::bind(&udp_server::handle_receive, this,
+          asio::placeholders::error,
+          asio::placeholders::bytes_transferred));
+  }
+
+  void handle_receive(const asio::error_code& error,
+      std::size_t /*bytes_transferred*/)
+  {
+    if (!error)
+    {
+      boost::shared_ptr<std::string> message(
+          new std::string(make_daytime_string()));
+
+      socket_.async_send_to(asio::buffer(*message), remote_endpoint_,
+          boost::bind(&udp_server::handle_send, this, message,
+            asio::placeholders::error,
+            asio::placeholders::bytes_transferred));
+
+      start_receive();
+    }
+  }
+
+  void handle_send(boost::shared_ptr<std::string> /*message*/,
+      const asio::error_code& /*error*/,
+      std::size_t /*bytes_transferred*/)
+  {
+  }
+
+  udp::socket socket_;
+  udp::endpoint remote_endpoint_;
+  boost::array<char, 1> recv_buffer_;
+};
+
+int main()
+{
+  try
+  {
+    asio::io_context io_context;
+    udp_server server(io_context);
+    io_context.run();
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ Return to Daytime.6 - An asynchronous + UDP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime7.html b/include/asio/doc/asio/tutorial/tutdaytime7.html new file mode 100644 index 0000000..594c3cc --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime7.html @@ -0,0 +1,220 @@ + + + +Daytime.7 - A combined TCP/UDP asynchronous server + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial program shows how to combine the two asynchronous servers that + we have just written, into a single server application. +

+
+ + The + main() function +
+
int main()
+{
+  try
+  {
+    asio::io_context io_context;
+
+

+ We will begin by creating a server object to accept a TCP client connection. +

+
    tcp_server server1(io_context);
+
+

+ We also need a server object to accept a UDP client request. +

+
    udp_server server2(io_context);
+
+

+ We have created two lots of work for the io_context + object to do. +

+
    io_context.run();
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+
+ + The + tcp_connection and tcp_server classes +
+

+ The following two classes are taken from Daytime.3 + . +

+
class tcp_connection
+  : public boost::enable_shared_from_this<tcp_connection>
+{
+public:
+  typedef boost::shared_ptr<tcp_connection> pointer;
+
+  static pointer create(asio::io_context& io_context)
+  {
+    return pointer(new tcp_connection(io_context));
+  }
+
+  tcp::socket& socket()
+  {
+    return socket_;
+  }
+
+  void start()
+  {
+    message_ = make_daytime_string();
+
+    asio::async_write(socket_, asio::buffer(message_),
+        boost::bind(&tcp_connection::handle_write, shared_from_this()));
+  }
+
+private:
+  tcp_connection(asio::io_context& io_context)
+    : socket_(io_context)
+  {
+  }
+
+  void handle_write()
+  {
+  }
+
+  tcp::socket socket_;
+  std::string message_;
+};
+
+class tcp_server
+{
+public:
+  tcp_server(asio::io_context& io_context)
+    : io_context_(io_context),
+      acceptor_(io_context, tcp::endpoint(tcp::v4(), 13))
+  {
+    start_accept();
+  }
+
+private:
+  void start_accept()
+  {
+    tcp_connection::pointer new_connection =
+      tcp_connection::create(io_context_);
+
+    acceptor_.async_accept(new_connection->socket(),
+        boost::bind(&tcp_server::handle_accept, this, new_connection,
+          asio::placeholders::error));
+  }
+
+  void handle_accept(tcp_connection::pointer new_connection,
+      const asio::error_code& error)
+  {
+    if (!error)
+    {
+      new_connection->start();
+    }
+
+    start_accept();
+  }
+
+  asio::io_context& io_context_;
+  tcp::acceptor acceptor_;
+};
+
+
+ + The + udp_server class +
+

+ Similarly, this next class is taken from the previous + tutorial step . +

+
class udp_server
+{
+public:
+  udp_server(asio::io_context& io_context)
+    : socket_(io_context, udp::endpoint(udp::v4(), 13))
+  {
+    start_receive();
+  }
+
+private:
+  void start_receive()
+  {
+    socket_.async_receive_from(
+        asio::buffer(recv_buffer_), remote_endpoint_,
+        boost::bind(&udp_server::handle_receive, this,
+          asio::placeholders::error));
+  }
+
+  void handle_receive(const asio::error_code& error)
+  {
+    if (!error)
+    {
+      boost::shared_ptr<std::string> message(
+          new std::string(make_daytime_string()));
+
+      socket_.async_send_to(asio::buffer(*message), remote_endpoint_,
+          boost::bind(&udp_server::handle_send, this, message));
+
+      start_receive();
+    }
+  }
+
+  void handle_send(boost::shared_ptr<std::string> /*message*/)
+  {
+  }
+
+  udp::socket socket_;
+  udp::endpoint remote_endpoint_;
+  boost::array<char, 1> recv_buffer_;
+};
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Daytime.6 - An asynchronous + UDP daytime server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tutdaytime7/src.html b/include/asio/doc/asio/tutorial/tutdaytime7/src.html new file mode 100644 index 0000000..fc4ba18 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tutdaytime7/src.html @@ -0,0 +1,202 @@ + + + +Source listing for Daytime.7 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// server.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <ctime>
+#include <iostream>
+#include <string>
+#include <boost/array.hpp>
+#include <boost/bind/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <asio.hpp>
+
+using asio::ip::tcp;
+using asio::ip::udp;
+
+std::string make_daytime_string()
+{
+  using namespace std; // For time_t, time and ctime;
+  time_t now = time(0);
+  return ctime(&now);
+}
+
+class tcp_connection
+  : public boost::enable_shared_from_this<tcp_connection>
+{
+public:
+  typedef boost::shared_ptr<tcp_connection> pointer;
+
+  static pointer create(asio::io_context& io_context)
+  {
+    return pointer(new tcp_connection(io_context));
+  }
+
+  tcp::socket& socket()
+  {
+    return socket_;
+  }
+
+  void start()
+  {
+    message_ = make_daytime_string();
+
+    asio::async_write(socket_, asio::buffer(message_),
+        boost::bind(&tcp_connection::handle_write, shared_from_this()));
+  }
+
+private:
+  tcp_connection(asio::io_context& io_context)
+    : socket_(io_context)
+  {
+  }
+
+  void handle_write()
+  {
+  }
+
+  tcp::socket socket_;
+  std::string message_;
+};
+
+class tcp_server
+{
+public:
+  tcp_server(asio::io_context& io_context)
+    : io_context_(io_context),
+      acceptor_(io_context, tcp::endpoint(tcp::v4(), 13))
+  {
+    start_accept();
+  }
+
+private:
+  void start_accept()
+  {
+    tcp_connection::pointer new_connection =
+      tcp_connection::create(io_context_);
+
+    acceptor_.async_accept(new_connection->socket(),
+        boost::bind(&tcp_server::handle_accept, this, new_connection,
+          asio::placeholders::error));
+  }
+
+  void handle_accept(tcp_connection::pointer new_connection,
+      const asio::error_code& error)
+  {
+    if (!error)
+    {
+      new_connection->start();
+    }
+
+    start_accept();
+  }
+
+  asio::io_context& io_context_;
+  tcp::acceptor acceptor_;
+};
+
+class udp_server
+{
+public:
+  udp_server(asio::io_context& io_context)
+    : socket_(io_context, udp::endpoint(udp::v4(), 13))
+  {
+    start_receive();
+  }
+
+private:
+  void start_receive()
+  {
+    socket_.async_receive_from(
+        asio::buffer(recv_buffer_), remote_endpoint_,
+        boost::bind(&udp_server::handle_receive, this,
+          asio::placeholders::error));
+  }
+
+  void handle_receive(const asio::error_code& error)
+  {
+    if (!error)
+    {
+      boost::shared_ptr<std::string> message(
+          new std::string(make_daytime_string()));
+
+      socket_.async_send_to(asio::buffer(*message), remote_endpoint_,
+          boost::bind(&udp_server::handle_send, this, message));
+
+      start_receive();
+    }
+  }
+
+  void handle_send(boost::shared_ptr<std::string> /*message*/)
+  {
+  }
+
+  udp::socket socket_;
+  udp::endpoint remote_endpoint_;
+  boost::array<char, 1> recv_buffer_;
+};
+
+int main()
+{
+  try
+  {
+    asio::io_context io_context;
+    tcp_server server1(io_context);
+    udp_server server2(io_context);
+    io_context.run();
+  }
+  catch (std::exception& e)
+  {
+    std::cerr << e.what() << std::endl;
+  }
+
+  return 0;
+}
+
+

+ Return to Daytime.7 - A combined + TCP/UDP asynchronous server +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer1.html b/include/asio/doc/asio/tutorial/tuttimer1.html new file mode 100644 index 0000000..2f5dbeb --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer1.html @@ -0,0 +1,103 @@ + + + +Timer.1 - Using a timer synchronously + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial program introduces asio by showing how to perform a blocking + wait on a timer. +

+

+ We start by including the necessary header files. +

+

+ All of the asio classes can be used by simply including the "asio.hpp" + header file. +

+
#include <iostream>
+#include <asio.hpp>
+
+

+ All programs that use asio need to have at least one I/O execution context, + such as an io_context or + thread_pool object. An + I/O execution context provides access to I/O functionality. We declare an + object of type io_context + first thing in the main function. +

+
int main()
+{
+  asio::io_context io;
+
+

+ Next we declare an object of type asio::steady_timer. The core asio classes + that provide I/O functionality (or as in this case timer functionality) always + take a reference to an io_context as their first constructor argument. The + second argument to the constructor sets the timer to expire 5 seconds from + now. +

+
  asio::steady_timer t(io, asio::chrono::seconds(5));
+
+

+ In this simple example we perform a blocking wait on the timer. That is, + the call to steady_timer::wait() + will not return until the timer has expired, 5 seconds after it was created + (i.e. not from when the wait starts). +

+

+ A timer is always in one of two states: "expired" or "not + expired". If the steady_timer::wait() + function is called on an expired timer, it will return immediately. +

+
  t.wait();
+
+

+ Finally we print the obligatory "Hello, world!" message + to show when the timer has expired. +

+
  std::cout << "Hello, world!" << std::endl;
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Next: Timer.2 - Using a timer asynchronously +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer1/src.html b/include/asio/doc/asio/tutorial/tuttimer1/src.html new file mode 100644 index 0000000..88c8e52 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer1/src.html @@ -0,0 +1,66 @@ + + + +Source listing for Timer.1 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// timer.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <asio.hpp>
+
+int main()
+{
+  asio::io_context io;
+
+  asio::steady_timer t(io, asio::chrono::seconds(5));
+  t.wait();
+
+  std::cout << "Hello, world!" << std::endl;
+
+  return 0;
+}
+
+

+ Return to Timer.1 - Using a timer + synchronously +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer2.html b/include/asio/doc/asio/tutorial/tuttimer2.html new file mode 100644 index 0000000..4780793 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer2.html @@ -0,0 +1,114 @@ + + + +Timer.2 - Using a timer asynchronously + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial program demonstrates how to use asio's asynchronous callback + functionality by modifying the program from tutorial Timer.1 to perform an + asynchronous wait on the timer. +

+
#include <iostream>
+#include <asio.hpp>
+
+

+ Using asio's asynchronous functionality means having a callback function + that will be called when an asynchronous operation completes. In this program + we define a function called print to be called when the asynchronous + wait finishes. +

+
void print(const asio::error_code& /*e*/)
+{
+  std::cout << "Hello, world!" << std::endl;
+}
+
+int main()
+{
+  asio::io_context io;
+
+  asio::steady_timer t(io, asio::chrono::seconds(5));
+
+

+ Next, instead of doing a blocking wait as in tutorial Timer.1, we call the + steady_timer::async_wait() + function to perform an asynchronous wait. When calling this function we pass + the print callback handler that was defined above. +

+
  t.async_wait(&print);
+
+

+ Finally, we must call the io_context::run() + member function on the io_context object. +

+

+ The asio library provides a guarantee that callback handlers will only be + called from threads that are currently calling io_context::run(). + Therefore unless the io_context::run() + function is called the callback for the asynchronous wait completion will + never be invoked. +

+

+ The io_context::run() + function will also continue to run while there is still "work" + to do. In this example, the work is the asynchronous wait on the timer, so + the call will not return until the timer has expired and the callback has + completed. +

+

+ It is important to remember to give the io_context some work to do before + calling io_context::run(). + For example, if we had omitted the above call to steady_timer::async_wait(), + the io_context would not have had any work to do, and consequently io_context::run() would have + returned immediately. +

+
  io.run();
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Timer.1 - Using a timer + synchronously +

+

+ Next: Timer.3 - Binding arguments + to a handler +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer2/src.html b/include/asio/doc/asio/tutorial/tuttimer2/src.html new file mode 100644 index 0000000..f455fa8 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer2/src.html @@ -0,0 +1,71 @@ + + + +Source listing for Timer.2 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// timer.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <asio.hpp>
+
+void print(const asio::error_code& /*e*/)
+{
+  std::cout << "Hello, world!" << std::endl;
+}
+
+int main()
+{
+  asio::io_context io;
+
+  asio::steady_timer t(io, asio::chrono::seconds(5));
+  t.async_wait(&print);
+
+  io.run();
+
+  return 0;
+}
+
+

+ Return to Timer.2 - Using a timer + asynchronously +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer3.html b/include/asio/doc/asio/tutorial/tuttimer3.html new file mode 100644 index 0000000..b816681 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer3.html @@ -0,0 +1,160 @@ + + + +Timer.3 - Binding arguments to a handler + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In this tutorial we will modify the program from tutorial Timer.2 so that + the timer fires once a second. This will show how to pass additional parameters + to your handler function. +

+
#include <iostream>
+#include <asio.hpp>
+#include <boost/bind/bind.hpp>
+
+

+ To implement a repeating timer using asio you need to change the timer's + expiry time in your callback function, and to then start a new asynchronous + wait. Obviously this means that the callback function will need to be able + to access the timer object. To this end we add two new parameters to the + print function: +

+
    +
  • + A pointer to a timer object. +
  • +
  • + A counter so that we can stop the program when the timer fires for the + sixth time. +
  • +
+
void print(const asio::error_code& /*e*/,
+    asio::steady_timer* t, int* count)
+{
+
+

+ As mentioned above, this tutorial program uses a counter to stop running + when the timer fires for the sixth time. However you will observe that there + is no explicit call to ask the io_context to stop. Recall that in tutorial + Timer.2 we learnt that the io_context::run() + function completes when there is no more "work" to do. By not starting + a new asynchronous wait on the timer when count reaches 5, the + io_context will run out of work and stop running. +

+
  if (*count < 5)
+  {
+    std::cout << *count << std::endl;
+    ++(*count);
+
+

+ Next we move the expiry time for the timer along by one second from the previous + expiry time. By calculating the new expiry time relative to the old, we can + ensure that the timer does not drift away from the whole-second mark due + to any delays in processing the handler. +

+
    t->expires_at(t->expiry() + asio::chrono::seconds(1));
+
+

+ Then we start a new asynchronous wait on the timer. As you can see, the + boost::bind function is used + to associate the extra parameters with your callback handler. The steady_timer::async_wait() + function expects a handler function (or function object) with the signature + void(const asio::error_code&). Binding the additional parameters + converts your print function into a function object that matches + the signature correctly. +

+

+ See the Boost.Bind + documentation for more information on how to use boost::bind + . +

+

+ In this example, the asio::placeholders::error argument to boost::bind + is a named placeholder for the error object passed to the handler. When initiating + the asynchronous operation, and if using boost::bind + , you must specify only the arguments that match the handler's parameter + list. In tutorial Timer.4 you will see that this placeholder may be elided + if the parameter is not needed by the callback handler. +

+
    t->async_wait(boost::bind(print,
+          asio::placeholders::error, t, count));
+  }
+}
+
+int main()
+{
+  asio::io_context io;
+
+

+ A new count variable is added so that we can stop the program + when the timer fires for the sixth time. +

+
  int count = 0;
+  asio::steady_timer t(io, asio::chrono::seconds(1));
+
+

+ As in Step 4, when making the call to steady_timer::async_wait() + from main we bind the additional parameters needed for the + print function. +

+
  t.async_wait(boost::bind(print,
+        asio::placeholders::error, &t, &count));
+
+  io.run();
+
+

+ Finally, just to prove that the count variable was being used + in the print handler function, we will print out its new value. +

+
  std::cout << "Final count is " << count << std::endl;
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Timer.2 - Using a timer + asynchronously +

+

+ Next: Timer.4 - Using a member function + as a handler +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer3/src.html b/include/asio/doc/asio/tutorial/tuttimer3/src.html new file mode 100644 index 0000000..66be107 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer3/src.html @@ -0,0 +1,85 @@ + + + +Source listing for Timer.3 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// timer.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <asio.hpp>
+#include <boost/bind/bind.hpp>
+
+void print(const asio::error_code& /*e*/,
+    asio::steady_timer* t, int* count)
+{
+  if (*count < 5)
+  {
+    std::cout << *count << std::endl;
+    ++(*count);
+
+    t->expires_at(t->expiry() + asio::chrono::seconds(1));
+    t->async_wait(boost::bind(print,
+          asio::placeholders::error, t, count));
+  }
+}
+
+int main()
+{
+  asio::io_context io;
+
+  int count = 0;
+  asio::steady_timer t(io, asio::chrono::seconds(1));
+  t.async_wait(boost::bind(print,
+        asio::placeholders::error, &t, &count));
+
+  io.run();
+
+  std::cout << "Final count is " << count << std::endl;
+
+  return 0;
+}
+
+

+ Return to Timer.3 - Binding arguments + to a handler +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer4.html b/include/asio/doc/asio/tutorial/tuttimer4.html new file mode 100644 index 0000000..a8d24f7 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer4.html @@ -0,0 +1,140 @@ + + + +Timer.4 - Using a member function as a handler + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ In this tutorial we will see how to use a class member function as a callback + handler. The program should execute identically to the tutorial program from + tutorial Timer.3. +

+
#include <iostream>
+#include <asio.hpp>
+#include <boost/bind/bind.hpp>
+
+

+ Instead of defining a free function print as the callback handler, + as we did in the earlier tutorial programs, we now define a class called + printer. +

+
class printer
+{
+public:
+
+

+ The constructor of this class will take a reference to the io_context object + and use it when initialising the timer_ member. The counter + used to shut down the program is now also a member of the class. +

+
  printer(asio::io_context& io)
+    : timer_(io, asio::chrono::seconds(1)),
+      count_(0)
+  {
+
+

+ The boost::bind function + works just as well with class member functions as with free functions. Since + all non-static class member functions have an implicit this + parameter, we need to bind this to the function. As in tutorial + Timer.3, boost::bind converts + our callback handler (now a member function) into a function object that + can be invoked as though it has the signature void(const asio::error_code&). +

+

+ You will note that the asio::placeholders::error placeholder is not specified + here, as the print member function does not accept an error + object as a parameter. +

+
    timer_.async_wait(boost::bind(&printer::print, this));
+  }
+
+

+ In the class destructor we will print out the final value of the counter. +

+
  ~printer()
+  {
+    std::cout << "Final count is " << count_ << std::endl;
+  }
+
+

+ The print member function is very similar to the print + function from tutorial Timer.3, except that it now operates on the class + data members instead of having the timer and counter passed in as parameters. +

+
  void print()
+  {
+    if (count_ < 5)
+    {
+      std::cout << count_ << std::endl;
+      ++count_;
+
+      timer_.expires_at(timer_.expiry() + asio::chrono::seconds(1));
+      timer_.async_wait(boost::bind(&printer::print, this));
+    }
+  }
+
+private:
+  asio::steady_timer timer_;
+  int count_;
+};
+
+

+ The main function is much simpler than before, as it now declares + a local printer object before running the io_context as normal. +

+
int main()
+{
+  asio::io_context io;
+  printer p(io);
+  io.run();
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Timer.3 - Binding arguments + to a handler +

+

+ Next: Timer.5 - Synchronising handlers + in multithreaded programs +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer4/src.html b/include/asio/doc/asio/tutorial/tuttimer4/src.html new file mode 100644 index 0000000..ea6ec68 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer4/src.html @@ -0,0 +1,96 @@ + + + +Source listing for Timer.4 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// timer.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <asio.hpp>
+#include <boost/bind/bind.hpp>
+
+class printer
+{
+public:
+  printer(asio::io_context& io)
+    : timer_(io, asio::chrono::seconds(1)),
+      count_(0)
+  {
+    timer_.async_wait(boost::bind(&printer::print, this));
+  }
+
+  ~printer()
+  {
+    std::cout << "Final count is " << count_ << std::endl;
+  }
+
+  void print()
+  {
+    if (count_ < 5)
+    {
+      std::cout << count_ << std::endl;
+      ++count_;
+
+      timer_.expires_at(timer_.expiry() + asio::chrono::seconds(1));
+      timer_.async_wait(boost::bind(&printer::print, this));
+    }
+  }
+
+private:
+  asio::steady_timer timer_;
+  int count_;
+};
+
+int main()
+{
+  asio::io_context io;
+  printer p(io);
+  io.run();
+
+  return 0;
+}
+
+

+ Return to Timer.4 - Using a member + function as a handler +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer5.html b/include/asio/doc/asio/tutorial/tuttimer5.html new file mode 100644 index 0000000..501cca3 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer5.html @@ -0,0 +1,199 @@ + + + +Timer.5 - Synchronising handlers in multithreaded programs + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ This tutorial demonstrates the use of the strand + class template to synchronise callback handlers in a multithreaded program. +

+

+ The previous four tutorials avoided the issue of handler synchronisation + by calling the io_context::run() + function from one thread only. As you already know, the asio library provides + a guarantee that callback handlers will only be called from threads that + are currently calling io_context::run(). + Consequently, calling io_context::run() + from only one thread ensures that callback handlers cannot run concurrently. +

+

+ The single threaded approach is usually the best place to start when developing + applications using asio. The downside is the limitations it places on programs, + particularly servers, including: +

+
    +
  • + Poor responsiveness when handlers can take a long time to complete. +
  • +
  • + An inability to scale on multiprocessor systems. +
  • +
+

+ If you find yourself running into these limitations, an alternative approach + is to have a pool of threads calling io_context::run(). + However, as this allows handlers to execute concurrently, we need a method + of synchronisation when handlers might be accessing a shared, thread-unsafe + resource. +

+
#include <iostream>
+#include <asio.hpp>
+#include <boost/bind/bind.hpp>
+
+

+ We start by defining a class called printer, similar to the + class in the previous tutorial. This class will extend the previous tutorial + by running two timers in parallel. +

+
class printer
+{
+public:
+
+

+ In addition to initialising a pair of asio::steady_timer members, the constructor + initialises the strand_ member, an object of type asio::strand<asio::io_context::executor_type>. +

+

+ The strand class template is + an executor adapter that guarantees that, for those handlers that are dispatched + through it, an executing handler will be allowed to complete before the next + one is started. This is guaranteed irrespective of the number of threads + that are calling io_context::run(). + Of course, the handlers may still execute concurrently with other handlers + that were not dispatched through an strand, + or were dispatched through a different strand + object. +

+
  printer(asio::io_context& io)
+    : strand_(asio::make_strand(io)),
+      timer1_(io, asio::chrono::seconds(1)),
+      timer2_(io, asio::chrono::seconds(1)),
+      count_(0)
+  {
+
+

+ When initiating the asynchronous operations, each callback handler is "bound" + to an asio::strand<asio::io_context::executor_type> object. The asio::bind_executor() + function returns a new handler that automatically dispatches its contained + handler through the strand object. + By binding the handlers to the same strand, + we are ensuring that they cannot execute concurrently. +

+
    timer1_.async_wait(asio::bind_executor(strand_,
+          boost::bind(&printer::print1, this)));
+
+    timer2_.async_wait(asio::bind_executor(strand_,
+          boost::bind(&printer::print2, this)));
+  }
+
+  ~printer()
+  {
+    std::cout << "Final count is " << count_ << std::endl;
+  }
+
+

+ In a multithreaded program, the handlers for asynchronous operations should + be synchronised if they access shared resources. In this tutorial, the shared + resources used by the handlers (print1 and print2) + are std::cout and the count_ data member. +

+
  void print1()
+  {
+    if (count_ < 10)
+    {
+      std::cout << "Timer 1: " << count_ << std::endl;
+      ++count_;
+
+      timer1_.expires_at(timer1_.expiry() + asio::chrono::seconds(1));
+
+      timer1_.async_wait(asio::bind_executor(strand_,
+            boost::bind(&printer::print1, this)));
+    }
+  }
+
+  void print2()
+  {
+    if (count_ < 10)
+    {
+      std::cout << "Timer 2: " << count_ << std::endl;
+      ++count_;
+
+      timer2_.expires_at(timer2_.expiry() + asio::chrono::seconds(1));
+
+      timer2_.async_wait(asio::bind_executor(strand_,
+            boost::bind(&printer::print2, this)));
+    }
+  }
+
+private:
+  asio::strand<asio::io_context::executor_type> strand_;
+  asio::steady_timer timer1_;
+  asio::steady_timer timer2_;
+  int count_;
+};
+
+

+ The main function now causes io_context::run() + to be called from two threads: the main thread and one additional thread. + This is accomplished using an thread + object. +

+

+ Just as it would with a call from a single thread, concurrent calls to io_context::run() will continue + to execute while there is "work" left to do. The background thread + will not exit until all asynchronous operations have completed. +

+
int main()
+{
+  asio::io_context io;
+  printer p(io);
+  asio::thread t(boost::bind(&asio::io_context::run, &io));
+  io.run();
+  t.join();
+
+  return 0;
+}
+
+

+ See the full source listing +

+

+ Return to the tutorial index +

+

+ Previous: Timer.4 - Using a member + function as a handler +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/tutorial/tuttimer5/src.html b/include/asio/doc/asio/tutorial/tuttimer5/src.html new file mode 100644 index 0000000..f7ca0a4 --- /dev/null +++ b/include/asio/doc/asio/tutorial/tuttimer5/src.html @@ -0,0 +1,122 @@ + + + +Source listing for Timer.5 + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +
//
+// timer.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <asio.hpp>
+#include <boost/bind/bind.hpp>
+
+class printer
+{
+public:
+  printer(asio::io_context& io)
+    : strand_(asio::make_strand(io)),
+      timer1_(io, asio::chrono::seconds(1)),
+      timer2_(io, asio::chrono::seconds(1)),
+      count_(0)
+  {
+    timer1_.async_wait(asio::bind_executor(strand_,
+          boost::bind(&printer::print1, this)));
+
+    timer2_.async_wait(asio::bind_executor(strand_,
+          boost::bind(&printer::print2, this)));
+  }
+
+  ~printer()
+  {
+    std::cout << "Final count is " << count_ << std::endl;
+  }
+
+  void print1()
+  {
+    if (count_ < 10)
+    {
+      std::cout << "Timer 1: " << count_ << std::endl;
+      ++count_;
+
+      timer1_.expires_at(timer1_.expiry() + asio::chrono::seconds(1));
+
+      timer1_.async_wait(asio::bind_executor(strand_,
+            boost::bind(&printer::print1, this)));
+    }
+  }
+
+  void print2()
+  {
+    if (count_ < 10)
+    {
+      std::cout << "Timer 2: " << count_ << std::endl;
+      ++count_;
+
+      timer2_.expires_at(timer2_.expiry() + asio::chrono::seconds(1));
+
+      timer2_.async_wait(asio::bind_executor(strand_,
+            boost::bind(&printer::print2, this)));
+    }
+  }
+
+private:
+  asio::strand<asio::io_context::executor_type> strand_;
+  asio::steady_timer timer1_;
+  asio::steady_timer timer2_;
+  int count_;
+};
+
+int main()
+{
+  asio::io_context io;
+  printer p(io);
+  asio::thread t(boost::bind(&asio::io_context::run, &io));
+  io.run();
+  t.join();
+
+  return 0;
+}
+
+

+ Return to Timer.5 - Synchronising + handlers in multithreaded programs +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/asio/using.html b/include/asio/doc/asio/using.html new file mode 100644 index 0000000..0565edc --- /dev/null +++ b/include/asio/doc/asio/using.html @@ -0,0 +1,549 @@ + + + +Using Asio + + + + + + + + +
asio C++ library
+
+
+PrevUpHomeNext +
+
+ +

+ + Supported + Platforms +

+

+ The following platform and compiler combinations are regularly tested: +

+
    +
  • + Linux using g++ 4.1 or later +
  • +
  • + Linux using clang 3.2 or later +
  • +
  • + FreeBSD using g++ 4.1 or later +
  • +
  • + macOS using Xcode 8 or later +
  • +
  • + Win32 using Visual C++ 9.0 or later +
  • +
  • + Win32 using g++ 4.1 or later (MinGW) +
  • +
  • + Win64 using Visual C++ 9.0 or later +
  • +
+

+ The following platforms may also work: +

+
    +
  • + AIX +
  • +
  • + Android +
  • +
  • + HP-UX +
  • +
  • + iOS +
  • +
  • + NetBSD +
  • +
  • + OpenBSD +
  • +
  • + QNX Neutrino +
  • +
  • + Solaris +
  • +
  • + Tru64 +
  • +
  • + Win32 using Cygwin. (__USE_W32_SOCKETS must be defined.) +
  • +
+

+ + Dependencies +

+

+ The following libraries must be available in order to link programs that use + Asio: +

+
    +
  • + Boost.Coroutine (optional) if you use spawn() + to launch coroutines. +
  • +
  • + Boost.Regex (optional) if you use any of the read_until() + or async_read_until() + overloads that take a boost::regex parameter. +
  • +
  • + OpenSSL (optional) if you use + Asio's SSL support. +
  • +
+

+ Furthermore, some of the examples also require Boost.Date_Time or Boost.Serialization + libraries. +

+
+ + + + + +
[Note]Note

+ With MSVC or Borland C++ you may want to add -DBOOST_DATE_TIME_NO_LIB + and -DBOOST_REGEX_NO_LIB to your project settings to disable + autolinking of the Boost.Date_Time and Boost.Regex libraries respectively. + Alternatively, you may choose to build these libraries and link to them. +

+

+ + Optional + separate compilation +

+

+ By default, Asio is a header-only library. However, some developers may prefer + to build Asio using separately compiled source code. To do this, add #include + <asio/impl/src.hpp> to one (and only one) source file in a program, + then build the program with ASIO_SEPARATE_COMPILATION defined + in the project/compiler settings. Alternatively, ASIO_DYN_LINK + may be defined to build a separately-compiled Asio as part of a shared library. +

+

+ If using Asio's SSL support, you will also need to add #include <asio/ssl/impl/src.hpp>. +

+

+ + Building + the tests and examples on Linux or UNIX +

+

+ If the boost directory (e.g. the directory called boost_1_34_1) + is in the same directory as the asio source kit, then you may configure asio + by simply going: +

+
./configure
+
+

+ in the root directory of the asio source kit. Note that configure will always + use the most recent boost version it knows about (i.e. 1.34.1) in preference + to earlier versions, if there is more than one version present. +

+

+ If the boost directory is in some other location, then you need to specify + this directory when running configure: +

+
./configure --with-boost=path_to_boost
+
+

+ When specifying the boost directory in this way you should ensure that you + use an absolute path. +

+

+ To build the examples, simply run make in the root directory of + the asio source kit. To also build and run the unit tests, to confirm that + asio is working correctly, run make check. +

+

+ + Building + the tests and examples with MSVC +

+

+ To build using the MSVC 9.0 (or later) command line compiler, perform the following + steps in a Command Prompt window: +

+
    +
  • + If you are using a version of boost other than 1.34.1, or if the boost + directory (i.e. the directory called boost_1_34_1) is not + in the same directory as the asio source kit, then specify the location + of boost by running a command similar to set BOOSTDIR=path_to_boost. + Ensure that you specify an absolute path. +
  • +
  • + Change to the asio src directory. +
  • +
  • + Execute the command nmake -f Makefile.msc. +
  • +
  • + Execute the command nmake -f Makefile.msc check to run a suite + of tests to confirm that asio is working correctly. +
  • +
+

+ + Building + the tests and examples with MinGW +

+

+ To build using the MinGW g++ compiler from the command line, perform the following + steps in a Command Prompt window: +

+
    +
  • + If you are using a version of boost other than 1.34.1, or if the boost + directory (i.e. the directory called boost_1_34_1) is not + in the same directory as the asio source kit, then specify the location + of boost by running a command similar to set BOOSTDIR=path_to_boost. + Ensure that you specify an absolute path using forward slashes + (i.e. c:/projects/boost_1_34_1 rather than c:\projects\boost_1_34_1). +
  • +
  • + Change to the asio src directory. +
  • +
  • + Execute the command make -f Makefile.mgw. +
  • +
  • + Execute the command make -f Makefile.mgw check to run a suite + of tests to confirm that asio is working correctly. +
  • +
+
+ + + + + +
[Note]Note

+ The above instructions do not work when building inside MSYS. If you want + to build using MSYS, you should use export rather than + set to specify the location of boost. +

+

+ + Macros +

+

+ The macros listed in the table below may be used to control the behaviour of + Asio. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Macro +

+
+

+ Description +

+
+

+ ASIO_ENABLE_BUFFER_DEBUGGING +

+
+

+ Enables Asio's buffer debugging support, which can help identify + when invalid buffers are used in read or write operations (e.g. if + a std::string object being written is destroyed before the write + operation completes). +

+

+ When using Microsoft Visual C++ 11.0 or later, this macro is defined + automatically if the compiler's iterator debugging support is enabled, + unless ASIO_DISABLE_BUFFER_DEBUGGING has been defined. +

+

+ When using g++, this macro is defined automatically if standard library + debugging is enabled (_GLIBCXX_DEBUG is defined), unless + ASIO_DISABLE_BUFFER_DEBUGGING has been defined. +

+
+

+ ASIO_DISABLE_BUFFER_DEBUGGING +

+
+

+ Explictly disables Asio's buffer debugging support. +

+
+

+ ASIO_DISABLE_DEV_POLL +

+
+

+ Explicitly disables /dev/poll support on Solaris, + forcing the use of a select-based implementation. +

+
+

+ ASIO_DISABLE_EPOLL +

+
+

+ Explicitly disables epoll support on Linux, forcing + the use of a select-based implementation. +

+
+

+ ASIO_DISABLE_EVENTFD +

+
+

+ Explicitly disables eventfd support on Linux, forcing + the use of a pipe to interrupt blocked epoll/select system calls. +

+
+

+ ASIO_DISABLE_KQUEUE +

+
+

+ Explicitly disables kqueue support on macOS and BSD + variants, forcing the use of a select-based implementation. +

+
+

+ ASIO_DISABLE_IOCP +

+
+

+ Explicitly disables I/O completion ports support on Windows, forcing + the use of a select-based implementation. +

+
+

+ ASIO_DISABLE_THREADS +

+
+

+ Explicitly disables Asio's threading support, independent of whether + or not Boost supports threads. +

+
+

+ ASIO_NO_WIN32_LEAN_AND_MEAN +

+
+

+ By default, Asio will automatically define WIN32_LEAN_AND_MEAN + when compiling for Windows, to minimise the number of Windows SDK + header files and features that are included. The presence of ASIO_NO_WIN32_LEAN_AND_MEAN + prevents WIN32_LEAN_AND_MEAN from being defined. +

+
+

+ ASIO_NO_NOMINMAX +

+
+

+ By default, Asio will automatically define NOMINMAX + when compiling for Windows, to suppress the definition of the min() + and max() macros. The presence of ASIO_NO_NOMINMAX + prevents NOMINMAX from being defined. +

+
+

+ ASIO_NO_DEFAULT_LINKED_LIBS +

+
+

+ When compiling for Windows using Microsoft Visual C++ or Borland + C++, Asio will automatically link in the necessary Windows SDK libraries + for sockets support (i.e. ws2_32.lib and mswsock.lib, + or ws2.lib when building for Windows CE). The + ASIO_NO_DEFAULT_LINKED_LIBS macro prevents these libraries + from being linked. +

+
+

+ ASIO_ENABLE_CANCELIO +

+
+

+ Enables use of the CancelIo function on older versions + of Windows. If not enabled, calls to cancel() on a socket + object will always fail with asio::error::operation_not_supported + when run on Windows XP, Windows Server 2003, and earlier versions + of Windows. When running on Windows Vista, Windows Server 2008, and + later, the CancelIoEx function is always used. +

+

+ The CancelIo function has two issues that should be + considered before enabling its use: +

+

+ * It will only cancel asynchronous operations that were initiated + in the current thread. +

+

+ * It can appear to complete without error, but the request to cancel + the unfinished operations may be silently ignored by the operating + system. Whether it works or not seems to depend on the drivers that + are installed. +

+

+ For portable cancellation, consider using one of the following alternatives: +

+

+ * Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP. +

+

+ * Use the socket object's close() function to simultaneously cancel + the outstanding operations and close the socket. +

+
+

+ ASIO_NO_TYPEID +

+
+

+ Disables uses of the typeid operator in asio. Defined + automatically if BOOST_NO_TYPEID is defined. +

+
+

+ ASIO_HASH_MAP_BUCKETS +

+
+

+ Determines the number of buckets in asio's internal hash_map + objects. The value should be a comma separated list of prime numbers, + in ascending order. The hash_map implementation will + automatically increase the number of buckets as the number of elements + in the map increases. +

+

+ Some examples: +

+

+ * Defining ASIO_HASH_MAP_BUCKETS to 1021 + means that the hash_map objects will always contain + 1021 buckets, irrespective of the number of elements in the map. +

+

+ * Defining ASIO_HASH_MAP_BUCKETS to 53,389,1543 + means that the hash_map objects will initially contain + 53 buckets. The number of buckets will be increased to 389 and then + 1543 as elements are added to the map. +

+
+

+ + Mailing + List +

+

+ A mailing list specifically for Asio may be found on SourceForge.net. + Newsgroup access is provided via Gmane. +

+

+ + Wiki +

+

+ Users are encouraged to share examples, tips and FAQs on the Asio wiki, which + is located at http://think-async.com/Asio/. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/include/asio/doc/async_op1.png b/include/asio/doc/async_op1.png new file mode 100644 index 0000000..1151be6 Binary files /dev/null and b/include/asio/doc/async_op1.png differ diff --git a/include/asio/doc/async_op2.png b/include/asio/doc/async_op2.png new file mode 100644 index 0000000..cf7cb43 Binary files /dev/null and b/include/asio/doc/async_op2.png differ diff --git a/include/asio/doc/blank.png b/include/asio/doc/blank.png new file mode 100644 index 0000000..764bf4f Binary files /dev/null and b/include/asio/doc/blank.png differ diff --git a/include/asio/doc/boostbook.css b/include/asio/doc/boostbook.css new file mode 100644 index 0000000..2831765 --- /dev/null +++ b/include/asio/doc/boostbook.css @@ -0,0 +1,789 @@ + +/*============================================================================= +Copyright (c) 2004 Joel de Guzman +http://spirit.sourceforge.net/ + +Copyright 2013 Niall Douglas additions for colors and alignment. +Copyright 2013 Paul A. Bristow additions for more colors and alignments. +Copyright 2017 Tom Westerhout font fixes to support Sphinx + +Distributed under the Boost Software License, Version 1.0. (See accompany- +ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +/*============================================================================= +Body defaults +=============================================================================*/ + + body + { + margin: 1em; + font-size: 16px; + font-family: sans-serif; + } + +/*============================================================================= +Paragraphs +=============================================================================*/ + + p, div.document, div.footer + { + text-align: left; + font-size: 10pt; + line-height: 1.15; + } + +/*============================================================================= +Program listings +=============================================================================*/ + + /* Code on paragraphs */ + p tt.computeroutput + { + font-size: 9pt; + } + + pre.synopsis + { + font-size: 9pt; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + div.highlight, + .programlisting, + .screen + { + font-size: 9pt; + display: block; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + /* Program listings in tables don't get borders */ + td .programlisting, + td .screen + { + margin: 0pc 0pc 0pc 0pc; + padding: 0pc 0pc 0pc 0pc; + } + +/*============================================================================= +Headings +=============================================================================*/ + + h1, h2, h3, h4, h5, h6 + { + text-align: left; + margin: 1em 0em 0.5em 0em; + font-weight: bold; + } + + h1 { font-size: 140%; } + h2 { font-weight: bold; font-size: 140%; } + h3 { font-weight: bold; font-size: 130%; } + h4 { font-weight: bold; font-size: 120%; } + h5 { font-weight: normal; font-style: italic; font-size: 110%; } + h6 { font-weight: normal; font-style: italic; font-size: 100%; } + + /* Top page titles */ + title, + h1.title, + h2.title + h3.title, + h4.title, + h5.title, + h6.title, + .refentrytitle + { + font-weight: bold; + margin-bottom: 1pc; + } + + h1.title { font-size: 140% } + h2.title { font-size: 140% } + h3.title { font-size: 130% } + h4.title { font-size: 120% } + h5.title { font-size: 110% } + h6.title { font-size: 100% } + + .section h1 + { + margin: 0em 0em 0.5em 0em; + font-size: 140%; + } + + .section h2 { font-size: 140% } + .section h3 { font-size: 130% } + .section h4 { font-size: 120% } + .section h5 { font-size: 110% } + .section h6 { font-size: 100% } + + /* Code on titles */ + h1 tt.computeroutput { font-size: 140% } + h2 tt.computeroutput { font-size: 140% } + h3 tt.computeroutput { font-size: 130% } + h4 tt.computeroutput { font-size: 130% } + h5 tt.computeroutput { font-size: 130% } + h6 tt.computeroutput { font-size: 130% } + + +/*============================================================================= +Author +=============================================================================*/ + + h3.author + { + font-size: 100% + } + +/*============================================================================= +Lists +=============================================================================*/ + + li + { + font-size: 10pt; + line-height: 1.3; + } + + /* Unordered lists */ + ul + { + text-align: left; + } + + /* Ordered lists */ + ol + { + text-align: left; + } + +/*============================================================================= +Links +=============================================================================*/ + + a + { + text-decoration: none; /* no underline */ + } + + a:hover + { + text-decoration: underline; + } + +/*============================================================================= +Spirit style navigation +=============================================================================*/ + + .spirit-nav + { + text-align: right; + } + + .spirit-nav a + { + color: white; + padding-left: 0.5em; + } + + .spirit-nav img + { + border-width: 0px; + } + +/*============================================================================= +Copyright footer +=============================================================================*/ + .copyright-footer + { + text-align: right; + font-size: 70%; + } + + .copyright-footer p + { + text-align: right; + font-size: 80%; + } + +/*============================================================================= +Table of contents +=============================================================================*/ + + div.toc + { + margin: 1pc 4% 0pc 4%; + padding: 0.1pc 1pc 0.1pc 1pc; + font-size: 80%; + line-height: 1.15; + } + + .boost-toc + { + float: right; + padding: 0.5pc; + } + + /* Code on toc */ + .toc .computeroutput { font-size: 120% } + + /* No margin on nested menus */ + + .toc dl dl { margin: 0; } + +/*============================================================================= +Tables +=============================================================================*/ + + .table-title, + div.table p.title + { + margin-left: 4%; + padding-right: 0.5em; + padding-left: 0.5em; + } + + .informaltable table, + .table table + { + width: 92%; + margin-left: 4%; + margin-right: 4%; + } + + div.informaltable table, + div.table table + { + padding: 4px; + } + + /* Table Cells */ + div.informaltable table tr td, + div.table table tr td + { + padding: 0.5em; + text-align: left; + font-size: 9pt; + } + + div.informaltable table tr th, + div.table table tr th + { + padding: 0.5em 0.5em 0.5em 0.5em; + border: 1pt solid white; + font-size: 80%; + } + + table.simplelist + { + width: auto !important; + margin: 0em !important; + padding: 0em !important; + border: none !important; + } + table.simplelist td + { + margin: 0em !important; + padding: 0em !important; + text-align: left !important; + font-size: 9pt !important; + border: none !important; + } + +/*============================================================================= +Suppress margins in tables +=============================================================================*/ + + table th > *:first-child, + table td > *:first-child + { + margin-top: 0; + } + + table th > *:last-child, + table td > *:last-child + { + margin-bottom: 0; + } + +/*============================================================================= +Blurbs +=============================================================================*/ + + div.note, + div.tip, + div.important, + div.caution, + div.warning, + div.blurb, + p.blurb + { + font-size: 9pt; /* A little bit smaller than the main text */ + line-height: 1.2; + display: block; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + div.blurb img, + p.blurb img + { + padding: 1pt; + } + +/*============================================================================= +Variable Lists +=============================================================================*/ + + div.variablelist + { + margin: 1em 0; + } + + /* Make the terms in definition lists bold */ + div.variablelist dl dt, + span.term + { + font-weight: bold; + font-size: 10pt; + } + + div.variablelist table tbody tr td + { + text-align: left; + vertical-align: top; + padding: 0em 2em 0em 0em; + font-size: 10pt; + margin: 0em 0em 0.5em 0em; + line-height: 1; + } + + div.variablelist dl dt + { + margin-bottom: 0.2em; + } + + div.variablelist dl dd + { + margin: 0em 0em 0.5em 2em; + font-size: 10pt; + } + + div.variablelist table tbody tr td p, + div.variablelist dl dd p + { + margin: 0em 0em 0.5em 0em; + line-height: 1; + } + +/*============================================================================= +Misc +=============================================================================*/ + + /* Title of books and articles in bibliographies */ + span.title + { + font-style: italic; + } + + span.underline + { + text-decoration: underline; + } + + span.strikethrough + { + text-decoration: line-through; + } + + /* Copyright, Legal Notice */ + div div.legalnotice p + { + text-align: left + } + +/*============================================================================= +Colors +=============================================================================*/ + + @media screen + { + body { + background-color: #FFFFFF; + color: #000000; + } + + /* Syntax Highlighting */ + .property, + .highlight .k, + .highlight .kc, + .highlight .kd, + .highlight .kn, + .highlight .kp, + .highlight .kr, + .highlight .kt, + .keyword { color: #0000AA; } + + .highlight .n, + .highlight .na, + .highlight .nb, + .highlight .bp, + .highlight .nc, + .highlight .no, + .highlight .nd, + .highlight .ni, + .highlight .ne, + .highlight .nf, + .highlight .py, + .highlight .nl, + .highlight .nn, + .highlight .nx, + .highlight .nt, + .highlight .nv, + .highlight .vc, + .highlight .vg, + .highlight .vi, + .identifier { color: #000000; } + + .special { color: #707070; } + + .highlight .cp, + .preprocessor { color: #402080; } + + .highlight .sc + .char { color: teal; } + + .highlight .c, + .highlight .ch, + .highlight .cm, + .highlight .cp, + .highlight .cpf, + .highlight .c1, + .highlight .cs, + .highlight .sd, + .highlight .sh, + .comment { color: #800000; } + + .highlight .s, + .highlight .sa, + .highlight .sb, + .highlight .dl, + .highlight .s2, + .highlight .se, + .highlight .si, + .highlight .sx, + .highlight .sr, + .highlight .s1, + .highlight .ss, + .string { color: teal; } + + .highlight .m, + .highlight .mf, + .highlight .mh, + .highlight .mi, + .highlight .mo, + .number { color: teal; } + + .highlight, + .white_bkd { background-color: #FFFFFF; } + + .highlight .hll, + .dk_grey_bkd { background-color: #999999; } + + /* Links */ + a, a .keyword, a .identifier, a .special, a .preprocessor + a .char, a .comment, a .string, a .number + { + color: #005a9c; + } + + a:visited, a:visited .keyword, a:visited .identifier, + a:visited .special, a:visited .preprocessor a:visited .char, + a:visited .comment, a:visited .string, a:visited .number + { + color: #9c5a9c; + } + + h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, + h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover, + h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited + { + text-decoration: none; /* no underline */ + color: #000000; + } + + /* Copyright, Legal Notice */ + .copyright + { + color: #666666; + font-size: small; + } + + div div.legalnotice p + { + color: #666666; + } + + /* Program listing */ + pre.synopsis + { + border: 1px solid #DCDCDC; + } + + div.highlight, + .programlisting, + .screen + { + border: 1px solid #DCDCDC; + } + + td .programlisting, + td .screen + { + border: 0px solid #DCDCDC; + } + + /* Blurbs */ + div.note, + div.tip, + div.important, + div.caution, + div.warning, + div.blurb, + p.blurb + { + border: 1px solid #DCDCDC; + } + + /* Table of contents */ + div.toc + { + border: 1px solid #DCDCDC; + } + + /* Tables */ + div.informaltable table tr td, + div.table table tr td + { + border: 1px solid #DCDCDC; + } + + div.informaltable table tr th, + div.table table tr th + { + background-color: #F0F0F0; + border: 1px solid #DCDCDC; + } + + .copyright-footer + { + color: #8F8F8F; + } + + /* Misc */ + span.highlight + { + color: #00A000; + } + } + + @media print + { + /* Links */ + a + { + color: black; + } + + a:visited + { + color: black; + } + + .spirit-nav + { + display: none; + } + + /* Program listing */ + pre.synopsis + { + border: 1px solid gray; + } + + div.highlight, + .programlisting, + .screen + { + border: 1px solid gray; + } + + td .programlisting, + td .screen + { + border: 0px solid #DCDCDC; + } + + /* Table of contents */ + div.toc + { + border: 1px solid gray; + } + + .informaltable table, + .table table + { + border: 1px solid gray; + border-collapse: collapse; + } + + /* Tables */ + div.informaltable table tr td, + div.table table tr td + { + border: 1px solid gray; + } + + div.informaltable table tr th, + div.table table tr th + { + border: 1px solid gray; + } + + table.simplelist tr td + { + border: none !important; + } + + /* Misc */ + span.highlight + { + font-weight: bold; + } + } + +/*============================================================================= +Images +=============================================================================*/ + + span.inlinemediaobject img + { + vertical-align: middle; + } + +/*============================================================================== +Super and Subscript: style so that line spacing isn't effected, see +http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341 +==============================================================================*/ + +sup, +sub { +height: 0; +line-height: 1; +vertical-align: baseline; +position: relative; + +} + +/* For internet explorer: */ + +* html sup, +* html sub { +vertical-align: bottom; +} + +sup { +bottom: 1ex; +} + +sub { +top: .5ex; +} + +/*============================================================================== +Indexes: pretty much the same as the TOC. +==============================================================================*/ + + .index + { + font-size: 80%; + padding-top: 0px; + padding-bottom: 0px; + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + } + + .index ul + { + padding-left: 3em; + } + + .index p + { + padding: 2px; + margin: 2px; + } + + .index-entry-level-0 + { + font-weight: bold; + } + + .index em + { + font-weight: bold; + } + + +/*============================================================================== +Alignment and coloring use 'role' feature, available from Quickbook 1.6 up. +Added from Niall Douglas for role color and alignment. +http://article.gmane.org/gmane.comp.lib.boost.devel/243318 +*/ + +/* Add text alignment (see http://www.w3schools.com/cssref/pr_text_text-align.asp) */ +span.aligncenter +{ + display: inline-block; width: 100%; text-align: center; +} +span.alignright +{ + display: inline-block; width: 100%; text-align: right; +} +/* alignleft is the default. */ +span.alignleft +{ + display: inline-block; width: 100%; text-align: left; +} + +/* alignjustify stretches the word spacing so that each line has equal width +within a chosen fraction of page width (here arbitrarily 20%). +*Not* useful inside table items as the column width remains the total string width. +Nor very useful, except to temporarily restrict the width. +*/ +span.alignjustify +{ + display: inline-block; width: 20%; text-align: justify; +} + +/* Text colors. +Names at http://www.w3.org/TR/2002/WD-css3-color-20020219/ 4.3. X11 color keywords. +Quickbook Usage: [role red Some red text] + +*/ +span.red { inline-block; color: red; } +span.green { color: green; } +span.lime { color: #00FF00; } +span.blue { color: blue; } +span.navy { color: navy; } +span.yellow { color: yellow; } +span.magenta { color: magenta; } +span.indigo { color: #4B0082; } +span.cyan { color: cyan; } +span.purple { color: purple; } +span.gold { color: gold; } +span.silver { color: silver; } /* lighter gray */ +span.gray { color: #808080; } /* light gray */ diff --git a/include/asio/doc/caution.png b/include/asio/doc/caution.png new file mode 100644 index 0000000..5b7809c Binary files /dev/null and b/include/asio/doc/caution.png differ diff --git a/include/asio/doc/draft.png b/include/asio/doc/draft.png new file mode 100644 index 0000000..0084708 Binary files /dev/null and b/include/asio/doc/draft.png differ diff --git a/include/asio/doc/examples/diffs/allocation/server.cpp.html b/include/asio/doc/examples/diffs/allocation/server.cpp.html new file mode 100644 index 0000000..c0c3bc8 --- /dev/null +++ b/include/asio/doc/examples/diffs/allocation/server.cpp.html @@ -0,0 +1,337 @@ + + + + + + + HTML Diff allocation/server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​allocation/​server.​cppsrc/​examples/​cpp11/​allocation/​server.​cpp
1 /​/​1 /​/​
2 /​/​·​server.​cpp2 /​/​·​server.​cpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<array>
11 #include·​<cstdlib>12 #include·​<cstdlib>
12 #include·​<iostream>13 #include·​<iostream>
13 #include·​<boost/​aligned_storage.​hpp>14 #include·​<memory>
14 #include·​<boost/​array.​hpp>15 #include·​<type_traits>
15 #include·​<boost/​bind/​bind.​hpp>16 #include·​<utility>
16 #include·<boost/​enable_shared_from_th​is.​hpp>
17 #include·<boost/​noncopyable.​hpp>
18 #include·<boost/​shared_ptr.​hpp>
19 #include·​"asio.​hpp"17 #include·​"asio.​hpp"
20 18
21 using·​asio:​:​ip:​:​tcp;​19 using·​asio:​:​ip:​:​tcp;​
22 20
23 /​/​·​Class·​to·​manage·​the·​memory·​to·​be·​used·​for·​handler-​based·​custom·​allocation.​21 /​/​·​Class·​to·​manage·​the·​memory·​to·​be·​used·​for·​handler-​based·​custom·​allocation.​
24 /​/​·​It·​contains·​a·​single·​block·​of·​memory·​which·​may·​be·​returned·​for·​allocation22 /​/​·​It·​contains·​a·​single·​block·​of·​memory·​which·​may·​be·​returned·​for·​allocation
25 /​/​·​requests.​·​If·​the·​memory·​is·​in·​use·​when·​an·​allocation·​request·​is·​made,​·​the23 /​/​·​requests.​·​If·​the·​memory·​is·​in·​use·​when·​an·​allocation·​request·​is·​made,​·​the
26 /​/​·​allocator·​delegates·​allocation·​to·​the·​global·​heap.​24 /​/​·​allocator·​delegates·​allocation·​to·​the·​global·​heap.​
27 class·​handler_memory25 class·​handler_memory
28 ··​:​·​private·​boost:​:​noncopyable
29 {26 {
30 public:​27 public:​
31 ··​handler_memory()​28 ··​handler_memory()​
32 ····​:​·​in_use_(false)​29 ····​:​·​in_use_(false)​
33 ··​{30 ··​{
34 ··​}31 ··​}
35 32
33 ··​handler_memory(const·​handler_memory&)​·​=·​delete;​
34 ··​handler_memory&·​operator=(const·​handler_memory&)​·​=·​delete;​
35
36 ··​void*·​allocate(std:​:​size_t·​size)​36 ··​void*·​allocate(std:​:​size_t·​size)​
37 ··​{37 ··​{
38 ····​if·​(!in_use_·​&&·​size·​<·​storage_.​size)​38 ····​if·​(!in_use_·​&&·​size·​<·sizeof(storage_)​)​
39 ····​{39 ····​{
40 ······​in_use_·​=·​true;​40 ······​in_use_·​=·​true;​
41 ······​return·​storage_.​address()​;​41 ······​return·&storage_;​
42 ····​}42 ····​}
43 ····​else43 ····​else
44 ····​{44 ····​{
45 ······​return·​:​:​operator·​new(size)​;​45 ······​return·​:​:​operator·​new(size)​;​
46 ····​}46 ····​}
47 ··​}47 ··​}
48 48
49 ··​void·​deallocate(void*·​pointer)​49 ··​void·​deallocate(void*·​pointer)​
50 ··​{50 ··​{
51 ····​if·​(pointer·​==·​storage_.​address()​)​51 ····​if·​(pointer·​==·&storage_)​
52 ····​{52 ····​{
53 ······​in_use_·​=·​false;​53 ······​in_use_·​=·​false;​
54 ····​}54 ····​}
55 ····​else55 ····​else
56 ····​{56 ····​{
57 ······​:​:​operator·​delete(pointer)​;​57 ······​:​:​operator·​delete(pointer)​;​
58 ····​}58 ····​}
59 ··​}59 ··​}
60 60
61 private:​61 private:​
62 ··​/​/​·​Storage·​space·​used·​for·​handler-​based·​custom·​memory·​allocation.​62 ··​/​/​·​Storage·​space·​used·​for·​handler-​based·​custom·​memory·​allocation.​
63 ··boost:​:​aligned_storage<1024>​·​storage_;​63 ··typename·std:​:​aligned_storage<1024>​:​:​type·​storage_;​
64 64
65 ··​/​/​·​Whether·​the·​handler-​based·​custom·​allocation·​storage·​has·​been·​used.​65 ··​/​/​·​Whether·​the·​handler-​based·​custom·​allocation·​storage·​has·​been·​used.​
66 ··​bool·​in_use_;​66 ··​bool·​in_use_;​
67 };​67 };​
68 68
69 /​/​·​The·​allocator·​to·​be·​associated·​with·​the·​handler·​objects.​·​This·​allocator·​only69 /​/​·​The·​allocator·​to·​be·​associated·​with·​the·​handler·​objects.​·​This·​allocator·​only
70 /​/​·​needs·​to·​satisfy·​the·​C++11·​minimal·​allocator·​requirements,​·plus·rebind·when70 /​/​·​needs·​to·​satisfy·​the·​C++11·​minimal·​allocator·​requirements.​
71 /​/​·targeting·C++03.​
72 template·​<typename·​T>71 template·​<typename·​T>
73 class·​handler_allocator72 class·​handler_allocator
74 {73 {
75 public:​74 public:​
76 ··typedef·T·​value_type;​75 ··using·​value_type·=·T;​
77 76
78 ··​explicit·​handler_allocator(han​dler_memory&·​mem)​77 ··​explicit·​handler_allocator(han​dler_memory&·​mem)​
79 ····​:​·​memory_(mem)​78 ····​:​·​memory_(mem)​
80 ··​{79 ··​{
81 ··​}80 ··​}
82 81
83 ··​template·​<typename·​U>82 ··​template·​<typename·​U>
84 ··​handler_allocator(con​st·​handler_allocator<U>&​·​other)​83 ··​handler_allocator(con​st·​handler_allocator<U>&​·​other)​·noexcept
85 ····​:​·​memory_(other.​memory_)​84 ····​:​·​memory_(other.​memory_)​
86 ··​{85 ··​{
87 ··​}86 ··​}
88 87
89 ··​template·<typename·U>88 ··bool·operator==(const·handler_allocator&·other)​·const·noexcept
90 ··struct·rebind
91 ··{
92 ····typedef·handler_allocator<U>·other;​
93 ··};​
94
95 ··bool·operator==(const·handler_allocator&·other)​·const
96 ··​{89 ··​{
97 ····​return·​&memory_·​==·​&other.​memory_;​90 ····​return·​&memory_·​==·​&other.​memory_;​
98 ··​}91 ··​}
99 92
100 ··​bool·​operator!=(const·​handler_allocator&·​other)​·​const93 ··​bool·​operator!=(const·​handler_allocator&·​other)​·​const·noexcept
101 ··​{94 ··​{
102 ····​return·​&memory_·​!=·​&other.​memory_;​95 ····​return·​&memory_·​!=·​&other.​memory_;​
103 ··​}96 ··​}
104 97
105 ··​T*·​allocate(std:​:​size_t·​n)​·​const98 ··​T*·​allocate(std:​:​size_t·​n)​·​const
106 ··​{99 ··​{
107 ····​return·​static_cast<T*>(memor​y_.​allocate(sizeof(T)​·​*·​n)​)​;​100 ····​return·​static_cast<T*>(memor​y_.​allocate(sizeof(T)​·​*·​n)​)​;​
108 ··​}101 ··​}
109 102
110 ··​void·​deallocate(T*·​p,​·​std:​:​size_t·​/​*n*/​)​·​const103 ··​void·​deallocate(T*·​p,​·​std:​:​size_t·​/​*n*/​)​·​const
111 ··​{104 ··​{
112 ····​return·​memory_.​deallocate(p)​;​105 ····​return·​memory_.​deallocate(p)​;​
113 ··​}106 ··​}
114 107
115 /​/​private:​108 private:​
109 ··​template·​<typename>·​friend·​class·​handler_allocator;​
110
116 ··​/​/​·​The·​underlying·​memory.​111 ··​/​/​·​The·​underlying·​memory.​
117 ··​handler_memory&·​memory_;​112 ··​handler_memory&·​memory_;​
118 };​113 };​
119 114
120 /​/​·​Wrapper·​class·​template·​for·​handler·​objects·​to·​allow·​handler·​memory115 /​/​·​Wrapper·​class·​template·​for·​handler·​objects·​to·​allow·​handler·​memory
121 /​/​·​allocation·​to·​be·​customised.​·​The·​allocator_type·​typedef·​and·​get_allocator()​116 /​/​·​allocation·​to·​be·​customised.​·​The·​allocator_type·​type·​and·​get_allocator()​
122 /​/​·​member·​function·​are·​used·​by·​the·​asynchronous·​operations·​to·​obtain·​the117 /​/​·​member·​function·​are·​used·​by·​the·​asynchronous·​operations·​to·​obtain·​the
123 /​/​·​allocator.​·​Calls·​to·​operator()​·​are·​forwarded·​to·​the·​encapsulated·​handler.​118 /​/​·​allocator.​·​Calls·​to·​operator()​·​are·​forwarded·​to·​the·​encapsulated·​handler.​
124 template·​<typename·​Handler>119 template·​<typename·​Handler>
125 class·​custom_alloc_handler120 class·​custom_alloc_handler
126 {121 {
127 public:​122 public:​
128 ··​typedef·​handler_allocator<Han​dler>·allocator_type;​123 ··using·allocator_type·=·​handler_allocator<Han​dler>;​
129 124
130 ··​custom_alloc_handler(​handler_memory&·​m,​·​Handler·​h)​125 ··​custom_alloc_handler(​handler_memory&·​m,​·​Handler·​h)​
131 ····​:​·​memory_(m)​,​126 ····​:​·​memory_(m)​,​
132 ······​handler_(h)​127 ······​handler_(h)​
133 ··​{128 ··​{
134 ··​}129 ··​}
135 130
136 ··​allocator_type·​get_allocator()​·​const131 ··​allocator_type·​get_allocator()​·​const·noexcept
137 ··​{132 ··​{
138 ····​return·​allocator_type(memory​_)​;​133 ····​return·​allocator_type(memory​_)​;​
139 ··​}134 ··​}
140 135
141 ··​template·​<typename·​Arg1>136 ··​template·​<typename·.​.​.​Args>
142 ··​void·​operator()​(Arg1·​arg1)​137 ··​void·​operator()​(Args&&.​.​.​·​args)​
143 ··{
144 ····handler_(arg1)​;​
145 ··}
146
147 ··template·<typename·Arg1,​·typename·Arg2>
148 ··void·operator()​(Arg1·arg1,​·Arg2·arg2)​
149 ··​{138 ··​{
150 ····​handler_(arg1,​·arg2)​;​139 ····​handler_(std:​:​forward<Args>(args)​.​.​.​)​;​
151 ··​}140 ··​}
152 141
153 private:​142 private:​
154 ··​handler_memory&·​memory_;​143 ··​handler_memory&·​memory_;​
155 ··​Handler·​handler_;​144 ··​Handler·​handler_;​
156 };​145 };​
157 146
158 /​/​·​Helper·​function·​to·​wrap·​a·​handler·​object·​to·​add·​custom·​allocation.​147 /​/​·​Helper·​function·​to·​wrap·​a·​handler·​object·​to·​add·​custom·​allocation.​
159 template·​<typename·​Handler>148 template·​<typename·​Handler>
160 inline·​custom_alloc_handler<​Handler>·​make_custom_alloc_han​dler(149 inline·​custom_alloc_handler<​Handler>·​make_custom_alloc_han​dler(
161 ····​handler_memory&·​m,​·​Handler·​h)​150 ····​handler_memory&·​m,​·​Handler·​h)​
162 {151 {
163 ··​return·​custom_alloc_handler<​Handler>(m,​·​h)​;​152 ··​return·​custom_alloc_handler<​Handler>(m,​·​h)​;​
164 }153 }
165 154
166 class·​session155 class·​session
167 ··​:​·​public·boost:​:​enable_shared_from_th​is<session>156 ··​:​·​public·​std:​:​enable_shared_from_th​is<session>
168 {157 {
169 public:​158 public:​
170 ··​session(asio:​:​io_context&·io_context)​159 ··​session(tcp:​:​socket·socket)​
171 ····​:​·​socket_(io_context)​160 ····​:​·​socket_(std:​:​move(socket)​)​
172 ··​{161 ··​{
173 ··​}162 ··​}
174 163
175 ··tcp:​:​socket&·​socket()​164 ··void·​start()​
176 ··​{165 ··​{
177 ····return·socket_;​166 ····do_read()​;​
178 ··​}167 ··​}
179 168
180 ··void·start()​169 private:​
170 ··​void·​do_read()​
181 ··​{171 ··​{
172 ····​auto·​self(shared_from_this​()​)​;​
182 ····​socket_.​async_read_some(asio:​:​buffer(data_)​,​173 ····​socket_.​async_read_some(asio:​:​buffer(data_)​,​
183 ········​make_custom_alloc_han​dler(handler_memory_,​174 ········​make_custom_alloc_han​dler(handler_memory_,​
184 ··········boost:​:​bind(&session:​:​handle_read,​175 ··········[this,​·self](std:​:​error_code·ec,​·std:​:​size_t·length)​
185 ············shared_from_this()​,​176 ··········{
186 ············asio:​:​placeholders:​:​error,​177 ············​if·(!ec)​
187 ············asio:​:​placeholders:​:​bytes_transferred)​)​)​;​178 ············{
188 ··}179 ··············do_write(length)​;​
189 180 ············}
190 ··void·handle_read(const·asio:​:​error_code&·error,​181 ··········})​)​;​
191 ······size_t·bytes_transferred)​
192 ··{
193 ····if·(!error)​
194 ····{
195 ······asio:​:​async_write(socket_,​
196 ··········asio:​:​buffer(data_,​·bytes_transferred)​,​
197 ··········make_custom_alloc_han​dler(handler_memory_,​
198 ············boost:​:​bind(&session:​:​handle_write,​
199 ··············shared_from_this()​,​
200 ··············asio:​:​placeholders:​:​error)​)​)​;​
201 ····}
202 ··​}182 ··​}
203 183
204 ··​void·handle_write(const·asio:​:​error_code&·error)​184 ··​void·​do_write(std:​:​size_t·length)​
205 ··​{185 ··​{
206 ····if·​(!error)​186 ····auto·self(shared_from_this​()​)​;​
207 ····{187 ····asio:​:​async_write(socket_,​·asio:​:​buffer(data_,​·length)​,​
208 ······socket_.​async_read_some(asio:​:​buffer(data_)​,​188 ········make_custom_alloc_han​dler(handler_memory_,​
209 ··········make_custom_alloc_han​dler(handler_memory_,​189 ··········[this,​·self](std:​:​error_code·ec,​·std:​:​size_t·/​*length*/​)​
210 ············boost:​:​bind(&session:​:​handle_read,​190 ··········{
211 ··············shared_from_this()​,​191 ············if·(!ec)​
212 ··············asio:​:​placeholders:​:​error,​192 ············{
213 ··············asio:​:​placeholders:​:​bytes_transferred)​)​)​;​193 ··············​do_read()​;​
214 ····​}194 ············​}
195 ··········​})​)​;​
215 ··​}196 ··​}
216 197
217 private:​
218 ··​/​/​·​The·​socket·​used·​to·​communicate·​with·​the·​client.​198 ··​/​/​·​The·​socket·​used·​to·​communicate·​with·​the·​client.​
219 ··​tcp:​:​socket·​socket_;​199 ··​tcp:​:​socket·​socket_;​
220 200
221 ··​/​/​·​Buffer·​used·​to·​store·​data·​received·​from·​the·​client.​201 ··​/​/​·​Buffer·​used·​to·​store·​data·​received·​from·​the·​client.​
222 ··boost:​:​array<char,​·​1024>·​data_;​202 ··​std:​:​array<char,​·​1024>·​data_;​
223 203
224 ··​/​/​·​The·​memory·​to·​use·​for·​handler-​based·​custom·​memory·​allocation.​204 ··​/​/​·​The·​memory·​to·​use·​for·​handler-​based·​custom·​memory·​allocation.​
225 ··​handler_memory·​handler_memory_;​205 ··​handler_memory·​handler_memory_;​
226 };​206 };​
227 207
228 typedef·​boost:​:​shared_ptr<session>·​session_ptr;​
229
230 class·​server208 class·​server
231 {209 {
232 public:​210 public:​
233 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​211 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​
234 ····​:​·​io_context_(io_contex​t)​,​212 ····​:​·acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·port)​)​
235 ······acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·port)​)​
236 ··​{213 ··​{
237 ····session_ptr·new_session(new·session(io_context_)​)​;​214 ····do_accept()​;​
238 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​
239 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​
240 ··········asio:​:​placeholders:​:​error)​)​;​
241 ··​}215 ··​}
242 216
243 ··void·handle_accept(session​_ptr·new_session,​217 private:​
244 ······const·asio:​:​error_code&·error)​218 ··void·do_accept()​
245 ··​{219 ··​{
246 ····if·(!error)​220 ····acceptor_.​async_accept(
247 ····{221 ········[this](std:​:​error_code·ec,​·tcp:​:​socket·socket)​
248 ······new_session-​>start()​;​222 ········{
249 ····}223 ··········if·(!ec)​
224 ··········​{
225 ············​std:​:​make_shared<session>(​std:​:​move(socket)​)​-​>start()​;​
226 ··········​}
250 227
251 ····new_session.​reset(new·session(io_context_)​)​;​228 ··········do_accept()​;​
252 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​229 ········})​;​
253 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​
254 ··········asio:​:​placeholders:​:​error)​)​;​
255 ··​}230 ··​}
256 231
257 private:​
258 ··​asio:​:​io_context&·​io_context_;​
259 ··​tcp:​:​acceptor·​acceptor_;​232 ··​tcp:​:​acceptor·​acceptor_;​
260 };​233 };​
261 234
262 int·​main(int·​argc,​·​char*·​argv[])​235 int·​main(int·​argc,​·​char*·​argv[])​
263 {236 {
264 ··​try237 ··​try
265 ··​{238 ··​{
266 ····​if·​(argc·​!=·​2)​239 ····​if·​(argc·​!=·​2)​
267 ····​{240 ····​{
268 ······​std:​:​cerr·​<<·​"Usage:​·​server·​<port>\n";​241 ······​std:​:​cerr·​<<·​"Usage:​·​server·​<port>\n";​
269 ······​return·​1;​242 ······​return·​1;​
270 ····​}243 ····​}
271 244
272 ····​asio:​:​io_context·​io_context;​245 ····​asio:​:​io_context·​io_context;​
273 246 ····server·s(io_context,​·std:​:​atoi(argv[1])​)​;​
274 ····using·namespace·std;​·/​/​·For·atoi.​
275 ····server·s(io_context,​·atoi(argv[1])​)​;​
276
277 ····​io_context.​run()​;​247 ····​io_context.​run()​;​
278 ··​}248 ··​}
279 ··​catch·​(std:​:​exception&·​e)​249 ··​catch·​(std:​:​exception&·​e)​
280 ··​{250 ··​{
281 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​251 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
282 ··​}252 ··​}
283 253
284 ··​return·​0;​254 ··​return·​0;​
285 }255 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/buffers/reference_counted.cpp.html b/include/asio/doc/examples/diffs/buffers/reference_counted.cpp.html new file mode 100644 index 0000000..50165d0 --- /dev/null +++ b/include/asio/doc/examples/diffs/buffers/reference_counted.cpp.html @@ -0,0 +1,186 @@ + + + + + + + HTML Diff buffers/reference_counted.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​buffers/​reference_counted.​cppsrc/​examples/​cpp11/​buffers/​reference_counted.​cpp
1 /​/​1 /​/​
2 /​/​·​reference_counted.​cpp2 /​/​·​reference_counted.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<asio.​hpp>11 #include·​<asio.​hpp>
12 #include·​<boost/​bind/​bind.​hpp>
13 #include·​<boost/​enable_shared_from_th​is.​hpp>
14 #include·​<boost/​shared_ptr.​hpp>
15 #include·​<iostream>12 #include·​<iostream>
13 #include·​<memory>
14 #include·​<utility>
16 #include·​<vector>15 #include·​<vector>
16 #include·​<ctime>
17 17
18 using·​asio:​:​ip:​:​tcp;​18 using·​asio:​:​ip:​:​tcp;​
19 19
20 /​/​·​A·​reference-​counted·​non-​modifiable·​buffer·​class.​20 /​/​·​A·​reference-​counted·​non-​modifiable·​buffer·​class.​
21 class·​shared_const_buffer21 class·​shared_const_buffer
22 {22 {
23 public:​23 public:​
24 ··​/​/​·​Construct·​from·​a·​std:​:​string.​24 ··​/​/​·​Construct·​from·​a·​std:​:​string.​
25 ··​explicit·​shared_const_buffer(c​onst·​std:​:​string&·​data)​25 ··​explicit·​shared_const_buffer(c​onst·​std:​:​string&·​data)​
26 ····​:​·​data_(new·​std:​:​vector<char>(data.​begin()​,​·​data.​end()​)​)​,​26 ····​:​·​data_(new·​std:​:​vector<char>(data.​begin()​,​·​data.​end()​)​)​,​
27 ······​buffer_(asio:​:​buffer(*data_)​)​27 ······​buffer_(asio:​:​buffer(*data_)​)​
28 ··​{28 ··​{
29 ··​}29 ··​}
30 30
31 ··​/​/​·​Implement·​the·​ConstBufferSequence·​requirements.​31 ··​/​/​·​Implement·​the·​ConstBufferSequence·​requirements.​
32 ··​typedef·​asio:​:​const_buffer·​value_type;​32 ··​typedef·​asio:​:​const_buffer·​value_type;​
33 ··​typedef·​const·​asio:​:​const_buffer*·​const_iterator;​33 ··​typedef·​const·​asio:​:​const_buffer*·​const_iterator;​
34 ··​const·​asio:​:​const_buffer*·​begin()​·​const·​{·​return·​&buffer_;​·​}34 ··​const·​asio:​:​const_buffer*·​begin()​·​const·​{·​return·​&buffer_;​·​}
35 ··​const·​asio:​:​const_buffer*·​end()​·​const·​{·​return·​&buffer_·​+·​1;​·​}35 ··​const·​asio:​:​const_buffer*·​end()​·​const·​{·​return·​&buffer_·​+·​1;​·​}
36 36
37 private:​37 private:​
38 ··boost:​:​shared_ptr<std:​:​vector<char>·​>·​data_;​38 ··​std:​:​shared_ptr<std:​:​vector<char>·​>·​data_;​
39 ··​asio:​:​const_buffer·​buffer_;​39 ··​asio:​:​const_buffer·​buffer_;​
40 };​40 };​
41 41
42 class·​session42 class·​session
43 ··​:​·​public·boost:​:​enable_shared_from_th​is<session>43 ··​:​·​public·​std:​:​enable_shared_from_th​is<session>
44 {44 {
45 public:​45 public:​
46 ··​session(asio:​:​io_context&·io_context)​46 ··​session(tcp:​:​socket·socket)​
47 ····​:​·​socket_(io_context)​47 ····​:​·​socket_(std:​:​move(socket)​)​
48 ··​{48 ··​{
49 ··​}49 ··​}
50 50
51 ··​tcp:​:​socket&·​socket()​
52 ··​{
53 ····​return·​socket_;​
54 ··​}
55
56 ··​void·​start()​51 ··​void·​start()​
57 ··​{52 ··​{
58 ····using·namespace·std;​·/​/​·For·time_t,​·time·and·ctime.​53 ····​do_write()​;​
59 ····time_t·now·=·time(0)​;​
60 ····shared_const_buffer·buffer(ctime(&now)​)​;​
61 ····asio:​:​async_write(socket_,​·buffer,​
62 ········boost:​:​bind(&session:​:​handle_write,​·shared_from_this()​)​)​;​
63 ··​}54 ··​}
64 55
65 ··void·handle_write()​56 private:​
57 ··​void·​do_write()​
66 ··​{58 ··​{
59 ····​std:​:​time_t·​now·​=·​std:​:​time(0)​;​
60 ····​shared_const_buffer·​buffer(std:​:​ctime(&now)​)​;​
61
62 ····​auto·​self(shared_from_this​()​)​;​
63 ····​asio:​:​async_write(socket_,​·​buffer,​
64 ········​[self](std:​:​error_code·​/​*ec*/​,​·​std:​:​size_t·​/​*length*/​)​
65 ········​{
66 ········​})​;​
67 ··​}67 ··​}
68 68
69 private:​
70 ··​/​/​·​The·​socket·​used·​to·​communicate·​with·​the·​client.​69 ··​/​/​·​The·​socket·​used·​to·​communicate·​with·​the·​client.​
71 ··​tcp:​:​socket·​socket_;​70 ··​tcp:​:​socket·​socket_;​
72 };​71 };​
73 72
74 typedef·​boost:​:​shared_ptr<session>·​session_ptr;​
75
76 class·​server73 class·​server
77 {74 {
78 public:​75 public:​
79 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​76 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​
80 ····​:​·​io_context_(io_contex​t)​,​77 ····​:​·acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·port)​)​
81 ······acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·port)​)​
82 ··​{78 ··​{
83 ····session_ptr·new_session(new·session(io_context_)​)​;​79 ····do_accept()​;​
84 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​
85 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​
86 ··········asio:​:​placeholders:​:​error)​)​;​
87 ··​}80 ··​}
88 81
89 ··void·handle_accept(session​_ptr·new_session,​82 private:​
90 ······const·asio:​:​error_code&·error)​83 ··void·do_accept()​
91 ··​{84 ··​{
92 ····if·(!error)​85 ····acceptor_.​async_accept(
93 ····{86 ········[this](std:​:​error_code·ec,​·tcp:​:​socket·socket)​
94 ······new_session-​>start()​;​87 ········{
95 ····}88 ··········if·(!ec)​
89 ··········​{
90 ············​std:​:​make_shared<session>(​std:​:​move(socket)​)​-​>start()​;​
91 ··········​}
96 92
97 ····new_session.​reset(new·session(io_context_)​)​;​93 ··········do_accept()​;​
98 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​94 ········})​;​
99 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​
100 ··········asio:​:​placeholders:​:​error)​)​;​
101 ··​}95 ··​}
102 96
103 private:​
104 ··​asio:​:​io_context&·​io_context_;​
105 ··​tcp:​:​acceptor·​acceptor_;​97 ··​tcp:​:​acceptor·​acceptor_;​
106 };​98 };​
107 99
108 int·​main(int·​argc,​·​char*·​argv[])​100 int·​main(int·​argc,​·​char*·​argv[])​
109 {101 {
110 ··​try102 ··​try
111 ··​{103 ··​{
112 ····​if·​(argc·​!=·​2)​104 ····​if·​(argc·​!=·​2)​
113 ····​{105 ····​{
114 ······​std:​:​cerr·​<<·​"Usage:​·​reference_counted·​<port>\n";​106 ······​std:​:​cerr·​<<·​"Usage:​·​reference_counted·​<port>\n";​
115 ······​return·​1;​107 ······​return·​1;​
116 ····​}108 ····​}
117 109
118 ····​asio:​:​io_context·​io_context;​110 ····​asio:​:​io_context·​io_context;​
119 111
120 ····using·namespace·​std;​·/​/​·For·atoi.​112 ····server·s(io_context,​·​std:​:​atoi(argv[1])​)​;​
121 ····server·s(io_context,​·atoi(argv[1])​)​;​
122 113
123 ····​io_context.​run()​;​114 ····​io_context.​run()​;​
124 ··​}115 ··​}
125 ··​catch·​(std:​:​exception&·​e)​116 ··​catch·​(std:​:​exception&·​e)​
126 ··​{117 ··​{
127 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​118 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
128 ··​}119 ··​}
129 120
130 ··​return·​0;​121 ··​return·​0;​
131 }122 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/chat/chat_client.cpp.html b/include/asio/doc/examples/diffs/chat/chat_client.cpp.html new file mode 100644 index 0000000..409b7c0 --- /dev/null +++ b/include/asio/doc/examples/diffs/chat/chat_client.cpp.html @@ -0,0 +1,270 @@ + + + + + + + HTML Diff chat/chat_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​chat/​chat_client.​cppsrc/​examples/​cpp11/​chat/​chat_client.​cpp
1 /​/​1 /​/​
2 /​/​·​chat_client.​cpp2 /​/​·​chat_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<deque>12 #include·​<deque>
13 #include·​<iostream>13 #include·​<iostream>
14 #include·​<boost/​bind/​bind.​hpp>14 #include·​<thread>
15 #include·​"asio.​hpp"15 #include·​"asio.​hpp"
16 #include·​"chat_message.​hpp"16 #include·​"chat_message.​hpp"
17 17
18 using·​asio:​:​ip:​:​tcp;​18 using·​asio:​:​ip:​:​tcp;​
19 19
20 typedef·​std:​:​deque<chat_message>·​chat_message_queue;​20 typedef·​std:​:​deque<chat_message>·​chat_message_queue;​
21 21
22 class·​chat_client22 class·​chat_client
23 {23 {
24 public:​24 public:​
25 ··​chat_client(asio:​:​io_context&·​io_context,​25 ··​chat_client(asio:​:​io_context&·​io_context,​
26 ······​const·​tcp:​:​resolver:​:​results_type&·​endpoints)​26 ······​const·​tcp:​:​resolver:​:​results_type&·​endpoints)​
27 ····​:​·​io_context_(io_contex​t)​,​27 ····​:​·​io_context_(io_contex​t)​,​
28 ······​socket_(io_context)​28 ······​socket_(io_context)​
29 ··​{29 ··​{
30 ····asio:​:​async_connect(socket_​,​·endpoints,​30 ····do_connect(endpoints)​;​
31 ········boost:​:​bind(&chat_client:​:​handle_connect,​·this,​
32 ··········asio:​:​placeholders:​:​error)​)​;​
33 ··​}31 ··​}
34 32
35 ··​void·​write(const·​chat_message&·​msg)​33 ··​void·​write(const·​chat_message&·​msg)​
36 ··​{34 ··​{
37 ····​asio:​:​post(io_context_,​35 ····​asio:​:​post(io_context_,​
38 ········boost:​:​bind(&chat_client:​:​do_write,​·this,​·​msg)​)​;​36 ········[this,​·​msg]()​
37 ········​{
38 ··········​bool·​write_in_progress·​=·​!write_msgs_.​empty()​;​
39 ··········​write_msgs_.​push_back(msg)​;​
40 ··········​if·​(!write_in_progress)​
41 ··········​{
42 ············​do_write()​;​
43 ··········​}
44 ········​})​;​
39 ··​}45 ··​}
40 46
41 ··​void·​close()​47 ··​void·​close()​
42 ··​{48 ··​{
43 ····​asio:​:​post(io_context_,​49 ····​asio:​:​post(io_context_,​·[this]()​·{·socket_.​close()​;​·})​;​
44 ········boost:​:​bind(&chat_client:​:​do_close,​·this)​)​;​
45 ··​}50 ··​}
46 51
47 private:​52 private:​
48 53 ··void·do_connect(const·tcp:​:​resolver:​:​results_type&·endpoints)​
49 ··void·handle_connect(const·asio:​:​error_code&·error)​
50 ··{
51 ····if·(!error)​
52 ····{
53 ······asio:​:​async_read(socket_,​
54 ··········asio:​:​buffer(read_msg_.​data()​,​·chat_message:​:​header_length)​,​
55 ··········boost:​:​bind(&chat_client:​:​handle_read_header,​·this,​
56 ············asio:​:​placeholders:​:​error)​)​;​
57 ····}
58 ··}
59
60 ··void·handle_read_header(co​nst·asio:​:​error_code&·error)​
61 ··{
62 ····if·(!error·&&·read_msg_.​decode_header()​)​
63 ····{
64 ······asio:​:​async_read(socket_,​
65 ··········asio:​:​buffer(read_msg_.​body()​,​·read_msg_.​body_length()​)​,​
66 ··········boost:​:​bind(&chat_client:​:​handle_read_body,​·this,​
67 ············asio:​:​placeholders:​:​error)​)​;​
68 ····}
69 ····else
70 ····{
71 ······do_close()​;​
72 ····}
73 ··}
74
75 ··void·handle_read_body(cons​t·asio:​:​error_code&·error)​
76 ··{
77 ····if·(!error)​
78 ····{
79 ······std:​:​cout.​write(read_msg_.​body()​,​·read_msg_.​body_length()​)​;​
80 ······std:​:​cout·<<·"\n";​
81 ······asio:​:​async_read(socket_,​
82 ··········asio:​:​buffer(read_msg_.​data()​,​·chat_message:​:​header_length)​,​
83 ··········boost:​:​bind(&chat_client:​:​handle_read_header,​·this,​
84 ············asio:​:​placeholders:​:​error)​)​;​
85 ····}
86 ····else
87 ····{
88 ······do_close()​;​
89 ····}
90 ··}
91
92 ··void·do_write(chat_message​·msg)​
93 ··{
94 ····bool·write_in_progress·=·!write_msgs_.​empty()​;​
95 ····write_msgs_.​push_back(msg)​;​
96 ····if·(!write_in_progress)​
97 ····{
98 ······asio:​:​async_write(socket_,​
99 ··········asio:​:​buffer(write_msgs_.​front()​.​data()​,​
100 ············write_msgs_.​front()​.​length()​)​,​
101 ··········boost:​:​bind(&chat_client:​:​handle_write,​·this,​
102 ············asio:​:​placeholders:​:​error)​)​;​
103 ····}
104 ··}
105
106 ··void·handle_write(const·asio:​:​error_code&·error)​
107 ··​{54 ··​{
108 ····​if·(!error)​55 ····asio:​:​async_connect(socket_​,​·endpoints,​
109 ····{56 ········[this](std:​:​error_code·ec,​·tcp:​:​endpoint)​
110 ······write_msgs_.​pop_front()​;​57 ········{
111 ······if·(!write_msgs_.​empty()​)​58 ··········if·(!ec)​
112 ······​{59 ··········​{
113 ········asio:​:​async_write(socket_,​60 ············do_read_header()​;​
114 ············asio:​:​buffer(write_msgs_.​front()​.​data()​,​61 ··········}
115 ··············write_msgs_.​front()​.​length()​)​,​62 ········})​;​
116 ············boost:​:​bind(&chat_client:​:​handle_write,​·this,​63 ··}
117 ··············asio:​:​placeholders:​:​error)​)​;​64
118 ······}65 ··void·do_read_header()​
119 ····}66 ··{
120 ····​else67 ····asio:​:​async_read(socket_,​
121 ····{68 ········asio:​:​buffer(read_msg_.​data()​,​·chat_message:​:​header_length)​,​
122 ······​do_close()​;​69 ········[this](std:​:​error_code·ec,​·std:​:​size_t·/​*length*/​)​
123 ····}70 ········{
124 ··}71 ··········if·(!ec·&&·read_msg_.​decode_header()​)​
125 72 ··········{
126 ··void·​do_close()​73 ············​do_read_body()​;​
127 ··{74 ··········}
128 ····socket_.​close()​;​75 ··········else
76 ··········​{
77 ············​socket_.​close()​;​
78 ··········​}
79 ········​})​;​
80 ··​}
81
82 ··​void·​do_read_body()​
83 ··​{
84 ····​asio:​:​async_read(socket_,​
85 ········​asio:​:​buffer(read_msg_.​body()​,​·​read_msg_.​body_length()​)​,​
86 ········​[this](std:​:​error_code·​ec,​·​std:​:​size_t·​/​*length*/​)​
87 ········​{
88 ··········​if·​(!ec)​
89 ··········​{
90 ············​std:​:​cout.​write(read_msg_.​body()​,​·​read_msg_.​body_length()​)​;​
91 ············​std:​:​cout·​<<·​"\n";​
92 ············​do_read_header()​;​
93 ··········​}
94 ··········​else
95 ··········​{
96 ············​socket_.​close()​;​
97 ··········​}
98 ········​})​;​
99 ··​}
100
101 ··​void·​do_write()​
102 ··​{
103 ····​asio:​:​async_write(socket_,​
104 ········​asio:​:​buffer(write_msgs_.​front()​.​data()​,​
105 ··········​write_msgs_.​front()​.​length()​)​,​
106 ········​[this](std:​:​error_code·​ec,​·​std:​:​size_t·​/​*length*/​)​
107 ········​{
108 ··········​if·​(!ec)​
109 ··········​{
110 ············​write_msgs_.​pop_front()​;​
111 ············​if·​(!write_msgs_.​empty()​)​
112 ············​{
113 ··············​do_write()​;​
114 ············​}
115 ··········​}
116 ··········​else
117 ··········​{
118 ············​socket_.​close()​;​
119 ··········​}
120 ········​})​;​
129 ··​}121 ··​}
130 122
131 private:​123 private:​
132 ··​asio:​:​io_context&·​io_context_;​124 ··​asio:​:​io_context&·​io_context_;​
133 ··​tcp:​:​socket·​socket_;​125 ··​tcp:​:​socket·​socket_;​
134 ··​chat_message·​read_msg_;​126 ··​chat_message·​read_msg_;​
135 ··​chat_message_queue·​write_msgs_;​127 ··​chat_message_queue·​write_msgs_;​
136 };​128 };​
137 129
138 int·​main(int·​argc,​·​char*·​argv[])​130 int·​main(int·​argc,​·​char*·​argv[])​
139 {131 {
140 ··​try132 ··​try
141 ··​{133 ··​{
142 ····​if·​(argc·​!=·​3)​134 ····​if·​(argc·​!=·​3)​
143 ····​{135 ····​{
144 ······​std:​:​cerr·​<<·​"Usage:​·​chat_client·​<host>·​<port>\n";​136 ······​std:​:​cerr·​<<·​"Usage:​·​chat_client·​<host>·​<port>\n";​
145 ······​return·​1;​137 ······​return·​1;​
146 ····​}138 ····​}
147 139
148 ····​asio:​:​io_context·​io_context;​140 ····​asio:​:​io_context·​io_context;​
149 141
150 ····​tcp:​:​resolver·​resolver(io_context)​;​142 ····​tcp:​:​resolver·​resolver(io_context)​;​
151 ····tcp:​:​resolver:​:​results_type·​endpoints·​=·​resolver.​resolve(argv[1],​·​argv[2])​;​143 ····auto·​endpoints·​=·​resolver.​resolve(argv[1],​·​argv[2])​;​
152
153 ····​chat_client·​c(io_context,​·​endpoints)​;​144 ····​chat_client·​c(io_context,​·​endpoints)​;​
154 145
155 ····asio:​:​thread·​t(boost:​:​bind(&asio:​:​io_context:​:​run,​·&io_context)​)​;​146 ····​std:​:​thread·​t([&io_context]()​{·​io_context.​run()​;​·})​;​
156 147
157 ····​char·​line[chat_message:​:​max_body_length·​+·​1];​148 ····​char·​line[chat_message:​:​max_body_length·​+·​1];​
158 ····​while·​(std:​:​cin.​getline(line,​·​chat_message:​:​max_body_length·​+·​1)​)​149 ····​while·​(std:​:​cin.​getline(line,​·​chat_message:​:​max_body_length·​+·​1)​)​
159 ····​{150 ····​{
160 ······​using·​namespace·​std;​·​/​/​·​For·​strlen·​and·​memcpy.​
161 ······​chat_message·​msg;​151 ······​chat_message·​msg;​
162 ······​msg.​body_length(strlen(li​ne)​)​;​152 ······​msg.​body_length(std:​:​strlen(line)​)​;​
163 ······​memcpy(msg.​body()​,​·​line,​·​msg.​body_length()​)​;​153 ······std:​:​memcpy(msg.​body()​,​·​line,​·​msg.​body_length()​)​;​
164 ······​msg.​encode_header()​;​154 ······​msg.​encode_header()​;​
165 ······​c.​write(msg)​;​155 ······​c.​write(msg)​;​
166 ····​}156 ····​}
167 157
168 ····​c.​close()​;​158 ····​c.​close()​;​
169 ····​t.​join()​;​159 ····​t.​join()​;​
170 ··​}160 ··​}
171 ··​catch·​(std:​:​exception&·​e)​161 ··​catch·​(std:​:​exception&·​e)​
172 ··​{162 ··​{
173 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​163 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
174 ··​}164 ··​}
175 165
176 ··​return·​0;​166 ··​return·​0;​
177 }167 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/chat/chat_message.hpp.html b/include/asio/doc/examples/diffs/chat/chat_message.hpp.html new file mode 100644 index 0000000..0a2eedc --- /dev/null +++ b/include/asio/doc/examples/diffs/chat/chat_message.hpp.html @@ -0,0 +1,133 @@ + + + + + + + HTML Diff chat/chat_message.hpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​chat/​chat_message.​hppsrc/​examples/​cpp11/​chat/​chat_message.​hpp
1 /​/​1 /​/​
2 /​/​·​chat_message.​hpp2 /​/​·​chat_message.​hpp
3 /​/​·​~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #ifndef·​CHAT_MESSAGE_HPP11 #ifndef·​CHAT_MESSAGE_HPP
12 #define·​CHAT_MESSAGE_HPP12 #define·​CHAT_MESSAGE_HPP
13 13
14 #include·​<cstdio>14 #include·​<cstdio>
15 #include·​<cstdlib>15 #include·​<cstdlib>
16 #include·​<cstring>16 #include·​<cstring>
17 17
18 class·​chat_message18 class·​chat_message
19 {19 {
20 public:​20 public:​
21 ··​enum·​{·​header_length·​=·​4·​};​21 ··​enum·​{·​header_length·​=·​4·​};​
22 ··​enum·​{·​max_body_length·​=·​512·​};​22 ··​enum·​{·​max_body_length·​=·​512·​};​
23 23
24 ··​chat_message()​24 ··​chat_message()​
25 ····​:​·​body_length_(0)​25 ····​:​·​body_length_(0)​
26 ··​{26 ··​{
27 ··​}27 ··​}
28 28
29 ··​const·​char*·​data()​·​const29 ··​const·​char*·​data()​·​const
30 ··​{30 ··​{
31 ····​return·​data_;​31 ····​return·​data_;​
32 ··​}32 ··​}
33 33
34 ··​char*·​data()​34 ··​char*·​data()​
35 ··​{35 ··​{
36 ····​return·​data_;​36 ····​return·​data_;​
37 ··​}37 ··​}
38 38
39 ··​size_t·​length()​·​const39 ··std:​:​size_t·​length()​·​const
40 ··​{40 ··​{
41 ····​return·​header_length·​+·​body_length_;​41 ····​return·​header_length·​+·​body_length_;​
42 ··​}42 ··​}
43 43
44 ··​const·​char*·​body()​·​const44 ··​const·​char*·​body()​·​const
45 ··​{45 ··​{
46 ····​return·​data_·​+·​header_length;​46 ····​return·​data_·​+·​header_length;​
47 ··​}47 ··​}
48 48
49 ··​char*·​body()​49 ··​char*·​body()​
50 ··​{50 ··​{
51 ····​return·​data_·​+·​header_length;​51 ····​return·​data_·​+·​header_length;​
52 ··​}52 ··​}
53 53
54 ··​size_t·​body_length()​·​const54 ··std:​:​size_t·​body_length()​·​const
55 ··​{55 ··​{
56 ····​return·​body_length_;​56 ····​return·​body_length_;​
57 ··​}57 ··​}
58 58
59 ··​void·​body_length(size_t·​new_length)​59 ··​void·​body_length(std:​:​size_t·​new_length)​
60 ··​{60 ··​{
61 ····​body_length_·​=·​new_length;​61 ····​body_length_·​=·​new_length;​
62 ····​if·​(body_length_·​>·​max_body_length)​62 ····​if·​(body_length_·​>·​max_body_length)​
63 ······​body_length_·​=·​max_body_length;​63 ······​body_length_·​=·​max_body_length;​
64 ··​}64 ··​}
65 65
66 ··​bool·​decode_header()​66 ··​bool·​decode_header()​
67 ··​{67 ··​{
68 ····​using·​namespace·​std;​·​/​/​·​For·​strncat·​and·​atoi.​
69 ····​char·​header[header_length·​+·​1]·​=·​"";​68 ····​char·​header[header_length·​+·​1]·​=·​"";​
70 ····​strncat(header,​·​data_,​·​header_length)​;​69 ····std:​:​strncat(header,​·​data_,​·​header_length)​;​
71 ····​body_length_·​=·​atoi(header)​;​70 ····​body_length_·​=·std:​:​atoi(header)​;​
72 ····​if·​(body_length_·​>·​max_body_length)​71 ····​if·​(body_length_·​>·​max_body_length)​
73 ····​{72 ····​{
74 ······​body_length_·​=·​0;​73 ······​body_length_·​=·​0;​
75 ······​return·​false;​74 ······​return·​false;​
76 ····​}75 ····​}
77 ····​return·​true;​76 ····​return·​true;​
78 ··​}77 ··​}
79 78
80 ··​void·​encode_header()​79 ··​void·​encode_header()​
81 ··​{80 ··​{
82 ····​using·​namespace·​std;​·​/​/​·​For·​sprintf·​and·​memcpy.​
83 ····​char·​header[header_length·​+·​1]·​=·​"";​81 ····​char·​header[header_length·​+·​1]·​=·​"";​
84 ····​sprintf(header,​·​"%4d",​·​static_cast<int>(body​_length_)​)​;​82 ····std:​:​sprintf(header,​·​"%4d",​·​static_cast<int>(body​_length_)​)​;​
85 ····​memcpy(data_,​·​header,​·​header_length)​;​83 ····std:​:​memcpy(data_,​·​header,​·​header_length)​;​
86 ··​}84 ··​}
87 85
88 private:​86 private:​
89 ··​char·​data_[header_length·​+·​max_body_length];​87 ··​char·​data_[header_length·​+·​max_body_length];​
90 ··​size_t·​body_length_;​88 ··std:​:​size_t·​body_length_;​
91 };​89 };​
92 90
93 #endif·​/​/​·​CHAT_MESSAGE_HPP91 #endif·​/​/​·​CHAT_MESSAGE_HPP
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/chat/chat_server.cpp.html b/include/asio/doc/examples/diffs/chat/chat_server.cpp.html new file mode 100644 index 0000000..02c4844 --- /dev/null +++ b/include/asio/doc/examples/diffs/chat/chat_server.cpp.html @@ -0,0 +1,318 @@ + + + + + + + HTML Diff chat/chat_server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​chat/​chat_server.​cppsrc/​examples/​cpp11/​chat/​chat_server.​cpp
1 /​/​1 /​/​
2 /​/​·​chat_server.​cpp2 /​/​·​chat_server.​cpp
3 /​/​·​~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<algorithm>
12 #include·​<cstdlib>11 #include·​<cstdlib>
13 #include·​<deque>12 #include·​<deque>
14 #include·​<iostream>13 #include·​<iostream>
15 #include·​<list>14 #include·​<list>
15 #include·​<memory>
16 #include·​<set>16 #include·​<set>
17 #include·​<boost/​bind/​bind.​hpp>17 #include·​<utility>
18 #include·<boost/​shared_ptr.​hpp>
19 #include·<boost/​enable_shared_from_th​is.​hpp>
20 #include·​"asio.​hpp"18 #include·​"asio.​hpp"
21 #include·​"chat_message.​hpp"19 #include·​"chat_message.​hpp"
22 20
23 using·​asio:​:​ip:​:​tcp;​21 using·​asio:​:​ip:​:​tcp;​
24 22
25 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​23 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
26 24
27 typedef·​std:​:​deque<chat_message>·​chat_message_queue;​25 typedef·​std:​:​deque<chat_message>·​chat_message_queue;​
28 26
29 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​27 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
30 28
31 class·​chat_participant29 class·​chat_participant
32 {30 {
33 public:​31 public:​
34 ··​virtual·​~chat_participant()​·​{}32 ··​virtual·​~chat_participant()​·​{}
35 ··​virtual·​void·​deliver(const·​chat_message&·​msg)​·​=·​0;​33 ··​virtual·​void·​deliver(const·​chat_message&·​msg)​·​=·​0;​
36 };​34 };​
37 35
38 typedef·boost:​:​shared_ptr<chat_parti​cipant>·​chat_participant_ptr;​36 typedef·​std:​:​shared_ptr<chat_parti​cipant>·​chat_participant_ptr;​
39 37
40 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​38 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
41 39
42 class·​chat_room40 class·​chat_room
43 {41 {
44 public:​42 public:​
45 ··​void·​join(chat_participant​_ptr·​participant)​43 ··​void·​join(chat_participant​_ptr·​participant)​
46 ··​{44 ··​{
47 ····​participants_.​insert(participant)​;​45 ····​participants_.​insert(participant)​;​
48 ····std:​:​for_each(recent_msgs_​.​begin()​,​·​recent_msgs_.​end()​,​46 ····​for·(auto·msg:​·​recent_msgs_)​
49 ········boost:​:​bind(&chat_participan​t:​:​deliver,​47 ······​participant-​>deliver(msg)​;​
50 ··········participant,​·boost:​:​placeholders:​:​_1)​)​;​
51 ··​}48 ··​}
52 49
53 ··​void·​leave(chat_participan​t_ptr·​participant)​50 ··​void·​leave(chat_participan​t_ptr·​participant)​
54 ··​{51 ··​{
55 ····​participants_.​erase(participant)​;​52 ····​participants_.​erase(participant)​;​
56 ··​}53 ··​}
57 54
58 ··​void·​deliver(const·​chat_message&·​msg)​55 ··​void·​deliver(const·​chat_message&·​msg)​
59 ··​{56 ··​{
60 ····​recent_msgs_.​push_back(msg)​;​57 ····​recent_msgs_.​push_back(msg)​;​
61 ····​while·​(recent_msgs_.​size()​·​>·​max_recent_msgs)​58 ····​while·​(recent_msgs_.​size()​·​>·​max_recent_msgs)​
62 ······​recent_msgs_.​pop_front()​;​59 ······​recent_msgs_.​pop_front()​;​
63 60
64 ····std:​:​for_each(participants​_.​begin()​,​·​participants_.​end()​,​61 ····​for·(auto·participant:​·​participants_)​
65 ········boost:​:​bind(&chat_participan​t:​:​deliver,​62 ······​participant-​>deliver(msg)​;​
66 ··········boost:​:​placeholders:​:​_1,​·boost:​:​ref(msg)​)​)​;​
67 ··​}63 ··​}
68 64
69 private:​65 private:​
70 ··​std:​:​set<chat_participant_​ptr>·​participants_;​66 ··​std:​:​set<chat_participant_​ptr>·​participants_;​
71 ··​enum·​{·​max_recent_msgs·​=·​100·​};​67 ··​enum·​{·​max_recent_msgs·​=·​100·​};​
72 ··​chat_message_queue·​recent_msgs_;​68 ··​chat_message_queue·​recent_msgs_;​
73 };​69 };​
74 70
75 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​71 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
76 72
77 class·​chat_session73 class·​chat_session
78 ··​:​·​public·​chat_participant,​74 ··​:​·​public·​chat_participant,​
79 ····​public·boost:​:​enable_shared_from_th​is<chat_session>75 ····​public·​std:​:​enable_shared_from_th​is<chat_session>
80 {76 {
81 public:​77 public:​
82 ··​chat_session(asio:​:​io_context&·io_context,​·​chat_room&·​room)​78 ··​chat_session(tcp:​:​socket·socket,​·​chat_room&·​room)​
83 ····​:​·​socket_(io_context)​,​79 ····​:​·​socket_(std:​:​move(socket)​)​,​
84 ······​room_(room)​80 ······​room_(room)​
85 ··​{81 ··​{
86 ··​}82 ··​}
87 83
88 ··​tcp:​:​socket&·​socket()​
89 ··​{
90 ····​return·​socket_;​
91 ··​}
92
93 ··​void·​start()​84 ··​void·​start()​
94 ··​{85 ··​{
95 ····​room_.​join(shared_from_this​()​)​;​86 ····​room_.​join(shared_from_this​()​)​;​
96 ····asio:​:​async_read(socket_,​87 ····do_read_header()​;​
97 ········asio:​:​buffer(read_msg_.​data()​,​·chat_message:​:​header_length)​,​
98 ········boost:​:​bind(
99 ··········&chat_session:​:​handle_read_header,​·shared_from_this()​,​
100 ··········asio:​:​placeholders:​:​error)​)​;​
101 ··​}88 ··​}
102 89
103 ··​void·​deliver(const·​chat_message&·​msg)​90 ··​void·​deliver(const·​chat_message&·​msg)​
104 ··​{91 ··​{
105 ····​bool·​write_in_progress·​=·​!write_msgs_.​empty()​;​92 ····​bool·​write_in_progress·​=·​!write_msgs_.​empty()​;​
106 ····​write_msgs_.​push_back(msg)​;​93 ····​write_msgs_.​push_back(msg)​;​
107 ····​if·​(!write_in_progress)​94 ····​if·​(!write_in_progress)​
108 ····​{95 ····​{
109 ······asio:​:​async_write(socket_,​96 ······do_write()​;​
110 ··········asio:​:​buffer(write_msgs_.​front()​.​data()​,​
111 ············write_msgs_.​front()​.​length()​)​,​
112 ··········boost:​:​bind(&chat_session:​:​handle_write,​·shared_from_this()​,​
113 ············asio:​:​placeholders:​:​error)​)​;​
114 ····​}97 ····​}
115 ··​}98 ··​}
116 99
117 ··void·handle_read_header(co​nst·asio:​:​error_code&·error)​100 private:​
118 ··{101 ··void·do_read_header()​
119 ····if·(!error·&&·read_msg_.​decode_header()​)​
120 ····{
121 ······asio:​:​async_read(socket_,​
122 ··········asio:​:​buffer(read_msg_.​body()​,​·read_msg_.​body_length()​)​,​
123 ··········boost:​:​bind(&chat_session:​:​handle_read_body,​·shared_from_this()​,​
124 ············asio:​:​placeholders:​:​error)​)​;​
125 ····}
126 ····else
127 ····{
128 ······room_.​leave(shared_from_thi​s()​)​;​
129 ····}
130 ··}
131
132 ··void·handle_read_body(cons​t·asio:​:​error_code&·error)​
133 ··​{102 ··​{
134 ····if·​(!error)​103 ····auto·self(shared_from_this​()​)​;​
135 ····{104 ····asio:​:​async_read(socket_,​
136 ······​room_.​deliver(read_msg_)​;​105 ········asio:​:​buffer(read_msg_.​data()​,​·chat_message:​:​header_length)​,​
137 ······asio:​:​async_read(socket_,​106 ········[this,​·self](std:​:​error_code·ec,​·std:​:​size_t·/​*length*/​)​
138 ··········asio:​:​buffer(read_msg_.​data()​,​·chat_message:​:​header_length)​,​107 ········{
139 ··········boost:​:​bind(&chat_session:​:​handle_read_header,​·shared_from_this()​,​108 ··········​if·(!ec·&&·read_msg_.​decode_header()​)​
140 ············asio:​:​placeholders:​:​error)​)​;​109 ··········{
141 ····}110 ············do_read_body()​;​
142 ····else111 ··········}
143 ····{112 ··········else
144 ······room_.​leave(shared_from_thi​s()​)​;​113 ··········{
145 ····}114 ············room_.​leave(shared_from_thi​s()​)​;​
115 ··········​}
116 ········​})​;​
146 ··​}117 ··​}
147 118
148 ··​void·handle_write(const·asio:​:​error_code&·error)​119 ··​void·​do_read_body()​
149 ··​{120 ··​{
150 ····if·​(!error)​121 ····auto·self(shared_from_this​()​)​;​
151 ····{122 ····asio:​:​async_read(socket_,​
152 ······write_msgs_.​pop_front()​;​123 ········asio:​:​buffer(read_msg_.​body()​,​·read_msg_.​body_length()​)​,​
153 ······​if·(!write_msgs_.​empty()​)​124 ········[this,​·self](std:​:​error_code·ec,​·std:​:​size_t·/​*length*/​)​
154 ······​{125 ········​{
155 ········asio:​:​async_write(socket_,​126 ··········if·(!ec)​
156 ············asio:​:​buffer(write_msgs_.​front()​.​data()​,​127 ··········{
157 ··············write_msgs_.​front()​.​length()​)​,​128 ············​room_.​deliver(read_msg_)​;​
158 ············boost:​:​bind(&chat_session:​:​handle_write,​·shared_from_this()​,​129 ············​do_read_header()​;​
159 ··············asio:​:​placeholders:​:​error)​)​;​130 ··········}
160 ······}131 ··········else
161 ····}132 ··········{
162 ····​else133 ············room_.​leave(shared_from_thi​s()​)​;​
163 ····{134 ··········}
164 ······room_.​leave(shared_from_thi​s()​)​;​135 ········})​;​
165 ····​}136 ··​}
137
138 ··​void·​do_write()​
139 ··​{
140 ····​auto·​self(shared_from_this​()​)​;​
141 ····​asio:​:​async_write(socket_,​
142 ········​asio:​:​buffer(write_msgs_.​front()​.​data()​,​
143 ··········​write_msgs_.​front()​.​length()​)​,​
144 ········​[this,​·​self](std:​:​error_code·​ec,​·​std:​:​size_t·​/​*length*/​)​
145 ········​{
146 ··········​if·​(!ec)​
147 ··········​{
148 ············​write_msgs_.​pop_front()​;​
149 ············​if·​(!write_msgs_.​empty()​)​
150 ············​{
151 ··············​do_write()​;​
152 ············​}
153 ··········​}
154 ··········​else
155 ··········​{
156 ············​room_.​leave(shared_from_thi​s()​)​;​
157 ··········​}
158 ········​})​;​
166 ··​}159 ··​}
167 160
168 private:​
169 ··​tcp:​:​socket·​socket_;​161 ··​tcp:​:​socket·​socket_;​
170 ··​chat_room&·​room_;​162 ··​chat_room&·​room_;​
171 ··​chat_message·​read_msg_;​163 ··​chat_message·​read_msg_;​
172 ··​chat_message_queue·​write_msgs_;​164 ··​chat_message_queue·​write_msgs_;​
173 };​165 };​
174 166
175 typedef·​boost:​:​shared_ptr<chat_sessi​on>·​chat_session_ptr;​
176
177 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​167 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
178 168
179 class·​chat_server169 class·​chat_server
180 {170 {
181 public:​171 public:​
182 ··​chat_server(asio:​:​io_context&·​io_context,​172 ··​chat_server(asio:​:​io_context&·​io_context,​
183 ······​const·​tcp:​:​endpoint&·​endpoint)​173 ······​const·​tcp:​:​endpoint&·​endpoint)​
184 ····​:​·io_context_(io_contex​t)​,​174 ····​:​·acceptor_(io_context,​·endpoint)​
185 ······acceptor_(io_context,​·endpoint)​
186 ··​{175 ··​{
187 ····start_accept()​;​176 ····do_accept()​;​
188 ··​}177 ··​}
189 178
190 ··void·start_accept()​179 private:​
191 ··{180 ··void·do_accept()​
192 ····chat_session_ptr·new_session(new·chat_session(io_conte​xt_,​·room_)​)​;​
193 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​
194 ········boost:​:​bind(&chat_server:​:​handle_accept,​·this,​·new_session,​
195 ··········asio:​:​placeholders:​:​error)​)​;​
196 ··}
197
198 ··void·handle_accept(chat_se​ssion_ptr·session,​
199 ······const·asio:​:​error_code&·error)​
200 ··​{181 ··​{
201 ····if·(!error)​182 ····acceptor_.​async_accept(
202 ····{183 ········[this](std:​:​error_code·ec,​·tcp:​:​socket·socket)​
203 ······session-​>start()​;​184 ········{
204 ····}185 ··········if·(!ec)​
186 ··········​{
187 ············​std:​:​make_shared<chat_sess​ion>(std:​:​move(socket)​,​·​room_)​-​>start()​;​
188 ··········​}
205 189
206 ····start_accept()​;​190 ··········do_accept()​;​
191 ········​})​;​
207 ··​}192 ··​}
208 193
209 private:​
210 ··​asio:​:​io_context&·​io_context_;​
211 ··​tcp:​:​acceptor·​acceptor_;​194 ··​tcp:​:​acceptor·​acceptor_;​
212 ··​chat_room·​room_;​195 ··​chat_room·​room_;​
213 };​196 };​
214 197
215 typedef·​boost:​:​shared_ptr<chat_serve​r>·​chat_server_ptr;​
216 typedef·​std:​:​list<chat_server_ptr>​·​chat_server_list;​
217
218 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​198 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
219 199
220 int·​main(int·​argc,​·​char*·​argv[])​200 int·​main(int·​argc,​·​char*·​argv[])​
221 {201 {
222 ··​try202 ··​try
223 ··​{203 ··​{
224 ····​if·​(argc·​<·​2)​204 ····​if·​(argc·​<·​2)​
225 ····​{205 ····​{
226 ······​std:​:​cerr·​<<·​"Usage:​·​chat_server·​<port>·​[<port>·​.​.​.​]\n";​206 ······​std:​:​cerr·​<<·​"Usage:​·​chat_server·​<port>·​[<port>·​.​.​.​]\n";​
227 ······​return·​1;​207 ······​return·​1;​
228 ····​}208 ····​}
229 209
230 ····​asio:​:​io_context·​io_context;​210 ····​asio:​:​io_context·​io_context;​
231 211
232 ····​chat_server_list·​servers;​212 ····std:​:​list<chat_server>·​servers;​
233 ····​for·​(int·​i·​=·​1;​·​i·​<·​argc;​·​++i)​213 ····​for·​(int·​i·​=·​1;​·​i·​<·​argc;​·​++i)​
234 ····​{214 ····​{
235 ······using·​namespace·​std;​·/​/​·For·atoi.​215 ······tcp:​:​endpoint·endpoint(tcp:​:​v4()​,​·​std:​:​atoi(argv[i])​)​;​
236 ······tcp:​:​endpoint·endpoint(tcp:​:​v4()​,​·atoi(argv[i])​)​;​216 ······servers.​emplace_back(io_conte​xt,​·endpoint)​;​
237 ······chat_server_ptr·server(new·chat_server(io_contex​t,​·endpoint)​)​;​
238 ······servers.​push_back(server)​;​
239 ····​}217 ····​}
240 218
241 ····​io_context.​run()​;​219 ····​io_context.​run()​;​
242 ··​}220 ··​}
243 ··​catch·​(std:​:​exception&·​e)​221 ··​catch·​(std:​:​exception&·​e)​
244 ··​{222 ··​{
245 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​223 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
246 ··​}224 ··​}
247 225
248 ··​return·​0;​226 ··​return·​0;​
249 }227 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/echo/async_tcp_echo_server.cpp.html b/include/asio/doc/examples/diffs/echo/async_tcp_echo_server.cpp.html new file mode 100644 index 0000000..781b1df --- /dev/null +++ b/include/asio/doc/examples/diffs/echo/async_tcp_echo_server.cpp.html @@ -0,0 +1,191 @@ + + + + + + + HTML Diff echo/async_tcp_echo_server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​echo/​async_tcp_echo_server​.​cppsrc/​examples/​cpp11/​echo/​async_tcp_echo_server​.​cpp
1 /​/​1 /​/​
2 /​/​·​async_tcp_echo_server​.​cpp2 /​/​·​async_tcp_echo_server​.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<iostream>12 #include·​<iostream>
13 #include·​<boost/​bind/​bind.​hpp>13 #include·​<memory>
14 #include·​<utility>
14 #include·​"asio.​hpp"15 #include·​"asio.​hpp"
15 16
16 using·​asio:​:​ip:​:​tcp;​17 using·​asio:​:​ip:​:​tcp;​
17 18
18 class·​session19 class·​session
20 ··​:​·​public·​std:​:​enable_shared_from_th​is<session>
19 {21 {
20 public:​22 public:​
21 ··​session(asio:​:​io_context&·io_context)​23 ··​session(tcp:​:​socket·socket)​
22 ····​:​·​socket_(io_context)​24 ····​:​·​socket_(std:​:​move(socket)​)​
23 ··​{25 ··​{
24 ··​}26 ··​}
25 27
26 ··​tcp:​:​socket&·​socket()​
27 ··​{
28 ····​return·​socket_;​
29 ··​}
30
31 ··​void·​start()​28 ··​void·​start()​
32 ··​{29 ··​{
33 ····socket_.​async_read_some(asio:​:​buffer(data_,​·max_length)​,​30 ····do_read()​;​
34 ········boost:​:​bind(&session:​:​handle_read,​·this,​
35 ··········asio:​:​placeholders:​:​error,​
36 ··········asio:​:​placeholders:​:​bytes_transferred)​)​;​
37 ··​}31 ··​}
38 32
39 private:​33 private:​
40 ··​void·handle_read(const·asio:​:​error_code&·error,​34 ··​void·​do_read()​
41 ······size_t·bytes_transferred)​
42 ··{
43 ····if·(!error)​
44 ····{
45 ······asio:​:​async_write(socket_,​
46 ··········asio:​:​buffer(data_,​·bytes_transferred)​,​
47 ··········boost:​:​bind(&session:​:​handle_write,​·this,​
48 ············asio:​:​placeholders:​:​error)​)​;​
49 ····}
50 ····else
51 ····{
52 ······delete·this;​
53 ····}
54 ··}
55
56 ··void·handle_write(const·asio:​:​error_code&·error)​
57 ··​{35 ··​{
58 ····if·​(!error)​36 ····auto·self(shared_from_this​()​)​;​
59 ····{37 ····socket_.​async_read_some(asio:​:​buffer(data_,​·max_length)​,​
60 ······socket_.​async_read_some(asio:​:​buffer(data_,​·max_length)​,​38 ········[this,​·self](std:​:​error_code·ec,​·std:​:​size_t·length)​
61 ··········boost:​:​bind(&session:​:​handle_read,​·this,​39 ········{
62 ············asio:​:​placeholders:​:​error,​40 ··········​if·(!ec)​
63 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​41 ··········{
64 ····}42 ············do_write(length)​;​
65 ····else43 ··········}
66 ····{44 ········})​;​
67 ······delete·this;​45 ··}
68 ····}46
47 ··​void·​do_write(std:​:​size_t·​length)​
48 ··​{
49 ····​auto·​self(shared_from_this​()​)​;​
50 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer(data_,​·​length)​,​
51 ········​[this,​·​self](std:​:​error_code·​ec,​·​std:​:​size_t·​/​*length*/​)​
52 ········​{
53 ··········​if·​(!ec)​
54 ··········​{
55 ············​do_read()​;​
56 ··········​}
57 ········​})​;​
69 ··​}58 ··​}
70 59
71 ··​tcp:​:​socket·​socket_;​60 ··​tcp:​:​socket·​socket_;​
72 ··​enum·​{·​max_length·​=·​1024·​};​61 ··​enum·​{·​max_length·​=·​1024·​};​
73 ··​char·​data_[max_length];​62 ··​char·​data_[max_length];​
74 };​63 };​
75 64
76 class·​server65 class·​server
77 {66 {
78 public:​67 public:​
79 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​68 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​
80 ····​:​·​io_context_(io_contex​t)​,​69 ····​:​·acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·port)​)​
81 ······acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·port)​)​
82 ··​{70 ··​{
83 ····start_accept()​;​71 ····do_accept()​;​
84 ··​}72 ··​}
85 73
86 private:​74 private:​
87 ··​void·start_accept()​75 ··​void·do_accept()​
88 ··​{76 ··​{
89 ····session*·new_session·=·new·session(io_context_)​;​77 ····acceptor_.​async_accept(
90 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​78 ········[this](std:​:​error_code·ec,​·tcp:​:​socket·socket)​
91 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​79 ········{
92 ··········asio:​:​placeholders:​:​error)​)​;​80 ··········​if·(!ec)​
93 ··}81 ··········{
94 82 ············std:​:​make_shared<session>(​std:​:​move(socket)​)​-​>start()​;​
95 ··void·handle_accept(session​*·new_session,​83 ··········}
96 ······const·asio:​:​error_code&·error)​
97 ··{
98 ····if·(!error)​
99 ····{
100 ······new_session-​>start()​;​
101 ····}
102 ····else
103 ····{
104 ······delete·new_session;​
105 ····}
106 84
107 ····start_accept()​;​85 ··········do_accept()​;​
86 ········​})​;​
108 ··​}87 ··​}
109 88
110 ··​asio:​:​io_context&·​io_context_;​
111 ··​tcp:​:​acceptor·​acceptor_;​89 ··​tcp:​:​acceptor·​acceptor_;​
112 };​90 };​
113 91
114 int·​main(int·​argc,​·​char*·​argv[])​92 int·​main(int·​argc,​·​char*·​argv[])​
115 {93 {
116 ··​try94 ··​try
117 ··​{95 ··​{
118 ····​if·​(argc·​!=·​2)​96 ····​if·​(argc·​!=·​2)​
119 ····​{97 ····​{
120 ······​std:​:​cerr·​<<·​"Usage:​·​async_tcp_echo_server​·​<port>\n";​98 ······​std:​:​cerr·​<<·​"Usage:​·​async_tcp_echo_server​·​<port>\n";​
121 ······​return·​1;​99 ······​return·​1;​
122 ····​}100 ····​}
123 101
124 ····​asio:​:​io_context·​io_context;​102 ····​asio:​:​io_context·​io_context;​
125 103
126 ····using·namespace·​std;​·/​/​·For·atoi.​104 ····server·s(io_context,​·​std:​:​atoi(argv[1])​)​;​
127 ····server·s(io_context,​·atoi(argv[1])​)​;​
128 105
129 ····​io_context.​run()​;​106 ····​io_context.​run()​;​
130 ··​}107 ··​}
131 ··​catch·​(std:​:​exception&·​e)​108 ··​catch·​(std:​:​exception&·​e)​
132 ··​{109 ··​{
133 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​110 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
134 ··​}111 ··​}
135 112
136 ··​return·​0;​113 ··​return·​0;​
137 }114 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/echo/async_udp_echo_server.cpp.html b/include/asio/doc/examples/diffs/echo/async_udp_echo_server.cpp.html new file mode 100644 index 0000000..c275ba6 --- /dev/null +++ b/include/asio/doc/examples/diffs/echo/async_udp_echo_server.cpp.html @@ -0,0 +1,133 @@ + + + + + + + HTML Diff echo/async_udp_echo_server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​echo/​async_udp_echo_server​.​cppsrc/​examples/​cpp11/​echo/​async_udp_echo_server​.​cpp
1 /​/​1 /​/​
2 /​/​·​async_udp_echo_server​.​cpp2 /​/​·​async_udp_echo_server​.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<iostream>12 #include·​<iostream>
13 #include·​<boost/​bind/​bind.​hpp>
14 #include·​"asio.​hpp"13 #include·​"asio.​hpp"
15 14
16 using·​asio:​:​ip:​:​udp;​15 using·​asio:​:​ip:​:​udp;​
17 16
18 class·​server17 class·​server
19 {18 {
20 public:​19 public:​
21 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​20 ··​server(asio:​:​io_context&·​io_context,​·​short·​port)​
22 ····​:​·​socket_(io_context,​·​udp:​:​endpoint(udp:​:​v4()​,​·​port)​)​21 ····​:​·​socket_(io_context,​·​udp:​:​endpoint(udp:​:​v4()​,​·​port)​)​
23 ··​{22 ··​{
24 ····socket_.​async_receive_from(23 ····do_receive()​;​
25 ········asio:​:​buffer(data_,​·max_length)​,​·sender_endpoint_,​
26 ········boost:​:​bind(&server:​:​handle_receive_from,​·this,​
27 ··········asio:​:​placeholders:​:​error,​
28 ··········asio:​:​placeholders:​:​bytes_transferred)​)​;​
29 ··​}24 ··​}
30 25
31 ··​void·handle_receive_from(c​onst·asio:​:​error_code&·error,​26 ··​void·​do_receive()​
32 ······size_t·bytes_recvd)​
33 ··​{27 ··​{
34 ····if·(!error·&&·bytes_recvd·>·0)​28 ····socket_.​async_receive_from(
35 ····{29 ········asio:​:​buffer(data_,​·max_length)​,​·sender_endpoint_,​
36 ······​socket_.​async_send_to(30 ········[this](std:​:​error_code·ec,​·std:​:​size_t·bytes_recvd)​
37 ··········asio:​:​buffer(data_,​·bytes_recvd)​,​·sender_endpoint_,​31 ········{
38 ··········boost:​:​bind(&server:​:​handle_send_to,​·this,​32 ··········​if·(!ec·&&·bytes_recvd·>·0)​
39 ············asio:​:​placeholders:​:​error,​33 ··········{
40 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​34 ············do_send(bytes_recvd)​;​
41 ····​}35 ··········​}
42 ····​else36 ··········​else
43 ····​{37 ··········​{
44 ······socket_.​async_receive_from(38 ············do_receive()​;​
45 ··········asio:​:​buffer(data_,​·max_length)​,​·sender_endpoint_,​39 ··········}
46 ··········boost:​:​bind(&server:​:​handle_receive_from,​·this,​40 ········})​;​
47 ············asio:​:​placeholders:​:​error,​
48 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​
49 ····}
50 ··​}41 ··​}
51 42
52 ··​void·handle_send_to(const·asio:​:​error_code&·/​*error*/​,​43 ··​void·​do_send(std:​:​size_t·length)​
53 ······size_t·/​*bytes_sent*/​)​
54 ··​{44 ··​{
55 ····​socket_.​async_receive_from(45 ····​socket_.​async_send_to(
56 ········​asio:​:​buffer(data_,​·max_length)​,​·​sender_endpoint_,​46 ········​asio:​:​buffer(data_,​·​length)​,​·​sender_endpoint_,​
57 ········boost:​:​bind(&server:​:​handle_receive_from,​·this,​47 ········[this](std:​:​error_code·/​*ec*/​,​·std:​:​size_t·/​*bytes_sent*/​)​
58 ··········asio:​:​placeholders:​:​error,​48 ········{
59 ··········asio:​:​placeholders:​:​bytes_transferred)​)​;​49 ··········​do_receive()​;​
50 ········​})​;​
60 ··​}51 ··​}
61 52
62 private:​53 private:​
63 ··​udp:​:​socket·​socket_;​54 ··​udp:​:​socket·​socket_;​
64 ··​udp:​:​endpoint·​sender_endpoint_;​55 ··​udp:​:​endpoint·​sender_endpoint_;​
65 ··​enum·​{·​max_length·​=·​1024·​};​56 ··​enum·​{·​max_length·​=·​1024·​};​
66 ··​char·​data_[max_length];​57 ··​char·​data_[max_length];​
67 };​58 };​
68 59
69 int·​main(int·​argc,​·​char*·​argv[])​60 int·​main(int·​argc,​·​char*·​argv[])​
70 {61 {
71 ··​try62 ··​try
72 ··​{63 ··​{
73 ····​if·​(argc·​!=·​2)​64 ····​if·​(argc·​!=·​2)​
74 ····​{65 ····​{
75 ······​std:​:​cerr·​<<·​"Usage:​·​async_udp_echo_server​·​<port>\n";​66 ······​std:​:​cerr·​<<·​"Usage:​·​async_udp_echo_server​·​<port>\n";​
76 ······​return·​1;​67 ······​return·​1;​
77 ····​}68 ····​}
78 69
79 ····​asio:​:​io_context·​io_context;​70 ····​asio:​:​io_context·​io_context;​
80 71
81 ····using·namespace·​std;​·/​/​·For·atoi.​72 ····server·s(io_context,​·​std:​:​atoi(argv[1])​)​;​
82 ····server·s(io_context,​·atoi(argv[1])​)​;​
83 73
84 ····​io_context.​run()​;​74 ····​io_context.​run()​;​
85 ··​}75 ··​}
86 ··​catch·​(std:​:​exception&·​e)​76 ··​catch·​(std:​:​exception&·​e)​
87 ··​{77 ··​{
88 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​78 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
89 ··​}79 ··​}
90 80
91 ··​return·​0;​81 ··​return·​0;​
92 }82 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/echo/blocking_tcp_echo_client.cpp.html b/include/asio/doc/examples/diffs/echo/blocking_tcp_echo_client.cpp.html new file mode 100644 index 0000000..c260f47 --- /dev/null +++ b/include/asio/doc/examples/diffs/echo/blocking_tcp_echo_client.cpp.html @@ -0,0 +1,100 @@ + + + + + + + HTML Diff echo/blocking_tcp_echo_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​echo/​blocking_tcp_echo_cli​ent.​cppsrc/​examples/​cpp11/​echo/​blocking_tcp_echo_cli​ent.​cpp
1 /​/​1 /​/​
2 /​/​·​blocking_tcp_echo_cli​ent.​cpp2 /​/​·​blocking_tcp_echo_cli​ent.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<cstring>12 #include·​<cstring>
13 #include·​<iostream>13 #include·​<iostream>
14 #include·​"asio.​hpp"14 #include·​"asio.​hpp"
15 15
16 using·​asio:​:​ip:​:​tcp;​16 using·​asio:​:​ip:​:​tcp;​
17 17
18 enum·​{·​max_length·​=·​1024·​};​18 enum·​{·​max_length·​=·​1024·​};​
19 19
20 int·​main(int·​argc,​·​char*·​argv[])​20 int·​main(int·​argc,​·​char*·​argv[])​
21 {21 {
22 ··​try22 ··​try
23 ··​{23 ··​{
24 ····​if·​(argc·​!=·​3)​24 ····​if·​(argc·​!=·​3)​
25 ····​{25 ····​{
26 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_echo_cli​ent·​<host>·​<port>\n";​26 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_echo_cli​ent·​<host>·​<port>\n";​
27 ······​return·​1;​27 ······​return·​1;​
28 ····​}28 ····​}
29 29
30 ····​asio:​:​io_context·​io_context;​30 ····​asio:​:​io_context·​io_context;​
31 31
32 ····​tcp:​:​resolver·​resolver(io_context)​;​
33 ····​tcp:​:​resolver:​:​results_type·​endpoints·​=
34 ······​resolver.​resolve(tcp:​:​v4()​,​·​argv[1],​·​argv[2])​;​
35
36 ····​tcp:​:​socket·​s(io_context)​;​32 ····​tcp:​:​socket·​s(io_context)​;​
37 ····asio:​:​connect(s,​·endpoints)​;​33 ····tcp:​:​resolver·resolver(io_context)​;​
34 ····​asio:​:​connect(s,​·​resolver.​resolve(argv[1],​·​argv[2])​)​;​
38 35
39 ····​using·​namespace·​std;​·​/​/​·​For·​strlen.​
40 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​36 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​
41 ····​char·​request[max_length];​37 ····​char·​request[max_length];​
42 ····​std:​:​cin.​getline(request,​·​max_length)​;​38 ····​std:​:​cin.​getline(request,​·​max_length)​;​
43 ····​size_t·​request_length·​=·​strlen(request)​;​39 ····​size_t·​request_length·​=·std:​:​strlen(request)​;​
44 ····​asio:​:​write(s,​·​asio:​:​buffer(request,​·​request_length)​)​;​40 ····​asio:​:​write(s,​·​asio:​:​buffer(request,​·​request_length)​)​;​
45 41
46 ····​char·​reply[max_length];​42 ····​char·​reply[max_length];​
47 ····​size_t·​reply_length·​=·​asio:​:​read(s,​43 ····​size_t·​reply_length·​=·​asio:​:​read(s,​
48 ········​asio:​:​buffer(reply,​·​request_length)​)​;​44 ········​asio:​:​buffer(reply,​·​request_length)​)​;​
49 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​45 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​
50 ····​std:​:​cout.​write(reply,​·​reply_length)​;​46 ····​std:​:​cout.​write(reply,​·​reply_length)​;​
51 ····​std:​:​cout·​<<·​"\n";​47 ····​std:​:​cout·​<<·​"\n";​
52 ··​}48 ··​}
53 ··​catch·​(std:​:​exception&·​e)​49 ··​catch·​(std:​:​exception&·​e)​
54 ··​{50 ··​{
55 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​51 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
56 ··​}52 ··​}
57 53
58 ··​return·​0;​54 ··​return·​0;​
59 }55 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/echo/blocking_tcp_echo_server.cpp.html b/include/asio/doc/examples/diffs/echo/blocking_tcp_echo_server.cpp.html new file mode 100644 index 0000000..aa6b25b --- /dev/null +++ b/include/asio/doc/examples/diffs/echo/blocking_tcp_echo_server.cpp.html @@ -0,0 +1,119 @@ + + + + + + + HTML Diff echo/blocking_tcp_echo_server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​echo/​blocking_tcp_echo_ser​ver.​cppsrc/​examples/​cpp11/​echo/​blocking_tcp_echo_ser​ver.​cpp
1 /​/​1 /​/​
2 /​/​·​blocking_tcp_echo_ser​ver.​cpp2 /​/​·​blocking_tcp_echo_ser​ver.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<iostream>12 #include·​<iostream>
13 #include·​<boost/​bind/​bind.​hpp>13 #include·​<thread>
14 #include·​<boost/​smart_ptr.​hpp>14 #include·​<utility>
15 #include·​"asio.​hpp"15 #include·​"asio.​hpp"
16 16
17 using·​asio:​:​ip:​:​tcp;​17 using·​asio:​:​ip:​:​tcp;​
18 18
19 const·​int·​max_length·​=·​1024;​19 const·​int·​max_length·​=·​1024;​
20 20
21 typedef·boost:​:​shared_ptr<tcp:​:​socket>·​socket_ptr;​21 void·​session(tcp:​:​socket·​sock)​
22
23 void·session(socket_ptr·sock)​
24 {22 {
25 ··​try23 ··​try
26 ··​{24 ··​{
27 ····​for·​(;​;​)​25 ····​for·​(;​;​)​
28 ····​{26 ····​{
29 ······​char·​data[max_length];​27 ······​char·​data[max_length];​
30 28
31 ······​asio:​:​error_code·​error;​29 ······​asio:​:​error_code·​error;​
32 ······​size_t·​length·​=·​sock-​>read_some(asio:​:​buffer(data)​,​·​error)​;​30 ······​size_t·​length·​=·​sock.​read_some(asio:​:​buffer(data)​,​·​error)​;​
33 ······​if·​(error·​==·​asio:​:​error:​:​eof)​31 ······​if·​(error·​==·​asio:​:​error:​:​eof)​
34 ········​break;​·​/​/​·​Connection·​closed·​cleanly·​by·​peer.​32 ········​break;​·​/​/​·​Connection·​closed·​cleanly·​by·​peer.​
35 ······​else·​if·​(error)​33 ······​else·​if·​(error)​
36 ········​throw·​asio:​:​system_error(error)​;​·​/​/​·​Some·​other·​error.​34 ········​throw·​asio:​:​system_error(error)​;​·​/​/​·​Some·​other·​error.​
37 35
38 ······​asio:​:​write(*sock,​·​asio:​:​buffer(data,​·​length)​)​;​36 ······​asio:​:​write(sock,​·​asio:​:​buffer(data,​·​length)​)​;​
39 ····​}37 ····​}
40 ··​}38 ··​}
41 ··​catch·​(std:​:​exception&·​e)​39 ··​catch·​(std:​:​exception&·​e)​
42 ··​{40 ··​{
43 ····​std:​:​cerr·​<<·​"Exception·​in·​thread:​·​"·​<<·​e.​what()​·​<<·​"\n";​41 ····​std:​:​cerr·​<<·​"Exception·​in·​thread:​·​"·​<<·​e.​what()​·​<<·​"\n";​
44 ··​}42 ··​}
45 }43 }
46 44
47 void·​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​45 void·​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​
48 {46 {
49 ··​tcp:​:​acceptor·​a(io_context,​·​tcp:​:​endpoint(tcp:​:​v4()​,​·​port)​)​;​47 ··​tcp:​:​acceptor·​a(io_context,​·​tcp:​:​endpoint(tcp:​:​v4()​,​·​port)​)​;​
50 ··​for·​(;​;​)​48 ··​for·​(;​;​)​
51 ··​{49 ··​{
52 ····​socket_ptr·sock(new·tcp:​:​socket(io_context)​)​;​50 ····​std:​:​thread(session,​·a.​accept()​)​.​detach()​;​
53 ····a.​accept(*sock)​;​
54 ····asio:​:​thread·t(boost:​:​bind(session,​·sock)​)​;​
55 ··​}51 ··​}
56 }52 }
57 53
58 int·​main(int·​argc,​·​char*·​argv[])​54 int·​main(int·​argc,​·​char*·​argv[])​
59 {55 {
60 ··​try56 ··​try
61 ··​{57 ··​{
62 ····​if·​(argc·​!=·​2)​58 ····​if·​(argc·​!=·​2)​
63 ····​{59 ····​{
64 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_echo_ser​ver·​<port>\n";​60 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_echo_ser​ver·​<port>\n";​
65 ······​return·​1;​61 ······​return·​1;​
66 ····​}62 ····​}
67 63
68 ····​asio:​:​io_context·​io_context;​64 ····​asio:​:​io_context·​io_context;​
69 65
70 ····using·namespace·​std;​·/​/​·For·atoi.​66 ····server(io_context,​·​std:​:​atoi(argv[1])​)​;​
71 ····server(io_context,​·atoi(argv[1])​)​;​
72 ··​}67 ··​}
73 ··​catch·​(std:​:​exception&·​e)​68 ··​catch·​(std:​:​exception&·​e)​
74 ··​{69 ··​{
75 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​70 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
76 ··​}71 ··​}
77 72
78 ··​return·​0;​73 ··​return·​0;​
79 }74 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/echo/blocking_udp_echo_client.cpp.html b/include/asio/doc/examples/diffs/echo/blocking_udp_echo_client.cpp.html new file mode 100644 index 0000000..d815cb0 --- /dev/null +++ b/include/asio/doc/examples/diffs/echo/blocking_udp_echo_client.cpp.html @@ -0,0 +1,99 @@ + + + + + + + HTML Diff echo/blocking_udp_echo_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​echo/​blocking_udp_echo_cli​ent.​cppsrc/​examples/​cpp11/​echo/​blocking_udp_echo_cli​ent.​cpp
1 /​/​1 /​/​
2 /​/​·​blocking_udp_echo_cli​ent.​cpp2 /​/​·​blocking_udp_echo_cli​ent.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<cstring>12 #include·​<cstring>
13 #include·​<iostream>13 #include·​<iostream>
14 #include·​"asio.​hpp"14 #include·​"asio.​hpp"
15 15
16 using·​asio:​:​ip:​:​udp;​16 using·​asio:​:​ip:​:​udp;​
17 17
18 enum·​{·​max_length·​=·​1024·​};​18 enum·​{·​max_length·​=·​1024·​};​
19 19
20 int·​main(int·​argc,​·​char*·​argv[])​20 int·​main(int·​argc,​·​char*·​argv[])​
21 {21 {
22 ··​try22 ··​try
23 ··​{23 ··​{
24 ····​if·​(argc·​!=·​3)​24 ····​if·​(argc·​!=·​3)​
25 ····​{25 ····​{
26 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_udp_echo_cli​ent·​<host>·​<port>\n";​26 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_udp_echo_cli​ent·​<host>·​<port>\n";​
27 ······​return·​1;​27 ······​return·​1;​
28 ····​}28 ····​}
29 29
30 ····​asio:​:​io_context·​io_context;​30 ····​asio:​:​io_context·​io_context;​
31 31
32 ····​udp:​:​socket·​s(io_context,​·​udp:​:​endpoint(udp:​:​v4()​,​·​0)​)​;​32 ····​udp:​:​socket·​s(io_context,​·​udp:​:​endpoint(udp:​:​v4()​,​·​0)​)​;​
33 33
34 ····​udp:​:​resolver·​resolver(io_context)​;​34 ····​udp:​:​resolver·​resolver(io_context)​;​
35 ····​udp:​:​resolver:​:​results_type·​endpoints·​=35 ····​udp:​:​resolver:​:​results_type·​endpoints·​=
36 ······​resolver.​resolve(udp:​:​v4()​,​·​argv[1],​·​argv[2])​;​36 ······​resolver.​resolve(udp:​:​v4()​,​·​argv[1],​·​argv[2])​;​
37 37
38 ····​using·​namespace·​std;​·​/​/​·​For·​strlen.​
39 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​38 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​
40 ····​char·​request[max_length];​39 ····​char·​request[max_length];​
41 ····​std:​:​cin.​getline(request,​·​max_length)​;​40 ····​std:​:​cin.​getline(request,​·​max_length)​;​
42 ····​size_t·​request_length·​=·​strlen(request)​;​41 ····​size_t·​request_length·​=·std:​:​strlen(request)​;​
43 ····​s.​send_to(asio:​:​buffer(request,​·​request_length)​,​·​*endpoints.​begin()​)​;​42 ····​s.​send_to(asio:​:​buffer(request,​·​request_length)​,​·​*endpoints.​begin()​)​;​
44 43
45 ····​char·​reply[max_length];​44 ····​char·​reply[max_length];​
46 ····​udp:​:​endpoint·​sender_endpoint;​45 ····​udp:​:​endpoint·​sender_endpoint;​
47 ····​size_t·​reply_length·​=·​s.​receive_from(46 ····​size_t·​reply_length·​=·​s.​receive_from(
48 ········​asio:​:​buffer(reply,​·​max_length)​,​·​sender_endpoint)​;​47 ········​asio:​:​buffer(reply,​·​max_length)​,​·​sender_endpoint)​;​
49 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​48 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​
50 ····​std:​:​cout.​write(reply,​·​reply_length)​;​49 ····​std:​:​cout.​write(reply,​·​reply_length)​;​
51 ····​std:​:​cout·​<<·​"\n";​50 ····​std:​:​cout·​<<·​"\n";​
52 ··​}51 ··​}
53 ··​catch·​(std:​:​exception&·​e)​52 ··​catch·​(std:​:​exception&·​e)​
54 ··​{53 ··​{
55 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​54 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
56 ··​}55 ··​}
57 56
58 ··​return·​0;​57 ··​return·​0;​
59 }58 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/echo/blocking_udp_echo_server.cpp.html b/include/asio/doc/examples/diffs/echo/blocking_udp_echo_server.cpp.html new file mode 100644 index 0000000..c417ecf --- /dev/null +++ b/include/asio/doc/examples/diffs/echo/blocking_udp_echo_server.cpp.html @@ -0,0 +1,93 @@ + + + + + + + HTML Diff echo/blocking_udp_echo_server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​echo/​blocking_udp_echo_ser​ver.​cppsrc/​examples/​cpp11/​echo/​blocking_udp_echo_ser​ver.​cpp
1 /​/​1 /​/​
2 /​/​·​blocking_udp_echo_ser​ver.​cpp2 /​/​·​blocking_udp_echo_ser​ver.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<iostream>12 #include·​<iostream>
13 #include·​"asio.​hpp"13 #include·​"asio.​hpp"
14 14
15 using·​asio:​:​ip:​:​udp;​15 using·​asio:​:​ip:​:​udp;​
16 16
17 enum·​{·​max_length·​=·​1024·​};​17 enum·​{·​max_length·​=·​1024·​};​
18 18
19 void·​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​19 void·​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​
20 {20 {
21 ··​udp:​:​socket·​sock(io_context,​·​udp:​:​endpoint(udp:​:​v4()​,​·​port)​)​;​21 ··​udp:​:​socket·​sock(io_context,​·​udp:​:​endpoint(udp:​:​v4()​,​·​port)​)​;​
22 ··​for·​(;​;​)​22 ··​for·​(;​;​)​
23 ··​{23 ··​{
24 ····​char·​data[max_length];​24 ····​char·​data[max_length];​
25 ····​udp:​:​endpoint·​sender_endpoint;​25 ····​udp:​:​endpoint·​sender_endpoint;​
26 ····​size_t·​length·​=·​sock.​receive_from(26 ····​size_t·​length·​=·​sock.​receive_from(
27 ········​asio:​:​buffer(data,​·​max_length)​,​·​sender_endpoint)​;​27 ········​asio:​:​buffer(data,​·​max_length)​,​·​sender_endpoint)​;​
28 ····​sock.​send_to(asio:​:​buffer(data,​·​length)​,​·​sender_endpoint)​;​28 ····​sock.​send_to(asio:​:​buffer(data,​·​length)​,​·​sender_endpoint)​;​
29 ··​}29 ··​}
30 }30 }
31 31
32 int·​main(int·​argc,​·​char*·​argv[])​32 int·​main(int·​argc,​·​char*·​argv[])​
33 {33 {
34 ··​try34 ··​try
35 ··​{35 ··​{
36 ····​if·​(argc·​!=·​2)​36 ····​if·​(argc·​!=·​2)​
37 ····​{37 ····​{
38 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_udp_echo_ser​ver·​<port>\n";​38 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_udp_echo_ser​ver·​<port>\n";​
39 ······​return·​1;​39 ······​return·​1;​
40 ····​}40 ····​}
41 41
42 ····​asio:​:​io_context·​io_context;​42 ····​asio:​:​io_context·​io_context;​
43 43
44 ····using·namespace·​std;​·/​/​·For·atoi.​44 ····server(io_context,​·​std:​:​atoi(argv[1])​)​;​
45 ····server(io_context,​·atoi(argv[1])​)​;​
46 ··​}45 ··​}
47 ··​catch·​(std:​:​exception&·​e)​46 ··​catch·​(std:​:​exception&·​e)​
48 ··​{47 ··​{
49 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​48 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
50 ··​}49 ··​}
51 50
52 ··​return·​0;​51 ··​return·​0;​
53 }52 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/executors/actor.cpp.html b/include/asio/doc/examples/diffs/executors/actor.cpp.html new file mode 100644 index 0000000..16b19e3 --- /dev/null +++ b/include/asio/doc/examples/diffs/executors/actor.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff executors/actor.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/executors/bank_account_1.cpp.html b/include/asio/doc/examples/diffs/executors/bank_account_1.cpp.html new file mode 100644 index 0000000..9dc99c7 --- /dev/null +++ b/include/asio/doc/examples/diffs/executors/bank_account_1.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff executors/bank_account_1.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/executors/bank_account_2.cpp.html b/include/asio/doc/examples/diffs/executors/bank_account_2.cpp.html new file mode 100644 index 0000000..c74edd2 --- /dev/null +++ b/include/asio/doc/examples/diffs/executors/bank_account_2.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff executors/bank_account_2.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/executors/fork_join.cpp.html b/include/asio/doc/examples/diffs/executors/fork_join.cpp.html new file mode 100644 index 0000000..275ebca --- /dev/null +++ b/include/asio/doc/examples/diffs/executors/fork_join.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff executors/fork_join.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/executors/pipeline.cpp.html b/include/asio/doc/examples/diffs/executors/pipeline.cpp.html new file mode 100644 index 0000000..ac969bb --- /dev/null +++ b/include/asio/doc/examples/diffs/executors/pipeline.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff executors/pipeline.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/executors/priority_scheduler.cpp.html b/include/asio/doc/examples/diffs/executors/priority_scheduler.cpp.html new file mode 100644 index 0000000..17163d2 --- /dev/null +++ b/include/asio/doc/examples/diffs/executors/priority_scheduler.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff executors/priority_scheduler.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/fork/daemon.cpp.html b/include/asio/doc/examples/diffs/fork/daemon.cpp.html new file mode 100644 index 0000000..0b118f6 --- /dev/null +++ b/include/asio/doc/examples/diffs/fork/daemon.cpp.html @@ -0,0 +1,234 @@ + + + + + + + HTML Diff fork/daemon.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​fork/​daemon.​cppsrc/​examples/​cpp11/​fork/​daemon.​cpp
1 /​/​1 /​/​
2 /​/​·​daemon.​cpp2 /​/​·​daemon.​cpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<asio/​io_context.​hpp>11 #include·​<asio/​io_context.​hpp>
12 #include·​<asio/​ip/​udp.​hpp>12 #include·​<asio/​ip/​udp.​hpp>
13 #include·​<asio/​signal_set.​hpp>13 #include·​<asio/​signal_set.​hpp>
14 #include·​<boost/​array.​hpp>14 #include·​<array>
15 #include·<boost/​bind/​bind.​hpp>
16 #include·​<ctime>15 #include·​<ctime>
17 #include·​<iostream>16 #include·​<iostream>
18 #include·​<syslog.​h>17 #include·​<syslog.​h>
19 #include·​<unistd.​h>18 #include·​<unistd.​h>
20 19
21 using·​asio:​:​ip:​:​udp;​20 using·​asio:​:​ip:​:​udp;​
22 21
23 class·​udp_daytime_server22 class·​udp_daytime_server
24 {23 {
25 public:​24 public:​
26 ··​udp_daytime_server(as​io:​:​io_context&·​io_context)​25 ··​udp_daytime_server(as​io:​:​io_context&·​io_context)​
27 ····​:​·​socket_(io_context,​·udp:​:​endpoint(udp:​:​v4()​,​·​13)​)​26 ····​:​·​socket_(io_context,​·{udp:​:​v4()​,​·​13})​
28 ··​{27 ··​{
29 ····start_receive()​;​28 ····​receive()​;​
30 ··​}29 ··​}
31 30
32 private:​31 private:​
33 ··​void·start_receive()​32 ··​void·​receive()​
34 ··​{33 ··​{
35 ····​socket_.​async_receive_from(34 ····​socket_.​async_receive_from(
36 ········​asio:​:​buffer(recv_buffer_)​,​·​remote_endpoint_,​35 ········​asio:​:​buffer(recv_buffer_)​,​·​remote_endpoint_,​
37 ········boost:​:​bind(&udp_daytime_ser​ver:​:​handle_receive,​36 ········[this](std:​:​error_code·ec,​·std:​:​size_t·/​*n*/​)​
38 ··········this,​·boost:​:​placeholders:​:​_1)​)​;​37 ········{
39 ··}38 ··········if·(!ec)​
40 39 ··········{
41 ··void·handle_receive(const·asio:​:​error_code&·ec)​40 ············using·namespace·std;​·/​/​·For·time_t,​·time·and·ctime;​
42 ··{41 ············time_t·now·=·time(0)​;​
43 ····​if·(!ec)​42 ············std:​:​string·message·=·ctime(&now)​;​
44 ····{43
45 ······using·namespace·​std;​·/​/​·For·time_t,​·time·and·ctime;​44 ············​std:​:​error_code·​ignored_ec;​
46 ······​time_t·now·=·time(0)​;​45 ············socket_.​send_to(asio:​:​buffer(message)​,​
47 ······std:​:​string·message·=·ctime(&now)​;​46 ················remote_endpoint_,​·0,​·ignored_ec)​;​
48 47 ··········}
49 ······asio:​:​error_code·ignored_ec;​
50 ······socket_.​send_to(asio:​:​buffer(message)​,​
51 ··········remote_endpoint_,​·0,​·ignored_ec)​;​
52 ····}
53 48
54 ····start_receive()​;​49 ··········receive()​;​
50 ········​})​;​
55 ··​}51 ··​}
56 52
57 ··​udp:​:​socket·​socket_;​53 ··​udp:​:​socket·​socket_;​
58 ··​udp:​:​endpoint·​remote_endpoint_;​54 ··​udp:​:​endpoint·​remote_endpoint_;​
59 ··boost:​:​array<char,​·​1>·​recv_buffer_;​55 ··​std:​:​array<char,​·​1>·​recv_buffer_;​
60 };​56 };​
61 57
62 int·​main()​58 int·​main()​
63 {59 {
64 ··​try60 ··​try
65 ··​{61 ··​{
66 ····​asio:​:​io_context·​io_context;​62 ····​asio:​:​io_context·​io_context;​
67 63
68 ····​/​/​·​Initialise·​the·​server·​before·​becoming·​a·​daemon.​·​If·​the·​process·​is64 ····​/​/​·​Initialise·​the·​server·​before·​becoming·​a·​daemon.​·​If·​the·​process·​is
69 ····​/​/​·​started·​from·​a·​shell,​·​this·​means·​any·​errors·​will·​be·​reported·​back·​to·​the65 ····​/​/​·​started·​from·​a·​shell,​·​this·​means·​any·​errors·​will·​be·​reported·​back·​to·​the
70 ····​/​/​·​user.​66 ····​/​/​·​user.​
71 ····​udp_daytime_server·​server(io_context)​;​67 ····​udp_daytime_server·​server(io_context)​;​
72 68
73 ····​/​/​·​Register·​signal·​handlers·​so·​that·​the·​daemon·​may·​be·​shut·​down.​·​You·​may69 ····​/​/​·​Register·​signal·​handlers·​so·​that·​the·​daemon·​may·​be·​shut·​down.​·​You·​may
74 ····​/​/​·​also·​want·​to·​register·​for·​other·​signals,​·​such·​as·​SIGHUP·​to·​trigger·​a70 ····​/​/​·​also·​want·​to·​register·​for·​other·​signals,​·​such·​as·​SIGHUP·​to·​trigger·​a
75 ····​/​/​·​re-​read·​of·​a·​configuration·​file.​71 ····​/​/​·​re-​read·​of·​a·​configuration·​file.​
76 ····​asio:​:​signal_set·​signals(io_context,​·​SIGINT,​·​SIGTERM)​;​72 ····​asio:​:​signal_set·​signals(io_context,​·​SIGINT,​·​SIGTERM)​;​
77 ····​signals.​async_wait(73 ····​signals.​async_wait(
78 ········boost:​:​bind(&asio:​:​io_context:​:​stop,​·&io_context)​)​;​74 ········[&](std:​:​error_code·/​*ec*/​,​·int·/​*signo*/​)​
75 ········​{
76 ··········​io_context.​stop()​;​
77 ········​})​;​
79 78
80 ····​/​/​·​Inform·​the·​io_context·​that·​we·​are·​about·​to·​become·​a·​daemon.​·​The79 ····​/​/​·​Inform·​the·​io_context·​that·​we·​are·​about·​to·​become·​a·​daemon.​·​The
81 ····​/​/​·​io_context·​cleans·​up·​any·​internal·​resources,​·​such·​as·​threads,​·​that·​may80 ····​/​/​·​io_context·​cleans·​up·​any·​internal·​resources,​·​such·​as·​threads,​·​that·​may
82 ····​/​/​·​interfere·​with·​forking.​81 ····​/​/​·​interfere·​with·​forking.​
83 ····​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​82 ····​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​
84 83
85 ····​/​/​·​Fork·​the·​process·​and·​have·​the·​parent·​exit.​·​If·​the·​process·​was·​started84 ····​/​/​·​Fork·​the·​process·​and·​have·​the·​parent·​exit.​·​If·​the·​process·​was·​started
86 ····​/​/​·​from·​a·​shell,​·​this·​returns·​control·​to·​the·​user.​·​Forking·​a·​new·​process·​is85 ····​/​/​·​from·​a·​shell,​·​this·​returns·​control·​to·​the·​user.​·​Forking·​a·​new·​process·​is
87 ····​/​/​·​also·​a·​prerequisite·​for·​the·​subsequent·​call·​to·​setsid()​.​86 ····​/​/​·​also·​a·​prerequisite·​for·​the·​subsequent·​call·​to·​setsid()​.​
88 ····​if·​(pid_t·​pid·​=·​fork()​)​87 ····​if·​(pid_t·​pid·​=·​fork()​)​
89 ····​{88 ····​{
90 ······​if·​(pid·​>·​0)​89 ······​if·​(pid·​>·​0)​
91 ······​{90 ······​{
92 ········​/​/​·​We're·​in·​the·​parent·​process·​and·​need·​to·​exit.​91 ········​/​/​·​We're·​in·​the·​parent·​process·​and·​need·​to·​exit.​
93 ········​/​/​92 ········​/​/​
94 ········​/​/​·​When·​the·​exit()​·​function·​is·​used,​·​the·​program·​terminates·​without93 ········​/​/​·​When·​the·​exit()​·​function·​is·​used,​·​the·​program·​terminates·​without
95 ········​/​/​·​invoking·​local·​variables'·​destructors.​·​Only·​global·​variables·​are94 ········​/​/​·​invoking·​local·​variables'·​destructors.​·​Only·​global·​variables·​are
96 ········​/​/​·​destroyed.​·​As·​the·​io_context·​object·​is·​a·​local·​variable,​·​this·​means95 ········​/​/​·​destroyed.​·​As·​the·​io_context·​object·​is·​a·​local·​variable,​·​this·​means
97 ········​/​/​·​we·​do·​not·​have·​to·​call:​96 ········​/​/​·​we·​do·​not·​have·​to·​call:​
98 ········​/​/​97 ········​/​/​
99 ········​/​/​···​io_context.​notify_fork(asio:​:​io_context:​:​fork_parent)​;​98 ········​/​/​···​io_context.​notify_fork(asio:​:​io_context:​:​fork_parent)​;​
100 ········​/​/​99 ········​/​/​
101 ········​/​/​·​However,​·​this·​line·​should·​be·​added·​before·​each·​call·​to·​exit()​·​if100 ········​/​/​·​However,​·​this·​line·​should·​be·​added·​before·​each·​call·​to·​exit()​·​if
102 ········​/​/​·​using·​a·​global·​io_context·​object.​·​An·​additional·​call:​101 ········​/​/​·​using·​a·​global·​io_context·​object.​·​An·​additional·​call:​
103 ········​/​/​102 ········​/​/​
104 ········​/​/​···​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​103 ········​/​/​···​io_context.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​
105 ········​/​/​104 ········​/​/​
106 ········​/​/​·​should·​also·​precede·​the·​second·​fork()​.​105 ········​/​/​·​should·​also·​precede·​the·​second·​fork()​.​
107 ········​exit(0)​;​106 ········​exit(0)​;​
108 ······​}107 ······​}
109 ······​else108 ······​else
110 ······​{109 ······​{
111 ········​syslog(LOG_ERR·​|·​LOG_USER,​·​"First·​fork·​failed:​·​%m")​;​110 ········​syslog(LOG_ERR·​|·​LOG_USER,​·​"First·​fork·​failed:​·​%m")​;​
112 ········​return·​1;​111 ········​return·​1;​
113 ······​}112 ······​}
114 ····​}113 ····​}
115 114
116 ····​/​/​·​Make·​the·​process·​a·​new·​session·​leader.​·​This·​detaches·​it·​from·​the115 ····​/​/​·​Make·​the·​process·​a·​new·​session·​leader.​·​This·​detaches·​it·​from·​the
117 ····​/​/​·​terminal.​116 ····​/​/​·​terminal.​
118 ····​setsid()​;​117 ····​setsid()​;​
119 118
120 ····​/​/​·​A·​process·​inherits·​its·​working·​directory·​from·​its·​parent.​·​This·​could·​be119 ····​/​/​·​A·​process·​inherits·​its·​working·​directory·​from·​its·​parent.​·​This·​could·​be
121 ····​/​/​·​on·​a·​mounted·​filesystem,​·​which·​means·​that·​the·​running·​daemon·​would120 ····​/​/​·​on·​a·​mounted·​filesystem,​·​which·​means·​that·​the·​running·​daemon·​would
122 ····​/​/​·​prevent·​this·​filesystem·​from·​being·​unmounted.​·​Changing·​to·​the·​root121 ····​/​/​·​prevent·​this·​filesystem·​from·​being·​unmounted.​·​Changing·​to·​the·​root
123 ····​/​/​·​directory·​avoids·​this·​problem.​122 ····​/​/​·​directory·​avoids·​this·​problem.​
124 ····​chdir("/​")​;​123 ····​chdir("/​")​;​
125 124
126 ····​/​/​·​The·​file·​mode·​creation·​mask·​is·​also·​inherited·​from·​the·​parent·​process.​125 ····​/​/​·​The·​file·​mode·​creation·​mask·​is·​also·​inherited·​from·​the·​parent·​process.​
127 ····​/​/​·​We·​don't·​want·​to·​restrict·​the·​permissions·​on·​files·​created·​by·​the126 ····​/​/​·​We·​don't·​want·​to·​restrict·​the·​permissions·​on·​files·​created·​by·​the
128 ····​/​/​·​daemon,​·​so·​the·​mask·​is·​cleared.​127 ····​/​/​·​daemon,​·​so·​the·​mask·​is·​cleared.​
129 ····​umask(0)​;​128 ····​umask(0)​;​
130 129
131 ····​/​/​·​A·​second·​fork·​ensures·​the·​process·​cannot·​acquire·​a·​controlling·​terminal.​130 ····​/​/​·​A·​second·​fork·​ensures·​the·​process·​cannot·​acquire·​a·​controlling·​terminal.​
132 ····​if·​(pid_t·​pid·​=·​fork()​)​131 ····​if·​(pid_t·​pid·​=·​fork()​)​
133 ····​{132 ····​{
134 ······​if·​(pid·​>·​0)​133 ······​if·​(pid·​>·​0)​
135 ······​{134 ······​{
136 ········​exit(0)​;​135 ········​exit(0)​;​
137 ······​}136 ······​}
138 ······​else137 ······​else
139 ······​{138 ······​{
140 ········​syslog(LOG_ERR·​|·​LOG_USER,​·​"Second·​fork·​failed:​·​%m")​;​139 ········​syslog(LOG_ERR·​|·​LOG_USER,​·​"Second·​fork·​failed:​·​%m")​;​
141 ········​return·​1;​140 ········​return·​1;​
142 ······​}141 ······​}
143 ····​}142 ····​}
144 143
145 ····​/​/​·​Close·​the·​standard·​streams.​·​This·​decouples·​the·​daemon·​from·​the·​terminal144 ····​/​/​·​Close·​the·​standard·​streams.​·​This·​decouples·​the·​daemon·​from·​the·​terminal
146 ····​/​/​·​that·​started·​it.​145 ····​/​/​·​that·​started·​it.​
147 ····​close(0)​;​146 ····​close(0)​;​
148 ····​close(1)​;​147 ····​close(1)​;​
149 ····​close(2)​;​148 ····​close(2)​;​
150 149
151 ····​/​/​·​We·​don't·​want·​the·​daemon·​to·​have·​any·​standard·​input.​150 ····​/​/​·​We·​don't·​want·​the·​daemon·​to·​have·​any·​standard·​input.​
152 ····​if·​(open("/​dev/​null",​·​O_RDONLY)​·​<·​0)​151 ····​if·​(open("/​dev/​null",​·​O_RDONLY)​·​<·​0)​
153 ····​{152 ····​{
154 ······​syslog(LOG_ERR·​|·​LOG_USER,​·​"Unable·​to·​open·​/​dev/​null:​·​%m")​;​153 ······​syslog(LOG_ERR·​|·​LOG_USER,​·​"Unable·​to·​open·​/​dev/​null:​·​%m")​;​
155 ······​return·​1;​154 ······​return·​1;​
156 ····​}155 ····​}
157 156
158 ····​/​/​·​Send·​standard·​output·​to·​a·​log·​file.​157 ····​/​/​·​Send·​standard·​output·​to·​a·​log·​file.​
159 ····​const·​char*·​output·​=·​"/​tmp/​asio.​daemon.​out";​158 ····​const·​char*·​output·​=·​"/​tmp/​asio.​daemon.​out";​
160 ····​const·​int·​flags·​=·​O_WRONLY·​|·​O_CREAT·​|·​O_APPEND;​159 ····​const·​int·​flags·​=·​O_WRONLY·​|·​O_CREAT·​|·​O_APPEND;​
161 ····​const·​mode_t·​mode·​=·​S_IRUSR·​|·​S_IWUSR·​|·​S_IRGRP·​|·​S_IROTH;​160 ····​const·​mode_t·​mode·​=·​S_IRUSR·​|·​S_IWUSR·​|·​S_IRGRP·​|·​S_IROTH;​
162 ····​if·​(open(output,​·​flags,​·​mode)​·​<·​0)​161 ····​if·​(open(output,​·​flags,​·​mode)​·​<·​0)​
163 ····​{162 ····​{
164 ······​syslog(LOG_ERR·​|·​LOG_USER,​·​"Unable·​to·​open·​output·​file·​%s:​·​%m",​·​output)​;​163 ······​syslog(LOG_ERR·​|·​LOG_USER,​·​"Unable·​to·​open·​output·​file·​%s:​·​%m",​·​output)​;​
165 ······​return·​1;​164 ······​return·​1;​
166 ····​}165 ····​}
167 166
168 ····​/​/​·​Also·​send·​standard·​error·​to·​the·​same·​log·​file.​167 ····​/​/​·​Also·​send·​standard·​error·​to·​the·​same·​log·​file.​
169 ····​if·​(dup(1)​·​<·​0)​168 ····​if·​(dup(1)​·​<·​0)​
170 ····​{169 ····​{
171 ······​syslog(LOG_ERR·​|·​LOG_USER,​·​"Unable·​to·​dup·​output·​descriptor:​·​%m")​;​170 ······​syslog(LOG_ERR·​|·​LOG_USER,​·​"Unable·​to·​dup·​output·​descriptor:​·​%m")​;​
172 ······​return·​1;​171 ······​return·​1;​
173 ····​}172 ····​}
174 173
175 ····​/​/​·​Inform·​the·​io_context·​that·​we·​have·​finished·​becoming·​a·​daemon.​·​The174 ····​/​/​·​Inform·​the·​io_context·​that·​we·​have·​finished·​becoming·​a·​daemon.​·​The
176 ····​/​/​·​io_context·​uses·​this·​opportunity·​to·​create·​any·​internal·​file·​descriptors175 ····​/​/​·​io_context·​uses·​this·​opportunity·​to·​create·​any·​internal·​file·​descriptors
177 ····​/​/​·​that·​need·​to·​be·​private·​to·​the·​new·​process.​176 ····​/​/​·​that·​need·​to·​be·​private·​to·​the·​new·​process.​
178 ····​io_context.​notify_fork(asio:​:​io_context:​:​fork_child)​;​177 ····​io_context.​notify_fork(asio:​:​io_context:​:​fork_child)​;​
179 178
180 ····​/​/​·​The·​io_context·​can·​now·​be·​used·​normally.​179 ····​/​/​·​The·​io_context·​can·​now·​be·​used·​normally.​
181 ····​syslog(LOG_INFO·​|·​LOG_USER,​·​"Daemon·​started")​;​180 ····​syslog(LOG_INFO·​|·​LOG_USER,​·​"Daemon·​started")​;​
182 ····​io_context.​run()​;​181 ····​io_context.​run()​;​
183 ····​syslog(LOG_INFO·​|·​LOG_USER,​·​"Daemon·​stopped")​;​182 ····​syslog(LOG_INFO·​|·​LOG_USER,​·​"Daemon·​stopped")​;​
184 ··​}183 ··​}
185 ··​catch·​(std:​:​exception&·​e)​184 ··​catch·​(std:​:​exception&·​e)​
186 ··​{185 ··​{
187 ····​syslog(LOG_ERR·​|·​LOG_USER,​·​"Exception:​·​%s",​·​e.​what()​)​;​186 ····​syslog(LOG_ERR·​|·​LOG_USER,​·​"Exception:​·​%s",​·​e.​what()​)​;​
188 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​std:​:​endl;​187 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​std:​:​endl;​
189 ··​}188 ··​}
190 }189 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/fork/process_per_connection.cpp.html b/include/asio/doc/examples/diffs/fork/process_per_connection.cpp.html new file mode 100644 index 0000000..51f10f8 --- /dev/null +++ b/include/asio/doc/examples/diffs/fork/process_per_connection.cpp.html @@ -0,0 +1,276 @@ + + + + + + + HTML Diff fork/process_per_connection.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​fork/​process_per_connectio​n.​cppsrc/​examples/​cpp11/​fork/​process_per_connectio​n.​cpp
1 /​/​1 /​/​
2 /​/​·​process_per_connectio​n.​cpp2 /​/​·​process_per_connectio​n.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<asio/​io_context.​hpp>11 #include·​<asio/​io_context.​hpp>
12 #include·​<asio/​ip/​tcp.​hpp>12 #include·​<asio/​ip/​tcp.​hpp>
13 #include·​<asio/​signal_set.​hpp>13 #include·​<asio/​signal_set.​hpp>
14 #include·​<asio/​write.​hpp>14 #include·​<asio/​write.​hpp>
15 #include·​<boost/​array.​hpp>
16 #include·​<boost/​bind/​bind.​hpp>
17 #include·​<cstdlib>15 #include·​<cstdlib>
18 #include·​<iostream>16 #include·​<iostream>
19 #include·​<sys/​types.​h>17 #include·​<sys/​types.​h>
20 #include·​<sys/​wait.​h>18 #include·​<sys/​wait.​h>
21 #include·​<unistd.​h>19 #include·​<unistd.​h>
22 20
23 using·​asio:​:​ip:​:​tcp;​21 using·​asio:​:​ip:​:​tcp;​
24 22
25 class·​server23 class·​server
26 {24 {
27 public:​25 public:​
28 ··​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​26 ··​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​
29 ····​:​·​io_context_(io_contex​t)​,​27 ····​:​·​io_context_(io_contex​t)​,​
30 ······​signal_(io_context,​·​SIGCHLD)​,​28 ······​signal_(io_context,​·​SIGCHLD)​,​
31 ······​acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·​port)​)​,​29 ······​acceptor_(io_context,​·{tcp:​:​v4()​,​·​port})​,​
32 ······​socket_(io_context)​30 ······​socket_(io_context)​
33 ··​{31 ··​{
34 ····start_signal_wait()​;​32 ····wait_for_signal()​;​
35 ····start_accept()​;​33 ····​accept()​;​
36 ··​}34 ··​}
37 35
38 private:​36 private:​
39 ··​void·start_signal_wait()​37 ··​void·wait_for_signal()​
40 ··​{38 ··​{
41 ····​signal_.​async_wait(boost:​:​bind(&server:​:​handle_signal_wait,​·this)​)​;​39 ····​signal_.​async_wait(
40 ········​[this](std:​:​error_code·​/​*ec*/​,​·​int·​/​*signo*/​)​
41 ········​{
42 ··········​/​/​·​Only·​the·​parent·​process·​should·​check·​for·​this·​signal.​·​We·​can
43 ··········​/​/​·​determine·​whether·​we·​are·​in·​the·​parent·​by·​checking·​if·​the·​acceptor
44 ··········​/​/​·​is·​still·​open.​
45 ··········​if·​(acceptor_.​is_open()​)​
46 ··········​{
47 ············​/​/​·​Reap·​completed·​child·​processes·​so·​that·​we·​don't·​end·​up·​with
48 ············​/​/​·​zombies.​
49 ············​int·​status·​=·​0;​
50 ············​while·​(waitpid(-​1,​·​&status,​·​WNOHANG)​·​>·​0)​·​{}
51
52 ············​wait_for_signal()​;​
53 ··········​}
54 ········​})​;​
55 ··​}
56
57 ··​void·​accept()​
58 ··​{
59 ····​acceptor_.​async_accept(
60 ········​[this](std:​:​error_code·​ec,​·​tcp:​:​socket·​new_socket)​
61 ········​{
62 ··········​if·​(!ec)​
63 ··········​{
64 ············​/​/​·​Take·​ownership·​of·​the·​newly·​accepted·​socket.​
65 ············​socket_·​=·​std:​:​move(new_socket)​;​
66
67 ············​/​/​·​Inform·​the·​io_context·​that·​we·​are·​about·​to·​fork.​·​The·​io_context
68 ············​/​/​·​cleans·​up·​any·​internal·​resources,​·​such·​as·​threads,​·​that·​may
69 ············​/​/​·​interfere·​with·​forking.​
70 ············​io_context_.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​
71
72 ············​if·​(fork()​·​==·​0)​
73 ············​{
74 ··············​/​/​·​Inform·​the·​io_context·​that·​the·​fork·​is·​finished·​and·​that·​this
75 ··············​/​/​·​is·​the·​child·​process.​·​The·​io_context·​uses·​this·​opportunity·​to
76 ··············​/​/​·​create·​any·​internal·​file·​descriptors·​that·​must·​be·​private·​to
77 ··············​/​/​·​the·​new·​process.​
78 ··············​io_context_.​notify_fork(asio:​:​io_context:​:​fork_child)​;​
79
80 ··············​/​/​·​The·​child·​won't·​be·​accepting·​new·​connections,​·​so·​we·​can·​close
81 ··············​/​/​·​the·​acceptor.​·​It·​remains·​open·​in·​the·​parent.​
82 ··············​acceptor_.​close()​;​
83
84 ··············​/​/​·​The·​child·​process·​is·​not·​interested·​in·​processing·​the·​SIGCHLD
85 ··············​/​/​·​signal.​
86 ··············​signal_.​cancel()​;​
87
88 ··············​read()​;​
89 ············​}
90 ············​else
91 ············​{
92
93 ··············​/​/​·​Inform·​the·​io_context·​that·​the·​fork·​is·​finished·​(or·​failed)​
94 ··············​/​/​·​and·​that·​this·​is·​the·​parent·​process.​·​The·​io_context·​uses·​this
95 ··············​/​/​·​opportunity·​to·​recreate·​any·​internal·​resources·​that·​were
96 ··············​/​/​·​cleaned·​up·​during·​preparation·​for·​the·​fork.​
97 ··············​io_context_.​notify_fork(asio:​:​io_context:​:​fork_parent)​;​
98
99 ··············​/​/​·​The·​parent·​process·​can·​now·​close·​the·​newly·​accepted·​socket.​·​It
100 ··············​/​/​·​remains·​open·​in·​the·​child.​
101 ··············​socket_.​close()​;​
102
103 ··············​accept()​;​
104 ············​}
105 ··········​}
106 ··········​else
107 ··········​{
108 ············​std:​:​cerr·​<<·​"Accept·​error:​·​"·​<<·​ec.​message()​·​<<·​std:​:​endl;​
109 ············​accept()​;​
110 ··········​}
111 ········​})​;​
42 ··​}112 ··​}
43 113
44 ··​void·handle_signal_wait()​114 ··​void·read()​
45 ··{
46 ····/​/​·Only·the·parent·process·should·check·for·this·signal.​·We·can·determine
47 ····/​/​·whether·we·are·in·the·parent·by·checking·if·the·acceptor·is·still·open.​
48 ····if·(acceptor_.​is_open()​)​
49 ····{
50 ······/​/​·Reap·completed·child·processes·so·that·we·don't·end·up·with·zombies.​
51 ······int·status·=·0;​
52 ······while·(waitpid(-​1,​·&status,​·WNOHANG)​·>·0)​·{}
53
54 ······start_signal_wait()​;​
55 ····}
56 ··}
57
58 ··void·start_accept()​
59 ··{
60 ····acceptor_.​async_accept(socket_,​
61 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·boost:​:​placeholders:​:​_1)​)​;​
62 ··}
63
64 ··void·handle_accept(const·asio:​:​error_code&·ec)​
65 ··{
66 ····if·(!ec)​
67 ····{
68 ······/​/​·Inform·the·io_context·that·we·are·about·to·fork.​·The·io_context·cleans
69 ······/​/​·up·any·internal·resources,​·such·as·threads,​·that·may·interfere·with
70 ······/​/​·forking.​
71 ······io_context_.​notify_fork(asio:​:​io_context:​:​fork_prepare)​;​
72
73 ······if·(fork()​·==·0)​
74 ······{
75 ········/​/​·Inform·the·io_context·that·the·fork·is·finished·and·that·this·is·the
76 ········/​/​·child·process.​·The·io_context·uses·this·opportunity·to·create·any
77 ········/​/​·internal·file·descriptors·that·must·be·private·to·the·new·process.​
78 ········io_context_.​notify_fork(asio:​:​io_context:​:​fork_child)​;​
79
80 ········/​/​·The·child·won't·be·accepting·new·connections,​·so·we·can·close·the
81 ········/​/​·acceptor.​·It·remains·open·in·the·parent.​
82 ········acceptor_.​close()​;​
83
84 ········/​/​·The·child·process·is·not·interested·in·processing·the·SIGCHLD·signal.​
85 ········signal_.​cancel()​;​
86
87 ········start_read()​;​
88 ······}
89 ······else
90 ······{
91 ········/​/​·Inform·the·io_context·that·the·fork·is·finished·(or·failed)​·and·that
92 ········/​/​·this·is·the·parent·process.​·The·io_context·uses·this·opportunity·to
93 ········/​/​·recreate·any·internal·resources·that·were·cleaned·up·during
94 ········/​/​·preparation·for·the·fork.​
95 ········io_context_.​notify_fork(asio:​:​io_context:​:​fork_parent)​;​
96
97 ········socket_.​close()​;​
98 ········start_accept()​;​
99 ······}
100 ····}
101 ····else
102 ····{
103 ······std:​:​cerr·<<·"Accept·error:​·"·<<·ec.​message()​·<<·std:​:​endl;​
104 ······start_accept()​;​
105 ····}
106 ··}
107
108 ··void·start_read()​
109 ··​{115 ··​{
110 ····​socket_.​async_read_some(asio:​:​buffer(data_)​,​116 ····​socket_.​async_read_some(asio:​:​buffer(data_)​,​
111 ········boost:​:​bind(&server:​:​handle_read,​·this,​117 ········[this](std:​:​error_code·ec,​·std:​:​size_t·length)​
112 ··········boost:​:​placeholders:​:​_1,​·boost:​:​placeholders:​:​_2)​)​;​118 ········{
119 ··········​if·​(!ec)​
120 ············​write(length)​;​
121 ········​})​;​
113 ··​}122 ··​}
114 123
115 ··​void·handle_read(const·asio:​:​error_code&·ec,​·std:​:​size_t·​length)​124 ··​void·write(std:​:​size_t·​length)​
116 ··{
117 ····if·(!ec)​
118 ······start_write(length)​;​
119 ··}
120
121 ··void·start_write(std:​:​size_t·length)​
122 ··​{125 ··​{
123 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer(data_,​·​length)​,​126 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer(data_,​·​length)​,​
124 ········boost:​:​bind(&server:​:​handle_write,​·this,​·boost:​:​placeholders:​:​_1)​)​;​127 ········[this](std:​:​error_code·ec,​·​std:​:​size_t·/​*length*/​)​
125 ··}128 ········{
126 129 ··········if·(!ec)​
127 ··void·handle_write(const·asio:​:​error_code&·ec)​130 ············read()​;​
128 ··{131 ········})​;​
129 ····if·(!ec)​
130 ······start_read()​;​
131 ··​}132 ··​}
132 133
133 ··​asio:​:​io_context&·​io_context_;​134 ··​asio:​:​io_context&·​io_context_;​
134 ··​asio:​:​signal_set·​signal_;​135 ··​asio:​:​signal_set·​signal_;​
135 ··​tcp:​:​acceptor·​acceptor_;​136 ··​tcp:​:​acceptor·​acceptor_;​
136 ··​tcp:​:​socket·​socket_;​137 ··​tcp:​:​socket·​socket_;​
137 ··boost:​:​array<char,​·​1024>·​data_;​138 ··​std:​:​array<char,​·​1024>·​data_;​
138 };​139 };​
139 140
140 int·​main(int·​argc,​·​char*·​argv[])​141 int·​main(int·​argc,​·​char*·​argv[])​
141 {142 {
142 ··​try143 ··​try
143 ··​{144 ··​{
144 ····​if·​(argc·​!=·​2)​145 ····​if·​(argc·​!=·​2)​
145 ····​{146 ····​{
146 ······​std:​:​cerr·​<<·​"Usage:​·​process_per_connectio​n·​<port>\n";​147 ······​std:​:​cerr·​<<·​"Usage:​·​process_per_connectio​n·​<port>\n";​
147 ······​return·​1;​148 ······​return·​1;​
148 ····​}149 ····​}
149 150
150 ····​asio:​:​io_context·​io_context;​151 ····​asio:​:​io_context·​io_context;​
151 152
152 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​153 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​
153 ····​server·​s(io_context,​·​atoi(argv[1])​)​;​154 ····​server·​s(io_context,​·​atoi(argv[1])​)​;​
154 155
155 ····​io_context.​run()​;​156 ····​io_context.​run()​;​
156 ··​}157 ··​}
157 ··​catch·​(std:​:​exception&·​e)​158 ··​catch·​(std:​:​exception&·​e)​
158 ··​{159 ··​{
159 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​std:​:​endl;​160 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​std:​:​endl;​
160 ··​}161 ··​}
161 }162 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/futures/daytime_client.cpp.html b/include/asio/doc/examples/diffs/futures/daytime_client.cpp.html new file mode 100644 index 0000000..82dc7ca --- /dev/null +++ b/include/asio/doc/examples/diffs/futures/daytime_client.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff futures/daytime_client.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/handler_tracking/async_tcp_echo_server.cpp.html b/include/asio/doc/examples/diffs/handler_tracking/async_tcp_echo_server.cpp.html new file mode 100644 index 0000000..85cabda --- /dev/null +++ b/include/asio/doc/examples/diffs/handler_tracking/async_tcp_echo_server.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff handler_tracking/async_tcp_echo_server.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/handler_tracking/custom_tracking.hpp.html b/include/asio/doc/examples/diffs/handler_tracking/custom_tracking.hpp.html new file mode 100644 index 0000000..3ba64fb --- /dev/null +++ b/include/asio/doc/examples/diffs/handler_tracking/custom_tracking.hpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff handler_tracking/custom_tracking.hpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/connection.cpp.html b/include/asio/doc/examples/diffs/http/server/connection.cpp.html new file mode 100644 index 0000000..91397a4 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/connection.cpp.html @@ -0,0 +1,144 @@ + + + + + + + HTML Diff http/server/connection.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​connection.​cppsrc/​examples/​cpp11/​http/​server/​connection.​cpp
1 /​/​1 /​/​
2 /​/​·​connection.​cpp2 /​/​·​connection.​cpp
3 /​/​·​~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"connection.​hpp"11 #include·​"connection.​hpp"
12 #include·​<utility>
12 #include·​<vector>13 #include·​<vector>
13 #include·​<boost/​bind/​bind.​hpp>
14 #include·​"connection_manager.​hpp"14 #include·​"connection_manager.​hpp"
15 #include·​"request_handler.​hpp"15 #include·​"request_handler.​hpp"
16 16
17 namespace·​http·​{17 namespace·​http·​{
18 namespace·​server·​{18 namespace·​server·​{
19 19
20 connection:​:​connection(asio:​:​io_context&·io_context,​20 connection:​:​connection(asio:​:​ip:​:​tcp:​:​socket·socket,​
21 ····​connection_manager&·​manager,​·​request_handler&·​handler)​21 ····​connection_manager&·​manager,​·​request_handler&·​handler)​
22 ··​:​·​socket_(io_context)​,​22 ··​:​·​socket_(std:​:​move(socket)​)​,​
23 ····​connection_manager_(m​anager)​,​23 ····​connection_manager_(m​anager)​,​
24 ····​request_handler_(hand​ler)​24 ····​request_handler_(hand​ler)​
25 {25 {
26 }26 }
27 27
28 asio:​:​ip:​:​tcp:​:​socket&·​connection:​:​socket()​
29 {
30 ··​return·​socket_;​
31 }
32
33 void·​connection:​:​start()​28 void·​connection:​:​start()​
34 {29 {
35 ··socket_.​async_read_some(asio:​:​buffer(buffer_)​,​30 ··do_read()​;​
36 ······boost:​:​bind(&connection:​:​handle_read,​·shared_from_this()​,​
37 ········asio:​:​placeholders:​:​error,​
38 ········asio:​:​placeholders:​:​bytes_transferred)​)​;​
39 }31 }
40 32
41 void·​connection:​:​stop()​33 void·​connection:​:​stop()​
42 {34 {
43 ··​socket_.​close()​;​35 ··​socket_.​close()​;​
44 }36 }
45 37
46 void·​connection:​:​handle_read(const·asio:​:​error_code&·e,​38 void·​connection:​:​do_read()​
47 ····std:​:​size_t·bytes_transferred)​
48 {39 {
49 ··if·​(!e)​40 ··auto·self(shared_from_this​()​)​;​
50 ··{41 ··socket_.​async_read_some(asio:​:​buffer(buffer_)​,​
51 ····boost:​:​tribool·result;​42 ······[this,​·self](std:​:​error_code·ec,​·std:​:​size_t·bytes_transferred)​
52 ····boost:​:​tie(result,​·boost:​:​tuples:​:​ignore)​·=·request_parser_.​parse(43 ······{
53 ········request_,​·buffer_.​data()​,​·buffer_.​data()​·+·bytes_transferred)​;​44 ········if·​(!ec)​
54 45 ········{
55 ····if·(result)​46 ··········request_parser:​:​result_type·result;​
56 ····{47 ··········std:​:​tie(result,​·std:​:​ignore)​·=·request_parser_.​parse(
57 ······​request_handler_.​handle_request(reques​t_,​·reply_)​;​48 ··············​request_,​·buffer_.​data()​,​·buffer_.​data()​·+·bytes_transferred)​;​
58 ······asio:​:​async_write(socket_,​·reply_.​to_buffers()​,​49
59 ··········boost:​:​bind(&connection:​:​handle_write,​·shared_from_this()​,​50 ··········​if·(result·==·request_parser:​:​good)​
60 ············asio:​:​placeholders:​:​error)​)​;​51 ··········{
61 ····}52 ············request_handler_.​handle_request(reques​t_,​·reply_)​;​
62 ····else·if·(!result)​53 ············do_write()​;​
63 ····{54 ··········}
64 ······reply_·=·​reply:​:​stock_reply(reply:​:​bad_request)​;​55 ··········else·if·(result·==·request_parser:​:​bad)​
65 ······asio:​:​async_write(socket_,​·reply_.​to_buffers()​,​56 ··········{
66 ··········boost:​:​bind(&connection:​:​handle_write,​·shared_from_this()​,​57 ············reply_·=·reply:​:​stock_reply(reply:​:​bad_request)​;​
67 ············asio:​:​placeholders:​:​error)​)​;​58 ············do_write()​;​
68 ····​}59 ··········​}
69 ····​else60 ··········​else
70 ····​{61 ··········​{
71 ······socket_.​async_read_some(asio:​:​buffer(buffer_)​,​62 ············do_read()​;​
72 ··········boost:​:​bind(&connection:​:​handle_read,​·shared_from_this()​,​63 ··········}
73 ············asio:​:​placeholders:​:​error,​64 ········}
74 ············​asio:​:​placeholders:​:​bytes_transferred)​)​;​65 ········else·if·(ec·!=·​asio:​:​error:​:​operation_aborted)​
75 ····}66 ········{
76 ··}67 ··········connection_manager_.​stop(shared_from_this​()​)​;​
77 ··else·if·(e·!=·asio:​:​error:​:​operation_aborted)​68 ········}
78 ··{69 ······})​;​
79 ····connection_manager_.​stop(shared_from_this​()​)​;​70 }
80 ··}71
81 }72 void·connection:​:​do_write()​
82 73 {
83 void·connection:​:​handle_write(const·asio:​:​error_code&·e)​74 ··auto·self(shared_from_this​()​)​;​
84 {75 ··asio:​:​async_write(socket_,​·reply_.​to_buffers()​,​
85 ··​if·(!e)​76 ······[this,​·self](std:​:​error_code·ec,​·std:​:​size_t)​
86 ··​{77 ······​{
87 ····/​/​·Initiate·graceful·connection·closure.​78 ········if·(!ec)​
88 ····asio:​:​error_code·ignored_ec;​79 ········{
89 ····socket_.​shutdown(asio:​:​ip:​:​tcp:​:​socket:​:​shutdown_both,​·ignored_ec)​;​80 ··········/​/​·Initiate·graceful·connection·closure.​
90 ··}81 ··········asio:​:​error_code·ignored_ec;​
91 82 ··········socket_.​shutdown(asio:​:​ip:​:​tcp:​:​socket:​:​shutdown_both,​
92 ··if·(e·!=·asio:​:​error:​:​operation_aborted)​83 ············ignored_ec)​;​
93 ··{84 ········}
94 ····connection_manager_.​stop(shared_from_this​()​)​;​85
95 ··}86 ········if·(ec·!=·asio:​:​error:​:​operation_aborted)​
87 ········​{
88 ··········​connection_manager_.​stop(shared_from_this​()​)​;​
89 ········​}
90 ······​})​;​
96 }91 }
97 92
98 }·​/​/​·​namespace·​server93 }·​/​/​·​namespace·​server
99 }·​/​/​·​namespace·​http94 }·​/​/​·​namespace·​http
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/connection.hpp.html b/include/asio/doc/examples/diffs/http/server/connection.hpp.html new file mode 100644 index 0000000..51b3c7b --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/connection.hpp.html @@ -0,0 +1,126 @@ + + + + + + + HTML Diff http/server/connection.hpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​connection.​hppsrc/​examples/​cpp11/​http/​server/​connection.​hpp
1 /​/​1 /​/​
2 /​/​·​connection.​hpp2 /​/​·​connection.​hpp
3 /​/​·​~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #ifndef·​HTTP_CONNECTION_HPP11 #ifndef·​HTTP_CONNECTION_HPP
12 #define·​HTTP_CONNECTION_HPP12 #define·​HTTP_CONNECTION_HPP
13 13
14 #include·​<array>
15 #include·​<memory>
14 #include·​<asio.​hpp>16 #include·​<asio.​hpp>
15 #include·​<boost/​array.​hpp>
16 #include·​<boost/​noncopyable.​hpp>
17 #include·​<boost/​shared_ptr.​hpp>
18 #include·​<boost/​enable_shared_from_th​is.​hpp>
19 #include·​"reply.​hpp"17 #include·​"reply.​hpp"
20 #include·​"request.​hpp"18 #include·​"request.​hpp"
21 #include·​"request_handler.​hpp"19 #include·​"request_handler.​hpp"
22 #include·​"request_parser.​hpp"20 #include·​"request_parser.​hpp"
23 21
24 namespace·​http·​{22 namespace·​http·​{
25 namespace·​server·​{23 namespace·​server·​{
26 24
27 class·​connection_manager;​25 class·​connection_manager;​
28 26
29 /​/​/​·​Represents·​a·​single·​connection·​from·​a·​client.​27 /​/​/​·​Represents·​a·​single·​connection·​from·​a·​client.​
30 class·​connection28 class·​connection
31 ··​:​·​public·boost:​:​enable_shared_from_th​is<connection>,​29 ··​:​·​public·​std:​:​enable_shared_from_th​is<connection>
32 ····private·boost:​:​noncopyable
33 {30 {
34 public:​31 public:​
35 ··/​/​/​·Construct·a·​connection·with·the·given·io_context.​32 ··connection(const·​connection&)​·=·delete;​
36 ··explicit·connection(asio:​:​io_context&·io_context,​33 ··connection&·operator=(const·connection&)​·=·delete;​
37 ······connection_manager&·manager,​·request_handler&·handler)​;​
38 34
39 ··​/​/​/​·Get·the·socket·​associated·​with·​the·connection.​35 ··​/​/​/​·Construct·​a·connection·​with·​the·given·socket.​
40 ··​asio:​:​ip:​:​tcp:​:​socket&·​socket()​;​36 ··explicit·connection(asio:​:​ip:​:​tcp:​:​socket·​socket,​
37 ······​connection_manager&·​manager,​·​request_handler&·​handler)​;​
41 38
42 ··​/​/​/​·​Start·​the·​first·​asynchronous·​operation·​for·​the·​connection.​39 ··​/​/​/​·​Start·​the·​first·​asynchronous·​operation·​for·​the·​connection.​
43 ··​void·​start()​;​40 ··​void·​start()​;​
44 41
45 ··​/​/​/​·​Stop·​all·​asynchronous·​operations·​associated·​with·​the·​connection.​42 ··​/​/​/​·​Stop·​all·​asynchronous·​operations·​associated·​with·​the·​connection.​
46 ··​void·​stop()​;​43 ··​void·​stop()​;​
47 44
48 private:​45 private:​
49 ··​/​/​/​·Handle·completion·of·a·​read·​operation.​46 ··​/​/​/​·Perform·an·asynchronous·​read·​operation.​
50 ··​void·handle_read(const·asio:​:​error_code&·e,​47 ··​void·​do_read()​;​
51 ······std:​:​size_t·bytes_transferred)​;​
52 48
53 ··​/​/​/​·Handle·completion·of·a·​write·​operation.​49 ··​/​/​/​·Perform·an·asynchronous·​write·​operation.​
54 ··​void·handle_write(const·asio:​:​error_code&·e)​;​50 ··​void·​do_write()​;​
55 51
56 ··​/​/​/​·​Socket·​for·​the·​connection.​52 ··​/​/​/​·​Socket·​for·​the·​connection.​
57 ··​asio:​:​ip:​:​tcp:​:​socket·​socket_;​53 ··​asio:​:​ip:​:​tcp:​:​socket·​socket_;​
58 54
59 ··​/​/​/​·​The·​manager·​for·​this·​connection.​55 ··​/​/​/​·​The·​manager·​for·​this·​connection.​
60 ··​connection_manager&·​connection_manager_;​56 ··​connection_manager&·​connection_manager_;​
61 57
62 ··​/​/​/​·​The·​handler·​used·​to·​process·​the·​incoming·​request.​58 ··​/​/​/​·​The·​handler·​used·​to·​process·​the·​incoming·​request.​
63 ··​request_handler&·​request_handler_;​59 ··​request_handler&·​request_handler_;​
64 60
65 ··​/​/​/​·​Buffer·​for·​incoming·​data.​61 ··​/​/​/​·​Buffer·​for·​incoming·​data.​
66 ··boost:​:​array<char,​·​8192>·​buffer_;​62 ··​std:​:​array<char,​·​8192>·​buffer_;​
67 63
68 ··​/​/​/​·​The·​incoming·​request.​64 ··​/​/​/​·​The·​incoming·​request.​
69 ··​request·​request_;​65 ··​request·​request_;​
70 66
71 ··​/​/​/​·​The·​parser·​for·​the·​incoming·​request.​67 ··​/​/​/​·​The·​parser·​for·​the·​incoming·​request.​
72 ··​request_parser·​request_parser_;​68 ··​request_parser·​request_parser_;​
73 69
74 ··​/​/​/​·​The·​reply·​to·​be·​sent·​back·​to·​the·​client.​70 ··​/​/​/​·​The·​reply·​to·​be·​sent·​back·​to·​the·​client.​
75 ··​reply·​reply_;​71 ··​reply·​reply_;​
76 };​72 };​
77 73
78 typedef·boost:​:​shared_ptr<connection​>·​connection_ptr;​74 typedef·​std:​:​shared_ptr<connection​>·​connection_ptr;​
79 75
80 }·​/​/​·​namespace·​server76 }·​/​/​·​namespace·​server
81 }·​/​/​·​namespace·​http77 }·​/​/​·​namespace·​http
82 78
83 #endif·​/​/​·​HTTP_CONNECTION_HPP79 #endif·​/​/​·​HTTP_CONNECTION_HPP
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/connection_manager.cpp.html b/include/asio/doc/examples/diffs/http/server/connection_manager.cpp.html new file mode 100644 index 0000000..9acd733 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/connection_manager.cpp.html @@ -0,0 +1,82 @@ + + + + + + + HTML Diff http/server/connection_manager.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​connection_manager.​cppsrc/​examples/​cpp11/​http/​server/​connection_manager.​cpp
1 /​/​1 /​/​
2 /​/​·​connection_manager.​cpp2 /​/​·​connection_manager.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"connection_manager.​hpp"11 #include·​"connection_manager.​hpp"
12 #include·​<algorithm>
13 #include·​<boost/​bind/​bind.​hpp>
14 12
15 namespace·​http·​{13 namespace·​http·​{
16 namespace·​server·​{14 namespace·​server·​{
17 15
16 connection_manager:​:​connection_manager()​
17 {
18 }
19
18 void·​connection_manager:​:​start(connection_ptr·​c)​20 void·​connection_manager:​:​start(connection_ptr·​c)​
19 {21 {
20 ··​connections_.​insert(c)​;​22 ··​connections_.​insert(c)​;​
21 ··​c-​>start()​;​23 ··​c-​>start()​;​
22 }24 }
23 25
24 void·​connection_manager:​:​stop(connection_ptr·​c)​26 void·​connection_manager:​:​stop(connection_ptr·​c)​
25 {27 {
26 ··​connections_.​erase(c)​;​28 ··​connections_.​erase(c)​;​
27 ··​c-​>stop()​;​29 ··​c-​>stop()​;​
28 }30 }
29 31
30 void·​connection_manager:​:​stop_all()​32 void·​connection_manager:​:​stop_all()​
31 {33 {
32 ··std:​:​for_each(connections_​.​begin()​,​·​connections_.​end()​,​34 ··​for·(auto·c:​·​connections_)​
33 ······boost:​:​bind(&connection:​:​stop,​·boost:​:​placeholders:​:​_1)​)​;​35 ····​c-​>stop()​;​
34 ··​connections_.​clear()​;​36 ··​connections_.​clear()​;​
35 }37 }
36 38
37 }·​/​/​·​namespace·​server39 }·​/​/​·​namespace·​server
38 }·​/​/​·​namespace·​http40 }·​/​/​·​namespace·​http
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/connection_manager.hpp.html b/include/asio/doc/examples/diffs/http/server/connection_manager.hpp.html new file mode 100644 index 0000000..37d9089 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/connection_manager.hpp.html @@ -0,0 +1,90 @@ + + + + + + + HTML Diff http/server/connection_manager.hpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​connection_manager.​hppsrc/​examples/​cpp11/​http/​server/​connection_manager.​hpp
1 /​/​1 /​/​
2 /​/​·​connection_manager.​hpp2 /​/​·​connection_manager.​hpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #ifndef·​HTTP_CONNECTION_MANAG​ER_HPP11 #ifndef·​HTTP_CONNECTION_MANAG​ER_HPP
12 #define·​HTTP_CONNECTION_MANAG​ER_HPP12 #define·​HTTP_CONNECTION_MANAG​ER_HPP
13 13
14 #include·​<set>14 #include·​<set>
15 #include·​<boost/​noncopyable.​hpp>
16 #include·​"connection.​hpp"15 #include·​"connection.​hpp"
17 16
18 namespace·​http·​{17 namespace·​http·​{
19 namespace·​server·​{18 namespace·​server·​{
20 19
21 /​/​/​·​Manages·​open·​connections·​so·​that·​they·​may·​be·​cleanly·​stopped·​when·​the·​server20 /​/​/​·​Manages·​open·​connections·​so·​that·​they·​may·​be·​cleanly·​stopped·​when·​the·​server
22 /​/​/​·​needs·​to·​shut·​down.​21 /​/​/​·​needs·​to·​shut·​down.​
23 class·​connection_manager22 class·​connection_manager
24 ··​:​·​private·​boost:​:​noncopyable
25 {23 {
26 public:​24 public:​
25 ··​connection_manager(co​nst·​connection_manager&)​·​=·​delete;​
26 ··​connection_manager&·​operator=(const·​connection_manager&)​·​=·​delete;​
27
28 ··​/​/​/​·​Construct·​a·​connection·​manager.​
29 ··​connection_manager()​;​
30
27 ··​/​/​/​·​Add·​the·​specified·​connection·​to·​the·​manager·​and·​start·​it.​31 ··​/​/​/​·​Add·​the·​specified·​connection·​to·​the·​manager·​and·​start·​it.​
28 ··​void·​start(connection_ptr·​c)​;​32 ··​void·​start(connection_ptr·​c)​;​
29 33
30 ··​/​/​/​·​Stop·​the·​specified·​connection.​34 ··​/​/​/​·​Stop·​the·​specified·​connection.​
31 ··​void·​stop(connection_ptr·​c)​;​35 ··​void·​stop(connection_ptr·​c)​;​
32 36
33 ··​/​/​/​·​Stop·​all·​connections.​37 ··​/​/​/​·​Stop·​all·​connections.​
34 ··​void·​stop_all()​;​38 ··​void·​stop_all()​;​
35 39
36 private:​40 private:​
37 ··​/​/​/​·​The·​managed·​connections.​41 ··​/​/​/​·​The·​managed·​connections.​
38 ··​std:​:​set<connection_ptr>·​connections_;​42 ··​std:​:​set<connection_ptr>·​connections_;​
39 };​43 };​
40 44
41 }·​/​/​·​namespace·​server45 }·​/​/​·​namespace·​server
42 }·​/​/​·​namespace·​http46 }·​/​/​·​namespace·​http
43 47
44 #endif·​/​/​·​HTTP_CONNECTION_MANAG​ER_HPP48 #endif·​/​/​·​HTTP_CONNECTION_MANAG​ER_HPP
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/header.hpp.html b/include/asio/doc/examples/diffs/http/server/header.hpp.html new file mode 100644 index 0000000..0e845d8 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/header.hpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff http/server/header.hpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/main.cpp.html b/include/asio/doc/examples/diffs/http/server/main.cpp.html new file mode 100644 index 0000000..0d74531 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/main.cpp.html @@ -0,0 +1,84 @@ + + + + + + + HTML Diff http/server/main.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​main.​cppsrc/​examples/​cpp11/​http/​server/​main.​cpp
1 /​/​1 /​/​
2 /​/​·​main.​cpp2 /​/​·​main.​cpp
3 /​/​·​~~~~~~~~3 /​/​·​~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<iostream>11 #include·​<iostream>
12 #include·​<string>12 #include·​<string>
13 #include·​<asio.​hpp>13 #include·​<asio.​hpp>
14 #include·​<boost/​bind/​bind.​hpp>
15 #include·​"server.​hpp"14 #include·​"server.​hpp"
16 15
17 int·​main(int·​argc,​·​char*·​argv[])​16 int·​main(int·​argc,​·​char*·​argv[])​
18 {17 {
19 ··​try18 ··​try
20 ··​{19 ··​{
21 ····​/​/​·​Check·​command·​line·​arguments.​20 ····​/​/​·​Check·​command·​line·​arguments.​
22 ····​if·​(argc·​!=·​4)​21 ····​if·​(argc·​!=·​4)​
23 ····​{22 ····​{
24 ······​std:​:​cerr·​<<·​"Usage:​·​http_server·​<address>·​<port>·​<doc_root>\n";​23 ······​std:​:​cerr·​<<·​"Usage:​·​http_server·​<address>·​<port>·​<doc_root>\n";​
25 ······​std:​:​cerr·​<<·​"··​For·​IPv4,​·​try:​\n";​24 ······​std:​:​cerr·​<<·​"··​For·​IPv4,​·​try:​\n";​
26 ······​std:​:​cerr·​<<·​"····​receiver·​0.​0.​0.​0·​80·​.​\n";​25 ······​std:​:​cerr·​<<·​"····​receiver·​0.​0.​0.​0·​80·​.​\n";​
27 ······​std:​:​cerr·​<<·​"··​For·​IPv6,​·​try:​\n";​26 ······​std:​:​cerr·​<<·​"··​For·​IPv6,​·​try:​\n";​
28 ······​std:​:​cerr·​<<·​"····​receiver·​0:​:​0·​80·​.​\n";​27 ······​std:​:​cerr·​<<·​"····​receiver·​0:​:​0·​80·​.​\n";​
29 ······​return·​1;​28 ······​return·​1;​
30 ····​}29 ····​}
31 30
32 ····​/​/​·​Initialise·​the·​server.​31 ····​/​/​·​Initialise·​the·​server.​
33 ····​http:​:​server:​:​server·​s(argv[1],​·​argv[2],​·​argv[3])​;​32 ····​http:​:​server:​:​server·​s(argv[1],​·​argv[2],​·​argv[3])​;​
34 33
35 ····​/​/​·​Run·​the·​server·​until·​stopped.​34 ····​/​/​·​Run·​the·​server·​until·​stopped.​
36 ····​s.​run()​;​35 ····​s.​run()​;​
37 ··​}36 ··​}
38 ··​catch·​(std:​:​exception&·​e)​37 ··​catch·​(std:​:​exception&·​e)​
39 ··​{38 ··​{
40 ····​std:​:​cerr·​<<·​"exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​39 ····​std:​:​cerr·​<<·​"exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
41 ··​}40 ··​}
42 41
43 ··​return·​0;​42 ··​return·​0;​
44 }43 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/mime_types.cpp.html b/include/asio/doc/examples/diffs/http/server/mime_types.cpp.html new file mode 100644 index 0000000..8488e4e --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/mime_types.cpp.html @@ -0,0 +1,86 @@ + + + + + + + HTML Diff http/server/mime_types.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​mime_types.​cppsrc/​examples/​cpp11/​http/​server/​mime_types.​cpp
1 /​/​1 /​/​
2 /​/​·​mime_types.​cpp2 /​/​·​mime_types.​cpp
3 /​/​·​~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"mime_types.​hpp"11 #include·​"mime_types.​hpp"
12 12
13 namespace·​http·​{13 namespace·​http·​{
14 namespace·​server·​{14 namespace·​server·​{
15 namespace·​mime_types·​{15 namespace·​mime_types·​{
16 16
17 struct·​mapping17 struct·​mapping
18 {18 {
19 ··​const·​char*·​extension;​19 ··​const·​char*·​extension;​
20 ··​const·​char*·​mime_type;​20 ··​const·​char*·​mime_type;​
21 }·​mappings[]·​=21 }·​mappings[]·​=
22 {22 {
23 ··​{·​"gif",​·​"image/​gif"·​},​23 ··​{·​"gif",​·​"image/​gif"·​},​
24 ··​{·​"htm",​·​"text/​html"·​},​24 ··​{·​"htm",​·​"text/​html"·​},​
25 ··​{·​"html",​·​"text/​html"·​},​25 ··​{·​"html",​·​"text/​html"·​},​
26 ··​{·​"jpg",​·​"image/​jpeg"·​},​26 ··​{·​"jpg",​·​"image/​jpeg"·​},​
27 ··​{·​"png",​·​"image/​png"·​},​27 ··​{·​"png",​·​"image/​png"·​}
28 ··{·0,​·0·}·/​/​·Marks·end·of·list.​
29 };​28 };​
30 29
31 std:​:​string·​extension_to_type(con​st·​std:​:​string&·​extension)​30 std:​:​string·​extension_to_type(con​st·​std:​:​string&·​extension)​
32 {31 {
33 ··​for·​(mapping*·​m·=·​mappings;​·m-​>extension;​·++m)​32 ··​for·​(mapping·​m:​·​mappings)​
34 ··​{33 ··​{
35 ····​if·​(m-​>extension·​==·​extension)​34 ····​if·​(m.​extension·​==·​extension)​
36 ····​{35 ····​{
37 ······​return·​m-​>mime_type;​36 ······​return·​m.​mime_type;​
38 ····​}37 ····​}
39 ··​}38 ··​}
40 39
41 ··​return·​"text/​plain";​40 ··​return·​"text/​plain";​
42 }41 }
43 42
44 }·​/​/​·​namespace·​mime_types43 }·​/​/​·​namespace·​mime_types
45 }·​/​/​·​namespace·​server44 }·​/​/​·​namespace·​server
46 }·​/​/​·​namespace·​http45 }·​/​/​·​namespace·​http
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/mime_types.hpp.html b/include/asio/doc/examples/diffs/http/server/mime_types.hpp.html new file mode 100644 index 0000000..d3974a7 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/mime_types.hpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff http/server/mime_types.hpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/reply.cpp.html b/include/asio/doc/examples/diffs/http/server/reply.cpp.html new file mode 100644 index 0000000..33034c0 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/reply.cpp.html @@ -0,0 +1,296 @@ + + + + + + + HTML Diff http/server/reply.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​reply.​cppsrc/​examples/​cpp11/​http/​server/​reply.​cpp
1 /​/​1 /​/​
2 /​/​·​reply.​cpp2 /​/​·​reply.​cpp
3 /​/​·​~~~~~~~~~3 /​/​·​~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"reply.​hpp"11 #include·​"reply.​hpp"
12 #include·​<string>12 #include·​<string>
13 #include·​<boost/​lexical_cast.​hpp>
14 13
15 namespace·​http·​{14 namespace·​http·​{
16 namespace·​server·​{15 namespace·​server·​{
17 16
18 namespace·​status_strings·​{17 namespace·​status_strings·​{
19 18
20 const·​std:​:​string·​ok·​=19 const·​std:​:​string·​ok·​=
21 ··​"HTTP/​1.​0·​200·​OK\r\n";​20 ··​"HTTP/​1.​0·​200·​OK\r\n";​
22 const·​std:​:​string·​created·​=21 const·​std:​:​string·​created·​=
23 ··​"HTTP/​1.​0·​201·​Created\r\n";​22 ··​"HTTP/​1.​0·​201·​Created\r\n";​
24 const·​std:​:​string·​accepted·​=23 const·​std:​:​string·​accepted·​=
25 ··​"HTTP/​1.​0·​202·​Accepted\r\n";​24 ··​"HTTP/​1.​0·​202·​Accepted\r\n";​
26 const·​std:​:​string·​no_content·​=25 const·​std:​:​string·​no_content·​=
27 ··​"HTTP/​1.​0·​204·​No·​Content\r\n";​26 ··​"HTTP/​1.​0·​204·​No·​Content\r\n";​
28 const·​std:​:​string·​multiple_choices·​=27 const·​std:​:​string·​multiple_choices·​=
29 ··​"HTTP/​1.​0·​300·​Multiple·​Choices\r\n";​28 ··​"HTTP/​1.​0·​300·​Multiple·​Choices\r\n";​
30 const·​std:​:​string·​moved_permanently·​=29 const·​std:​:​string·​moved_permanently·​=
31 ··​"HTTP/​1.​0·​301·​Moved·​Permanently\r\n";​30 ··​"HTTP/​1.​0·​301·​Moved·​Permanently\r\n";​
32 const·​std:​:​string·​moved_temporarily·​=31 const·​std:​:​string·​moved_temporarily·​=
33 ··​"HTTP/​1.​0·​302·​Moved·​Temporarily\r\n";​32 ··​"HTTP/​1.​0·​302·​Moved·​Temporarily\r\n";​
34 const·​std:​:​string·​not_modified·​=33 const·​std:​:​string·​not_modified·​=
35 ··​"HTTP/​1.​0·​304·​Not·​Modified\r\n";​34 ··​"HTTP/​1.​0·​304·​Not·​Modified\r\n";​
36 const·​std:​:​string·​bad_request·​=35 const·​std:​:​string·​bad_request·​=
37 ··​"HTTP/​1.​0·​400·​Bad·​Request\r\n";​36 ··​"HTTP/​1.​0·​400·​Bad·​Request\r\n";​
38 const·​std:​:​string·​unauthorized·​=37 const·​std:​:​string·​unauthorized·​=
39 ··​"HTTP/​1.​0·​401·​Unauthorized\r\n";​38 ··​"HTTP/​1.​0·​401·​Unauthorized\r\n";​
40 const·​std:​:​string·​forbidden·​=39 const·​std:​:​string·​forbidden·​=
41 ··​"HTTP/​1.​0·​403·​Forbidden\r\n";​40 ··​"HTTP/​1.​0·​403·​Forbidden\r\n";​
42 const·​std:​:​string·​not_found·​=41 const·​std:​:​string·​not_found·​=
43 ··​"HTTP/​1.​0·​404·​Not·​Found\r\n";​42 ··​"HTTP/​1.​0·​404·​Not·​Found\r\n";​
44 const·​std:​:​string·​internal_server_error​·​=43 const·​std:​:​string·​internal_server_error​·​=
45 ··​"HTTP/​1.​0·​500·​Internal·​Server·​Error\r\n";​44 ··​"HTTP/​1.​0·​500·​Internal·​Server·​Error\r\n";​
46 const·​std:​:​string·​not_implemented·​=45 const·​std:​:​string·​not_implemented·​=
47 ··​"HTTP/​1.​0·​501·​Not·​Implemented\r\n";​46 ··​"HTTP/​1.​0·​501·​Not·​Implemented\r\n";​
48 const·​std:​:​string·​bad_gateway·​=47 const·​std:​:​string·​bad_gateway·​=
49 ··​"HTTP/​1.​0·​502·​Bad·​Gateway\r\n";​48 ··​"HTTP/​1.​0·​502·​Bad·​Gateway\r\n";​
50 const·​std:​:​string·​service_unavailable·​=49 const·​std:​:​string·​service_unavailable·​=
51 ··​"HTTP/​1.​0·​503·​Service·​Unavailable\r\n";​50 ··​"HTTP/​1.​0·​503·​Service·​Unavailable\r\n";​
52 51
53 asio:​:​const_buffer·​to_buffer(reply:​:​status_type·​status)​52 asio:​:​const_buffer·​to_buffer(reply:​:​status_type·​status)​
54 {53 {
55 ··​switch·​(status)​54 ··​switch·​(status)​
56 ··​{55 ··​{
57 ··​case·​reply:​:​ok:​56 ··​case·​reply:​:​ok:​
58 ····​return·​asio:​:​buffer(ok)​;​57 ····​return·​asio:​:​buffer(ok)​;​
59 ··​case·​reply:​:​created:​58 ··​case·​reply:​:​created:​
60 ····​return·​asio:​:​buffer(created)​;​59 ····​return·​asio:​:​buffer(created)​;​
61 ··​case·​reply:​:​accepted:​60 ··​case·​reply:​:​accepted:​
62 ····​return·​asio:​:​buffer(accepted)​;​61 ····​return·​asio:​:​buffer(accepted)​;​
63 ··​case·​reply:​:​no_content:​62 ··​case·​reply:​:​no_content:​
64 ····​return·​asio:​:​buffer(no_content)​;​63 ····​return·​asio:​:​buffer(no_content)​;​
65 ··​case·​reply:​:​multiple_choices:​64 ··​case·​reply:​:​multiple_choices:​
66 ····​return·​asio:​:​buffer(multiple_choic​es)​;​65 ····​return·​asio:​:​buffer(multiple_choic​es)​;​
67 ··​case·​reply:​:​moved_permanently:​66 ··​case·​reply:​:​moved_permanently:​
68 ····​return·​asio:​:​buffer(moved_permanen​tly)​;​67 ····​return·​asio:​:​buffer(moved_permanen​tly)​;​
69 ··​case·​reply:​:​moved_temporarily:​68 ··​case·​reply:​:​moved_temporarily:​
70 ····​return·​asio:​:​buffer(moved_temporar​ily)​;​69 ····​return·​asio:​:​buffer(moved_temporar​ily)​;​
71 ··​case·​reply:​:​not_modified:​70 ··​case·​reply:​:​not_modified:​
72 ····​return·​asio:​:​buffer(not_modified)​;​71 ····​return·​asio:​:​buffer(not_modified)​;​
73 ··​case·​reply:​:​bad_request:​72 ··​case·​reply:​:​bad_request:​
74 ····​return·​asio:​:​buffer(bad_request)​;​73 ····​return·​asio:​:​buffer(bad_request)​;​
75 ··​case·​reply:​:​unauthorized:​74 ··​case·​reply:​:​unauthorized:​
76 ····​return·​asio:​:​buffer(unauthorized)​;​75 ····​return·​asio:​:​buffer(unauthorized)​;​
77 ··​case·​reply:​:​forbidden:​76 ··​case·​reply:​:​forbidden:​
78 ····​return·​asio:​:​buffer(forbidden)​;​77 ····​return·​asio:​:​buffer(forbidden)​;​
79 ··​case·​reply:​:​not_found:​78 ··​case·​reply:​:​not_found:​
80 ····​return·​asio:​:​buffer(not_found)​;​79 ····​return·​asio:​:​buffer(not_found)​;​
81 ··​case·​reply:​:​internal_server_error​:​80 ··​case·​reply:​:​internal_server_error​:​
82 ····​return·​asio:​:​buffer(internal_serve​r_error)​;​81 ····​return·​asio:​:​buffer(internal_serve​r_error)​;​
83 ··​case·​reply:​:​not_implemented:​82 ··​case·​reply:​:​not_implemented:​
84 ····​return·​asio:​:​buffer(not_implemente​d)​;​83 ····​return·​asio:​:​buffer(not_implemente​d)​;​
85 ··​case·​reply:​:​bad_gateway:​84 ··​case·​reply:​:​bad_gateway:​
86 ····​return·​asio:​:​buffer(bad_gateway)​;​85 ····​return·​asio:​:​buffer(bad_gateway)​;​
87 ··​case·​reply:​:​service_unavailable:​86 ··​case·​reply:​:​service_unavailable:​
88 ····​return·​asio:​:​buffer(service_unavai​lable)​;​87 ····​return·​asio:​:​buffer(service_unavai​lable)​;​
89 ··​default:​88 ··​default:​
90 ····​return·​asio:​:​buffer(internal_serve​r_error)​;​89 ····​return·​asio:​:​buffer(internal_serve​r_error)​;​
91 ··​}90 ··​}
92 }91 }
93 92
94 }·​/​/​·​namespace·​status_strings93 }·​/​/​·​namespace·​status_strings
95 94
96 namespace·​misc_strings·​{95 namespace·​misc_strings·​{
97 96
98 const·​char·​name_value_separator[​]·​=·​{·​':​',​·​'·​'·​};​97 const·​char·​name_value_separator[​]·​=·​{·​':​',​·​'·​'·​};​
99 const·​char·​crlf[]·​=·​{·​'\r',​·​'\n'·​};​98 const·​char·​crlf[]·​=·​{·​'\r',​·​'\n'·​};​
100 99
101 }·​/​/​·​namespace·​misc_strings100 }·​/​/​·​namespace·​misc_strings
102 101
103 std:​:​vector<asio:​:​const_buffer>·​reply:​:​to_buffers()​102 std:​:​vector<asio:​:​const_buffer>·​reply:​:​to_buffers()​
104 {103 {
105 ··​std:​:​vector<asio:​:​const_buffer>·​buffers;​104 ··​std:​:​vector<asio:​:​const_buffer>·​buffers;​
106 ··​buffers.​push_back(status_stri​ngs:​:​to_buffer(status)​)​;​105 ··​buffers.​push_back(status_stri​ngs:​:​to_buffer(status)​)​;​
107 ··​for·​(std:​:​size_t·​i·​=·​0;​·​i·​<·​headers.​size()​;​·​++i)​106 ··​for·​(std:​:​size_t·​i·​=·​0;​·​i·​<·​headers.​size()​;​·​++i)​
108 ··​{107 ··​{
109 ····​header&·​h·​=·​headers[i];​108 ····​header&·​h·​=·​headers[i];​
110 ····​buffers.​push_back(asio:​:​buffer(h.​name)​)​;​109 ····​buffers.​push_back(asio:​:​buffer(h.​name)​)​;​
111 ····​buffers.​push_back(asio:​:​buffer(misc_strings:​:​name_value_separator)​)​;​110 ····​buffers.​push_back(asio:​:​buffer(misc_strings:​:​name_value_separator)​)​;​
112 ····​buffers.​push_back(asio:​:​buffer(h.​value)​)​;​111 ····​buffers.​push_back(asio:​:​buffer(h.​value)​)​;​
113 ····​buffers.​push_back(asio:​:​buffer(misc_strings:​:​crlf)​)​;​112 ····​buffers.​push_back(asio:​:​buffer(misc_strings:​:​crlf)​)​;​
114 ··​}113 ··​}
115 ··​buffers.​push_back(asio:​:​buffer(misc_strings:​:​crlf)​)​;​114 ··​buffers.​push_back(asio:​:​buffer(misc_strings:​:​crlf)​)​;​
116 ··​buffers.​push_back(asio:​:​buffer(content)​)​;​115 ··​buffers.​push_back(asio:​:​buffer(content)​)​;​
117 ··​return·​buffers;​116 ··​return·​buffers;​
118 }117 }
119 118
120 namespace·​stock_replies·​{119 namespace·​stock_replies·​{
121 120
122 const·​char·​ok[]·​=·​"";​121 const·​char·​ok[]·​=·​"";​
123 const·​char·​created[]·​=122 const·​char·​created[]·​=
124 ··​"<html>"123 ··​"<html>"
125 ··​"<head><title>Created​</​title></​head>"124 ··​"<head><title>Created​</​title></​head>"
126 ··​"<body><h1>201·​Created</​h1></​body>"125 ··​"<body><h1>201·​Created</​h1></​body>"
127 ··​"</​html>";​126 ··​"</​html>";​
128 const·​char·​accepted[]·​=127 const·​char·​accepted[]·​=
129 ··​"<html>"128 ··​"<html>"
130 ··​"<head><title>Accepte​d</​title></​head>"129 ··​"<head><title>Accepte​d</​title></​head>"
131 ··​"<body><h1>202·​Accepted</​h1></​body>"130 ··​"<body><h1>202·​Accepted</​h1></​body>"
132 ··​"</​html>";​131 ··​"</​html>";​
133 const·​char·​no_content[]·​=132 const·​char·​no_content[]·​=
134 ··​"<html>"133 ··​"<html>"
135 ··​"<head><title>No·​Content</​title></​head>"134 ··​"<head><title>No·​Content</​title></​head>"
136 ··​"<body><h1>204·​Content</​h1></​body>"135 ··​"<body><h1>204·​Content</​h1></​body>"
137 ··​"</​html>";​136 ··​"</​html>";​
138 const·​char·​multiple_choices[]·​=137 const·​char·​multiple_choices[]·​=
139 ··​"<html>"138 ··​"<html>"
140 ··​"<head><title>Multipl​e·​Choices</​title></​head>"139 ··​"<head><title>Multipl​e·​Choices</​title></​head>"
141 ··​"<body><h1>300·​Multiple·​Choices</​h1></​body>"140 ··​"<body><h1>300·​Multiple·​Choices</​h1></​body>"
142 ··​"</​html>";​141 ··​"</​html>";​
143 const·​char·​moved_permanently[]·​=142 const·​char·​moved_permanently[]·​=
144 ··​"<html>"143 ··​"<html>"
145 ··​"<head><title>Moved·​Permanently</​title></​head>"144 ··​"<head><title>Moved·​Permanently</​title></​head>"
146 ··​"<body><h1>301·​Moved·​Permanently</​h1></​body>"145 ··​"<body><h1>301·​Moved·​Permanently</​h1></​body>"
147 ··​"</​html>";​146 ··​"</​html>";​
148 const·​char·​moved_temporarily[]·​=147 const·​char·​moved_temporarily[]·​=
149 ··​"<html>"148 ··​"<html>"
150 ··​"<head><title>Moved·​Temporarily</​title></​head>"149 ··​"<head><title>Moved·​Temporarily</​title></​head>"
151 ··​"<body><h1>302·​Moved·​Temporarily</​h1></​body>"150 ··​"<body><h1>302·​Moved·​Temporarily</​h1></​body>"
152 ··​"</​html>";​151 ··​"</​html>";​
153 const·​char·​not_modified[]·​=152 const·​char·​not_modified[]·​=
154 ··​"<html>"153 ··​"<html>"
155 ··​"<head><title>Not·​Modified</​title></​head>"154 ··​"<head><title>Not·​Modified</​title></​head>"
156 ··​"<body><h1>304·​Not·​Modified</​h1></​body>"155 ··​"<body><h1>304·​Not·​Modified</​h1></​body>"
157 ··​"</​html>";​156 ··​"</​html>";​
158 const·​char·​bad_request[]·​=157 const·​char·​bad_request[]·​=
159 ··​"<html>"158 ··​"<html>"
160 ··​"<head><title>Bad·​Request</​title></​head>"159 ··​"<head><title>Bad·​Request</​title></​head>"
161 ··​"<body><h1>400·​Bad·​Request</​h1></​body>"160 ··​"<body><h1>400·​Bad·​Request</​h1></​body>"
162 ··​"</​html>";​161 ··​"</​html>";​
163 const·​char·​unauthorized[]·​=162 const·​char·​unauthorized[]·​=
164 ··​"<html>"163 ··​"<html>"
165 ··​"<head><title>Unautho​rized</​title></​head>"164 ··​"<head><title>Unautho​rized</​title></​head>"
166 ··​"<body><h1>401·​Unauthorized</​h1></​body>"165 ··​"<body><h1>401·​Unauthorized</​h1></​body>"
167 ··​"</​html>";​166 ··​"</​html>";​
168 const·​char·​forbidden[]·​=167 const·​char·​forbidden[]·​=
169 ··​"<html>"168 ··​"<html>"
170 ··​"<head><title>Forbidd​en</​title></​head>"169 ··​"<head><title>Forbidd​en</​title></​head>"
171 ··​"<body><h1>403·​Forbidden</​h1></​body>"170 ··​"<body><h1>403·​Forbidden</​h1></​body>"
172 ··​"</​html>";​171 ··​"</​html>";​
173 const·​char·​not_found[]·​=172 const·​char·​not_found[]·​=
174 ··​"<html>"173 ··​"<html>"
175 ··​"<head><title>Not·​Found</​title></​head>"174 ··​"<head><title>Not·​Found</​title></​head>"
176 ··​"<body><h1>404·​Not·​Found</​h1></​body>"175 ··​"<body><h1>404·​Not·​Found</​h1></​body>"
177 ··​"</​html>";​176 ··​"</​html>";​
178 const·​char·​internal_server_error​[]·​=177 const·​char·​internal_server_error​[]·​=
179 ··​"<html>"178 ··​"<html>"
180 ··​"<head><title>Interna​l·​Server·​Error</​title></​head>"179 ··​"<head><title>Interna​l·​Server·​Error</​title></​head>"
181 ··​"<body><h1>500·​Internal·​Server·​Error</​h1></​body>"180 ··​"<body><h1>500·​Internal·​Server·​Error</​h1></​body>"
182 ··​"</​html>";​181 ··​"</​html>";​
183 const·​char·​not_implemented[]·​=182 const·​char·​not_implemented[]·​=
184 ··​"<html>"183 ··​"<html>"
185 ··​"<head><title>Not·​Implemented</​title></​head>"184 ··​"<head><title>Not·​Implemented</​title></​head>"
186 ··​"<body><h1>501·​Not·​Implemented</​h1></​body>"185 ··​"<body><h1>501·​Not·​Implemented</​h1></​body>"
187 ··​"</​html>";​186 ··​"</​html>";​
188 const·​char·​bad_gateway[]·​=187 const·​char·​bad_gateway[]·​=
189 ··​"<html>"188 ··​"<html>"
190 ··​"<head><title>Bad·​Gateway</​title></​head>"189 ··​"<head><title>Bad·​Gateway</​title></​head>"
191 ··​"<body><h1>502·​Bad·​Gateway</​h1></​body>"190 ··​"<body><h1>502·​Bad·​Gateway</​h1></​body>"
192 ··​"</​html>";​191 ··​"</​html>";​
193 const·​char·​service_unavailable[]​·​=192 const·​char·​service_unavailable[]​·​=
194 ··​"<html>"193 ··​"<html>"
195 ··​"<head><title>Service​·​Unavailable</​title></​head>"194 ··​"<head><title>Service​·​Unavailable</​title></​head>"
196 ··​"<body><h1>503·​Service·​Unavailable</​h1></​body>"195 ··​"<body><h1>503·​Service·​Unavailable</​h1></​body>"
197 ··​"</​html>";​196 ··​"</​html>";​
198 197
199 std:​:​string·​to_string(reply:​:​status_type·​status)​198 std:​:​string·​to_string(reply:​:​status_type·​status)​
200 {199 {
201 ··​switch·​(status)​200 ··​switch·​(status)​
202 ··​{201 ··​{
203 ··​case·​reply:​:​ok:​202 ··​case·​reply:​:​ok:​
204 ····​return·​ok;​203 ····​return·​ok;​
205 ··​case·​reply:​:​created:​204 ··​case·​reply:​:​created:​
206 ····​return·​created;​205 ····​return·​created;​
207 ··​case·​reply:​:​accepted:​206 ··​case·​reply:​:​accepted:​
208 ····​return·​accepted;​207 ····​return·​accepted;​
209 ··​case·​reply:​:​no_content:​208 ··​case·​reply:​:​no_content:​
210 ····​return·​no_content;​209 ····​return·​no_content;​
211 ··​case·​reply:​:​multiple_choices:​210 ··​case·​reply:​:​multiple_choices:​
212 ····​return·​multiple_choices;​211 ····​return·​multiple_choices;​
213 ··​case·​reply:​:​moved_permanently:​212 ··​case·​reply:​:​moved_permanently:​
214 ····​return·​moved_permanently;​213 ····​return·​moved_permanently;​
215 ··​case·​reply:​:​moved_temporarily:​214 ··​case·​reply:​:​moved_temporarily:​
216 ····​return·​moved_temporarily;​215 ····​return·​moved_temporarily;​
217 ··​case·​reply:​:​not_modified:​216 ··​case·​reply:​:​not_modified:​
218 ····​return·​not_modified;​217 ····​return·​not_modified;​
219 ··​case·​reply:​:​bad_request:​218 ··​case·​reply:​:​bad_request:​
220 ····​return·​bad_request;​219 ····​return·​bad_request;​
221 ··​case·​reply:​:​unauthorized:​220 ··​case·​reply:​:​unauthorized:​
222 ····​return·​unauthorized;​221 ····​return·​unauthorized;​
223 ··​case·​reply:​:​forbidden:​222 ··​case·​reply:​:​forbidden:​
224 ····​return·​forbidden;​223 ····​return·​forbidden;​
225 ··​case·​reply:​:​not_found:​224 ··​case·​reply:​:​not_found:​
226 ····​return·​not_found;​225 ····​return·​not_found;​
227 ··​case·​reply:​:​internal_server_error​:​226 ··​case·​reply:​:​internal_server_error​:​
228 ····​return·​internal_server_error​;​227 ····​return·​internal_server_error​;​
229 ··​case·​reply:​:​not_implemented:​228 ··​case·​reply:​:​not_implemented:​
230 ····​return·​not_implemented;​229 ····​return·​not_implemented;​
231 ··​case·​reply:​:​bad_gateway:​230 ··​case·​reply:​:​bad_gateway:​
232 ····​return·​bad_gateway;​231 ····​return·​bad_gateway;​
233 ··​case·​reply:​:​service_unavailable:​232 ··​case·​reply:​:​service_unavailable:​
234 ····​return·​service_unavailable;​233 ····​return·​service_unavailable;​
235 ··​default:​234 ··​default:​
236 ····​return·​internal_server_error​;​235 ····​return·​internal_server_error​;​
237 ··​}236 ··​}
238 }237 }
239 238
240 }·​/​/​·​namespace·​stock_replies239 }·​/​/​·​namespace·​stock_replies
241 240
242 reply·​reply:​:​stock_reply(reply:​:​status_type·​status)​241 reply·​reply:​:​stock_reply(reply:​:​status_type·​status)​
243 {242 {
244 ··​reply·​rep;​243 ··​reply·​rep;​
245 ··​rep.​status·​=·​status;​244 ··​rep.​status·​=·​status;​
246 ··​rep.​content·​=·​stock_replies:​:​to_string(status)​;​245 ··​rep.​content·​=·​stock_replies:​:​to_string(status)​;​
247 ··​rep.​headers.​resize(2)​;​246 ··​rep.​headers.​resize(2)​;​
248 ··​rep.​headers[0].​name·​=·​"Content-​Length";​247 ··​rep.​headers[0].​name·​=·​"Content-​Length";​
249 ··​rep.​headers[0].​value·​=·boost:​:​lexical_cast<std:​:​string>(rep.​content.​size()​)​;​248 ··​rep.​headers[0].​value·​=·​std:​:​to_string(rep.​content.​size()​)​;​
250 ··​rep.​headers[1].​name·​=·​"Content-​Type";​249 ··​rep.​headers[1].​name·​=·​"Content-​Type";​
251 ··​rep.​headers[1].​value·​=·​"text/​html";​250 ··​rep.​headers[1].​value·​=·​"text/​html";​
252 ··​return·​rep;​251 ··​return·​rep;​
253 }252 }
254 253
255 }·​/​/​·​namespace·​server254 }·​/​/​·​namespace·​server
256 }·​/​/​·​namespace·​http255 }·​/​/​·​namespace·​http
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/reply.hpp.html b/include/asio/doc/examples/diffs/http/server/reply.hpp.html new file mode 100644 index 0000000..44c0d72 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/reply.hpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff http/server/reply.hpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/request.hpp.html b/include/asio/doc/examples/diffs/http/server/request.hpp.html new file mode 100644 index 0000000..6a09ef5 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/request.hpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff http/server/request.hpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/request_handler.cpp.html b/include/asio/doc/examples/diffs/http/server/request_handler.cpp.html new file mode 100644 index 0000000..5df3807 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/request_handler.cpp.html @@ -0,0 +1,162 @@ + + + + + + + HTML Diff http/server/request_handler.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​request_handler.​cppsrc/​examples/​cpp11/​http/​server/​request_handler.​cpp
1 /​/​1 /​/​
2 /​/​·​request_handler.​cpp2 /​/​·​request_handler.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"request_handler.​hpp"11 #include·​"request_handler.​hpp"
12 #include·​<fstream>12 #include·​<fstream>
13 #include·​<sstream>13 #include·​<sstream>
14 #include·​<string>14 #include·​<string>
15 #include·​<boost/​lexical_cast.​hpp>
16 #include·​"mime_types.​hpp"15 #include·​"mime_types.​hpp"
17 #include·​"reply.​hpp"16 #include·​"reply.​hpp"
18 #include·​"request.​hpp"17 #include·​"request.​hpp"
19 18
20 namespace·​http·​{19 namespace·​http·​{
21 namespace·​server·​{20 namespace·​server·​{
22 21
23 request_handler:​:​request_handler(const​·​std:​:​string&·​doc_root)​22 request_handler:​:​request_handler(const​·​std:​:​string&·​doc_root)​
24 ··​:​·​doc_root_(doc_root)​23 ··​:​·​doc_root_(doc_root)​
25 {24 {
26 }25 }
27 26
28 void·​request_handler:​:​handle_request(const·​request&·​req,​·​reply&·​rep)​27 void·​request_handler:​:​handle_request(const·​request&·​req,​·​reply&·​rep)​
29 {28 {
30 ··​/​/​·​Decode·​url·​to·​path.​29 ··​/​/​·​Decode·​url·​to·​path.​
31 ··​std:​:​string·​request_path;​30 ··​std:​:​string·​request_path;​
32 ··​if·​(!url_decode(req.​uri,​·​request_path)​)​31 ··​if·​(!url_decode(req.​uri,​·​request_path)​)​
33 ··​{32 ··​{
34 ····​rep·​=·​reply:​:​stock_reply(reply:​:​bad_request)​;​33 ····​rep·​=·​reply:​:​stock_reply(reply:​:​bad_request)​;​
35 ····​return;​34 ····​return;​
36 ··​}35 ··​}
37 36
38 ··​/​/​·​Request·​path·​must·​be·​absolute·​and·​not·​contain·​".​.​".​37 ··​/​/​·​Request·​path·​must·​be·​absolute·​and·​not·​contain·​".​.​".​
39 ··​if·​(request_path.​empty()​·​||·​request_path[0]·​!=·​'/​'38 ··​if·​(request_path.​empty()​·​||·​request_path[0]·​!=·​'/​'
40 ······​||·​request_path.​find(".​.​")​·​!=·​std:​:​string:​:​npos)​39 ······​||·​request_path.​find(".​.​")​·​!=·​std:​:​string:​:​npos)​
41 ··​{40 ··​{
42 ····​rep·​=·​reply:​:​stock_reply(reply:​:​bad_request)​;​41 ····​rep·​=·​reply:​:​stock_reply(reply:​:​bad_request)​;​
43 ····​return;​42 ····​return;​
44 ··​}43 ··​}
45 44
46 ··​/​/​·​If·​path·​ends·​in·​slash·​(i.​e.​·​is·​a·​directory)​·​then·​add·​"index.​html".​45 ··​/​/​·​If·​path·​ends·​in·​slash·​(i.​e.​·​is·​a·​directory)​·​then·​add·​"index.​html".​
47 ··​if·​(request_path[request​_path.​size()​·​-​·​1]·​==·​'/​')​46 ··​if·​(request_path[request​_path.​size()​·​-​·​1]·​==·​'/​')​
48 ··​{47 ··​{
49 ····​request_path·​+=·​"index.​html";​48 ····​request_path·​+=·​"index.​html";​
50 ··​}49 ··​}
51 50
52 ··​/​/​·​Determine·​the·​file·​extension.​51 ··​/​/​·​Determine·​the·​file·​extension.​
53 ··​std:​:​size_t·​last_slash_pos·​=·​request_path.​find_last_of("/​")​;​52 ··​std:​:​size_t·​last_slash_pos·​=·​request_path.​find_last_of("/​")​;​
54 ··​std:​:​size_t·​last_dot_pos·​=·​request_path.​find_last_of(".​")​;​53 ··​std:​:​size_t·​last_dot_pos·​=·​request_path.​find_last_of(".​")​;​
55 ··​std:​:​string·​extension;​54 ··​std:​:​string·​extension;​
56 ··​if·​(last_dot_pos·​!=·​std:​:​string:​:​npos·​&&·​last_dot_pos·​>·​last_slash_pos)​55 ··​if·​(last_dot_pos·​!=·​std:​:​string:​:​npos·​&&·​last_dot_pos·​>·​last_slash_pos)​
57 ··​{56 ··​{
58 ····​extension·​=·​request_path.​substr(last_dot_pos·​+·​1)​;​57 ····​extension·​=·​request_path.​substr(last_dot_pos·​+·​1)​;​
59 ··​}58 ··​}
60 59
61 ··​/​/​·​Open·​the·​file·​to·​send·​back.​60 ··​/​/​·​Open·​the·​file·​to·​send·​back.​
62 ··​std:​:​string·​full_path·​=·​doc_root_·​+·​request_path;​61 ··​std:​:​string·​full_path·​=·​doc_root_·​+·​request_path;​
63 ··​std:​:​ifstream·​is(full_path.​c_str()​,​·​std:​:​ios:​:​in·​|·​std:​:​ios:​:​binary)​;​62 ··​std:​:​ifstream·​is(full_path.​c_str()​,​·​std:​:​ios:​:​in·​|·​std:​:​ios:​:​binary)​;​
64 ··​if·​(!is)​63 ··​if·​(!is)​
65 ··​{64 ··​{
66 ····​rep·​=·​reply:​:​stock_reply(reply:​:​not_found)​;​65 ····​rep·​=·​reply:​:​stock_reply(reply:​:​not_found)​;​
67 ····​return;​66 ····​return;​
68 ··​}67 ··​}
69 68
70 ··​/​/​·​Fill·​out·​the·​reply·​to·​be·​sent·​to·​the·​client.​69 ··​/​/​·​Fill·​out·​the·​reply·​to·​be·​sent·​to·​the·​client.​
71 ··​rep.​status·​=·​reply:​:​ok;​70 ··​rep.​status·​=·​reply:​:​ok;​
72 ··​char·​buf[512];​71 ··​char·​buf[512];​
73 ··​while·​(is.​read(buf,​·​sizeof(buf)​)​.​gcount()​·​>·​0)​72 ··​while·​(is.​read(buf,​·​sizeof(buf)​)​.​gcount()​·​>·​0)​
74 ····​rep.​content.​append(buf,​·​is.​gcount()​)​;​73 ····​rep.​content.​append(buf,​·​is.​gcount()​)​;​
75 ··​rep.​headers.​resize(2)​;​74 ··​rep.​headers.​resize(2)​;​
76 ··​rep.​headers[0].​name·​=·​"Content-​Length";​75 ··​rep.​headers[0].​name·​=·​"Content-​Length";​
77 ··​rep.​headers[0].​value·​=·boost:​:​lexical_cast<std:​:​string>(rep.​content.​size()​)​;​76 ··​rep.​headers[0].​value·​=·​std:​:​to_string(rep.​content.​size()​)​;​
78 ··​rep.​headers[1].​name·​=·​"Content-​Type";​77 ··​rep.​headers[1].​name·​=·​"Content-​Type";​
79 ··​rep.​headers[1].​value·​=·​mime_types:​:​extension_to_type(ext​ension)​;​78 ··​rep.​headers[1].​value·​=·​mime_types:​:​extension_to_type(ext​ension)​;​
80 }79 }
81 80
82 bool·​request_handler:​:​url_decode(const·​std:​:​string&·​in,​·​std:​:​string&·​out)​81 bool·​request_handler:​:​url_decode(const·​std:​:​string&·​in,​·​std:​:​string&·​out)​
83 {82 {
84 ··​out.​clear()​;​83 ··​out.​clear()​;​
85 ··​out.​reserve(in.​size()​)​;​84 ··​out.​reserve(in.​size()​)​;​
86 ··​for·​(std:​:​size_t·​i·​=·​0;​·​i·​<·​in.​size()​;​·​++i)​85 ··​for·​(std:​:​size_t·​i·​=·​0;​·​i·​<·​in.​size()​;​·​++i)​
87 ··​{86 ··​{
88 ····​if·​(in[i]·​==·​'%')​87 ····​if·​(in[i]·​==·​'%')​
89 ····​{88 ····​{
90 ······​if·​(i·​+·​3·​<=·​in.​size()​)​89 ······​if·​(i·​+·​3·​<=·​in.​size()​)​
91 ······​{90 ······​{
92 ········​int·​value·​=·​0;​91 ········​int·​value·​=·​0;​
93 ········​std:​:​istringstream·​is(in.​substr(i·​+·​1,​·​2)​)​;​92 ········​std:​:​istringstream·​is(in.​substr(i·​+·​1,​·​2)​)​;​
94 ········​if·​(is·​>>·​std:​:​hex·​>>·​value)​93 ········​if·​(is·​>>·​std:​:​hex·​>>·​value)​
95 ········​{94 ········​{
96 ··········​out·​+=·​static_cast<char>(val​ue)​;​95 ··········​out·​+=·​static_cast<char>(val​ue)​;​
97 ··········​i·​+=·​2;​96 ··········​i·​+=·​2;​
98 ········​}97 ········​}
99 ········​else98 ········​else
100 ········​{99 ········​{
101 ··········​return·​false;​100 ··········​return·​false;​
102 ········​}101 ········​}
103 ······​}102 ······​}
104 ······​else103 ······​else
105 ······​{104 ······​{
106 ········​return·​false;​105 ········​return·​false;​
107 ······​}106 ······​}
108 ····​}107 ····​}
109 ····​else·​if·​(in[i]·​==·​'+')​108 ····​else·​if·​(in[i]·​==·​'+')​
110 ····​{109 ····​{
111 ······​out·​+=·​'·​';​110 ······​out·​+=·​'·​';​
112 ····​}111 ····​}
113 ····​else112 ····​else
114 ····​{113 ····​{
115 ······​out·​+=·​in[i];​114 ······​out·​+=·​in[i];​
116 ····​}115 ····​}
117 ··​}116 ··​}
118 ··​return·​true;​117 ··​return·​true;​
119 }118 }
120 119
121 }·​/​/​·​namespace·​server120 }·​/​/​·​namespace·​server
122 }·​/​/​·​namespace·​http121 }·​/​/​·​namespace·​http
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/request_handler.hpp.html b/include/asio/doc/examples/diffs/http/server/request_handler.hpp.html new file mode 100644 index 0000000..4e15351 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/request_handler.hpp.html @@ -0,0 +1,89 @@ + + + + + + + HTML Diff http/server/request_handler.hpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​request_handler.​hppsrc/​examples/​cpp11/​http/​server/​request_handler.​hpp
1 /​/​1 /​/​
2 /​/​·​request_handler.​hpp2 /​/​·​request_handler.​hpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #ifndef·​HTTP_REQUEST_HANDLER_​HPP11 #ifndef·​HTTP_REQUEST_HANDLER_​HPP
12 #define·​HTTP_REQUEST_HANDLER_​HPP12 #define·​HTTP_REQUEST_HANDLER_​HPP
13 13
14 #include·​<string>14 #include·​<string>
15 #include·​<boost/​noncopyable.​hpp>
16 15
17 namespace·​http·​{16 namespace·​http·​{
18 namespace·​server·​{17 namespace·​server·​{
19 18
20 struct·​reply;​19 struct·​reply;​
21 struct·​request;​20 struct·​request;​
22 21
23 /​/​/​·​The·​common·​handler·​for·​all·​incoming·​requests.​22 /​/​/​·​The·​common·​handler·​for·​all·​incoming·​requests.​
24 class·​request_handler23 class·​request_handler
25 ··​:​·​private·​boost:​:​noncopyable
26 {24 {
27 public:​25 public:​
26 ··​request_handler(const​·​request_handler&)​·​=·​delete;​
27 ··​request_handler&·​operator=(const·​request_handler&)​·​=·​delete;​
28
28 ··​/​/​/​·​Construct·​with·​a·​directory·​containing·​files·​to·​be·​served.​29 ··​/​/​/​·​Construct·​with·​a·​directory·​containing·​files·​to·​be·​served.​
29 ··​explicit·​request_handler(const​·​std:​:​string&·​doc_root)​;​30 ··​explicit·​request_handler(const​·​std:​:​string&·​doc_root)​;​
30 31
31 ··​/​/​/​·​Handle·​a·​request·​and·​produce·​a·​reply.​32 ··​/​/​/​·​Handle·​a·​request·​and·​produce·​a·​reply.​
32 ··​void·​handle_request(const·​request&·​req,​·​reply&·​rep)​;​33 ··​void·​handle_request(const·​request&·​req,​·​reply&·​rep)​;​
33 34
34 private:​35 private:​
35 ··​/​/​/​·​The·​directory·​containing·​the·​files·​to·​be·​served.​36 ··​/​/​/​·​The·​directory·​containing·​the·​files·​to·​be·​served.​
36 ··​std:​:​string·​doc_root_;​37 ··​std:​:​string·​doc_root_;​
37 38
38 ··​/​/​/​·​Perform·​URL-​decoding·​on·​a·​string.​·​Returns·​false·​if·​the·​encoding·​was39 ··​/​/​/​·​Perform·​URL-​decoding·​on·​a·​string.​·​Returns·​false·​if·​the·​encoding·​was
39 ··​/​/​/​·​invalid.​40 ··​/​/​/​·​invalid.​
40 ··​static·​bool·​url_decode(const·​std:​:​string&·​in,​·​std:​:​string&·​out)​;​41 ··​static·​bool·​url_decode(const·​std:​:​string&·​in,​·​std:​:​string&·​out)​;​
41 };​42 };​
42 43
43 }·​/​/​·​namespace·​server44 }·​/​/​·​namespace·​server
44 }·​/​/​·​namespace·​http45 }·​/​/​·​namespace·​http
45 46
46 #endif·​/​/​·​HTTP_REQUEST_HANDLER_​HPP47 #endif·​/​/​·​HTTP_REQUEST_HANDLER_​HPP
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/request_parser.cpp.html b/include/asio/doc/examples/diffs/http/server/request_parser.cpp.html new file mode 100644 index 0000000..98c97fa --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/request_parser.cpp.html @@ -0,0 +1,355 @@ + + + + + + + HTML Diff http/server/request_parser.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​request_parser.​cppsrc/​examples/​cpp11/​http/​server/​request_parser.​cpp
1 /​/​1 /​/​
2 /​/​·​request_parser.​cpp2 /​/​·​request_parser.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"request_parser.​hpp"11 #include·​"request_parser.​hpp"
12 #include·​"request.​hpp"12 #include·​"request.​hpp"
13 13
14 namespace·​http·​{14 namespace·​http·​{
15 namespace·​server·​{15 namespace·​server·​{
16 16
17 request_parser:​:​request_parser()​17 request_parser:​:​request_parser()​
18 ··​:​·​state_(method_start)​18 ··​:​·​state_(method_start)​
19 {19 {
20 }20 }
21 21
22 void·​request_parser:​:​reset()​22 void·​request_parser:​:​reset()​
23 {23 {
24 ··​state_·​=·​method_start;​24 ··​state_·​=·​method_start;​
25 }25 }
26 26
27 boost:​:​tribool·​request_parser:​:​consume(request&·​req,​·​char·​input)​27 request_parser:​:​result_type·​request_parser:​:​consume(request&·​req,​·​char·​input)​
28 {28 {
29 ··​switch·​(state_)​29 ··​switch·​(state_)​
30 ··​{30 ··​{
31 ··​case·​method_start:​31 ··​case·​method_start:​
32 ····​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​32 ····​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​
33 ····​{33 ····​{
34 ······​return·false;​34 ······​return·bad;​
35 ····​}35 ····​}
36 ····​else36 ····​else
37 ····​{37 ····​{
38 ······​state_·​=·​method;​38 ······​state_·​=·​method;​
39 ······​req.​method.​push_back(input)​;​39 ······​req.​method.​push_back(input)​;​
40 ······​return·boost:​:​indeterminate;​40 ······​return·​indeterminate;​
41 ····​}41 ····​}
42 ··​case·​method:​42 ··​case·​method:​
43 ····​if·​(input·​==·​'·​')​43 ····​if·​(input·​==·​'·​')​
44 ····​{44 ····​{
45 ······​state_·​=·​uri;​45 ······​state_·​=·​uri;​
46 ······​return·boost:​:​indeterminate;​46 ······​return·​indeterminate;​
47 ····​}47 ····​}
48 ····​else·​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​48 ····​else·​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​
49 ····​{49 ····​{
50 ······​return·false;​50 ······​return·bad;​
51 ····​}51 ····​}
52 ····​else52 ····​else
53 ····​{53 ····​{
54 ······​req.​method.​push_back(input)​;​54 ······​req.​method.​push_back(input)​;​
55 ······​return·boost:​:​indeterminate;​55 ······​return·​indeterminate;​
56 ····​}56 ····​}
57 ··​case·​uri:​57 ··​case·​uri:​
58 ····​if·​(input·​==·​'·​')​58 ····​if·​(input·​==·​'·​')​
59 ····​{59 ····​{
60 ······​state_·​=·​http_version_h;​60 ······​state_·​=·​http_version_h;​
61 ······​return·boost:​:​indeterminate;​61 ······​return·​indeterminate;​
62 ····​}62 ····​}
63 ····​else·​if·​(is_ctl(input)​)​63 ····​else·​if·​(is_ctl(input)​)​
64 ····​{64 ····​{
65 ······​return·false;​65 ······​return·bad;​
66 ····​}66 ····​}
67 ····​else67 ····​else
68 ····​{68 ····​{
69 ······​req.​uri.​push_back(input)​;​69 ······​req.​uri.​push_back(input)​;​
70 ······​return·boost:​:​indeterminate;​70 ······​return·​indeterminate;​
71 ····​}71 ····​}
72 ··​case·​http_version_h:​72 ··​case·​http_version_h:​
73 ····​if·​(input·​==·​'H')​73 ····​if·​(input·​==·​'H')​
74 ····​{74 ····​{
75 ······​state_·​=·​http_version_t_1;​75 ······​state_·​=·​http_version_t_1;​
76 ······​return·boost:​:​indeterminate;​76 ······​return·​indeterminate;​
77 ····​}77 ····​}
78 ····​else78 ····​else
79 ····​{79 ····​{
80 ······​return·false;​80 ······​return·bad;​
81 ····​}81 ····​}
82 ··​case·​http_version_t_1:​82 ··​case·​http_version_t_1:​
83 ····​if·​(input·​==·​'T')​83 ····​if·​(input·​==·​'T')​
84 ····​{84 ····​{
85 ······​state_·​=·​http_version_t_2;​85 ······​state_·​=·​http_version_t_2;​
86 ······​return·boost:​:​indeterminate;​86 ······​return·​indeterminate;​
87 ····​}87 ····​}
88 ····​else88 ····​else
89 ····​{89 ····​{
90 ······​return·false;​90 ······​return·bad;​
91 ····​}91 ····​}
92 ··​case·​http_version_t_2:​92 ··​case·​http_version_t_2:​
93 ····​if·​(input·​==·​'T')​93 ····​if·​(input·​==·​'T')​
94 ····​{94 ····​{
95 ······​state_·​=·​http_version_p;​95 ······​state_·​=·​http_version_p;​
96 ······​return·boost:​:​indeterminate;​96 ······​return·​indeterminate;​
97 ····​}97 ····​}
98 ····​else98 ····​else
99 ····​{99 ····​{
100 ······​return·false;​100 ······​return·bad;​
101 ····​}101 ····​}
102 ··​case·​http_version_p:​102 ··​case·​http_version_p:​
103 ····​if·​(input·​==·​'P')​103 ····​if·​(input·​==·​'P')​
104 ····​{104 ····​{
105 ······​state_·​=·​http_version_slash;​105 ······​state_·​=·​http_version_slash;​
106 ······​return·boost:​:​indeterminate;​106 ······​return·​indeterminate;​
107 ····​}107 ····​}
108 ····​else108 ····​else
109 ····​{109 ····​{
110 ······​return·false;​110 ······​return·bad;​
111 ····​}111 ····​}
112 ··​case·​http_version_slash:​112 ··​case·​http_version_slash:​
113 ····​if·​(input·​==·​'/​')​113 ····​if·​(input·​==·​'/​')​
114 ····​{114 ····​{
115 ······​req.​http_version_major·​=·​0;​115 ······​req.​http_version_major·​=·​0;​
116 ······​req.​http_version_minor·​=·​0;​116 ······​req.​http_version_minor·​=·​0;​
117 ······​state_·​=·​http_version_major_st​art;​117 ······​state_·​=·​http_version_major_st​art;​
118 ······​return·boost:​:​indeterminate;​118 ······​return·​indeterminate;​
119 ····​}119 ····​}
120 ····​else120 ····​else
121 ····​{121 ····​{
122 ······​return·false;​122 ······​return·bad;​
123 ····​}123 ····​}
124 ··​case·​http_version_major_st​art:​124 ··​case·​http_version_major_st​art:​
125 ····​if·​(is_digit(input)​)​125 ····​if·​(is_digit(input)​)​
126 ····​{126 ····​{
127 ······​req.​http_version_major·​=·​req.​http_version_major·​*·​10·​+·​input·​-​·​'0';​127 ······​req.​http_version_major·​=·​req.​http_version_major·​*·​10·​+·​input·​-​·​'0';​
128 ······​state_·​=·​http_version_major;​128 ······​state_·​=·​http_version_major;​
129 ······​return·boost:​:​indeterminate;​129 ······​return·​indeterminate;​
130 ····​}130 ····​}
131 ····​else131 ····​else
132 ····​{132 ····​{
133 ······​return·false;​133 ······​return·bad;​
134 ····​}134 ····​}
135 ··​case·​http_version_major:​135 ··​case·​http_version_major:​
136 ····​if·​(input·​==·​'.​')​136 ····​if·​(input·​==·​'.​')​
137 ····​{137 ····​{
138 ······​state_·​=·​http_version_minor_st​art;​138 ······​state_·​=·​http_version_minor_st​art;​
139 ······​return·boost:​:​indeterminate;​139 ······​return·​indeterminate;​
140 ····​}140 ····​}
141 ····​else·​if·​(is_digit(input)​)​141 ····​else·​if·​(is_digit(input)​)​
142 ····​{142 ····​{
143 ······​req.​http_version_major·​=·​req.​http_version_major·​*·​10·​+·​input·​-​·​'0';​143 ······​req.​http_version_major·​=·​req.​http_version_major·​*·​10·​+·​input·​-​·​'0';​
144 ······​return·boost:​:​indeterminate;​144 ······​return·​indeterminate;​
145 ····​}145 ····​}
146 ····​else146 ····​else
147 ····​{147 ····​{
148 ······​return·false;​148 ······​return·bad;​
149 ····​}149 ····​}
150 ··​case·​http_version_minor_st​art:​150 ··​case·​http_version_minor_st​art:​
151 ····​if·​(is_digit(input)​)​151 ····​if·​(is_digit(input)​)​
152 ····​{152 ····​{
153 ······​req.​http_version_minor·​=·​req.​http_version_minor·​*·​10·​+·​input·​-​·​'0';​153 ······​req.​http_version_minor·​=·​req.​http_version_minor·​*·​10·​+·​input·​-​·​'0';​
154 ······​state_·​=·​http_version_minor;​154 ······​state_·​=·​http_version_minor;​
155 ······​return·boost:​:​indeterminate;​155 ······​return·​indeterminate;​
156 ····​}156 ····​}
157 ····​else157 ····​else
158 ····​{158 ····​{
159 ······​return·false;​159 ······​return·bad;​
160 ····​}160 ····​}
161 ··​case·​http_version_minor:​161 ··​case·​http_version_minor:​
162 ····​if·​(input·​==·​'\r')​162 ····​if·​(input·​==·​'\r')​
163 ····​{163 ····​{
164 ······​state_·​=·​expecting_newline_1;​164 ······​state_·​=·​expecting_newline_1;​
165 ······​return·boost:​:​indeterminate;​165 ······​return·​indeterminate;​
166 ····​}166 ····​}
167 ····​else·​if·​(is_digit(input)​)​167 ····​else·​if·​(is_digit(input)​)​
168 ····​{168 ····​{
169 ······​req.​http_version_minor·​=·​req.​http_version_minor·​*·​10·​+·​input·​-​·​'0';​169 ······​req.​http_version_minor·​=·​req.​http_version_minor·​*·​10·​+·​input·​-​·​'0';​
170 ······​return·boost:​:​indeterminate;​170 ······​return·​indeterminate;​
171 ····​}171 ····​}
172 ····​else172 ····​else
173 ····​{173 ····​{
174 ······​return·false;​174 ······​return·bad;​
175 ····​}175 ····​}
176 ··​case·​expecting_newline_1:​176 ··​case·​expecting_newline_1:​
177 ····​if·​(input·​==·​'\n')​177 ····​if·​(input·​==·​'\n')​
178 ····​{178 ····​{
179 ······​state_·​=·​header_line_start;​179 ······​state_·​=·​header_line_start;​
180 ······​return·boost:​:​indeterminate;​180 ······​return·​indeterminate;​
181 ····​}181 ····​}
182 ····​else182 ····​else
183 ····​{183 ····​{
184 ······​return·false;​184 ······​return·bad;​
185 ····​}185 ····​}
186 ··​case·​header_line_start:​186 ··​case·​header_line_start:​
187 ····​if·​(input·​==·​'\r')​187 ····​if·​(input·​==·​'\r')​
188 ····​{188 ····​{
189 ······​state_·​=·​expecting_newline_3;​189 ······​state_·​=·​expecting_newline_3;​
190 ······​return·boost:​:​indeterminate;​190 ······​return·​indeterminate;​
191 ····​}191 ····​}
192 ····​else·​if·​(!req.​headers.​empty()​·​&&·​(input·​==·​'·​'·​||·​input·​==·​'\t')​)​192 ····​else·​if·​(!req.​headers.​empty()​·​&&·​(input·​==·​'·​'·​||·​input·​==·​'\t')​)​
193 ····​{193 ····​{
194 ······​state_·​=·​header_lws;​194 ······​state_·​=·​header_lws;​
195 ······​return·boost:​:​indeterminate;​195 ······​return·​indeterminate;​
196 ····​}196 ····​}
197 ····​else·​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​197 ····​else·​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​
198 ····​{198 ····​{
199 ······​return·false;​199 ······​return·bad;​
200 ····​}200 ····​}
201 ····​else201 ····​else
202 ····​{202 ····​{
203 ······​req.​headers.​push_back(header()​)​;​203 ······​req.​headers.​push_back(header()​)​;​
204 ······​req.​headers.​back()​.​name.​push_back(input)​;​204 ······​req.​headers.​back()​.​name.​push_back(input)​;​
205 ······​state_·​=·​header_name;​205 ······​state_·​=·​header_name;​
206 ······​return·boost:​:​indeterminate;​206 ······​return·​indeterminate;​
207 ····​}207 ····​}
208 ··​case·​header_lws:​208 ··​case·​header_lws:​
209 ····​if·​(input·​==·​'\r')​209 ····​if·​(input·​==·​'\r')​
210 ····​{210 ····​{
211 ······​state_·​=·​expecting_newline_2;​211 ······​state_·​=·​expecting_newline_2;​
212 ······​return·boost:​:​indeterminate;​212 ······​return·​indeterminate;​
213 ····​}213 ····​}
214 ····​else·​if·​(input·​==·​'·​'·​||·​input·​==·​'\t')​214 ····​else·​if·​(input·​==·​'·​'·​||·​input·​==·​'\t')​
215 ····​{215 ····​{
216 ······​return·boost:​:​indeterminate;​216 ······​return·​indeterminate;​
217 ····​}217 ····​}
218 ····​else·​if·​(is_ctl(input)​)​218 ····​else·​if·​(is_ctl(input)​)​
219 ····​{219 ····​{
220 ······​return·false;​220 ······​return·bad;​
221 ····​}221 ····​}
222 ····​else222 ····​else
223 ····​{223 ····​{
224 ······​state_·​=·​header_value;​224 ······​state_·​=·​header_value;​
225 ······​req.​headers.​back()​.​value.​push_back(input)​;​225 ······​req.​headers.​back()​.​value.​push_back(input)​;​
226 ······​return·boost:​:​indeterminate;​226 ······​return·​indeterminate;​
227 ····​}227 ····​}
228 ··​case·​header_name:​228 ··​case·​header_name:​
229 ····​if·​(input·​==·​':​')​229 ····​if·​(input·​==·​':​')​
230 ····​{230 ····​{
231 ······​state_·​=·​space_before_header_v​alue;​231 ······​state_·​=·​space_before_header_v​alue;​
232 ······​return·boost:​:​indeterminate;​232 ······​return·​indeterminate;​
233 ····​}233 ····​}
234 ····​else·​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​234 ····​else·​if·​(!is_char(input)​·​||·​is_ctl(input)​·​||·​is_tspecial(input)​)​
235 ····​{235 ····​{
236 ······​return·false;​236 ······​return·bad;​
237 ····​}237 ····​}
238 ····​else238 ····​else
239 ····​{239 ····​{
240 ······​req.​headers.​back()​.​name.​push_back(input)​;​240 ······​req.​headers.​back()​.​name.​push_back(input)​;​
241 ······​return·boost:​:​indeterminate;​241 ······​return·​indeterminate;​
242 ····​}242 ····​}
243 ··​case·​space_before_header_v​alue:​243 ··​case·​space_before_header_v​alue:​
244 ····​if·​(input·​==·​'·​')​244 ····​if·​(input·​==·​'·​')​
245 ····​{245 ····​{
246 ······​state_·​=·​header_value;​246 ······​state_·​=·​header_value;​
247 ······​return·boost:​:​indeterminate;​247 ······​return·​indeterminate;​
248 ····​}248 ····​}
249 ····​else249 ····​else
250 ····​{250 ····​{
251 ······​return·false;​251 ······​return·bad;​
252 ····​}252 ····​}
253 ··​case·​header_value:​253 ··​case·​header_value:​
254 ····​if·​(input·​==·​'\r')​254 ····​if·​(input·​==·​'\r')​
255 ····​{255 ····​{
256 ······​state_·​=·​expecting_newline_2;​256 ······​state_·​=·​expecting_newline_2;​
257 ······​return·boost:​:​indeterminate;​257 ······​return·​indeterminate;​
258 ····​}258 ····​}
259 ····​else·​if·​(is_ctl(input)​)​259 ····​else·​if·​(is_ctl(input)​)​
260 ····​{260 ····​{
261 ······​return·false;​261 ······​return·bad;​
262 ····​}262 ····​}
263 ····​else263 ····​else
264 ····​{264 ····​{
265 ······​req.​headers.​back()​.​value.​push_back(input)​;​265 ······​req.​headers.​back()​.​value.​push_back(input)​;​
266 ······​return·boost:​:​indeterminate;​266 ······​return·​indeterminate;​
267 ····​}267 ····​}
268 ··​case·​expecting_newline_2:​268 ··​case·​expecting_newline_2:​
269 ····​if·​(input·​==·​'\n')​269 ····​if·​(input·​==·​'\n')​
270 ····​{270 ····​{
271 ······​state_·​=·​header_line_start;​271 ······​state_·​=·​header_line_start;​
272 ······​return·boost:​:​indeterminate;​272 ······​return·​indeterminate;​
273 ····​}273 ····​}
274 ····​else274 ····​else
275 ····​{275 ····​{
276 ······​return·false;​276 ······​return·bad;​
277 ····​}277 ····​}
278 ··​case·​expecting_newline_3:​278 ··​case·​expecting_newline_3:​
279 ····​return·​(input·​==·​'\n')​;​279 ····​return·​(input·​==·​'\n')​·?·good·:​·bad;​
280 ··​default:​280 ··​default:​
281 ····​return·false;​281 ····​return·bad;​
282 ··​}282 ··​}
283 }283 }
284 284
285 bool·​request_parser:​:​is_char(int·​c)​285 bool·​request_parser:​:​is_char(int·​c)​
286 {286 {
287 ··​return·​c·​>=·​0·​&&·​c·​<=·​127;​287 ··​return·​c·​>=·​0·​&&·​c·​<=·​127;​
288 }288 }
289 289
290 bool·​request_parser:​:​is_ctl(int·​c)​290 bool·​request_parser:​:​is_ctl(int·​c)​
291 {291 {
292 ··​return·​(c·​>=·​0·​&&·​c·​<=·​31)​·​||·​(c·​==·​127)​;​292 ··​return·​(c·​>=·​0·​&&·​c·​<=·​31)​·​||·​(c·​==·​127)​;​
293 }293 }
294 294
295 bool·​request_parser:​:​is_tspecial(int·​c)​295 bool·​request_parser:​:​is_tspecial(int·​c)​
296 {296 {
297 ··​switch·​(c)​297 ··​switch·​(c)​
298 ··​{298 ··​{
299 ··​case·​'(':​·​case·​')​':​·​case·​'<':​·​case·​'>':​·​case·​'@':​299 ··​case·​'(':​·​case·​')​':​·​case·​'<':​·​case·​'>':​·​case·​'@':​
300 ··​case·​',​':​·​case·​';​':​·​case·​':​':​·​case·​'\\':​·​case·​'"':​300 ··​case·​',​':​·​case·​';​':​·​case·​':​':​·​case·​'\\':​·​case·​'"':​
301 ··​case·​'/​':​·​case·​'[':​·​case·​']':​·​case·​'?':​·​case·​'=':​301 ··​case·​'/​':​·​case·​'[':​·​case·​']':​·​case·​'?':​·​case·​'=':​
302 ··​case·​'{':​·​case·​'}':​·​case·​'·​':​·​case·​'\t':​302 ··​case·​'{':​·​case·​'}':​·​case·​'·​':​·​case·​'\t':​
303 ····​return·​true;​303 ····​return·​true;​
304 ··​default:​304 ··​default:​
305 ····​return·​false;​305 ····​return·​false;​
306 ··​}306 ··​}
307 }307 }
308 308
309 bool·​request_parser:​:​is_digit(int·​c)​309 bool·​request_parser:​:​is_digit(int·​c)​
310 {310 {
311 ··​return·​c·​>=·​'0'·​&&·​c·​<=·​'9';​311 ··​return·​c·​>=·​'0'·​&&·​c·​<=·​'9';​
312 }312 }
313 313
314 }·​/​/​·​namespace·​server314 }·​/​/​·​namespace·​server
315 }·​/​/​·​namespace·​http315 }·​/​/​·​namespace·​http
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/request_parser.hpp.html b/include/asio/doc/examples/diffs/http/server/request_parser.hpp.html new file mode 100644 index 0000000..a47d4c6 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/request_parser.hpp.html @@ -0,0 +1,138 @@ + + + + + + + HTML Diff http/server/request_parser.hpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​request_parser.​hppsrc/​examples/​cpp11/​http/​server/​request_parser.​hpp
1 /​/​1 /​/​
2 /​/​·​request_parser.​hpp2 /​/​·​request_parser.​hpp
3 /​/​·​~~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #ifndef·​HTTP_REQUEST_PARSER_H​PP11 #ifndef·​HTTP_REQUEST_PARSER_H​PP
12 #define·​HTTP_REQUEST_PARSER_H​PP12 #define·​HTTP_REQUEST_PARSER_H​PP
13 13
14 #include·​<boost/​logic/​tribool.​hpp>14 #include·​<tuple>
15 #include·<boost/​tuple/​tuple.​hpp>
16 15
17 namespace·​http·​{16 namespace·​http·​{
18 namespace·​server·​{17 namespace·​server·​{
19 18
20 struct·​request;​19 struct·​request;​
21 20
22 /​/​/​·​Parser·​for·​incoming·​requests.​21 /​/​/​·​Parser·​for·​incoming·​requests.​
23 class·​request_parser22 class·​request_parser
24 {23 {
25 public:​24 public:​
26 ··​/​/​/​·​Construct·​ready·​to·​parse·​the·​request·​method.​25 ··​/​/​/​·​Construct·​ready·​to·​parse·​the·​request·​method.​
27 ··​request_parser()​;​26 ··​request_parser()​;​
28 27
29 ··​/​/​/​·​Reset·​to·​initial·​parser·​state.​28 ··​/​/​/​·​Reset·​to·​initial·​parser·​state.​
30 ··​void·​reset()​;​29 ··​void·​reset()​;​
31 30
32 ··​/​/​/​·Parse·some·data.​·The·tribool·return·value·is·true·when·a·complete·request31 ··​/​/​/​·Result·of·​parse.​
33 ··/​/​/​·has·been·parsed,​·false·if·the·data·is·invalid,​·​indeterminate·when·more32 ··​enum·result_type·{·good,​·bad,​·​indeterminate·};​
34 ··/​/​/​·data·is·required.​·The·InputIterator·return·value·indicates·how·much·of·the33
35 ··​/​/​/​·input·has·been·​consumed.​34 ··​/​/​/​·Parse·some·data.​·The·enum·return·value·is·good·when·a·​complete·request·has
35 ··​/​/​/​·​been·​parsed,​·​bad·​if·​the·​data·​is·​invalid,​·​indeterminate·​when·​more·​data·​is
36 ··​/​/​/​·​required.​·​The·​InputIterator·​return·​value·​indicates·​how·​much·​of·​the·​input
37 ··​/​/​/​·​has·​been·​consumed.​
36 ··​template·​<typename·​InputIterator>38 ··​template·​<typename·​InputIterator>
37 ··boost:​:​tuple<boost:​:​tribool,​·​InputIterator>·​parse(request&·​req,​39 ··​std:​:​tuple<result_type,​·​InputIterator>·​parse(request&·​req,​
38 ······​InputIterator·​begin,​·​InputIterator·​end)​40 ······​InputIterator·​begin,​·​InputIterator·​end)​
39 ··​{41 ··​{
40 ····​while·​(begin·​!=·​end)​42 ····​while·​(begin·​!=·​end)​
41 ····​{43 ····​{
42 ······boost:​:​tribool·​result·​=·​consume(req,​·​*begin++)​;​44 ······result_type·​result·​=·​consume(req,​·​*begin++)​;​
43 ······​if·​(result·​||·!result)​45 ······​if·​(result·==·good·​||·​result·==·bad)​
44 ········​return·boost:​:​make_tuple(result,​·​begin)​;​46 ········​return·​std:​:​make_tuple(result,​·​begin)​;​
45 ····​}47 ····​}
46 ····boost:​:​tribool·result·=·boost:​:​indeterminate;​48 ····return·std:​:​make_tuple(indetermin​ate,​·begin)​;​
47 ····return·boost:​:​make_tuple(result,​·begin)​;​
48 ··​}49 ··​}
49 50
50 private:​51 private:​
51 ··​/​/​/​·​Handle·​the·​next·​character·​of·​input.​52 ··​/​/​/​·​Handle·​the·​next·​character·​of·​input.​
52 ··boost:​:​tribool·​consume(request&·​req,​·​char·​input)​;​53 ··result_type·​consume(request&·​req,​·​char·​input)​;​
53 54
54 ··​/​/​/​·​Check·​if·​a·​byte·​is·​an·​HTTP·​character.​55 ··​/​/​/​·​Check·​if·​a·​byte·​is·​an·​HTTP·​character.​
55 ··​static·​bool·​is_char(int·​c)​;​56 ··​static·​bool·​is_char(int·​c)​;​
56 57
57 ··​/​/​/​·​Check·​if·​a·​byte·​is·​an·​HTTP·​control·​character.​58 ··​/​/​/​·​Check·​if·​a·​byte·​is·​an·​HTTP·​control·​character.​
58 ··​static·​bool·​is_ctl(int·​c)​;​59 ··​static·​bool·​is_ctl(int·​c)​;​
59 60
60 ··​/​/​/​·​Check·​if·​a·​byte·​is·​defined·​as·​an·​HTTP·​tspecial·​character.​61 ··​/​/​/​·​Check·​if·​a·​byte·​is·​defined·​as·​an·​HTTP·​tspecial·​character.​
61 ··​static·​bool·​is_tspecial(int·​c)​;​62 ··​static·​bool·​is_tspecial(int·​c)​;​
62 63
63 ··​/​/​/​·​Check·​if·​a·​byte·​is·​a·​digit.​64 ··​/​/​/​·​Check·​if·​a·​byte·​is·​a·​digit.​
64 ··​static·​bool·​is_digit(int·​c)​;​65 ··​static·​bool·​is_digit(int·​c)​;​
65 66
66 ··​/​/​/​·​The·​current·​state·​of·​the·​parser.​67 ··​/​/​/​·​The·​current·​state·​of·​the·​parser.​
67 ··​enum·​state68 ··​enum·​state
68 ··​{69 ··​{
69 ····​method_start,​70 ····​method_start,​
70 ····​method,​71 ····​method,​
71 ····​uri,​72 ····​uri,​
72 ····​http_version_h,​73 ····​http_version_h,​
73 ····​http_version_t_1,​74 ····​http_version_t_1,​
74 ····​http_version_t_2,​75 ····​http_version_t_2,​
75 ····​http_version_p,​76 ····​http_version_p,​
76 ····​http_version_slash,​77 ····​http_version_slash,​
77 ····​http_version_major_st​art,​78 ····​http_version_major_st​art,​
78 ····​http_version_major,​79 ····​http_version_major,​
79 ····​http_version_minor_st​art,​80 ····​http_version_minor_st​art,​
80 ····​http_version_minor,​81 ····​http_version_minor,​
81 ····​expecting_newline_1,​82 ····​expecting_newline_1,​
82 ····​header_line_start,​83 ····​header_line_start,​
83 ····​header_lws,​84 ····​header_lws,​
84 ····​header_name,​85 ····​header_name,​
85 ····​space_before_header_v​alue,​86 ····​space_before_header_v​alue,​
86 ····​header_value,​87 ····​header_value,​
87 ····​expecting_newline_2,​88 ····​expecting_newline_2,​
88 ····​expecting_newline_389 ····​expecting_newline_3
89 ··​}·​state_;​90 ··​}·​state_;​
90 };​91 };​
91 92
92 }·​/​/​·​namespace·​server93 }·​/​/​·​namespace·​server
93 }·​/​/​·​namespace·​http94 }·​/​/​·​namespace·​http
94 95
95 #endif·​/​/​·​HTTP_REQUEST_PARSER_H​PP96 #endif·​/​/​·​HTTP_REQUEST_PARSER_H​PP
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/server.cpp.html b/include/asio/doc/examples/diffs/http/server/server.cpp.html new file mode 100644 index 0000000..587ed54 --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/server.cpp.html @@ -0,0 +1,145 @@ + + + + + + + HTML Diff http/server/server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​server.​cppsrc/​examples/​cpp11/​http/​server/​server.​cpp
1 /​/​1 /​/​
2 /​/​·​server.​cpp2 /​/​·​server.​cpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"server.​hpp"11 #include·​"server.​hpp"
12 #include·​<boost/​bind/​bind.​hpp>
13 #include·​<signal.​h>12 #include·​<signal.​h>
13 #include·​<utility>
14 14
15 namespace·​http·​{15 namespace·​http·​{
16 namespace·​server·​{16 namespace·​server·​{
17 17
18 server:​:​server(const·​std:​:​string&·​address,​·​const·​std:​:​string&·​port,​18 server:​:​server(const·​std:​:​string&·​address,​·​const·​std:​:​string&·​port,​
19 ····​const·​std:​:​string&·​doc_root)​19 ····​const·​std:​:​string&·​doc_root)​
20 ··​:​·​io_context_()​,​20 ··​:​·​io_context_(1)​,​
21 ····​signals_(io_context_)​,​21 ····​signals_(io_context_)​,​
22 ····​acceptor_(io_context_​)​,​22 ····​acceptor_(io_context_​)​,​
23 ····​connection_manager_()​,​23 ····​connection_manager_()​,​
24 ····​new_connection_()​,​
25 ····​request_handler_(doc_​root)​24 ····​request_handler_(doc_​root)​
26 {25 {
27 ··​/​/​·​Register·​to·​handle·​the·​signals·​that·​indicate·​when·​the·​server·​should·​exit.​26 ··​/​/​·​Register·​to·​handle·​the·​signals·​that·​indicate·​when·​the·​server·​should·​exit.​
28 ··​/​/​·​It·​is·​safe·​to·​register·​for·​the·​same·​signal·​multiple·​times·​in·​a·​program,​27 ··​/​/​·​It·​is·​safe·​to·​register·​for·​the·​same·​signal·​multiple·​times·​in·​a·​program,​
29 ··​/​/​·​provided·​all·​registration·​for·​the·​specified·​signal·​is·​made·​through·​Asio.​28 ··​/​/​·​provided·​all·​registration·​for·​the·​specified·​signal·​is·​made·​through·​Asio.​
30 ··​signals_.​add(SIGINT)​;​29 ··​signals_.​add(SIGINT)​;​
31 ··​signals_.​add(SIGTERM)​;​30 ··​signals_.​add(SIGTERM)​;​
32 #if·​defined(SIGQUIT)​31 #if·​defined(SIGQUIT)​
33 ··​signals_.​add(SIGQUIT)​;​32 ··​signals_.​add(SIGQUIT)​;​
34 #endif·​/​/​·​defined(SIGQUIT)​33 #endif·​/​/​·​defined(SIGQUIT)​
35 ··signals_.​async_wait(boost:​:​bind(&server:​:​handle_stop,​·this)​)​;​34
35 ··​do_await_stop()​;​
36 36
37 ··​/​/​·​Open·​the·​acceptor·​with·​the·​option·​to·​reuse·​the·​address·​(i.​e.​·​SO_REUSEADDR)​.​37 ··​/​/​·​Open·​the·​acceptor·​with·​the·​option·​to·​reuse·​the·​address·​(i.​e.​·​SO_REUSEADDR)​.​
38 ··​asio:​:​ip:​:​tcp:​:​resolver·​resolver(io_context_)​;​38 ··​asio:​:​ip:​:​tcp:​:​resolver·​resolver(io_context_)​;​
39 ··​asio:​:​ip:​:​tcp:​:​endpoint·​endpoint·​=39 ··​asio:​:​ip:​:​tcp:​:​endpoint·​endpoint·​=
40 ····​*resolver.​resolve(address,​·​port)​.​begin()​;​40 ····​*resolver.​resolve(address,​·​port)​.​begin()​;​
41 ··​acceptor_.​open(endpoint.​protocol()​)​;​41 ··​acceptor_.​open(endpoint.​protocol()​)​;​
42 ··​acceptor_.​set_option(asio:​:​ip:​:​tcp:​:​acceptor:​:​reuse_address(true)​)​;​42 ··​acceptor_.​set_option(asio:​:​ip:​:​tcp:​:​acceptor:​:​reuse_address(true)​)​;​
43 ··​acceptor_.​bind(endpoint)​;​43 ··​acceptor_.​bind(endpoint)​;​
44 ··​acceptor_.​listen()​;​44 ··​acceptor_.​listen()​;​
45 45
46 ··start_accept()​;​46 ··do_accept()​;​
47 }47 }
48 48
49 void·​server:​:​run()​49 void·​server:​:​run()​
50 {50 {
51 ··​/​/​·​The·​io_context:​:​run()​·​call·​will·​block·​until·​all·​asynchronous·​operations51 ··​/​/​·​The·​io_context:​:​run()​·​call·​will·​block·​until·​all·​asynchronous·​operations
52 ··​/​/​·​have·​finished.​·​While·​the·​server·​is·​running,​·​there·​is·​always·​at·​least·​one52 ··​/​/​·​have·​finished.​·​While·​the·​server·​is·​running,​·​there·​is·​always·​at·​least·​one
53 ··​/​/​·​asynchronous·​operation·​outstanding:​·​the·​asynchronous·​accept·​call·​waiting53 ··​/​/​·​asynchronous·​operation·​outstanding:​·​the·​asynchronous·​accept·​call·​waiting
54 ··​/​/​·​for·​new·​incoming·​connections.​54 ··​/​/​·​for·​new·​incoming·​connections.​
55 ··​io_context_.​run()​;​55 ··​io_context_.​run()​;​
56 }56 }
57 57
58 void·​server:​:​start_accept()​58 void·​server:​:​do_accept()​
59 {
60 ··new_connection_.​reset(new·connection(io_context​_,​
61 ········connection_manager_,​·request_handler_)​)​;​
62 ··acceptor_.​async_accept(new_conn​ection_-​>socket()​,​
63 ······boost:​:​bind(&server:​:​handle_accept,​·this,​
64 ········asio:​:​placeholders:​:​error)​)​;​
65 }
66
67 void·server:​:​handle_accept(const·asio:​:​error_code&·e)​
68 {59 {
69 ··/​/​·Check·whether·the·server·was·stopped·by·a·signal·before·this·completion60 ··acceptor_.​async_accept(
70 ··/​/​·​handler·had·​a·chance·to·run.​61 ······[this](std:​:​error_code·ec,​·​asio:​:​ip:​:​tcp:​:​socket·socket)​
71 ··if·(!acceptor_.​is_open()​)​62 ······{
72 ··{63 ········/​/​·Check·whether·the·server·was·stopped·by·a·signal·before·this
73 ····​return;​64 ········/​/​·completion·handler·had·a·chance·to·run.​
74 ··}65 ········if·(!acceptor_.​is_open()​)​
75 66 ········{
76 ··if·(!e)​67 ··········return;​
77 ··{68 ········}
78 ····connection_manager_.​start(new_connection_​)​;​69
79 ··}70 ········if·(!ec)​
71 ········​{
72 ··········​connection_manager_.​start(std:​:​make_shared<connectio​n>(
73 ··············​std:​:​move(socket)​,​·​connection_manager_,​·​request_handler_)​)​;​
74 ········​}
80 75
81 ··start_accept()​;​76 ········do_accept()​;​
77 ······​})​;​
82 }78 }
83 79
84 void·​server:​:​handle_stop()​80 void·​server:​:​do_await_stop()​
85 {81 {
86 ··/​/​·The·server·is·​stopped·by·cancelling·all·outstanding·asynchronous82 ··​signals_.​async_wait(
87 ··/​/​·operations.​·Once·all·operations·have·finished·the·​io_context:​:​run()​·call83 ······[this](std:​:​error_code·/​*ec*/​,​·​int·/​*signo*/​)​
88 ··/​/​·will·exit.​84 ······{
89 ··acceptor_.​close()​;​85 ········/​/​·The·server·is·stopped·by·cancelling·all·outstanding·asynchronous
90 ··connection_manager_.​stop_all()​;​86 ········/​/​·operations.​·Once·all·operations·have·finished·the·io_context:​:​run()​
87 ········​/​/​·​call·​will·​exit.​
88 ········​acceptor_.​close()​;​
89 ········​connection_manager_.​stop_all()​;​
90 ······​})​;​
91 }91 }
92 92
93 }·​/​/​·​namespace·​server93 }·​/​/​·​namespace·​server
94 }·​/​/​·​namespace·​http94 }·​/​/​·​namespace·​http
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/http/server/server.hpp.html b/include/asio/doc/examples/diffs/http/server/server.hpp.html new file mode 100644 index 0000000..da8aaaf --- /dev/null +++ b/include/asio/doc/examples/diffs/http/server/server.hpp.html @@ -0,0 +1,112 @@ + + + + + + + HTML Diff http/server/server.hpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​http/​server/​server.​hppsrc/​examples/​cpp11/​http/​server/​server.​hpp
1 /​/​1 /​/​
2 /​/​·​server.​hpp2 /​/​·​server.​hpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #ifndef·​HTTP_SERVER_HPP11 #ifndef·​HTTP_SERVER_HPP
12 #define·​HTTP_SERVER_HPP12 #define·​HTTP_SERVER_HPP
13 13
14 #include·​<asio.​hpp>14 #include·​<asio.​hpp>
15 #include·​<string>15 #include·​<string>
16 #include·​<boost/​noncopyable.​hpp>
17 #include·​"connection.​hpp"16 #include·​"connection.​hpp"
18 #include·​"connection_manager.​hpp"17 #include·​"connection_manager.​hpp"
19 #include·​"request_handler.​hpp"18 #include·​"request_handler.​hpp"
20 19
21 namespace·​http·​{20 namespace·​http·​{
22 namespace·​server·​{21 namespace·​server·​{
23 22
24 /​/​/​·​The·​top-​level·​class·​of·​the·​HTTP·​server.​23 /​/​/​·​The·​top-​level·​class·​of·​the·​HTTP·​server.​
25 class·​server24 class·​server
26 ··​:​·​private·​boost:​:​noncopyable
27 {25 {
28 public:​26 public:​
27 ··​server(const·​server&)​·​=·​delete;​
28 ··​server&·​operator=(const·​server&)​·​=·​delete;​
29
29 ··​/​/​/​·​Construct·​the·​server·​to·​listen·​on·​the·​specified·​TCP·​address·​and·​port,​·​and30 ··​/​/​/​·​Construct·​the·​server·​to·​listen·​on·​the·​specified·​TCP·​address·​and·​port,​·​and
30 ··​/​/​/​·​serve·​up·​files·​from·​the·​given·​directory.​31 ··​/​/​/​·​serve·​up·​files·​from·​the·​given·​directory.​
31 ··​explicit·​server(const·​std:​:​string&·​address,​·​const·​std:​:​string&·​port,​32 ··​explicit·​server(const·​std:​:​string&·​address,​·​const·​std:​:​string&·​port,​
32 ······​const·​std:​:​string&·​doc_root)​;​33 ······​const·​std:​:​string&·​doc_root)​;​
33 34
34 ··​/​/​/​·​Run·​the·​server's·​io_context·​loop.​35 ··​/​/​/​·​Run·​the·​server's·​io_context·​loop.​
35 ··​void·​run()​;​36 ··​void·​run()​;​
36 37
37 private:​38 private:​
38 ··​/​/​/​·Initiate·​an·​asynchronous·​accept·​operation.​39 ··​/​/​/​·Perform·​an·​asynchronous·​accept·​operation.​
39 ··​void·start_accept()​;​40 ··​void·do_accept()​;​
40
41 ··/​/​/​·Handle·completion·of·an·asynchronous·accept·operation.​
42 ··void·handle_accept(const·asio:​:​error_code&·e)​;​
43 41
44 ··​/​/​/​·Handle·​a·​request·​to·​stop·​the·​server.​42 ··​/​/​/​·Wait·for·​a·​request·​to·​stop·​the·​server.​
45 ··​void·handle_stop()​;​43 ··​void·do_await_stop()​;​
46 44
47 ··​/​/​/​·​The·​io_context·​used·​to·​perform·​asynchronous·​operations.​45 ··​/​/​/​·​The·​io_context·​used·​to·​perform·​asynchronous·​operations.​
48 ··​asio:​:​io_context·​io_context_;​46 ··​asio:​:​io_context·​io_context_;​
49 47
50 ··​/​/​/​·​The·​signal_set·​is·​used·​to·​register·​for·​process·​termination·​notifications.​48 ··​/​/​/​·​The·​signal_set·​is·​used·​to·​register·​for·​process·​termination·​notifications.​
51 ··​asio:​:​signal_set·​signals_;​49 ··​asio:​:​signal_set·​signals_;​
52 50
53 ··​/​/​/​·​Acceptor·​used·​to·​listen·​for·​incoming·​connections.​51 ··​/​/​/​·​Acceptor·​used·​to·​listen·​for·​incoming·​connections.​
54 ··​asio:​:​ip:​:​tcp:​:​acceptor·​acceptor_;​52 ··​asio:​:​ip:​:​tcp:​:​acceptor·​acceptor_;​
55 53
56 ··​/​/​/​·​The·​connection·​manager·​which·​owns·​all·​live·​connections.​54 ··​/​/​/​·​The·​connection·​manager·​which·​owns·​all·​live·​connections.​
57 ··​connection_manager·​connection_manager_;​55 ··​connection_manager·​connection_manager_;​
58 56
59 ··​/​/​/​·​The·​next·​connection·​to·​be·​accepted.​
60 ··​connection_ptr·​new_connection_;​
61
62 ··​/​/​/​·​The·​handler·​for·​all·​incoming·​requests.​57 ··​/​/​/​·​The·​handler·​for·​all·​incoming·​requests.​
63 ··​request_handler·​request_handler_;​58 ··​request_handler·​request_handler_;​
64 };​59 };​
65 60
66 }·​/​/​·​namespace·​server61 }·​/​/​·​namespace·​server
67 }·​/​/​·​namespace·​http62 }·​/​/​·​namespace·​http
68 63
69 #endif·​/​/​·​HTTP_SERVER_HPP64 #endif·​/​/​·​HTTP_SERVER_HPP
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/invocation/prioritised_handlers.cpp.html b/include/asio/doc/examples/diffs/invocation/prioritised_handlers.cpp.html new file mode 100644 index 0000000..c247094 --- /dev/null +++ b/include/asio/doc/examples/diffs/invocation/prioritised_handlers.cpp.html @@ -0,0 +1,247 @@ + + + + + + + HTML Diff invocation/prioritised_handlers.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​invocation/​prioritised_handlers.​cppsrc/​examples/​cpp11/​invocation/​prioritised_handlers.​cpp
1 /​/​1 /​/​
2 /​/​·​prioritised_handlers.​cpp2 /​/​·​prioritised_handlers.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"asio.​hpp"11 #include·​"asio.​hpp"
12 #include·​<boost/​function.​hpp>
13 #include·​<iostream>12 #include·​<iostream>
13 #include·​<memory>
14 #include·​<queue>14 #include·​<queue>
15 15
16 using·​asio:​:​ip:​:​tcp;​16 using·​asio:​:​ip:​:​tcp;​
17 17
18 class·​handler_priority_queu​e·​:​·​public·​asio:​:​execution_context18 class·​handler_priority_queu​e·​:​·​public·​asio:​:​execution_context
19 {19 {
20 public:​20 public:​
21 ··void·add(int·priority,​·boost:​:​function<void()​>·function)​21 ··​template·<typename·Function>
22 ··​void·​add(int·​priority,​·​Function·​function)​
22 ··​{23 ··​{
23 ····handlers_.​push(queued_handler(p​riority,​·function)​)​;​24 ····std:​:​unique_ptr<queued_han​dler_base>·handler(
25 ········​new·​queued_handler<Functi​on>(
26 ··········​priority,​·​std:​:​move(function)​)​)​;​
27
28 ····​handlers_.​push(std:​:​move(handler)​)​;​
24 ··​}29 ··​}
25 30
26 ··​void·​execute_all()​31 ··​void·​execute_all()​
27 ··​{32 ··​{
28 ····​while·​(!handlers_.​empty()​)​33 ····​while·​(!handlers_.​empty()​)​
29 ····​{34 ····​{
30 ······queued_handler·handler·=·handlers_.​top()​;​35 ······​handlers_.​top()​-​>execute()​;​
31 ······handler.​execute()​;​
32 ······​handlers_.​pop()​;​36 ······​handlers_.​pop()​;​
33 ····​}37 ····​}
34 ··​}38 ··​}
35 39
36 ··​class·​executor40 ··​class·​executor
37 ··​{41 ··​{
38 ··​public:​42 ··​public:​
39 ····​executor(handler_prio​rity_queue&·​q,​·​int·​p)​43 ····​executor(handler_prio​rity_queue&·​q,​·​int·​p)​
40 ······​:​·​context_(q)​,​·​priority_(p)​44 ······​:​·​context_(q)​,​·​priority_(p)​
41 ····​{45 ····​{
42 ····​}46 ····​}
43 47
44 ····​handler_priority_queu​e&·​context()​·​const48 ····​handler_priority_queu​e&·​context()​·​const·noexcept
45 ····​{49 ····​{
46 ······​return·​context_;​50 ······​return·​context_;​
47 ····​}51 ····​}
48 52
49 ····​template·​<typename·​Function,​·​typename·​Allocator>53 ····​template·​<typename·​Function,​·​typename·​Allocator>
50 ····​void·​dispatch(const·Function&·​f,​·​const·​Allocator&)​·​const54 ····​void·​dispatch(Function·​f,​·​const·​Allocator&)​·​const
51 ····​{55 ····​{
52 ······​context_.​add(priority_,​·​f)​;​56 ······​context_.​add(priority_,​·std:​:​move(f)​)​;​
53 ····​}57 ····​}
54 58
55 ····​template·​<typename·​Function,​·​typename·​Allocator>59 ····​template·​<typename·​Function,​·​typename·​Allocator>
56 ····​void·​post(const·Function&·​f,​·​const·​Allocator&)​·​const60 ····​void·​post(Function·​f,​·​const·​Allocator&)​·​const
57 ····​{61 ····​{
58 ······​context_.​add(priority_,​·​f)​;​62 ······​context_.​add(priority_,​·std:​:​move(f)​)​;​
59 ····​}63 ····​}
60 64
61 ····​template·​<typename·​Function,​·​typename·​Allocator>65 ····​template·​<typename·​Function,​·​typename·​Allocator>
62 ····​void·​defer(const·Function&·​f,​·​const·​Allocator&)​·​const66 ····​void·​defer(Function·​f,​·​const·​Allocator&)​·​const
63 ····​{67 ····​{
64 ······​context_.​add(priority_,​·​f)​;​68 ······​context_.​add(priority_,​·std:​:​move(f)​)​;​
65 ····​}69 ····​}
66 70
67 ····​void·​on_work_started()​·​const·​{}71 ····​void·​on_work_started()​·​const·noexcept·​{}
68 ····​void·​on_work_finished()​·​const·​{}72 ····​void·​on_work_finished()​·​const·noexcept·​{}
69 73
70 ····​bool·​operator==(const·​executor&·​other)​·​const74 ····​bool·​operator==(const·​executor&·​other)​·​const·noexcept
71 ····​{75 ····​{
72 ······​return·​&context_·​==·​&other.​context_·​&&·​priority_·​==·​other.​priority_;​76 ······​return·​&context_·​==·​&other.​context_·​&&·​priority_·​==·​other.​priority_;​
73 ····​}77 ····​}
74 78
75 ····​bool·​operator!=(const·​executor&·​other)​·​const79 ····​bool·​operator!=(const·​executor&·​other)​·​const·noexcept
76 ····​{80 ····​{
77 ······​return·​!operator==(other)​;​81 ······​return·​!operator==(other)​;​
78 ····​}82 ····​}
79 83
80 ··​private:​84 ··​private:​
81 ····​handler_priority_queu​e&·​context_;​85 ····​handler_priority_queu​e&·​context_;​
82 ····​int·​priority_;​86 ····​int·​priority_;​
83 ··​};​87 ··​};​
84 88
85 ··​template·​<typename·​Handler>89 ··​template·​<typename·​Handler>
86 ··​asio:​:​executor_binder<Handl​er,​·​executor>90 ··​asio:​:​executor_binder<Handl​er,​·​executor>
87 ··​wrap(int·​priority,​·​Handler·​handler)​91 ··​wrap(int·​priority,​·​Handler·​handler)​
88 ··​{92 ··​{
89 ····​return·​asio:​:​bind_executor(executo​r(*this,​·priority)​,​·handler)​;​93 ····​return·​asio:​:​bind_executor(
94 ········​executor(*this,​·​priority)​,​·​std:​:​move(handler)​)​;​
90 ··​}95 ··​}
91 96
92 private:​97 private:​
93 ··​class·​queued_handler98 ··​class·​queued_handler_base
94 ··​{99 ··​{
95 ··​public:​100 ··​public:​
96 ····​queued_handler(int·p,​·boost:​:​function<void()​>·f)​101 ····​queued_handler_base(i​nt·p)​
97 ······​:​·​priority_(p)​,​·function_(f)​102 ······​:​·​priority_(p)​
98 ····​{103 ····​{
99 ····​}104 ····​}
100 105
101 ····​void·​execute()​106 ····​virtual·~queued_handler_base(​)​
102 ····​{107 ····​{
103 ······​function_()​;​
104 ····​}108 ····​}
105 109
106 ····friend·bool·operator<(const·queued_handler&·a,​110 ····virtual·void·​execute()​·=·0;​
107 ········const·queued_handler&·b)​111
112 ····​friend·​bool·​operator<(const·​std:​:​unique_ptr<queued_han​dler_base>&·​a,​
113 ········​const·​std:​:​unique_ptr<queued_han​dler_base>&·​b)​·​noexcept
108 ····​{114 ····​{
109 ······​return·​a.​priority_·​<·​b.​priority_;​115 ······​return·​a-​>priority_·​<·​b-​>priority_;​
110 ····​}116 ····​}
111 117
112 ··​private:​118 ··​private:​
113 ····​int·​priority_;​119 ····​int·​priority_;​
114 ····​boost:​:​function<void()​>·​function_;​
115 ··​};​120 ··​};​
116 121
117 ··std:​:​priority_queue<queued​_handler>·handlers_;​122 ··​template·<typename·Function>
123 ··​class·​queued_handler·​:​·​public·​queued_handler_base
124 ··​{
125 ··​public:​
126 ····​queued_handler(int·​p,​·​Function·​f)​
127 ······​:​·​queued_handler_base(p​)​,​·​function_(std:​:​move(f)​)​
128 ····​{
129 ····​}
130
131 ····​void·​execute()​·​override
132 ····​{
133 ······​function_()​;​
134 ····​}
135
136 ··​private:​
137 ····​Function·​function_;​
138 ··​};​
139
140 ··​std:​:​priority_queue<std:​:​unique_ptr<queued_han​dler_base>>·​handlers_;​
118 };​141 };​
119 142
120 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​143 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
121 144
122 void·​high_priority_handler​(const·​asio:​:​error_code&·​/​*ec*/​)​145 void·​high_priority_handler​(const·​asio:​:​error_code&·​/​*ec*/​,​
146 ····​tcp:​:​socket·​/​*socket*/​)​
123 {147 {
124 ··​std:​:​cout·​<<·​"High·​priority·​handler\n";​148 ··​std:​:​cout·​<<·​"High·​priority·​handler\n";​
125 }149 }
126 150
127 void·​middle_priority_handl​er(const·​asio:​:​error_code&·​/​*ec*/​)​151 void·​middle_priority_handl​er(const·​asio:​:​error_code&·​/​*ec*/​)​
128 {152 {
129 ··​std:​:​cout·​<<·​"Middle·​priority·​handler\n";​153 ··​std:​:​cout·​<<·​"Middle·​priority·​handler\n";​
130 }154 }
131 155
132 void·​low_priority_handler(​)​156 struct·​low_priority_handler
133 {157 {
134 ··std:​:​cout·<<·"Low·priority·handler\n";​158 ··/​/​·Make·the·handler·a·move-​only·type.​
135 }159 ··low_priority_handler(​)​·=·default;​
160 ··​low_priority_handler(​const·​low_priority_handler&​)​·​=·​delete;​
161 ··​low_priority_handler(​low_priority_handler&​&)​·​=·​default;​
162
163 ··​void·​operator()​()​
164 ··​{
165 ····​std:​:​cout·​<<·​"Low·​priority·​handler\n";​
166 ··​}
167 };​
136 168
137 int·​main()​169 int·​main()​
138 {170 {
139 ··​asio:​:​io_context·​io_context;​171 ··​asio:​:​io_context·​io_context;​
140 172
141 ··​handler_priority_queu​e·​pri_queue;​173 ··​handler_priority_queu​e·​pri_queue;​
142 174
143 ··​/​/​·​Post·​a·​completion·​handler·​to·​be·​run·​immediately.​175 ··​/​/​·​Post·​a·​completion·​handler·​to·​be·​run·​immediately.​
144 ··​asio:​:​post(io_context,​·​pri_queue.​wrap(0,​·​low_priority_handler)​)​;​176 ··​asio:​:​post(io_context,​·​pri_queue.​wrap(0,​·​low_priority_handler(​)​)​)​;​
145 177
146 ··​/​/​·​Start·​an·​asynchronous·​accept·​that·​will·​complete·​immediately.​178 ··​/​/​·​Start·​an·​asynchronous·​accept·​that·​will·​complete·​immediately.​
147 ··​tcp:​:​endpoint·​endpoint(asio:​:​ip:​:​address_v4:​:​loopback()​,​·​0)​;​179 ··​tcp:​:​endpoint·​endpoint(asio:​:​ip:​:​address_v4:​:​loopback()​,​·​0)​;​
148 ··​tcp:​:​acceptor·​acceptor(io_context,​·​endpoint)​;​180 ··​tcp:​:​acceptor·​acceptor(io_context,​·​endpoint)​;​
149 ··​tcp:​:​socket·​server_socket(io_cont​ext)​;​181 ··​tcp:​:​socket·​server_socket(io_cont​ext)​;​
150 ··​acceptor.​async_accept(server_s​ocket,​182 ··​acceptor.​async_accept(pri_queu​e.​wrap(100,​·high_priority_handler​)​)​;​
151 ······pri_queue.​wrap(100,​·high_priority_handler​)​)​;​
152 ··​tcp:​:​socket·​client_socket(io_cont​ext)​;​183 ··​tcp:​:​socket·​client_socket(io_cont​ext)​;​
153 ··​client_socket.​connect(acceptor.​local_endpoint()​)​;​184 ··​client_socket.​connect(acceptor.​local_endpoint()​)​;​
154 185
155 ··​/​/​·​Set·​a·​deadline·​timer·​to·​expire·​immediately.​186 ··​/​/​·​Set·​a·​deadline·​timer·​to·​expire·​immediately.​
156 ··​asio:​:​steady_timer·​timer(io_context)​;​187 ··​asio:​:​steady_timer·​timer(io_context)​;​
157 ··​timer.​expires_at(asio:​:​steady_timer:​:​time_point:​:​min()​)​;​188 ··​timer.​expires_at(asio:​:​steady_timer:​:​clock_type:​:​time_point:​:​min()​)​;​
158 ··​timer.​async_wait(pri_queue.​wrap(42,​·​middle_priority_handl​er)​)​;​189 ··​timer.​async_wait(pri_queue.​wrap(42,​·​middle_priority_handl​er)​)​;​
159 190
160 ··​while·​(io_context.​run_one()​)​191 ··​while·​(io_context.​run_one()​)​
161 ··​{192 ··​{
162 ····​/​/​·​The·​custom·​invocation·​hook·​adds·​the·​handlers·​to·​the·​priority·​queue193 ····​/​/​·​The·​custom·​invocation·​hook·​adds·​the·​handlers·​to·​the·​priority·​queue
163 ····​/​/​·​rather·​than·​executing·​them·​from·​within·​the·​poll_one()​·​call.​194 ····​/​/​·​rather·​than·​executing·​them·​from·​within·​the·​poll_one()​·​call.​
164 ····​while·​(io_context.​poll_one()​)​195 ····​while·​(io_context.​poll_one()​)​
165 ······​;​196 ······​;​
166 197
167 ····​pri_queue.​execute_all()​;​198 ····​pri_queue.​execute_all()​;​
168 ··​}199 ··​}
169 200
170 ··​return·​0;​201 ··​return·​0;​
171 }202 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/iostreams/http_client.cpp.html b/include/asio/doc/examples/diffs/iostreams/http_client.cpp.html new file mode 100644 index 0000000..b08403b --- /dev/null +++ b/include/asio/doc/examples/diffs/iostreams/http_client.cpp.html @@ -0,0 +1,131 @@ + + + + + + + HTML Diff iostreams/http_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​iostreams/​http_client.​cppsrc/​examples/​cpp11/​iostreams/​http_client.​cpp
1 /​/​1 /​/​
2 /​/​·​http_client.​cpp2 /​/​·​http_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<iostream>11 #include·​<iostream>
12 #include·​<istream>12 #include·​<istream>
13 #include·​<ostream>13 #include·​<ostream>
14 #include·​<string>14 #include·​<string>
15 #include·​<asio/​ip/​tcp.​hpp>15 #include·​<asio/​ip/​tcp.​hpp>
16 16
17 using·​asio:​:​ip:​:​tcp;​17 using·​asio:​:​ip:​:​tcp;​
18 18
19 int·​main(int·​argc,​·​char*·​argv[])​19 int·​main(int·​argc,​·​char*·​argv[])​
20 {20 {
21 ··​try21 ··​try
22 ··​{22 ··​{
23 ····​if·​(argc·​!=·​3)​23 ····​if·​(argc·​!=·​3)​
24 ····​{24 ····​{
25 ······​std:​:​cout·​<<·​"Usage:​·​http_client·​<server>·​<path>\n";​25 ······​std:​:​cout·​<<·​"Usage:​·​http_client·​<server>·​<path>\n";​
26 ······​std:​:​cout·​<<·​"Example:​\n";​26 ······​std:​:​cout·​<<·​"Example:​\n";​
27 ······​std:​:​cout·​<<·​"··​http_client·​www.​boost.​org·​/​LICENSE_1_0.​txt\n";​27 ······​std:​:​cout·​<<·​"··​http_client·​www.​boost.​org·​/​LICENSE_1_0.​txt\n";​
28 ······​return·​1;​28 ······​return·​1;​
29 ····​}29 ····​}
30 30
31 ····​asio:​:​ip:​:​tcp:​:​iostream·​s;​31 ····​asio:​:​ip:​:​tcp:​:​iostream·​s;​
32 32
33 ····​/​/​·​The·​entire·​sequence·​of·​I/​O·​operations·​must·​complete·​within·​60·​seconds.​33 ····​/​/​·​The·​entire·​sequence·​of·​I/​O·​operations·​must·​complete·​within·​60·​seconds.​
34 ····​/​/​·​If·​an·​expiry·​occurs,​·​the·​socket·​is·​automatically·​closed·​and·​the·​stream34 ····​/​/​·​If·​an·​expiry·​occurs,​·​the·​socket·​is·​automatically·​closed·​and·​the·​stream
35 ····​/​/​·​becomes·​bad.​35 ····​/​/​·​becomes·​bad.​
36 ····​s.​expires_after(asio:​:​chrono:​:​seconds(60)​)​;​36 ····​s.​expires_after(std:​:​chrono:​:​seconds(60)​)​;​
37 37
38 ····​/​/​·​Establish·​a·​connection·​to·​the·​server.​38 ····​/​/​·​Establish·​a·​connection·​to·​the·​server.​
39 ····​s.​connect(argv[1],​·​"http")​;​39 ····​s.​connect(argv[1],​·​"http")​;​
40 ····​if·​(!s)​40 ····​if·​(!s)​
41 ····​{41 ····​{
42 ······​std:​:​cout·​<<·​"Unable·​to·​connect:​·​"·​<<·​s.​error()​.​message()​·​<<·​"\n";​42 ······​std:​:​cout·​<<·​"Unable·​to·​connect:​·​"·​<<·​s.​error()​.​message()​·​<<·​"\n";​
43 ······​return·​1;​43 ······​return·​1;​
44 ····​}44 ····​}
45 45
46 ····​/​/​·​Send·​the·​request.​·​We·​specify·​the·​"Connection:​·​close"·​header·​so·​that·​the46 ····​/​/​·​Send·​the·​request.​·​We·​specify·​the·​"Connection:​·​close"·​header·​so·​that·​the
47 ····​/​/​·​server·​will·​close·​the·​socket·​after·​transmitting·​the·​response.​·​This·​will47 ····​/​/​·​server·​will·​close·​the·​socket·​after·​transmitting·​the·​response.​·​This·​will
48 ····​/​/​·​allow·​us·​to·​treat·​all·​data·​up·​until·​the·​EOF·​as·​the·​content.​48 ····​/​/​·​allow·​us·​to·​treat·​all·​data·​up·​until·​the·​EOF·​as·​the·​content.​
49 ····​s·​<<·​"GET·​"·​<<·​argv[2]·​<<·​"·​HTTP/​1.​0\r\n";​49 ····​s·​<<·​"GET·​"·​<<·​argv[2]·​<<·​"·​HTTP/​1.​0\r\n";​
50 ····​s·​<<·​"Host:​·​"·​<<·​argv[1]·​<<·​"\r\n";​50 ····​s·​<<·​"Host:​·​"·​<<·​argv[1]·​<<·​"\r\n";​
51 ····​s·​<<·​"Accept:​·​*/​*\r\n";​51 ····​s·​<<·​"Accept:​·​*/​*\r\n";​
52 ····​s·​<<·​"Connection:​·​close\r\n\r\n";​52 ····​s·​<<·​"Connection:​·​close\r\n\r\n";​
53 53
54 ····​/​/​·​By·​default,​·​the·​stream·​is·​tied·​with·​itself.​·​This·​means·​that·​the·​stream54 ····​/​/​·​By·​default,​·​the·​stream·​is·​tied·​with·​itself.​·​This·​means·​that·​the·​stream
55 ····​/​/​·​automatically·​flush·​the·​buffered·​output·​before·​attempting·​a·​read.​·​It·​is55 ····​/​/​·​automatically·​flush·​the·​buffered·​output·​before·​attempting·​a·​read.​·​It·​is
56 ····​/​/​·​not·​necessary·​not·​explicitly·​flush·​the·​stream·​at·​this·​point.​56 ····​/​/​·​not·​necessary·​not·​explicitly·​flush·​the·​stream·​at·​this·​point.​
57 57
58 ····​/​/​·​Check·​that·​response·​is·​OK.​58 ····​/​/​·​Check·​that·​response·​is·​OK.​
59 ····​std:​:​string·​http_version;​59 ····​std:​:​string·​http_version;​
60 ····​s·​>>·​http_version;​60 ····​s·​>>·​http_version;​
61 ····​unsigned·​int·​status_code;​61 ····​unsigned·​int·​status_code;​
62 ····​s·​>>·​status_code;​62 ····​s·​>>·​status_code;​
63 ····​std:​:​string·​status_message;​63 ····​std:​:​string·​status_message;​
64 ····​std:​:​getline(s,​·​status_message)​;​64 ····​std:​:​getline(s,​·​status_message)​;​
65 ····​if·​(!s·​||·​http_version.​substr(0,​·​5)​·​!=·​"HTTP/​")​65 ····​if·​(!s·​||·​http_version.​substr(0,​·​5)​·​!=·​"HTTP/​")​
66 ····​{66 ····​{
67 ······​std:​:​cout·​<<·​"Invalid·​response\n";​67 ······​std:​:​cout·​<<·​"Invalid·​response\n";​
68 ······​return·​1;​68 ······​return·​1;​
69 ····​}69 ····​}
70 ····​if·​(status_code·​!=·​200)​70 ····​if·​(status_code·​!=·​200)​
71 ····​{71 ····​{
72 ······​std:​:​cout·​<<·​"Response·​returned·​with·​status·​code·​"·​<<·​status_code·​<<·​"\n";​72 ······​std:​:​cout·​<<·​"Response·​returned·​with·​status·​code·​"·​<<·​status_code·​<<·​"\n";​
73 ······​return·​1;​73 ······​return·​1;​
74 ····​}74 ····​}
75 75
76 ····​/​/​·​Process·​the·​response·​headers,​·​which·​are·​terminated·​by·​a·​blank·​line.​76 ····​/​/​·​Process·​the·​response·​headers,​·​which·​are·​terminated·​by·​a·​blank·​line.​
77 ····​std:​:​string·​header;​77 ····​std:​:​string·​header;​
78 ····​while·​(std:​:​getline(s,​·​header)​·​&&·​header·​!=·​"\r")​78 ····​while·​(std:​:​getline(s,​·​header)​·​&&·​header·​!=·​"\r")​
79 ······​std:​:​cout·​<<·​header·​<<·​"\n";​79 ······​std:​:​cout·​<<·​header·​<<·​"\n";​
80 ····​std:​:​cout·​<<·​"\n";​80 ····​std:​:​cout·​<<·​"\n";​
81 81
82 ····​/​/​·​Write·​the·​remaining·​data·​to·​output.​82 ····​/​/​·​Write·​the·​remaining·​data·​to·​output.​
83 ····​std:​:​cout·​<<·​s.​rdbuf()​;​83 ····​std:​:​cout·​<<·​s.​rdbuf()​;​
84 ··​}84 ··​}
85 ··​catch·​(std:​:​exception&·​e)​85 ··​catch·​(std:​:​exception&·​e)​
86 ··​{86 ··​{
87 ····​std:​:​cout·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​87 ····​std:​:​cout·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
88 ··​}88 ··​}
89 89
90 ··​return·​0;​90 ··​return·​0;​
91 }91 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/local/connect_pair.cpp.html b/include/asio/doc/examples/diffs/local/connect_pair.cpp.html new file mode 100644 index 0000000..6fefa32 --- /dev/null +++ b/include/asio/doc/examples/diffs/local/connect_pair.cpp.html @@ -0,0 +1,198 @@ + + + + + + + HTML Diff local/connect_pair.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​local/​connect_pair.​cppsrc/​examples/​cpp11/​local/​connect_pair.​cpp
1 /​/​1 /​/​
2 /​/​·​connect_pair.​cpp2 /​/​·​connect_pair.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<array>
11 #include·​<iostream>12 #include·​<iostream>
12 #include·​<string>13 #include·​<string>
13 #include·​<cctype>14 #include·​<cctype>
14 #include·​<asio.​hpp>15 #include·​<asio.​hpp>
15 #include·​<boost/​array.​hpp>
16 #include·​<boost/​bind/​bind.​hpp>
17 16
18 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​17 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
19 18
20 using·​asio:​:​local:​:​stream_protocol;​19 using·​asio:​:​local:​:​stream_protocol;​
21 20
22 class·​uppercase_filter21 class·​uppercase_filter
23 {22 {
24 public:​23 public:​
25 ··​uppercase_filter(asio​:​:​io_context&·io_context)​24 ··​uppercase_filter(stre​am_protocol:​:​socket·sock)​
26 ····​:​·​socket_(io_context)​25 ····​:​·​socket_(std:​:​move(sock)​)​
27 ··​{26 ··​{
28 ··}27 ····read()​;​
29
30 ··stream_protocol:​:​socket&·socket()​
31 ··{
32 ····return·socket_;​
33 ··}
34
35 ··void·start()​
36 ··{
37 ····/​/​·Wait·for·request.​
38 ····socket_.​async_read_some(asio:​:​buffer(data_)​,​
39 ········boost:​:​bind(&uppercase_filte​r:​:​handle_read,​
40 ··········this,​·asio:​:​placeholders:​:​error,​
41 ··········asio:​:​placeholders:​:​bytes_transferred)​)​;​
42 ··​}28 ··​}
43 29
44 private:​30 private:​
45 ··​void·handle_read(const·asio:​:​error_code&·ec,​·std:​:​size_t·size)​31 ··​void·​read()​
46 ··​{32 ··​{
47 ····​if·(!ec)​33 ····socket_.​async_read_some(asio:​:​buffer(data_)​,​
48 ····{34 ········[this](std:​:​error_code·ec,​·std:​:​size_t·size)​
49 ······/​/​·Compute·result.​35 ········{
50 ······for·(std:​:​size_t·i·=·0;​·​i·<·size;​·++i)​36 ··········​if·(!ec)​
51 ········data_[i]·=·std:​:​toupper(data_[i])​;​37 ··········{
52 38 ············/​/​·Compute·result.​
53 ······/​/​·Send·result.​39 ············for·(std:​:​size_t·i·=·0;​·i·<·size;​·++i)​
54 ······asio:​:​async_write(socket_,​·asio:​:​buffer(data_,​·size)​,​40 ··············data_[i]·=·​std:​:​toupper(data_[i])​;​
55 ··········boost:​:​bind(&uppercase_filte​r:​:​handle_write,​41
56 ············this,​·asio:​:​placeholders:​:​error)​)​;​42 ············/​/​·Send·result.​
57 ····}43 ············write(size)​;​
58 ····else44 ··········}
59 ····{45 ··········else
60 ······throw·asio:​:​system_error(ec)​;​46 ··········{
61 ····}47 ············throw·asio:​:​system_error(ec)​;​
62 ··​}48 ··········​}
63 49 ········})​;​
64 ··void·handle_write(const·asio:​:​error_code&·ec)​50 ··}
65 ··{51
66 ····if·(!ec)​52 ··void·write(std:​:​size_t·size)​
67 ····​{53 ··​{
68 ······/​/​·Wait·for·request.​54 ····asio:​:​async_write(socket_,​·asio:​:​buffer(data_,​·size)​,​
69 ······socket_.​async_read_some(asio:​:​buffer(data_)​,​55 ········[this](std:​:​error_code·ec,​·std:​:​size_t·/​*size*/​)​
70 ··········boost:​:​bind(&uppercase_filte​r:​:​handle_read,​56 ········{
71 ············this,​·asio:​:​placeholders:​:​error,​57 ··········​if·(!ec)​
72 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​58 ··········{
73 ····}59 ············/​/​·Wait·for·request.​
74 ····​else60 ············read()​;​
75 ····{61 ··········}
76 ······throw·asio:​:​system_error(ec)​;​62 ··········else
77 ····}63 ··········{
64 ············​throw·​asio:​:​system_error(ec)​;​
65 ··········​}
66 ········​})​;​
78 ··​}67 ··​}
79 68
80 ··​stream_protocol:​:​socket·​socket_;​69 ··​stream_protocol:​:​socket·​socket_;​
81 ··boost:​:​array<char,​·​512>·​data_;​70 ··​std:​:​array<char,​·​512>·​data_;​
82 };​71 };​
83 72
84 void·​run(asio:​:​io_context*·​io_context)​
85 {
86 ··​try
87 ··​{
88 ····​io_context-​>run()​;​
89 ··​}
90 ··​catch·​(std:​:​exception&·​e)​
91 ··​{
92 ····​std:​:​cerr·​<<·​"Exception·​in·​thread:​·​"·​<<·​e.​what()​·​<<·​"\n";​
93 ····​std:​:​exit(1)​;​
94 ··​}
95 }
96
97 int·​main()​73 int·​main()​
98 {74 {
99 ··​try75 ··​try
100 ··​{76 ··​{
101 ····​asio:​:​io_context·​io_context;​77 ····​asio:​:​io_context·​io_context;​
102 78
103 ····​/​/​·​Create·filter·​and·establish·a·connection·to·it.​79 ····​/​/​·​Create·a·connected·pair·and·pass·one·end·to·a·filter.​
104 ····uppercase_filter·filter(io_context)​;​
105 ····​stream_protocol:​:​socket·​socket(io_context)​;​80 ····​stream_protocol:​:​socket·​socket(io_context)​;​
106 ····asio:​:​local:​:​connect_pair(socket,​·​filter.​socket()​)​;​81 ····​stream_protocol:​:​socket·​filter_socket(io_cont​ext)​;​
107 ····​filter.​start()​;​82 ····asio:​:​local:​:​connect_pair(socket,​·​filter_socket)​;​
83 ····​uppercase_filter·​filter(std:​:​move(filter_socket)​)​;​
108 84
109 ····​/​/​·​The·​io_context·​runs·​in·​a·​background·​thread·​to·​perform·​filtering.​85 ····​/​/​·​The·​io_context·​runs·​in·​a·​background·​thread·​to·​perform·​filtering.​
110 ····​asio:​:​thread·​thread(boost:​:​bind(run,​·&io_context)​)​;​86 ····​asio:​:​thread·​thread(
87 ········​[&io_context]()​
88 ········​{
89 ··········​try
90 ··········​{
91 ············​io_context.​run()​;​
92 ··········​}
93 ··········​catch·​(std:​:​exception&·​e)​
94 ··········​{
95 ············​std:​:​cerr·​<<·​"Exception·​in·​thread:​·​"·​<<·​e.​what()​·​<<·​"\n";​
96 ············​std:​:​exit(1)​;​
97 ··········​}
98 ········​})​;​
111 99
112 ····​for·​(;​;​)​100 ····​for·​(;​;​)​
113 ····​{101 ····​{
114 ······​/​/​·​Collect·​request·​from·​user.​102 ······​/​/​·​Collect·​request·​from·​user.​
115 ······​std:​:​cout·​<<·​"Enter·​a·​string:​·​";​103 ······​std:​:​cout·​<<·​"Enter·​a·​string:​·​";​
116 ······​std:​:​string·​request;​104 ······​std:​:​string·​request;​
117 ······​std:​:​getline(std:​:​cin,​·​request)​;​105 ······​std:​:​getline(std:​:​cin,​·​request)​;​
118 106
119 ······​/​/​·​Send·​request·​to·​filter.​107 ······​/​/​·​Send·​request·​to·​filter.​
120 ······​asio:​:​write(socket,​·​asio:​:​buffer(request)​)​;​108 ······​asio:​:​write(socket,​·​asio:​:​buffer(request)​)​;​
121 109
122 ······​/​/​·​Wait·​for·​reply·​from·​filter.​110 ······​/​/​·​Wait·​for·​reply·​from·​filter.​
123 ······​std:​:​vector<char>·​reply(request.​size()​)​;​111 ······​std:​:​vector<char>·​reply(request.​size()​)​;​
124 ······​asio:​:​read(socket,​·​asio:​:​buffer(reply)​)​;​112 ······​asio:​:​read(socket,​·​asio:​:​buffer(reply)​)​;​
125 113
126 ······​/​/​·​Show·​reply·​to·​user.​114 ······​/​/​·​Show·​reply·​to·​user.​
127 ······​std:​:​cout·​<<·​"Result:​·​";​115 ······​std:​:​cout·​<<·​"Result:​·​";​
128 ······​std:​:​cout.​write(&reply[0],​·​request.​size()​)​;​116 ······​std:​:​cout.​write(&reply[0],​·​request.​size()​)​;​
129 ······​std:​:​cout·​<<·​std:​:​endl;​117 ······​std:​:​cout·​<<·​std:​:​endl;​
130 ····​}118 ····​}
131 ··​}119 ··​}
132 ··​catch·​(std:​:​exception&·​e)​120 ··​catch·​(std:​:​exception&·​e)​
133 ··​{121 ··​{
134 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​122 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
135 ····​std:​:​exit(1)​;​123 ····​std:​:​exit(1)​;​
136 ··​}124 ··​}
137 }125 }
138 126
139 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​127 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
140 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​128 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​
141 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​129 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/local/iostream_client.cpp.html b/include/asio/doc/examples/diffs/local/iostream_client.cpp.html new file mode 100644 index 0000000..a7a6ccf --- /dev/null +++ b/include/asio/doc/examples/diffs/local/iostream_client.cpp.html @@ -0,0 +1,102 @@ + + + + + + + HTML Diff local/iostream_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​local/​iostream_client.​cppsrc/​examples/​cpp11/​local/​iostream_client.​cpp
1 /​/​1 /​/​
2 /​/​·​stream_client.​cpp2 /​/​·​stream_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstring>11 #include·​<cstring>
12 #include·​<iostream>12 #include·​<iostream>
13 #include·​"asio.​hpp"13 #include·​"asio.​hpp"
14 14
15 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​15 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
16 16
17 using·​asio:​:​local:​:​stream_protocol;​17 using·​asio:​:​local:​:​stream_protocol;​
18 18
19 enum·{·​max_length·​=·​1024·};​19 constexpr·std:​:​size_t·​max_length·​=·​1024;​
20 20
21 int·​main(int·​argc,​·​char*·​argv[])​21 int·​main(int·​argc,​·​char*·​argv[])​
22 {22 {
23 ··​try23 ··​try
24 ··​{24 ··​{
25 ····​if·​(argc·​!=·​2)​25 ····​if·​(argc·​!=·​2)​
26 ····​{26 ····​{
27 ······​std:​:​cerr·​<<·​"Usage:​·​iostream_client·​<file>\n";​27 ······​std:​:​cerr·​<<·​"Usage:​·​iostream_client·​<file>\n";​
28 ······​return·​1;​28 ······​return·​1;​
29 ····​}29 ····​}
30 30
31 ····​stream_protocol:​:​endpoint·​ep(argv[1])​;​31 ····​stream_protocol:​:​endpoint·​ep(argv[1])​;​
32 ····​stream_protocol:​:​iostream·​s(ep)​;​32 ····​stream_protocol:​:​iostream·​s(ep)​;​
33 ····​if·​(!s)​33 ····​if·​(!s)​
34 ····​{34 ····​{
35 ······​std:​:​cerr·​<<·​"Unable·​to·​connect:​·​"·​<<·​s.​error()​.​message()​·​<<·​std:​:​endl;​35 ······​std:​:​cerr·​<<·​"Unable·​to·​connect:​·​"·​<<·​s.​error()​.​message()​·​<<·​std:​:​endl;​
36 ······​return·​1;​36 ······​return·​1;​
37 ····​}37 ····​}
38 38
39 ····​using·​namespace·​std;​·​/​/​·​For·​strlen.​
40 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​39 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​
41 ····​char·​request[max_length];​40 ····​char·​request[max_length];​
42 ····​std:​:​cin.​getline(request,​·​max_length)​;​41 ····​std:​:​cin.​getline(request,​·​max_length)​;​
43 ····​size_t·​length·​=·​strlen(request)​;​42 ····​size_t·​length·​=·std:​:​strlen(request)​;​
44 ····​s·​<<·​request;​43 ····​s·​<<·​request;​
45 44
46 ····​char·​reply[max_length];​45 ····​char·​reply[max_length];​
47 ····​s.​read(reply,​·​length)​;​46 ····​s.​read(reply,​·​length)​;​
48 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​47 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​
49 ····​std:​:​cout.​write(reply,​·​length)​;​48 ····​std:​:​cout.​write(reply,​·​length)​;​
50 ····​std:​:​cout·​<<·​"\n";​49 ····​std:​:​cout·​<<·​"\n";​
51 ··​}50 ··​}
52 ··​catch·​(std:​:​exception&·​e)​51 ··​catch·​(std:​:​exception&·​e)​
53 ··​{52 ··​{
54 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​53 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
55 ··​}54 ··​}
56 55
57 ··​return·​0;​56 ··​return·​0;​
58 }57 }
59 58
60 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​59 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
61 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​60 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​
62 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​61 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/local/stream_client.cpp.html b/include/asio/doc/examples/diffs/local/stream_client.cpp.html new file mode 100644 index 0000000..fce5ed8 --- /dev/null +++ b/include/asio/doc/examples/diffs/local/stream_client.cpp.html @@ -0,0 +1,101 @@ + + + + + + + HTML Diff local/stream_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​local/​stream_client.​cppsrc/​examples/​cpp11/​local/​stream_client.​cpp
1 /​/​1 /​/​
2 /​/​·​stream_client.​cpp2 /​/​·​stream_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<cstring>12 #include·​<cstring>
13 #include·​<iostream>13 #include·​<iostream>
14 #include·​"asio.​hpp"14 #include·​"asio.​hpp"
15 15
16 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​16 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
17 17
18 using·​asio:​:​local:​:​stream_protocol;​18 using·​asio:​:​local:​:​stream_protocol;​
19 19
20 enum·{·​max_length·​=·​1024·};​20 constexpr·std:​:​size_t·​max_length·​=·​1024;​
21 21
22 int·​main(int·​argc,​·​char*·​argv[])​22 int·​main(int·​argc,​·​char*·​argv[])​
23 {23 {
24 ··​try24 ··​try
25 ··​{25 ··​{
26 ····​if·​(argc·​!=·​2)​26 ····​if·​(argc·​!=·​2)​
27 ····​{27 ····​{
28 ······​std:​:​cerr·​<<·​"Usage:​·​stream_client·​<file>\n";​28 ······​std:​:​cerr·​<<·​"Usage:​·​stream_client·​<file>\n";​
29 ······​return·​1;​29 ······​return·​1;​
30 ····​}30 ····​}
31 31
32 ····​asio:​:​io_context·​io_context;​32 ····​asio:​:​io_context·​io_context;​
33 33
34 ····​stream_protocol:​:​socket·​s(io_context)​;​34 ····​stream_protocol:​:​socket·​s(io_context)​;​
35 ····​s.​connect(stream_protoc​ol:​:​endpoint(argv[1])​)​;​35 ····​s.​connect(stream_protoc​ol:​:​endpoint(argv[1])​)​;​
36 36
37 ····​using·​namespace·​std;​·​/​/​·​For·​strlen.​
38 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​37 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​
39 ····​char·​request[max_length];​38 ····​char·​request[max_length];​
40 ····​std:​:​cin.​getline(request,​·​max_length)​;​39 ····​std:​:​cin.​getline(request,​·​max_length)​;​
41 ····​size_t·​request_length·​=·​strlen(request)​;​40 ····​size_t·​request_length·​=·std:​:​strlen(request)​;​
42 ····​asio:​:​write(s,​·​asio:​:​buffer(request,​·​request_length)​)​;​41 ····​asio:​:​write(s,​·​asio:​:​buffer(request,​·​request_length)​)​;​
43 42
44 ····​char·​reply[max_length];​43 ····​char·​reply[max_length];​
45 ····​size_t·​reply_length·​=·​asio:​:​read(s,​44 ····​size_t·​reply_length·​=·​asio:​:​read(s,​
46 ········​asio:​:​buffer(reply,​·​request_length)​)​;​45 ········​asio:​:​buffer(reply,​·​request_length)​)​;​
47 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​46 ····​std:​:​cout·​<<·​"Reply·​is:​·​";​
48 ····​std:​:​cout.​write(reply,​·​reply_length)​;​47 ····​std:​:​cout.​write(reply,​·​reply_length)​;​
49 ····​std:​:​cout·​<<·​"\n";​48 ····​std:​:​cout·​<<·​"\n";​
50 ··​}49 ··​}
51 ··​catch·​(std:​:​exception&·​e)​50 ··​catch·​(std:​:​exception&·​e)​
52 ··​{51 ··​{
53 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​52 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
54 ··​}53 ··​}
55 54
56 ··​return·​0;​55 ··​return·​0;​
57 }56 }
58 57
59 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​58 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
60 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​59 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​
61 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​60 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/local/stream_server.cpp.html b/include/asio/doc/examples/diffs/local/stream_server.cpp.html new file mode 100644 index 0000000..a2eb647 --- /dev/null +++ b/include/asio/doc/examples/diffs/local/stream_server.cpp.html @@ -0,0 +1,197 @@ + + + + + + + HTML Diff local/stream_server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​local/​stream_server.​cppsrc/​examples/​cpp11/​local/​stream_server.​cpp
1 /​/​1 /​/​
2 /​/​·​stream_server.​cpp2 /​/​·​stream_server.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<array>
11 #include·​<cstdio>12 #include·​<cstdio>
12 #include·​<iostream>13 #include·​<iostream>
13 #include·​<boost/​array.​hpp>14 #include·​<memory>
14 #include·<boost/​bind/​bind.​hpp>
15 #include·<boost/​enable_shared_from_th​is.​hpp>
16 #include·<boost/​shared_ptr.​hpp>
17 #include·​"asio.​hpp"15 #include·​"asio.​hpp"
18 16
19 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​17 #if·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
20 18
21 using·​asio:​:​local:​:​stream_protocol;​19 using·​asio:​:​local:​:​stream_protocol;​
22 20
23 class·​session21 class·​session
24 ··​:​·​public·boost:​:​enable_shared_from_th​is<session>22 ··​:​·​public·​std:​:​enable_shared_from_th​is<session>
25 {23 {
26 public:​24 public:​
27 ··​session(asio:​:​io_context&·io_context)​25 ··​session(stream_protoc​ol:​:​socket·sock)​
28 ····​:​·​socket_(io_context)​26 ····​:​·​socket_(std:​:​move(sock)​)​
29 ··​{27 ··​{
30 ··​}28 ··​}
31 29
32 ··​stream_protocol:​:​socket&·​socket()​
33 ··​{
34 ····​return·​socket_;​
35 ··​}
36
37 ··​void·​start()​30 ··​void·​start()​
38 ··​{31 ··​{
39 ····socket_.​async_read_some(asio:​:​buffer(data_)​,​32 ····do_read()​;​
40 ········boost:​:​bind(&session:​:​handle_read,​
41 ··········shared_from_this()​,​
42 ··········asio:​:​placeholders:​:​error,​
43 ··········asio:​:​placeholders:​:​bytes_transferred)​)​;​
44 ··}
45
46 ··void·handle_read(const·asio:​:​error_code&·error,​
47 ······size_t·bytes_transferred)​
48 ··{
49 ····if·(!error)​
50 ····{
51 ······asio:​:​async_write(socket_,​
52 ··········asio:​:​buffer(data_,​·bytes_transferred)​,​
53 ··········boost:​:​bind(&session:​:​handle_write,​
54 ············shared_from_this()​,​
55 ············asio:​:​placeholders:​:​error)​)​;​
56 ····}
57 ··​}33 ··​}
58 34
59 ··void·handle_write(const·asio:​:​error_code&·error)​35 private:​
36 ··​void·​do_read()​
60 ··​{37 ··​{
61 ····if·​(!error)​38 ····auto·self(shared_from_this​()​)​;​
62 ····{39 ····socket_.​async_read_some(asio:​:​buffer(data_)​,​
63 ······​socket_.​async_read_some(asio:​:​buffer(data_)​,​40 ········[this,​·self](std:​:​error_code·ec,​·std:​:​size_t·length)​
64 ··········boost:​:​bind(&session:​:​handle_read,​41 ········{
65 ············shared_from_this()​,​42 ··········if·(!ec)​
66 ············asio:​:​placeholders:​:​error,​43 ············do_write(length)​;​
67 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​44 ········})​;​
68 ····​}45 ··​}
46
47 ··​void·​do_write(std:​:​size_t·​length)​
48 ··​{
49 ····​auto·​self(shared_from_this​()​)​;​
50 ····​asio:​:​async_write(socket_,​
51 ········​asio:​:​buffer(data_,​·​length)​,​
52 ········​[this,​·​self](std:​:​error_code·​ec,​·​std:​:​size_t·​/​*length*/​)​
53 ········​{
54 ··········​if·​(!ec)​
55 ············​do_read()​;​
56 ········​})​;​
69 ··​}57 ··​}
70 58
71 private:​
72 ··​/​/​·​The·​socket·​used·​to·​communicate·​with·​the·​client.​59 ··​/​/​·​The·​socket·​used·​to·​communicate·​with·​the·​client.​
73 ··​stream_protocol:​:​socket·​socket_;​60 ··​stream_protocol:​:​socket·​socket_;​
74 61
75 ··​/​/​·​Buffer·​used·​to·​store·​data·​received·​from·​the·​client.​62 ··​/​/​·​Buffer·​used·​to·​store·​data·​received·​from·​the·​client.​
76 ··boost:​:​array<char,​·​1024>·​data_;​63 ··​std:​:​array<char,​·​1024>·​data_;​
77 };​64 };​
78 65
79 typedef·​boost:​:​shared_ptr<session>·​session_ptr;​
80
81 class·​server66 class·​server
82 {67 {
83 public:​68 public:​
84 ··​server(asio:​:​io_context&·​io_context,​·​const·​std:​:​string&·​file)​69 ··​server(asio:​:​io_context&·​io_context,​·​const·​std:​:​string&·​file)​
85 ····​:​·​io_context_(io_contex​t)​,​70 ····​:​·acceptor_(io_context,​·stream_protocol:​:​endpoint(file)​)​
86 ······acceptor_(io_context,​·stream_protocol:​:​endpoint(file)​)​
87 ··​{71 ··​{
88 ····session_ptr·new_session(new·session(io_context_)​)​;​72 ····do_accept()​;​
89 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​
90 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​
91 ··········asio:​:​placeholders:​:​error)​)​;​
92 ··​}73 ··​}
93 74
94 ··void·handle_accept(session​_ptr·new_session,​75 private:​
95 ······const·asio:​:​error_code&·error)​76 ··void·do_accept()​
96 ··​{77 ··​{
97 ····if·(!error)​78 ····acceptor_.​async_accept(
98 ····{79 ········[this](std:​:​error_code·ec,​·stream_protocol:​:​socket·socket)​
99 ······new_session-​>start()​;​80 ········{
100 ····}81 ··········if·(!ec)​
82 ··········​{
83 ············​std:​:​make_shared<session>(​std:​:​move(socket)​)​-​>start()​;​
84 ··········​}
101 85
102 ····new_session.​reset(new·session(io_context_)​)​;​86 ··········do_accept()​;​
103 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​87 ········})​;​
104 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​
105 ··········asio:​:​placeholders:​:​error)​)​;​
106 ··​}88 ··​}
107 89
108 private:​
109 ··​asio:​:​io_context&·​io_context_;​
110 ··​stream_protocol:​:​acceptor·​acceptor_;​90 ··​stream_protocol:​:​acceptor·​acceptor_;​
111 };​91 };​
112 92
113 int·​main(int·​argc,​·​char*·​argv[])​93 int·​main(int·​argc,​·​char*·​argv[])​
114 {94 {
115 ··​try95 ··​try
116 ··​{96 ··​{
117 ····​if·​(argc·​!=·​2)​97 ····​if·​(argc·​!=·​2)​
118 ····​{98 ····​{
119 ······​std:​:​cerr·​<<·​"Usage:​·​stream_server·​<file>\n";​99 ······​std:​:​cerr·​<<·​"Usage:​·​stream_server·​<file>\n";​
120 ······​std:​:​cerr·​<<·​"***·​WARNING:​·​existing·​file·​is·​removed·​***\n";​100 ······​std:​:​cerr·​<<·​"***·​WARNING:​·​existing·​file·​is·​removed·​***\n";​
121 ······​return·​1;​101 ······​return·​1;​
122 ····​}102 ····​}
123 103
124 ····​asio:​:​io_context·​io_context;​104 ····​asio:​:​io_context·​io_context;​
125 105
126 ····​std:​:​remove(argv[1])​;​106 ····​std:​:​remove(argv[1])​;​
127 ····​server·​s(io_context,​·​argv[1])​;​107 ····​server·​s(io_context,​·​argv[1])​;​
128 108
129 ····​io_context.​run()​;​109 ····​io_context.​run()​;​
130 ··​}110 ··​}
131 ··​catch·​(std:​:​exception&·​e)​111 ··​catch·​(std:​:​exception&·​e)​
132 ··​{112 ··​{
133 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​113 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
134 ··​}114 ··​}
135 115
136 ··​return·​0;​116 ··​return·​0;​
137 }117 }
138 118
139 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​119 #else·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
140 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​120 #·​error·​Local·​sockets·​not·​available·​on·​this·​platform.​
141 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​121 #endif·​/​/​·​defined(ASIO_HAS_LOCA​L_SOCKETS)​
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/multicast/receiver.cpp.html b/include/asio/doc/examples/diffs/multicast/receiver.cpp.html new file mode 100644 index 0000000..561f7b7 --- /dev/null +++ b/include/asio/doc/examples/diffs/multicast/receiver.cpp.html @@ -0,0 +1,135 @@ + + + + + + + HTML Diff multicast/receiver.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​multicast/​receiver.​cppsrc/​examples/​cpp11/​multicast/​receiver.​cpp
1 /​/​1 /​/​
2 /​/​·​receiver.​cpp2 /​/​·​receiver.​cpp
3 /​/​·​~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<array>
11 #include·​<iostream>12 #include·​<iostream>
12 #include·​<string>13 #include·​<string>
13 #include·​"asio.​hpp"14 #include·​"asio.​hpp"
14 #include·​"boost/​bind/​bind.​hpp"
15 15
16 const·​short·​multicast_port·​=·​30001;​16 constexpr·​short·​multicast_port·​=·​30001;​
17 17
18 class·​receiver18 class·​receiver
19 {19 {
20 public:​20 public:​
21 ··​receiver(asio:​:​io_context&·​io_context,​21 ··​receiver(asio:​:​io_context&·​io_context,​
22 ······​const·​asio:​:​ip:​:​address&·​listen_address,​22 ······​const·​asio:​:​ip:​:​address&·​listen_address,​
23 ······​const·​asio:​:​ip:​:​address&·​multicast_address)​23 ······​const·​asio:​:​ip:​:​address&·​multicast_address)​
24 ····​:​·​socket_(io_context)​24 ····​:​·​socket_(io_context)​
25 ··​{25 ··​{
26 ····​/​/​·​Create·​the·​socket·​so·​that·​multiple·​may·​be·​bound·​to·​the·​same·​address.​26 ····​/​/​·​Create·​the·​socket·​so·​that·​multiple·​may·​be·​bound·​to·​the·​same·​address.​
27 ····​asio:​:​ip:​:​udp:​:​endpoint·​listen_endpoint(27 ····​asio:​:​ip:​:​udp:​:​endpoint·​listen_endpoint(
28 ········​listen_address,​·​multicast_port)​;​28 ········​listen_address,​·​multicast_port)​;​
29 ····​socket_.​open(listen_endpoint.​protocol()​)​;​29 ····​socket_.​open(listen_endpoint.​protocol()​)​;​
30 ····​socket_.​set_option(asio:​:​ip:​:​udp:​:​socket:​:​reuse_address(true)​)​;​30 ····​socket_.​set_option(asio:​:​ip:​:​udp:​:​socket:​:​reuse_address(true)​)​;​
31 ····​socket_.​bind(listen_endpoint)​;​31 ····​socket_.​bind(listen_endpoint)​;​
32 32
33 ····​/​/​·​Join·​the·​multicast·​group.​33 ····​/​/​·​Join·​the·​multicast·​group.​
34 ····​socket_.​set_option(34 ····​socket_.​set_option(
35 ········​asio:​:​ip:​:​multicast:​:​join_group(multicast_​address)​)​;​35 ········​asio:​:​ip:​:​multicast:​:​join_group(multicast_​address)​)​;​
36 36
37 ····socket_.​async_receive_from(37 ····do_receive()​;​
38 ········asio:​:​buffer(data_,​·max_length)​,​·sender_endpoint_,​
39 ········boost:​:​bind(&receiver:​:​handle_receive_from,​·this,​
40 ··········asio:​:​placeholders:​:​error,​
41 ··········asio:​:​placeholders:​:​bytes_transferred)​)​;​
42 ··​}38 ··​}
43 39
44 ··void·handle_receive_from(c​onst·asio:​:​error_code&·error,​40 private:​
45 ······size_t·bytes_recvd)​41 ··void·do_receive()​
46 ··​{42 ··​{
47 ····if·(!error)​43 ····socket_.​async_receive_from(
48 ····{44 ········asio:​:​buffer(data_)​,​·sender_endpoint_,​
49 ······​std:​:​cout.​write(data_,​·bytes_recvd)​;​45 ········[this](std:​:​error_code·ec,​·std:​:​size_t·length)​
50 ······std:​:​cout·<<·std:​:​endl;​46 ········{
51 47 ··········if·(!ec)​
52 ······socket_.​async_receive_from(48 ··········{
53 ··········asio:​:​buffer(data_,​·max_length)​,​·sender_endpoint_,​49 ············std:​:​cout.​write(data_.​data()​,​·length)​;​
54 ··········boost:​:​bind(&receiver:​:​handle_receive_from,​·this,​50 ············std:​:​cout·<<·std:​:​endl;​
55 ············asio:​:​placeholders:​:​error,​51
56 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​52 ············​do_receive()​;​
57 ····​}53 ··········​}
54 ········​})​;​
58 ··​}55 ··​}
59 56
60 private:​
61 ··​asio:​:​ip:​:​udp:​:​socket·​socket_;​57 ··​asio:​:​ip:​:​udp:​:​socket·​socket_;​
62 ··​asio:​:​ip:​:​udp:​:​endpoint·​sender_endpoint_;​58 ··​asio:​:​ip:​:​udp:​:​endpoint·​sender_endpoint_;​
63 ··enum·{·max_length·=·​1024·};​59 ··std:​:​array<char,​·​1024>·data_;​
64 ··char·data_[max_length];​
65 };​60 };​
66 61
67 int·​main(int·​argc,​·​char*·​argv[])​62 int·​main(int·​argc,​·​char*·​argv[])​
68 {63 {
69 ··​try64 ··​try
70 ··​{65 ··​{
71 ····​if·​(argc·​!=·​3)​66 ····​if·​(argc·​!=·​3)​
72 ····​{67 ····​{
73 ······​std:​:​cerr·​<<·​"Usage:​·​receiver·​<listen_address>·​<multicast_address>\n​";​68 ······​std:​:​cerr·​<<·​"Usage:​·​receiver·​<listen_address>·​<multicast_address>\n​";​
74 ······​std:​:​cerr·​<<·​"··​For·​IPv4,​·​try:​\n";​69 ······​std:​:​cerr·​<<·​"··​For·​IPv4,​·​try:​\n";​
75 ······​std:​:​cerr·​<<·​"····​receiver·​0.​0.​0.​0·​239.​255.​0.​1\n";​70 ······​std:​:​cerr·​<<·​"····​receiver·​0.​0.​0.​0·​239.​255.​0.​1\n";​
76 ······​std:​:​cerr·​<<·​"··​For·​IPv6,​·​try:​\n";​71 ······​std:​:​cerr·​<<·​"··​For·​IPv6,​·​try:​\n";​
77 ······​std:​:​cerr·​<<·​"····​receiver·​0:​:​0·​ff31:​:​8000:​1234\n";​72 ······​std:​:​cerr·​<<·​"····​receiver·​0:​:​0·​ff31:​:​8000:​1234\n";​
78 ······​return·​1;​73 ······​return·​1;​
79 ····​}74 ····​}
80 75
81 ····​asio:​:​io_context·​io_context;​76 ····​asio:​:​io_context·​io_context;​
82 ····​receiver·​r(io_context,​77 ····​receiver·​r(io_context,​
83 ········​asio:​:​ip:​:​make_address(argv[1])​,​78 ········​asio:​:​ip:​:​make_address(argv[1])​,​
84 ········​asio:​:​ip:​:​make_address(argv[2])​)​;​79 ········​asio:​:​ip:​:​make_address(argv[2])​)​;​
85 ····​io_context.​run()​;​80 ····​io_context.​run()​;​
86 ··​}81 ··​}
87 ··​catch·​(std:​:​exception&·​e)​82 ··​catch·​(std:​:​exception&·​e)​
88 ··​{83 ··​{
89 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​84 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
90 ··​}85 ··​}
91 86
92 ··​return·​0;​87 ··​return·​0;​
93 }88 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/multicast/sender.cpp.html b/include/asio/doc/examples/diffs/multicast/sender.cpp.html new file mode 100644 index 0000000..1178664 --- /dev/null +++ b/include/asio/doc/examples/diffs/multicast/sender.cpp.html @@ -0,0 +1,147 @@ + + + + + + + HTML Diff multicast/sender.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​multicast/​sender.​cppsrc/​examples/​cpp11/​multicast/​sender.​cpp
1 /​/​1 /​/​
2 /​/​·​sender.​cpp2 /​/​·​sender.​cpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<iostream>11 #include·​<iostream>
12 #include·​<sstream>12 #include·​<sstream>
13 #include·​<string>13 #include·​<string>
14 #include·​"asio.​hpp"14 #include·​"asio.​hpp"
15 #include·​"boost/​bind/​bind.​hpp"
16 15
17 const·​short·​multicast_port·​=·​30001;​16 constexpr·​short·​multicast_port·​=·​30001;​
18 const·​int·​max_message_count·​=·​10;​17 constexpr·​int·​max_message_count·​=·​10;​
19 18
20 class·​sender19 class·​sender
21 {20 {
22 public:​21 public:​
23 ··​sender(asio:​:​io_context&·​io_context,​22 ··​sender(asio:​:​io_context&·​io_context,​
24 ······​const·​asio:​:​ip:​:​address&·​multicast_address)​23 ······​const·​asio:​:​ip:​:​address&·​multicast_address)​
25 ····​:​·​endpoint_(multicast_a​ddress,​·​multicast_port)​,​24 ····​:​·​endpoint_(multicast_a​ddress,​·​multicast_port)​,​
26 ······​socket_(io_context,​·​endpoint_.​protocol()​)​,​25 ······​socket_(io_context,​·​endpoint_.​protocol()​)​,​
27 ······​timer_(io_context)​,​26 ······​timer_(io_context)​,​
28 ······​message_count_(0)​27 ······​message_count_(0)​
29 ··​{28 ··​{
29 ····​do_send()​;​
30 ··​}
31
32 private:​
33 ··​void·​do_send()​
34 ··​{
30 ····​std:​:​ostringstream·​os;​35 ····​std:​:​ostringstream·​os;​
31 ····​os·​<<·​"Message·​"·​<<·​message_count_++;​36 ····​os·​<<·​"Message·​"·​<<·​message_count_++;​
32 ····​message_·​=·​os.​str()​;​37 ····​message_·​=·​os.​str()​;​
33 38
34 ····​socket_.​async_send_to(39 ····​socket_.​async_send_to(
35 ········​asio:​:​buffer(message_)​,​·​endpoint_,​40 ········​asio:​:​buffer(message_)​,​·​endpoint_,​
36 ········boost:​:​bind(&sender:​:​handle_send_to,​·this,​41 ········[this](std:​:​error_code·ec,​·std:​:​size_t·/​*length*/​)​
37 ··········asio:​:​placeholders:​:​error)​)​;​42 ········{
43 ··········​if·​(!ec·​&&·​message_count_·​<·​max_message_count)​
44 ············​do_timeout()​;​
45 ········​})​;​
38 ··​}46 ··​}
39 47
40 ··​void·handle_send_to(const·asio:​:​error_code&·error)​48 ··​void·​do_timeout()​
41 ··​{49 ··​{
42 ····if·(!error·&&·message_count_·<·max_message_count)​50 ····timer_.​expires_after(std:​:​chrono:​:​seconds(1)​)​;​
43 ····{51 ····timer_.​async_wait(
44 ······timer_.​expires_after(asio:​:​chrono:​:​seconds(1)​)​;​52 ········[this](std:​:​error_code·ec)​
45 ······timer_.​async_wait(53 ········{
46 ··········boost:​:​bind(&sender:​:​handle_timeout,​·this,​54 ··········​if·(!ec)​
47 ············asio:​:​placeholders:​:​error)​)​;​55 ············​do_send()​;​
48 ····​}56 ········​})​;​
49 ··}
50
51 ··void·handle_timeout(const·asio:​:​error_code&·error)​
52 ··{
53 ····if·(!error)​
54 ····{
55 ······std:​:​ostringstream·os;​
56 ······os·<<·"Message·"·<<·message_count_++;​
57 ······message_·=·os.​str()​;​
58
59 ······socket_.​async_send_to(
60 ··········asio:​:​buffer(message_)​,​·endpoint_,​
61 ··········boost:​:​bind(&sender:​:​handle_send_to,​·this,​
62 ············asio:​:​placeholders:​:​error)​)​;​
63 ····}
64 ··​}57 ··​}
65 58
66 private:​59 private:​
67 ··​asio:​:​ip:​:​udp:​:​endpoint·​endpoint_;​60 ··​asio:​:​ip:​:​udp:​:​endpoint·​endpoint_;​
68 ··​asio:​:​ip:​:​udp:​:​socket·​socket_;​61 ··​asio:​:​ip:​:​udp:​:​socket·​socket_;​
69 ··​asio:​:​steady_timer·​timer_;​62 ··​asio:​:​steady_timer·​timer_;​
70 ··​int·​message_count_;​63 ··​int·​message_count_;​
71 ··​std:​:​string·​message_;​64 ··​std:​:​string·​message_;​
72 };​65 };​
73 66
74 int·​main(int·​argc,​·​char*·​argv[])​67 int·​main(int·​argc,​·​char*·​argv[])​
75 {68 {
76 ··​try69 ··​try
77 ··​{70 ··​{
78 ····​if·​(argc·​!=·​2)​71 ····​if·​(argc·​!=·​2)​
79 ····​{72 ····​{
80 ······​std:​:​cerr·​<<·​"Usage:​·​sender·​<multicast_address>\n​";​73 ······​std:​:​cerr·​<<·​"Usage:​·​sender·​<multicast_address>\n​";​
81 ······​std:​:​cerr·​<<·​"··​For·​IPv4,​·​try:​\n";​74 ······​std:​:​cerr·​<<·​"··​For·​IPv4,​·​try:​\n";​
82 ······​std:​:​cerr·​<<·​"····​sender·​239.​255.​0.​1\n";​75 ······​std:​:​cerr·​<<·​"····​sender·​239.​255.​0.​1\n";​
83 ······​std:​:​cerr·​<<·​"··​For·​IPv6,​·​try:​\n";​76 ······​std:​:​cerr·​<<·​"··​For·​IPv6,​·​try:​\n";​
84 ······​std:​:​cerr·​<<·​"····​sender·​ff31:​:​8000:​1234\n";​77 ······​std:​:​cerr·​<<·​"····​sender·​ff31:​:​8000:​1234\n";​
85 ······​return·​1;​78 ······​return·​1;​
86 ····​}79 ····​}
87 80
88 ····​asio:​:​io_context·​io_context;​81 ····​asio:​:​io_context·​io_context;​
89 ····​sender·​s(io_context,​·​asio:​:​ip:​:​make_address(argv[1])​)​;​82 ····​sender·​s(io_context,​·​asio:​:​ip:​:​make_address(argv[1])​)​;​
90 ····​io_context.​run()​;​83 ····​io_context.​run()​;​
91 ··​}84 ··​}
92 ··​catch·​(std:​:​exception&·​e)​85 ··​catch·​(std:​:​exception&·​e)​
93 ··​{86 ··​{
94 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​87 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
95 ··​}88 ··​}
96 89
97 ··​return·​0;​90 ··​return·​0;​
98 }91 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/nonblocking/third_party_lib.cpp.html b/include/asio/doc/examples/diffs/nonblocking/third_party_lib.cpp.html new file mode 100644 index 0000000..729cd0a --- /dev/null +++ b/include/asio/doc/examples/diffs/nonblocking/third_party_lib.cpp.html @@ -0,0 +1,318 @@ + + + + + + + HTML Diff nonblocking/third_party_lib.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​nonblocking/​third_party_lib.​cppsrc/​examples/​cpp11/​nonblocking/​third_party_lib.​cpp
1 /​/​1 /​/​
2 /​/​·​third_party_lib.​cpp2 /​/​·​third_party_lib.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<asio.​hpp>11 #include·​<asio.​hpp>
12 #include·​<boost/​array.​hpp>12 #include·​<array>
13 #include·<boost/​bind/​bind.​hpp>
14 #include·<boost/​shared_ptr.​hpp>
15 #include·<boost/​enable_shared_from_th​is.​hpp>
16 #include·​<iostream>13 #include·​<iostream>
14 #include·​<memory>
17 15
18 using·​asio:​:​ip:​:​tcp;​16 using·​asio:​:​ip:​:​tcp;​
19 17
20 namespace·​third_party_lib·​{18 namespace·​third_party_lib·​{
21 19
22 /​/​·​Simulation·​of·​a·​third·​party·​library·​that·​wants·​to·​perform·​read·​and·​write20 /​/​·​Simulation·​of·​a·​third·​party·​library·​that·​wants·​to·​perform·​read·​and·​write
23 /​/​·​operations·​directly·​on·​a·​socket.​·​It·​needs·​to·​be·​polled·​to·​determine·​whether21 /​/​·​operations·​directly·​on·​a·​socket.​·​It·​needs·​to·​be·​polled·​to·​determine·​whether
24 /​/​·​it·​requires·​a·​read·​or·​write·​operation,​·​and·​notified·​when·​the·​socket·​is·​ready22 /​/​·​it·​requires·​a·​read·​or·​write·​operation,​·​and·​notified·​when·​the·​socket·​is·​ready
25 /​/​·​for·​reading·​or·​writing.​23 /​/​·​for·​reading·​or·​writing.​
26 class·​session24 class·​session
27 {25 {
28 public:​26 public:​
29 ··​session(tcp:​:​socket&·​socket)​27 ··​session(tcp:​:​socket&·​socket)​
30 ····​:​·​socket_(socket)​,​28 ····​:​·​socket_(socket)​
31 ······state_(reading)​
32 ··​{29 ··​{
33 ··​}30 ··​}
34 31
35 ··​/​/​·​Returns·​true·​if·​the·​third·​party·​library·​wants·​to·​be·​notified·​when·​the32 ··​/​/​·​Returns·​true·​if·​the·​third·​party·​library·​wants·​to·​be·​notified·​when·​the
36 ··​/​/​·​socket·​is·​ready·​for·​reading.​33 ··​/​/​·​socket·​is·​ready·​for·​reading.​
37 ··​bool·​want_read()​·​const34 ··​bool·​want_read()​·​const
38 ··​{35 ··​{
39 ····​return·​state_·​==·​reading;​36 ····​return·​state_·​==·​reading;​
40 ··​}37 ··​}
41 38
42 ··​/​/​·​Notify·​that·​third·​party·​library·​that·​it·​should·​perform·​its·​read·​operation.​39 ··​/​/​·​Notify·​that·​third·​party·​library·​that·​it·​should·​perform·​its·​read·​operation.​
43 ··​void·​do_read(asio:​:​error_code&·​ec)​40 ··​void·​do_read(std:​:​error_code&·​ec)​
44 ··​{41 ··​{
45 ····​if·​(std:​:​size_t·​len·​=·​socket_.​read_some(asio:​:​buffer(data_)​,​·​ec)​)​42 ····​if·​(std:​:​size_t·​len·​=·​socket_.​read_some(asio:​:​buffer(data_)​,​·​ec)​)​
46 ····​{43 ····​{
47 ······​write_buffer_·​=·​asio:​:​buffer(data_,​·​len)​;​44 ······​write_buffer_·​=·​asio:​:​buffer(data_,​·​len)​;​
48 ······​state_·​=·​writing;​45 ······​state_·​=·​writing;​
49 ····​}46 ····​}
50 ··​}47 ··​}
51 48
52 ··​/​/​·​Returns·​true·​if·​the·​third·​party·​library·​wants·​to·​be·​notified·​when·​the49 ··​/​/​·​Returns·​true·​if·​the·​third·​party·​library·​wants·​to·​be·​notified·​when·​the
53 ··​/​/​·​socket·​is·​ready·​for·​writing.​50 ··​/​/​·​socket·​is·​ready·​for·​writing.​
54 ··​bool·​want_write()​·​const51 ··​bool·​want_write()​·​const
55 ··​{52 ··​{
56 ····​return·​state_·​==·​writing;​53 ····​return·​state_·​==·​writing;​
57 ··​}54 ··​}
58 55
59 ··​/​/​·​Notify·​that·​third·​party·​library·​that·​it·​should·​perform·​its·​write·​operation.​56 ··​/​/​·​Notify·​that·​third·​party·​library·​that·​it·​should·​perform·​its·​write·​operation.​
60 ··​void·​do_write(asio:​:​error_code&·​ec)​57 ··​void·​do_write(std:​:​error_code&·​ec)​
61 ··​{58 ··​{
62 ····​if·​(std:​:​size_t·​len·​=·​socket_.​write_some(59 ····​if·​(std:​:​size_t·​len·​=·​socket_.​write_some(
63 ··········​asio:​:​buffer(write_buffer_)​,​·​ec)​)​60 ··········​asio:​:​buffer(write_buffer_)​,​·​ec)​)​
64 ····​{61 ····​{
65 ······​write_buffer_·​=·​write_buffer_·​+·​len;​62 ······​write_buffer_·​=·​write_buffer_·​+·​len;​
66 ······​state_·​=·​asio:​:​buffer_size(write_buf​fer_)​·​>·​0·​?·​writing·​:​·​reading;​63 ······​state_·​=·​asio:​:​buffer_size(write_buf​fer_)​·​>·​0·​?·​writing·​:​·​reading;​
67 ····​}64 ····​}
68 ··​}65 ··​}
69 66
70 private:​67 private:​
71 ··​tcp:​:​socket&·​socket_;​68 ··​tcp:​:​socket&·​socket_;​
72 ··​enum·​{·​reading,​·​writing·​}·​state_;​69 ··​enum·​{·​reading,​·​writing·​}·​state_·=·reading;​
73 ··boost:​:​array<char,​·​128>·​data_;​70 ··​std:​:​array<char,​·​128>·​data_;​
74 ··​asio:​:​const_buffer·​write_buffer_;​71 ··​asio:​:​const_buffer·​write_buffer_;​
75 };​72 };​
76 73
77 }·​/​/​·​namespace·​third_party_lib74 }·​/​/​·​namespace·​third_party_lib
78 75
79 /​/​·​The·​glue·​between·​asio's·​sockets·​and·​the·​third·​party·​library.​76 /​/​·​The·​glue·​between·​asio's·​sockets·​and·​the·​third·​party·​library.​
80 class·​connection77 class·​connection
81 ··​:​·​public·boost:​:​enable_shared_from_th​is<connection>78 ··​:​·​public·​std:​:​enable_shared_from_th​is<connection>
82 {79 {
83 public:​80 public:​
84 ··typedef·boost:​:​shared_ptr<connection​>·pointer;​81 ··connection(tcp:​:​socket·socket)​
85 82 ····:​·socket_(std:​:​move(socket)​)​
86 ··static·pointer·create(const·asio:​:​any_io_executor&·ex)​
87 ··{
88 ····return·pointer(new·connection(ex)​)​;​
89 ··}
90
91 ··tcp:​:​socket&·socket()​
92 ··​{83 ··​{
93 ····​return·​socket_;​
94 ··​}84 ··​}
95 85
96 ··​void·​start()​86 ··​void·​start()​
97 ··​{87 ··​{
98 ····​/​/​·​Put·​the·​socket·​into·​non-​blocking·​mode.​88 ····​/​/​·​Put·​the·​socket·​into·​non-​blocking·​mode.​
99 ····​socket_.​non_blocking(true)​;​89 ····​socket_.​non_blocking(true)​;​
100 90
101 ····start_operations()​;​91 ····do_operations()​;​
102 ··​}92 ··​}
103 93
104 private:​94 private:​
105 ··connection(const·asio:​:​any_io_executor&·ex)​95 ··void·do_operations()​
106 ····:​·socket_(ex)​,​
107 ······session_impl_(socket_​)​,​
108 ······read_in_progress_(fal​se)​,​
109 ······write_in_progress_(fa​lse)​
110 ··​{96 ··​{
111 ··}97 ····auto·self(shared_from_this​()​)​;​
112 98
113 ··​void·​start_operations()​
114 ··​{
115 ····​/​/​·​Start·​a·​read·​operation·​if·​the·​third·​party·​library·​wants·​one.​99 ····​/​/​·​Start·​a·​read·​operation·​if·​the·​third·​party·​library·​wants·​one.​
116 ····​if·​(session_impl_.​want_read()​·​&&·​!read_in_progress_)​100 ····​if·​(session_impl_.​want_read()​·​&&·​!read_in_progress_)​
117 ····​{101 ····​{
118 ······​read_in_progress_·​=·​true;​102 ······​read_in_progress_·​=·​true;​
119 ······​socket_.​async_wait(tcp:​:​socket:​:​wait_read,​103 ······​socket_.​async_wait(tcp:​:​socket:​:​wait_read,​
120 ··········boost:​:​bind(&connection:​:​handle_read,​104 ··········[this,​·self](std:​:​error_code·ec)​
121 ············shared_from_this()​,​105 ··········{
122 ············asio:​:​placeholders:​:​error)​)​;​106 ············read_in_progress_·=·false;​
107
108 ············​/​/​·​Notify·​third·​party·​library·​that·​it·​can·​perform·​a·​read.​
109 ············​if·​(!ec)​
110 ··············​session_impl_.​do_read(ec)​;​
111
112 ············​/​/​·​The·​third·​party·​library·​successfully·​performed·​a·​read·​on·​the
113 ············​/​/​·​socket.​·​Start·​new·​read·​or·​write·​operations·​based·​on·​what·​it·​now
114 ············​/​/​·​wants.​
115 ············​if·​(!ec·​||·​ec·​==·​asio:​:​error:​:​would_block)​
116 ··············​do_operations()​;​
117
118 ············​/​/​·​Otherwise,​·​an·​error·​occurred.​·​Closing·​the·​socket·​cancels·​any
119 ············​/​/​·​outstanding·​asynchronous·​read·​or·​write·​operations.​·​The
120 ············​/​/​·​connection·​object·​will·​be·​destroyed·​automatically·​once·​those
121 ············​/​/​·​outstanding·​operations·​complete.​
122 ············​else
123 ··············​socket_.​close()​;​
124 ··········​})​;​
123 ····​}125 ····​}
124 126
125 ····​/​/​·​Start·​a·​write·​operation·​if·​the·​third·​party·​library·​wants·​one.​127 ····​/​/​·​Start·​a·​write·​operation·​if·​the·​third·​party·​library·​wants·​one.​
126 ····​if·​(session_impl_.​want_write()​·​&&·​!write_in_progress_)​128 ····​if·​(session_impl_.​want_write()​·​&&·​!write_in_progress_)​
127 ····​{129 ····​{
128 ······​write_in_progress_·​=·​true;​130 ······​write_in_progress_·​=·​true;​
129 ······​socket_.​async_wait(tcp:​:​socket:​:​wait_write,​131 ······​socket_.​async_wait(tcp:​:​socket:​:​wait_write,​
130 ··········boost:​:​bind(&connection:​:​handle_write,​132 ··········[this,​·self](std:​:​error_code·ec)​
131 ············shared_from_this()​,​133 ··········{
132 ············asio:​:​placeholders:​:​error)​)​;​134 ············write_in_progress_·=·false;​
135
136 ············​/​/​·​Notify·​third·​party·​library·​that·​it·​can·​perform·​a·​write.​
137 ············​if·​(!ec)​
138 ··············​session_impl_.​do_write(ec)​;​
139
140 ············​/​/​·​The·​third·​party·​library·​successfully·​performed·​a·​write·​on·​the
141 ············​/​/​·​socket.​·​Start·​new·​read·​or·​write·​operations·​based·​on·​what·​it·​now
142 ············​/​/​·​wants.​
143 ············​if·​(!ec·​||·​ec·​==·​asio:​:​error:​:​would_block)​
144 ··············​do_operations()​;​
145
146 ············​/​/​·​Otherwise,​·​an·​error·​occurred.​·​Closing·​the·​socket·​cancels·​any
147 ············​/​/​·​outstanding·​asynchronous·​read·​or·​write·​operations.​·​The
148 ············​/​/​·​connection·​object·​will·​be·​destroyed·​automatically·​once·​those
149 ············​/​/​·​outstanding·​operations·​complete.​
150 ············​else
151 ··············​socket_.​close()​;​
152 ··········​})​;​
133 ····​}153 ····​}
134 ··​}154 ··​}
135 155
136 ··​void·​handle_read(asio:​:​error_code·​ec)​
137 ··​{
138 ····​read_in_progress_·​=·​false;​
139
140 ····​/​/​·​Notify·​third·​party·​library·​that·​it·​can·​perform·​a·​read.​
141 ····​if·​(!ec)​
142 ······​session_impl_.​do_read(ec)​;​
143
144 ····​/​/​·​The·​third·​party·​library·​successfully·​performed·​a·​read·​on·​the·​socket.​
145 ····​/​/​·​Start·​new·​read·​or·​write·​operations·​based·​on·​what·​it·​now·​wants.​
146 ····​if·​(!ec·​||·​ec·​==·​asio:​:​error:​:​would_block)​
147 ······​start_operations()​;​
148
149 ····​/​/​·​Otherwise,​·​an·​error·​occurred.​·​Closing·​the·​socket·​cancels·​any·​outstanding
150 ····​/​/​·​asynchronous·​read·​or·​write·​operations.​·​The·​connection·​object·​will·​be
151 ····​/​/​·​destroyed·​automatically·​once·​those·​outstanding·​operations·​complete.​
152 ····​else
153 ······​socket_.​close()​;​
154 ··​}
155
156 ··​void·​handle_write(asio:​:​error_code·​ec)​
157 ··​{
158 ····​write_in_progress_·​=·​false;​
159
160 ····​/​/​·​Notify·​third·​party·​library·​that·​it·​can·​perform·​a·​write.​
161 ····​if·​(!ec)​
162 ······​session_impl_.​do_write(ec)​;​
163
164 ····​/​/​·​The·​third·​party·​library·​successfully·​performed·​a·​write·​on·​the·​socket.​
165 ····​/​/​·​Start·​new·​read·​or·​write·​operations·​based·​on·​what·​it·​now·​wants.​
166 ····​if·​(!ec·​||·​ec·​==·​asio:​:​error:​:​would_block)​
167 ······​start_operations()​;​
168
169 ····​/​/​·​Otherwise,​·​an·​error·​occurred.​·​Closing·​the·​socket·​cancels·​any·​outstanding
170 ····​/​/​·​asynchronous·​read·​or·​write·​operations.​·​The·​connection·​object·​will·​be
171 ····​/​/​·​destroyed·​automatically·​once·​those·​outstanding·​operations·​complete.​
172 ····​else
173 ······​socket_.​close()​;​
174 ··​}
175
176 private:​156 private:​
177 ··​tcp:​:​socket·​socket_;​157 ··​tcp:​:​socket·​socket_;​
178 ··​third_party_lib:​:​session·​session_impl_;​158 ··​third_party_lib:​:​session·​session_impl_{socket_​};​
179 ··​bool·​read_in_progress_;​159 ··​bool·​read_in_progress_·=·false;​
180 ··​bool·​write_in_progress_;​160 ··​bool·​write_in_progress_·=·false;​
181 };​161 };​
182 162
183 class·​server163 class·​server
184 {164 {
185 public:​165 public:​
186 ··​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​166 ··​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​
187 ····​:​·​acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·​port)​)​167 ····​:​·​acceptor_(io_context,​·{tcp:​:​v4()​,​·​port})​
188 ··​{168 ··​{
189 ····start_accept()​;​169 ····do_accept()​;​
190 ··​}170 ··​}
191 171
192 private:​172 private:​
193 ··​void·start_accept()​173 ··​void·do_accept()​
194 ··​{174 ··​{
195 ····connection:​:​pointer·new_connection·=175 ····acceptor_.​async_accept(
196 ······connection:​:​create(acceptor_.​get_executor()​)​;​176 ········[this](std:​:​error_code·ec,​·tcp:​:​socket·socket)​
197 177 ········{
198 ····acceptor_.​async_accept(new_conn​ection-​>socket()​,​178 ··········if·(!ec)​
199 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_connection,​179 ··········{
200 ··········asio:​:​placeholders:​:​error)​)​;​180 ············std:​:​make_shared<connectio​n>(std:​:​move(socket)​)​-​>start()​;​
201 ··​}181 ··········​}
202
203 ··void·handle_accept(connect​ion:​:​pointer·new_connection,​
204 ······const·asio:​:​error_code&·error)​
205 ··{
206 ····if·(!error)​
207 ····{
208 ······new_connection-​>start()​;​
209 ····}
210 182
211 ····start_accept()​;​183 ··········do_accept()​;​
184 ········​})​;​
212 ··​}185 ··​}
213 186
214 ··​tcp:​:​acceptor·​acceptor_;​187 ··​tcp:​:​acceptor·​acceptor_;​
215 };​188 };​
216 189
217 int·​main(int·​argc,​·​char*·​argv[])​190 int·​main(int·​argc,​·​char*·​argv[])​
218 {191 {
219 ··​try192 ··​try
220 ··​{193 ··​{
221 ····​if·​(argc·​!=·​2)​194 ····​if·​(argc·​!=·​2)​
222 ····​{195 ····​{
223 ······​std:​:​cerr·​<<·​"Usage:​·​third_party_lib·​<port>\n";​196 ······​std:​:​cerr·​<<·​"Usage:​·​third_party_lib·​<port>\n";​
224 ······​return·​1;​197 ······​return·​1;​
225 ····​}198 ····​}
226 199
227 ····​asio:​:​io_context·​io_context;​200 ····​asio:​:​io_context·​io_context;​
228 201
229 ····using·namespace·​std;​·/​/​·For·atoi.​202 ····server·s(io_context,​·​std:​:​atoi(argv[1])​)​;​
230 ····server·s(io_context,​·atoi(argv[1])​)​;​
231 203
232 ····​io_context.​run()​;​204 ····​io_context.​run()​;​
233 ··​}205 ··​}
234 ··​catch·​(std:​:​exception&·​e)​206 ··​catch·​(std:​:​exception&·​e)​
235 ··​{207 ··​{
236 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​208 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
237 ··​}209 ··​}
238 210
239 ··​return·​0;​211 ··​return·​0;​
240 }212 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_1.cpp.html b/include/asio/doc/examples/diffs/operations/composed_1.cpp.html new file mode 100644 index 0000000..3577367 --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_1.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_1.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_2.cpp.html b/include/asio/doc/examples/diffs/operations/composed_2.cpp.html new file mode 100644 index 0000000..04ecce7 --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_2.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_2.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_3.cpp.html b/include/asio/doc/examples/diffs/operations/composed_3.cpp.html new file mode 100644 index 0000000..19a6bac --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_3.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_3.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_4.cpp.html b/include/asio/doc/examples/diffs/operations/composed_4.cpp.html new file mode 100644 index 0000000..8bd2927 --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_4.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_4.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_5.cpp.html b/include/asio/doc/examples/diffs/operations/composed_5.cpp.html new file mode 100644 index 0000000..0aa1cbe --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_5.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_5.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_6.cpp.html b/include/asio/doc/examples/diffs/operations/composed_6.cpp.html new file mode 100644 index 0000000..a1762f6 --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_6.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_6.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_7.cpp.html b/include/asio/doc/examples/diffs/operations/composed_7.cpp.html new file mode 100644 index 0000000..4c484da --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_7.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_7.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/operations/composed_8.cpp.html b/include/asio/doc/examples/diffs/operations/composed_8.cpp.html new file mode 100644 index 0000000..a473b08 --- /dev/null +++ b/include/asio/doc/examples/diffs/operations/composed_8.cpp.html @@ -0,0 +1,39 @@ + + + + + + + HTML Diff operations/composed_8.cpp + + + + + + + + + + + + +
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/socks4/socks4.hpp.html b/include/asio/doc/examples/diffs/socks4/socks4.hpp.html new file mode 100644 index 0000000..7f33a33 --- /dev/null +++ b/include/asio/doc/examples/diffs/socks4/socks4.hpp.html @@ -0,0 +1,185 @@ + + + + + + + HTML Diff socks4/socks4.hpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​socks4/​socks4.​hppsrc/​examples/​cpp11/​socks4/​socks4.​hpp
1 /​/​1 /​/​
2 /​/​·​socks4.​hpp2 /​/​·​socks4.​hpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #ifndef·​SOCKS4_HPP11 #ifndef·​SOCKS4_HPP
12 #define·​SOCKS4_HPP12 #define·​SOCKS4_HPP
13 13
14 #include·​<array>
14 #include·​<string>15 #include·​<string>
15 #include·​<asio.​hpp>16 #include·​<asio/​buffer.​hpp>
16 #include·​<boost/​array.​hpp>17 #include·​<asio/​ip/​tcp.​hpp>
17 18
18 namespace·​socks4·​{19 namespace·​socks4·​{
19 20
20 const·​unsigned·​char·​version·​=·​0x04;​21 const·​unsigned·​char·​version·​=·​0x04;​
21 22
22 class·​request23 class·​request
23 {24 {
24 public:​25 public:​
25 ··​enum·​command_type26 ··​enum·​command_type
26 ··​{27 ··​{
27 ····​connect·​=·​0x01,​28 ····​connect·​=·​0x01,​
28 ····​bind·​=·​0x0229 ····​bind·​=·​0x02
29 ··​};​30 ··​};​
30 31
31 ··​request(command_type·​cmd,​·​const·​asio:​:​ip:​:​tcp:​:​endpoint&·​endpoint,​32 ··​request(command_type·​cmd,​·​const·​asio:​:​ip:​:​tcp:​:​endpoint&·​endpoint,​
32 ······​const·​std:​:​string&·​user_id)​33 ······​const·​std:​:​string&·​user_id)​
33 ····​:​·​version_(version)​,​34 ····​:​·​version_(version)​,​
34 ······​command_(cmd)​,​35 ······​command_(cmd)​,​
35 ······​user_id_(user_id)​,​36 ······​user_id_(user_id)​,​
36 ······​null_byte_(0)​37 ······​null_byte_(0)​
37 ··​{38 ··​{
38 ····​/​/​·​Only·​IPv4·​is·​supported·​by·​the·​SOCKS·​4·​protocol.​39 ····​/​/​·​Only·​IPv4·​is·​supported·​by·​the·​SOCKS·​4·​protocol.​
39 ····​if·​(endpoint.​protocol()​·​!=·​asio:​:​ip:​:​tcp:​:​v4()​)​40 ····​if·​(endpoint.​protocol()​·​!=·​asio:​:​ip:​:​tcp:​:​v4()​)​
40 ····​{41 ····​{
41 ······​throw·​asio:​:​system_error(42 ······​throw·​asio:​:​system_error(
42 ··········​asio:​:​error:​:​address_family_not_su​pported)​;​43 ··········​asio:​:​error:​:​address_family_not_su​pported)​;​
43 ····​}44 ····​}
44 45
45 ····​/​/​·​Convert·​port·​number·​to·​network·​byte·​order.​46 ····​/​/​·​Convert·​port·​number·​to·​network·​byte·​order.​
46 ····​unsigned·​short·​port·​=·​endpoint.​port()​;​47 ····​unsigned·​short·​port·​=·​endpoint.​port()​;​
47 ····​port_high_byte_·​=·​(port·​>>·​8)​·​&·​0xff;​48 ····​port_high_byte_·​=·​(port·​>>·​8)​·​&·​0xff;​
48 ····​port_low_byte_·​=·​port·​&·​0xff;​49 ····​port_low_byte_·​=·​port·​&·​0xff;​
49 50
50 ····​/​/​·​Save·​IP·​address·​in·​network·​byte·​order.​51 ····​/​/​·​Save·​IP·​address·​in·​network·​byte·​order.​
51 ····​address_·​=·​endpoint.​address()​.​to_v4()​.​to_bytes()​;​52 ····​address_·​=·​endpoint.​address()​.​to_v4()​.​to_bytes()​;​
52 ··​}53 ··​}
53 54
54 ··boost:​:​array<asio:​:​const_buffer,​·​7>·​buffers()​·​const55 ··​std:​:​array<asio:​:​const_buffer,​·​7>·​buffers()​·​const
55 ··​{56 ··​{
56 ····boost:​:​array<asio:​:​const_buffer,​·7>·bufs·=57 ····​return
57 ····​{58 ····​{
58 ······​{59 ······​{
59 ········​asio:​:​buffer(&version_,​·​1)​,​60 ········​asio:​:​buffer(&version_,​·​1)​,​
60 ········​asio:​:​buffer(&command_,​·​1)​,​61 ········​asio:​:​buffer(&command_,​·​1)​,​
61 ········​asio:​:​buffer(&port_high_byt​e_,​·​1)​,​62 ········​asio:​:​buffer(&port_high_byt​e_,​·​1)​,​
62 ········​asio:​:​buffer(&port_low_byte​_,​·​1)​,​63 ········​asio:​:​buffer(&port_low_byte​_,​·​1)​,​
63 ········​asio:​:​buffer(address_)​,​64 ········​asio:​:​buffer(address_)​,​
64 ········​asio:​:​buffer(user_id_)​,​65 ········​asio:​:​buffer(user_id_)​,​
65 ········​asio:​:​buffer(&null_byte_,​·​1)​66 ········​asio:​:​buffer(&null_byte_,​·​1)​
66 ······​}67 ······​}
67 ····​};​68 ····​};​
68 ····​return·​bufs;​
69 ··​}69 ··​}
70 70
71 private:​71 private:​
72 ··​unsigned·​char·​version_;​72 ··​unsigned·​char·​version_;​
73 ··​unsigned·​char·​command_;​73 ··​unsigned·​char·​command_;​
74 ··​unsigned·​char·​port_high_byte_;​74 ··​unsigned·​char·​port_high_byte_;​
75 ··​unsigned·​char·​port_low_byte_;​75 ··​unsigned·​char·​port_low_byte_;​
76 ··​asio:​:​ip:​:​address_v4:​:​bytes_type·​address_;​76 ··​asio:​:​ip:​:​address_v4:​:​bytes_type·​address_;​
77 ··​std:​:​string·​user_id_;​77 ··​std:​:​string·​user_id_;​
78 ··​unsigned·​char·​null_byte_;​78 ··​unsigned·​char·​null_byte_;​
79 };​79 };​
80 80
81 class·​reply81 class·​reply
82 {82 {
83 public:​83 public:​
84 ··​enum·​status_type84 ··​enum·​status_type
85 ··​{85 ··​{
86 ····​request_granted·​=·​0x5a,​86 ····​request_granted·​=·​0x5a,​
87 ····​request_failed·​=·​0x5b,​87 ····​request_failed·​=·​0x5b,​
88 ····​request_failed_no_ide​ntd·​=·​0x5c,​88 ····​request_failed_no_ide​ntd·​=·​0x5c,​
89 ····​request_failed_bad_us​er_id·​=·​0x5d89 ····​request_failed_bad_us​er_id·​=·​0x5d
90 ··​};​90 ··​};​
91 91
92 ··​reply()​92 ··​reply()​
93 ····​:​·​null_byte_(0)​,​93 ····​:​·​null_byte_(0)​,​
94 ······​status_()​94 ······​status_()​
95 ··​{95 ··​{
96 ··​}96 ··​}
97 97
98 ··boost:​:​array<asio:​:​mutable_buffer,​·​5>·​buffers()​98 ··​std:​:​array<asio:​:​mutable_buffer,​·​5>·​buffers()​
99 ··​{99 ··​{
100 ····boost:​:​array<asio:​:​mutable_buffer,​·5>·bufs·=100 ····​return
101 ····​{101 ····​{
102 ······​{102 ······​{
103 ········​asio:​:​buffer(&null_byte_,​·​1)​,​103 ········​asio:​:​buffer(&null_byte_,​·​1)​,​
104 ········​asio:​:​buffer(&status_,​·​1)​,​104 ········​asio:​:​buffer(&status_,​·​1)​,​
105 ········​asio:​:​buffer(&port_high_byt​e_,​·​1)​,​105 ········​asio:​:​buffer(&port_high_byt​e_,​·​1)​,​
106 ········​asio:​:​buffer(&port_low_byte​_,​·​1)​,​106 ········​asio:​:​buffer(&port_low_byte​_,​·​1)​,​
107 ········​asio:​:​buffer(address_)​107 ········​asio:​:​buffer(address_)​
108 ······​}108 ······​}
109 ····​};​109 ····​};​
110 ····​return·​bufs;​
111 ··​}110 ··​}
112 111
113 ··​bool·​success()​·​const112 ··​bool·​success()​·​const
114 ··​{113 ··​{
115 ····​return·​null_byte_·​==·​0·​&&·​status_·​==·​request_granted;​114 ····​return·​null_byte_·​==·​0·​&&·​status_·​==·​request_granted;​
116 ··​}115 ··​}
117 116
118 ··​unsigned·​char·​status()​·​const117 ··​unsigned·​char·​status()​·​const
119 ··​{118 ··​{
120 ····​return·​status_;​119 ····​return·​status_;​
121 ··​}120 ··​}
122 121
123 ··​asio:​:​ip:​:​tcp:​:​endpoint·​endpoint()​·​const122 ··​asio:​:​ip:​:​tcp:​:​endpoint·​endpoint()​·​const
124 ··​{123 ··​{
125 ····​unsigned·​short·​port·​=·​port_high_byte_;​124 ····​unsigned·​short·​port·​=·​port_high_byte_;​
126 ····​port·​=·​(port·​<<·​8)​·​&·​0xff00;​125 ····​port·​=·​(port·​<<·​8)​·​&·​0xff00;​
127 ····​port·​=·​port·​|·​port_low_byte_;​126 ····​port·​=·​port·​|·​port_low_byte_;​
128 127
129 ····​asio:​:​ip:​:​address_v4·​address(address_)​;​128 ····​asio:​:​ip:​:​address_v4·​address(address_)​;​
130 129
131 ····​return·​asio:​:​ip:​:​tcp:​:​endpoint(address,​·​port)​;​130 ····​return·​asio:​:​ip:​:​tcp:​:​endpoint(address,​·​port)​;​
132 ··​}131 ··​}
133 132
134 private:​133 private:​
135 ··​unsigned·​char·​null_byte_;​134 ··​unsigned·​char·​null_byte_;​
136 ··​unsigned·​char·​status_;​135 ··​unsigned·​char·​status_;​
137 ··​unsigned·​char·​port_high_byte_;​136 ··​unsigned·​char·​port_high_byte_;​
138 ··​unsigned·​char·​port_low_byte_;​137 ··​unsigned·​char·​port_low_byte_;​
139 ··​asio:​:​ip:​:​address_v4:​:​bytes_type·​address_;​138 ··​asio:​:​ip:​:​address_v4:​:​bytes_type·​address_;​
140 };​139 };​
141 140
142 }·​/​/​·​namespace·​socks4141 }·​/​/​·​namespace·​socks4
143 142
144 #endif·​/​/​·​SOCKS4_HPP143 #endif·​/​/​·​SOCKS4_HPP
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/socks4/sync_client.cpp.html b/include/asio/doc/examples/diffs/socks4/sync_client.cpp.html new file mode 100644 index 0000000..bcb7b5d --- /dev/null +++ b/include/asio/doc/examples/diffs/socks4/sync_client.cpp.html @@ -0,0 +1,135 @@ + + + + + + + HTML Diff socks4/sync_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​socks4/​sync_client.​cppsrc/​examples/​cpp11/​socks4/​sync_client.​cpp
1 /​/​1 /​/​
2 /​/​·​sync_client.​cpp2 /​/​·​sync_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<array>
11 #include·​<iostream>12 #include·​<iostream>
12 #include·​<iomanip>13 #include·​<iomanip>
13 #include·​<ostream>14 #include·​<ostream>
14 #include·​<string>15 #include·​<string>
15 #include·​<asio.​hpp>16 #include·​<asio.​hpp>
16 #include·​<boost/​array.​hpp>
17 #include·​"socks4.​hpp"17 #include·​"socks4.​hpp"
18 18
19 using·​asio:​:​ip:​:​tcp;​19 using·​asio:​:​ip:​:​tcp;​
20 20
21 int·​main(int·​argc,​·​char*·​argv[])​21 int·​main(int·​argc,​·​char*·​argv[])​
22 {22 {
23 ··​try23 ··​try
24 ··​{24 ··​{
25 ····​if·​(argc·​!=·​4)​25 ····​if·​(argc·​!=·​4)​
26 ····​{26 ····​{
27 ······​std:​:​cout·​<<·​"Usage:​·​sync_client·​<socks4server>·​<socks4port>·​<user>\n";​27 ······​std:​:​cout·​<<·​"Usage:​·​sync_client·​<socks4server>·​<socks4port>·​<user>\n";​
28 ······​std:​:​cout·​<<·​"Examples:​\n";​28 ······​std:​:​cout·​<<·​"Examples:​\n";​
29 ······​std:​:​cout·​<<·​"··​sync_client·​127.​0.​0.​1·​1080·​chris\n";​29 ······​std:​:​cout·​<<·​"··​sync_client·​127.​0.​0.​1·​1080·​chris\n";​
30 ······​std:​:​cout·​<<·​"··​sync_client·​localhost·​socks·​chris\n";​30 ······​std:​:​cout·​<<·​"··​sync_client·​localhost·​socks·​chris\n";​
31 ······​return·​1;​31 ······​return·​1;​
32 ····​}32 ····​}
33 33
34 ····​asio:​:​io_context·​io_context;​34 ····​asio:​:​io_context·​io_context;​
35 35
36 ····​/​/​·​Get·​a·​list·​of·​endpoints·​corresponding·​to·​the·​SOCKS·​4·​server·​name.​36 ····​/​/​·​Get·​a·​list·​of·​endpoints·​corresponding·​to·​the·​SOCKS·​4·​server·​name.​
37 ····​tcp:​:​resolver·​resolver(io_context)​;​37 ····​tcp:​:​resolver·​resolver(io_context)​;​
38 ····tcp:​:​resolver:​:​results_type·​endpoints·​=·​resolver.​resolve(argv[1],​·​argv[2])​;​38 ····auto·​endpoints·​=·​resolver.​resolve(argv[1],​·​argv[2])​;​
39 39
40 ····​/​/​·​Try·​each·​endpoint·​until·​we·​successfully·​establish·​a·​connection·​to·​the40 ····​/​/​·​Try·​each·​endpoint·​until·​we·​successfully·​establish·​a·​connection·​to·​the
41 ····​/​/​·​SOCKS·​4·​server.​41 ····​/​/​·​SOCKS·​4·​server.​
42 ····​tcp:​:​socket·​socket(io_context)​;​42 ····​tcp:​:​socket·​socket(io_context)​;​
43 ····​asio:​:​connect(socket,​·​endpoints)​;​43 ····​asio:​:​connect(socket,​·​endpoints)​;​
44 44
45 ····​/​/​·​Get·​an·​endpoint·​for·​the·​Boost·​website.​·​This·​will·​be·​passed·​to·​the·​SOCKS45 ····​/​/​·​Get·​an·​endpoint·​for·​the·​Boost·​website.​·​This·​will·​be·​passed·​to·​the·​SOCKS
46 ····​/​/​·​4·​server.​·​Explicitly·​specify·​IPv4·​since·​SOCKS·​4·​does·​not·​support·​IPv6.​46 ····​/​/​·​4·​server.​·​Explicitly·​specify·​IPv4·​since·​SOCKS·​4·​does·​not·​support·​IPv6.​
47 ····tcp:​:​endpoint·​http_endpoint·​=47 ····auto·​http_endpoint·​=
48 ······​*resolver.​resolve(tcp:​:​v4()​,​·​"www.​boost.​org",​·​"http")​.​begin()​;​48 ······​*resolver.​resolve(tcp:​:​v4()​,​·​"www.​boost.​org",​·​"http")​.​begin()​;​
49 49
50 ····​/​/​·​Send·​the·​request·​to·​the·​SOCKS·​4·​server.​50 ····​/​/​·​Send·​the·​request·​to·​the·​SOCKS·​4·​server.​
51 ····​socks4:​:​request·​socks_request(51 ····​socks4:​:​request·​socks_request(
52 ········​socks4:​:​request:​:​connect,​·​http_endpoint,​·​argv[3])​;​52 ········​socks4:​:​request:​:​connect,​·​http_endpoint,​·​argv[3])​;​
53 ····​asio:​:​write(socket,​·​socks_request.​buffers()​)​;​53 ····​asio:​:​write(socket,​·​socks_request.​buffers()​)​;​
54 54
55 ····​/​/​·​Receive·​a·​response·​from·​the·​SOCKS·​4·​server.​55 ····​/​/​·​Receive·​a·​response·​from·​the·​SOCKS·​4·​server.​
56 ····​socks4:​:​reply·​socks_reply;​56 ····​socks4:​:​reply·​socks_reply;​
57 ····​asio:​:​read(socket,​·​socks_reply.​buffers()​)​;​57 ····​asio:​:​read(socket,​·​socks_reply.​buffers()​)​;​
58 58
59 ····​/​/​·​Check·​whether·​we·​successfully·​negotiated·​with·​the·​SOCKS·​4·​server.​59 ····​/​/​·​Check·​whether·​we·​successfully·​negotiated·​with·​the·​SOCKS·​4·​server.​
60 ····​if·​(!socks_reply.​success()​)​60 ····​if·​(!socks_reply.​success()​)​
61 ····​{61 ····​{
62 ······​std:​:​cout·​<<·​"Connection·​failed.​\n";​62 ······​std:​:​cout·​<<·​"Connection·​failed.​\n";​
63 ······​std:​:​cout·​<<·​"status·​=·​0x"·​<<·​std:​:​hex·​<<·​socks_reply.​status()​;​63 ······​std:​:​cout·​<<·​"status·​=·​0x"·​<<·​std:​:​hex·​<<·​socks_reply.​status()​;​
64 ······​return·​1;​64 ······​return·​1;​
65 ····​}65 ····​}
66 66
67 ····​/​/​·​Form·​the·​HTTP·​request.​·​We·​specify·​the·​"Connection:​·​close"·​header·​so·​that67 ····​/​/​·​Form·​the·​HTTP·​request.​·​We·​specify·​the·​"Connection:​·​close"·​header·​so·​that
68 ····​/​/​·​the·​server·​will·​close·​the·​socket·​after·​transmitting·​the·​response.​·​This68 ····​/​/​·​the·​server·​will·​close·​the·​socket·​after·​transmitting·​the·​response.​·​This
69 ····​/​/​·​will·​allow·​us·​to·​treat·​all·​data·​up·​until·​the·​EOF·​as·​the·​response.​69 ····​/​/​·​will·​allow·​us·​to·​treat·​all·​data·​up·​until·​the·​EOF·​as·​the·​response.​
70 ····​std:​:​string·​request·​=70 ····​std:​:​string·​request·​=
71 ······​"GET·​/​·​HTTP/​1.​0\r\n"71 ······​"GET·​/​·​HTTP/​1.​0\r\n"
72 ······​"Host:​·​www.​boost.​org\r\n"72 ······​"Host:​·​www.​boost.​org\r\n"
73 ······​"Accept:​·​*/​*\r\n"73 ······​"Accept:​·​*/​*\r\n"
74 ······​"Connection:​·​close\r\n\r\n";​74 ······​"Connection:​·​close\r\n\r\n";​
75 75
76 ····​/​/​·​Send·​the·​HTTP·​request.​76 ····​/​/​·​Send·​the·​HTTP·​request.​
77 ····​asio:​:​write(socket,​·​asio:​:​buffer(request)​)​;​77 ····​asio:​:​write(socket,​·​asio:​:​buffer(request)​)​;​
78 78
79 ····​/​/​·​Read·​until·​EOF,​·​writing·​data·​to·​output·​as·​we·​go.​79 ····​/​/​·​Read·​until·​EOF,​·​writing·​data·​to·​output·​as·​we·​go.​
80 ····boost:​:​array<char,​·​512>·​response;​80 ····​std:​:​array<char,​·​512>·​response;​
81 ····asio:​:​error_code·​error;​81 ····​std:​:​error_code·​error;​
82 ····​while·​(std:​:​size_t·​s·​=·​socket.​read_some(82 ····​while·​(std:​:​size_t·​s·​=·​socket.​read_some(
83 ··········​asio:​:​buffer(response)​,​·​error)​)​83 ··········​asio:​:​buffer(response)​,​·​error)​)​
84 ······​std:​:​cout.​write(response.​data()​,​·​s)​;​84 ······​std:​:​cout.​write(response.​data()​,​·​s)​;​
85 ····​if·​(error·​!=·​asio:​:​error:​:​eof)​85 ····​if·​(error·​!=·​asio:​:​error:​:​eof)​
86 ······​throw·asio:​:​system_error(error)​;​86 ······​throw·​std:​:​system_error(error)​;​
87 ··​}87 ··​}
88 ··​catch·​(std:​:​exception&·​e)​88 ··​catch·​(std:​:​exception&·​e)​
89 ··​{89 ··​{
90 ····​std:​:​cout·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​90 ····​std:​:​cout·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
91 ··​}91 ··​}
92 92
93 ··​return·​0;​93 ··​return·​0;​
94 }94 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/spawn/echo_server.cpp.html b/include/asio/doc/examples/diffs/spawn/echo_server.cpp.html new file mode 100644 index 0000000..16b34d4 --- /dev/null +++ b/include/asio/doc/examples/diffs/spawn/echo_server.cpp.html @@ -0,0 +1,204 @@ + + + + + + + HTML Diff spawn/echo_server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​spawn/​echo_server.​cppsrc/​examples/​cpp11/​spawn/​echo_server.​cpp
1 /​/​1 /​/​
2 /​/​·​echo_server.​cpp2 /​/​·​echo_server.​cpp
3 /​/​·​~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<asio/​io_context.​hpp>11 #include·​<asio/​io_context.​hpp>
12 #include·​<asio/​ip/​tcp.​hpp>12 #include·​<asio/​ip/​tcp.​hpp>
13 #include·​<asio/​spawn.​hpp>13 #include·​<asio/​spawn.​hpp>
14 #include·​<asio/​steady_timer.​hpp>14 #include·​<asio/​steady_timer.​hpp>
15 #include·​<asio/​write.​hpp>15 #include·​<asio/​write.​hpp>
16 #include·​<boost/​bind/​bind.​hpp>
17 #include·​<boost/​shared_ptr.​hpp>
18 #include·​<boost/​enable_shared_from_th​is.​hpp>
19 #include·​<iostream>16 #include·​<iostream>
17 #include·​<memory>
20 18
21 using·​asio:​:​ip:​:​tcp;​19 using·​asio:​:​ip:​:​tcp;​
22 20
23 class·​session·​:​·​public·boost:​:​enable_shared_from_th​is<session>21 class·​session·​:​·​public·​std:​:​enable_shared_from_th​is<session>
24 {22 {
25 public:​23 public:​
26 ··​explicit·​session(asio:​:​io_context&·​io_context)​24 ··​explicit·​session(asio:​:​io_context&·​io_context,​·tcp:​:​socket·socket)​
27 ····​:​·​strand_(asio:​:​make_strand(io_contex​t)​)​,​25 ····​:​·​socket_(std:​:​move(socket)​)​,​
28 ······socket_(io_context)​,​26 ······timer_(io_context)​,​
29 ······​timer_(io_context)​27 ······strand_(io_context.​get_executor()​)​
30 ··​{28 ··​{
31 ··​}29 ··​}
32 30
33 ··​tcp:​:​socket&·​socket()​
34 ··​{
35 ····​return·​socket_;​
36 ··​}
37
38 ··​void·​go()​31 ··​void·​go()​
39 ··​{32 ··​{
33 ····​auto·​self(shared_from_this​()​)​;​
40 ····​asio:​:​spawn(strand_,​34 ····​asio:​:​spawn(strand_,​
41 ········boost:​:​bind(&session:​:​echo,​35 ········[this,​·self](asio:​:​yield_context·yield)​
42 ··········shared_from_this()​,​·boost:​:​placeholders:​:​_1)​)​;​36 ········{
37 ··········​try
38 ··········​{
39 ············​char·​data[128];​
40 ············​for·​(;​;​)​
41 ············​{
42 ··············​timer_.​expires_from_now(std:​:​chrono:​:​seconds(10)​)​;​
43 ··············​std:​:​size_t·​n·​=·​socket_.​async_read_some(asio:​:​buffer(data)​,​·​yield)​;​
44 ··············​asio:​:​async_write(socket_,​·​asio:​:​buffer(data,​·​n)​,​·​yield)​;​
45 ············​}
46 ··········​}
47 ··········​catch·​(std:​:​exception&·​e)​
48 ··········​{
49 ············​socket_.​close()​;​
50 ············​timer_.​cancel()​;​
51 ··········​}
52 ········​})​;​
53
43 ····​asio:​:​spawn(strand_,​54 ····​asio:​:​spawn(strand_,​
44 ········boost:​:​bind(&session:​:​timeout,​55 ········[this,​·self](asio:​:​yield_context·yield)​
45 ··········shared_from_this()​,​·boost:​:​placeholders:​:​_1)​)​;​56 ········{
57 ··········​while·​(socket_.​is_open()​)​
58 ··········​{
59 ············​asio:​:​error_code·​ignored_ec;​
60 ············​timer_.​async_wait(yield[igno​red_ec])​;​
61 ············​if·​(timer_.​expires_from_now()​·​<=·​std:​:​chrono:​:​seconds(0)​)​
62 ··············​socket_.​close()​;​
63 ··········​}
64 ········​})​;​
46 ··​}65 ··​}
47 66
48 private:​67 private:​
49 ··​void·​echo(asio:​:​yield_context·​yield)​
50 ··​{
51 ····​try
52 ····​{
53 ······​char·​data[128];​
54 ······​for·​(;​;​)​
55 ······​{
56 ········​timer_.​expires_after(asio:​:​chrono:​:​seconds(10)​)​;​
57 ········​std:​:​size_t·​n·​=·​socket_.​async_read_some(asio:​:​buffer(data)​,​·​yield)​;​
58 ········​asio:​:​async_write(socket_,​·​asio:​:​buffer(data,​·​n)​,​·​yield)​;​
59 ······​}
60 ····​}
61 ····​catch·​(std:​:​exception&·​e)​
62 ····​{
63 ······​socket_.​close()​;​
64 ······​timer_.​cancel()​;​
65 ····​}
66 ··​}
67
68 ··​void·​timeout(asio:​:​yield_context·​yield)​
69 ··​{
70 ····​while·​(socket_.​is_open()​)​
71 ····​{
72 ······​asio:​:​error_code·​ignored_ec;​
73 ······​timer_.​async_wait(yield[igno​red_ec])​;​
74 ······​if·​(timer_.​expiry()​·​<=·​asio:​:​steady_timer:​:​clock_type:​:​now()​)​
75 ········​socket_.​close()​;​
76 ····​}
77 ··​}
78
79 ··​asio:​:​strand<asio:​:​io_context:​:​executor_type>·​strand_;​
80 ··​tcp:​:​socket·​socket_;​68 ··​tcp:​:​socket·​socket_;​
81 ··​asio:​:​steady_timer·​timer_;​69 ··​asio:​:​steady_timer·​timer_;​
70 ··​asio:​:​strand<asio:​:​io_context:​:​executor_type>·​strand_;​
82 };​71 };​
83 72
84 void·​do_accept(asio:​:​io_context&·​io_context,​
85 ····​unsigned·​short·​port,​·​asio:​:​yield_context·​yield)​
86 {
87 ··​tcp:​:​acceptor·​acceptor(io_context,​·​tcp:​:​endpoint(tcp:​:​v4()​,​·​port)​)​;​
88
89 ··​for·​(;​;​)​
90 ··​{
91 ····​asio:​:​error_code·​ec;​
92 ····​boost:​:​shared_ptr<session>·​new_session(new·​session(io_context)​)​;​
93 ····​acceptor.​async_accept(new_sess​ion-​>socket()​,​·​yield[ec])​;​
94 ····​if·​(!ec)​·​new_session-​>go()​;​
95 ··​}
96 }
97
98 int·​main(int·​argc,​·​char*·​argv[])​73 int·​main(int·​argc,​·​char*·​argv[])​
99 {74 {
100 ··​try75 ··​try
101 ··​{76 ··​{
102 ····​if·​(argc·​!=·​2)​77 ····​if·​(argc·​!=·​2)​
103 ····​{78 ····​{
104 ······​std:​:​cerr·​<<·​"Usage:​·​echo_server·​<port>\n";​79 ······​std:​:​cerr·​<<·​"Usage:​·​echo_server·​<port>\n";​
105 ······​return·​1;​80 ······​return·​1;​
106 ····​}81 ····​}
107 82
108 ····​asio:​:​io_context·​io_context;​83 ····​asio:​:​io_context·​io_context;​
109 84
110 ····​asio:​:​spawn(io_context,​85 ····​asio:​:​spawn(io_context,​
111 ········boost:​:​bind(do_accept,​86 ········[&](asio:​:​yield_context·yield)​
112 ··········boost:​:​ref(io_context)​,​·atoi(argv[1])​,​·boost:​:​placeholders:​:​_1)​)​;​87 ········{
88 ··········​tcp:​:​acceptor·​acceptor(io_context,​
89 ············​tcp:​:​endpoint(tcp:​:​v4()​,​·​std:​:​atoi(argv[1])​)​)​;​
90
91 ··········​for·​(;​;​)​
92 ··········​{
93 ············​asio:​:​error_code·​ec;​
94 ············​tcp:​:​socket·​socket(io_context)​;​
95 ············​acceptor.​async_accept(socket,​·​yield[ec])​;​
96 ············​if·​(!ec)​
97 ············​{
98 ··············​std:​:​make_shared<session>(​io_context,​·​std:​:​move(socket)​)​-​>go()​;​
99 ············​}
100 ··········​}
101 ········​})​;​
113 102
114 ····​io_context.​run()​;​103 ····​io_context.​run()​;​
115 ··​}104 ··​}
116 ··​catch·​(std:​:​exception&·​e)​105 ··​catch·​(std:​:​exception&·​e)​
117 ··​{106 ··​{
118 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​107 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
119 ··​}108 ··​}
120 109
121 ··​return·​0;​110 ··​return·​0;​
122 }111 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/spawn/parallel_grep.cpp.html b/include/asio/doc/examples/diffs/spawn/parallel_grep.cpp.html new file mode 100644 index 0000000..56bbdf9 --- /dev/null +++ b/include/asio/doc/examples/diffs/spawn/parallel_grep.cpp.html @@ -0,0 +1,150 @@ + + + + + + + HTML Diff spawn/parallel_grep.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​spawn/​parallel_grep.​cppsrc/​examples/​cpp11/​spawn/​parallel_grep.​cpp
1 /​/​1 /​/​
2 /​/​·​parallel_grep.​cpp2 /​/​·​parallel_grep.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<asio/​dispatch.​hpp>11 #include·​<asio/​dispatch.​hpp>
12 #include·​<asio/​post.​hpp>12 #include·​<asio/​post.​hpp>
13 #include·​<asio/​spawn.​hpp>13 #include·​<asio/​spawn.​hpp>
14 #include·​<asio/​strand.​hpp>14 #include·​<asio/​strand.​hpp>
15 #include·​<asio/​thread_pool.​hpp>15 #include·​<asio/​thread_pool.​hpp>
16 #include·​<boost/​bind/​bind.​hpp>
17 #include·​<fstream>16 #include·​<fstream>
18 #include·​<iostream>17 #include·​<iostream>
19 #include·​<string>18 #include·​<string>
20 19
21 using·​asio:​:​dispatch;​20 using·​asio:​:​dispatch;​
22 using·​asio:​:​spawn;​21 using·​asio:​:​spawn;​
23 using·​asio:​:​strand;​22 using·​asio:​:​strand;​
24 using·​asio:​:​thread_pool;​23 using·​asio:​:​thread_pool;​
25 using·​asio:​:​yield_context;​24 using·​asio:​:​yield_context;​
26 25
27 void·​print_match(std:​:​string·​input_file,​·​std:​:​string·​line)​
28 {
29 ··​std:​:​cout·​<<·​input_file·​<<·​':​'·​<<·​line·​<<·​std:​:​endl;​
30 }
31
32 void·​search_file(std:​:​string·​search_string,​·​std:​:​string·​input_file,​
33 ····​strand<thread_pool:​:​executor_type>·​output_strand,​·​yield_context·​yield)​
34 {
35 ··​std:​:​ifstream·​is(input_file.​c_str()​)​;​
36 ··​std:​:​string·​line;​
37 ··​std:​:​size_t·​line_num·​=·​0;​
38 ··​while·​(std:​:​getline(is,​·​line)​)​
39 ··​{
40 ····​/​/​·​If·​we·​find·​a·​match,​·​send·​a·​message·​to·​the·​output.​
41 ····​if·​(line.​find(search_string)​·​!=·​std:​:​string:​:​npos)​
42 ····​{
43 ······​dispatch(output_stran​d,​·​boost:​:​bind(&print_match,​·​input_file,​·​line)​)​;​
44 ····​}
45
46 ····​/​/​·​Every·​so·​often·​we·​yield·​control·​to·​another·​coroutine.​
47 ····​if·​(++line_num·​%·​10·​==·​0)​
48 ······​post(yield)​;​
49 ··​}
50 }
51
52 int·​main(int·​argc,​·​char*·​argv[])​26 int·​main(int·​argc,​·​char*·​argv[])​
53 {27 {
54 ··​try28 ··​try
55 ··​{29 ··​{
56 ····​if·​(argc·​<·​2)​30 ····​if·​(argc·​<·​2)​
57 ····​{31 ····​{
58 ······​std:​:​cerr·​<<·​"Usage:​·​parallel_grep·​<string>·​<files.​.​.​>\n";​32 ······​std:​:​cerr·​<<·​"Usage:​·​parallel_grep·​<string>·​<files.​.​.​>\n";​
59 ······​return·​1;​33 ······​return·​1;​
60 ····​}34 ····​}
61 35
62 ····​/​/​·​We·​use·​a·​fixed·​size·​pool·​of·​threads·​for·​reading·​the·​input·​files.​·​The36 ····​/​/​·​We·​use·​a·​fixed·​size·​pool·​of·​threads·​for·​reading·​the·​input·​files.​·​The
63 ····​/​/​·​number·​of·​threads·​is·​automatically·​determined·​based·​on·​the·​number·​of37 ····​/​/​·​number·​of·​threads·​is·​automatically·​determined·​based·​on·​the·​number·​of
64 ····​/​/​·​CPUs·​available·​in·​the·​system.​38 ····​/​/​·​CPUs·​available·​in·​the·​system.​
65 ····​thread_pool·​pool;​39 ····​thread_pool·​pool;​
66 40
67 ····​/​/​·​To·​prevent·​the·​output·​from·​being·​garbled,​·​we·​use·​a·​strand·​to·​synchronise41 ····​/​/​·​To·​prevent·​the·​output·​from·​being·​garbled,​·​we·​use·​a·​strand·​to·​synchronise
68 ····​/​/​·​printing.​42 ····​/​/​·​printing.​
69 ····​strand<thread_pool:​:​executor_type>·​output_strand(pool.​get_executor()​)​;​43 ····​strand<thread_pool:​:​executor_type>·​output_strand(pool.​get_executor()​)​;​
70 44
71 ····​/​/​·​Spawn·​a·​new·​coroutine·​for·​each·​file·​specified·​on·​the·​command·​line.​45 ····​/​/​·​Spawn·​a·​new·​coroutine·​for·​each·​file·​specified·​on·​the·​command·​line.​
72 ····​std:​:​string·​search_string·​=·​argv[1];​46 ····​std:​:​string·​search_string·​=·​argv[1];​
73 ····​for·​(int·​argn·​=·​2;​·​argn·​<·​argc;​·​++argn)​47 ····​for·​(int·​argn·​=·​2;​·​argn·​<·​argc;​·​++argn)​
74 ····​{48 ····​{
75 ······​std:​:​string·​input_file·​=·​argv[argn];​49 ······​std:​:​string·​input_file·​=·​argv[argn];​
76 ······​spawn(pool,​·boost:​:​bind(&search_file,​·search_string,​50 ······​spawn(pool,​
77 ············input_file,​·output_strand,​·boost:​:​placeholders:​:​_1)​)​;​51 ········[=](yield_context·yield)​
52 ········​{
53 ··········​std:​:​ifstream·​is(input_file.​c_str()​)​;​
54 ··········​std:​:​string·​line;​
55 ··········​std:​:​size_t·​line_num·​=·​0;​
56 ··········​while·​(std:​:​getline(is,​·​line)​)​
57 ··········​{
58 ············​/​/​·​If·​we·​find·​a·​match,​·​send·​a·​message·​to·​the·​output.​
59 ············​if·​(line.​find(search_string)​·​!=·​std:​:​string:​:​npos)​
60 ············​{
61 ··············​dispatch(output_stran​d,​
62 ··················​[=]
63 ··················​{
64 ····················​std:​:​cout·​<<·​input_file·​<<·​':​'·​<<·​line·​<<·​std:​:​endl;​
65 ··················​})​;​
66 ············​}
67
68 ············​/​/​·​Every·​so·​often·​we·​yield·​control·​to·​another·​coroutine.​
69 ············​if·​(++line_num·​%·​10·​==·​0)​
70 ··············​post(yield)​;​
71 ··········​}
72 ········​})​;​
78 ····​}73 ····​}
79 74
80 ····​/​/​·​Join·​the·​thread·​pool·​to·​wait·​for·​all·​the·​spawned·​tasks·​to·​complete.​75 ····​/​/​·​Join·​the·​thread·​pool·​to·​wait·​for·​all·​the·​spawned·​tasks·​to·​complete.​
81 ····​pool.​join()​;​76 ····​pool.​join()​;​
82 ··​}77 ··​}
83 ··​catch·​(std:​:​exception&·​e)​78 ··​catch·​(std:​:​exception&·​e)​
84 ··​{79 ··​{
85 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​80 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
86 ··​}81 ··​}
87 82
88 ··​return·​0;​83 ··​return·​0;​
89 }84 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/ssl/client.cpp.html b/include/asio/doc/examples/diffs/ssl/client.cpp.html new file mode 100644 index 0000000..8109739 --- /dev/null +++ b/include/asio/doc/examples/diffs/ssl/client.cpp.html @@ -0,0 +1,246 @@ + + + + + + + HTML Diff ssl/client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​ssl/​client.​cppsrc/​examples/​cpp11/​ssl/​client.​cpp
1 /​/​1 /​/​
2 /​/​·​client.​cpp2 /​/​·​client.​cpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<cstring>
13 #include·​<functional>
12 #include·​<iostream>14 #include·​<iostream>
13 #include·​<boost/​bind/​bind.​hpp>
14 #include·​"asio.​hpp"15 #include·​"asio.​hpp"
15 #include·​"asio/​ssl.​hpp"16 #include·​"asio/​ssl.​hpp"
16 17
18 using·​asio:​:​ip:​:​tcp;​
19 using·​std:​:​placeholders:​:​_1;​
20 using·​std:​:​placeholders:​:​_2;​
21
17 enum·​{·​max_length·​=·​1024·​};​22 enum·​{·​max_length·​=·​1024·​};​
18 23
19 class·​client24 class·​client
20 {25 {
21 public:​26 public:​
22 ··​client(asio:​:​io_context&·​io_context,​27 ··​client(asio:​:​io_context&·​io_context,​
23 ······​asio:​:​ssl:​:​context&·​context,​28 ······​asio:​:​ssl:​:​context&·​context,​
24 ······asio:​:​ip:​:​tcp:​:​resolver:​:​results_type·​endpoints)​29 ······const·tcp:​:​resolver:​:​results_type&·​endpoints)​
25 ····​:​·​socket_(io_context,​·​context)​30 ····​:​·​socket_(io_context,​·​context)​
26 ··​{31 ··​{
27 ····​socket_.​set_verify_mode(asio:​:​ssl:​:​verify_peer)​;​32 ····​socket_.​set_verify_mode(asio:​:​ssl:​:​verify_peer)​;​
28 ····​socket_.​set_verify_callback(33 ····​socket_.​set_verify_callback(
29 ········boost:​:​bind(&client:​:​verify_certificate,​·​this,​34 ········​std:​:​bind(&client:​:​verify_certificate,​·​this,​·_1,​·_2)​)​;​
30 ··········boost:​:​placeholders:​:​_1,​·boost:​:​placeholders:​:​_2)​)​;​
31 35
32 ····asio:​:​async_connect(socket_​.​lowest_layer()​,​·endpoints,​36 ····​connect(endpoints)​;​
33 ········boost:​:​bind(&client:​:​handle_connect,​·this,​
34 ··········asio:​:​placeholders:​:​error)​)​;​
35 ··​}37 ··​}
36 38
39 private:​
37 ··​bool·​verify_certificate(bo​ol·​preverified,​40 ··​bool·​verify_certificate(bo​ol·​preverified,​
38 ······​asio:​:​ssl:​:​verify_context&·​ctx)​41 ······​asio:​:​ssl:​:​verify_context&·​ctx)​
39 ··​{42 ··​{
40 ····​/​/​·​The·​verify·​callback·​can·​be·​used·​to·​check·​whether·​the·​certificate·​that·​is43 ····​/​/​·​The·​verify·​callback·​can·​be·​used·​to·​check·​whether·​the·​certificate·​that·​is
41 ····​/​/​·​being·​presented·​is·​valid·​for·​the·​peer.​·​For·​example,​·​RFC·​2818·​describes44 ····​/​/​·​being·​presented·​is·​valid·​for·​the·​peer.​·​For·​example,​·​RFC·​2818·​describes
42 ····​/​/​·​the·​steps·​involved·​in·​doing·​this·​for·​HTTPS.​·​Consult·​the·​OpenSSL45 ····​/​/​·​the·​steps·​involved·​in·​doing·​this·​for·​HTTPS.​·​Consult·​the·​OpenSSL
43 ····​/​/​·​documentation·​for·​more·​details.​·​Note·​that·​the·​callback·​is·​called·​once46 ····​/​/​·​documentation·​for·​more·​details.​·​Note·​that·​the·​callback·​is·​called·​once
44 ····​/​/​·​for·​each·​certificate·​in·​the·​certificate·​chain,​·​starting·​from·​the·​root47 ····​/​/​·​for·​each·​certificate·​in·​the·​certificate·​chain,​·​starting·​from·​the·​root
45 ····​/​/​·​certificate·​authority.​48 ····​/​/​·​certificate·​authority.​
46 49
47 ····​/​/​·​In·​this·​example·​we·​will·​simply·​print·​the·​certificate's·​subject·​name.​50 ····​/​/​·​In·​this·​example·​we·​will·​simply·​print·​the·​certificate's·​subject·​name.​
48 ····​char·​subject_name[256];​51 ····​char·​subject_name[256];​
49 ····​X509*·​cert·​=·​X509_STORE_CTX_get_cu​rrent_cert(ctx.​native_handle()​)​;​52 ····​X509*·​cert·​=·​X509_STORE_CTX_get_cu​rrent_cert(ctx.​native_handle()​)​;​
50 ····​X509_NAME_oneline(X50​9_get_subject_name(ce​rt)​,​·​subject_name,​·​256)​;​53 ····​X509_NAME_oneline(X50​9_get_subject_name(ce​rt)​,​·​subject_name,​·​256)​;​
51 ····​std:​:​cout·​<<·​"Verifying·​"·​<<·​subject_name·​<<·​"\n";​54 ····​std:​:​cout·​<<·​"Verifying·​"·​<<·​subject_name·​<<·​"\n";​
52 55
53 ····​return·​preverified;​56 ····​return·​preverified;​
54 ··​}57 ··​}
55 58
56 ··​void·handle_connect(const·asio:​:​error_code&·​error)​59 ··​void·​connect(const·tcp:​:​resolver:​:​results_type&·​endpoints)​
57 ··{
58 ····if·(!error)​
59 ····{
60 ······socket_.​async_handshake(asio:​:​ssl:​:​stream_base:​:​client,​
61 ··········boost:​:​bind(&client:​:​handle_handshake,​·this,​
62 ············asio:​:​placeholders:​:​error)​)​;​
63 ····}
64 ····else
65 ····{
66 ······std:​:​cout·<<·"Connect·failed:​·"·<<·error.​message()​·<<·"\n";​
67 ····}
68 ··}
69
70 ··void·handle_handshake(cons​t·asio:​:​error_code&·error)​
71 ··{
72 ····if·(!error)​
73 ····{
74 ······std:​:​cout·<<·"Enter·message:​·";​
75 ······std:​:​cin.​getline(request_,​·max_length)​;​
76 ······size_t·request_length·=·strlen(request_)​;​
77
78 ······asio:​:​async_write(socket_,​
79 ··········asio:​:​buffer(request_,​·request_length)​,​
80 ··········boost:​:​bind(&client:​:​handle_write,​·this,​
81 ············asio:​:​placeholders:​:​error,​
82 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​
83 ····}
84 ····else
85 ····{
86 ······std:​:​cout·<<·"Handshake·failed:​·"·<<·error.​message()​·<<·"\n";​
87 ····}
88 ··}
89
90 ··void·handle_write(const·asio:​:​error_code&·error,​
91 ······size_t·bytes_transferred)​
92 ··​{60 ··​{
93 ····​if·(!error)​61 ····asio:​:​async_connect(socket_​.​lowest_layer()​,​·endpoints,​
94 ····{62 ········[this](const·std:​:​error_code&·error,​
95 ······asio:​:​async_read(socket_,​63 ··········const·tcp:​:​endpoint&·/​*endpoint*/​)​
96 ··········asio:​:​buffer(reply_,​·bytes_transferred)​,​64 ········{
97 ··········boost:​:​bind(&client:​:​handle_read,​·this,​65 ··········​if·(!error)​
98 ············asio:​:​placeholders:​:​error,​66 ··········{
99 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​67 ············​handshake()​;​
100 ····​}68 ··········​}
101 ····​else69 ··········​else
102 ····​{70 ··········​{
103 ······​std:​:​cout·​<<·​"Write·​failed:​·​"·​<<·​error.​message()​·​<<·​"\n";​71 ············​std:​:​cout·​<<·​"Connect·​failed:​·​"·​<<·​error.​message()​·​<<·​"\n";​
104 ····​}72 ··········​}
105 ··​}73 ········​})​;​
106 74 ··}
107 ··void·handle_read(const·asio:​:​error_code&·error,​75
108 ······size_t·bytes_transferred)​76 ··void·handshake()​
109 ··​{77 ··​{
110 ····if·(!error)​78 ····socket_.​async_handshake(asio:​:​ssl:​:​stream_base:​:​client,​
111 ····{79 ········[this](const·std:​:​error_code&·error)​
112 ······std:​:​cout·<<·"Reply:​·";​80 ········{
113 ······std:​:​cout.​write(reply_,​·bytes_transferred)​;​81 ··········if·(!error)​
114 ······std:​:​cout·<<·"\n";​82 ··········{
115 ····}83 ············send_request()​;​
116 ····else84 ··········}
117 ····{85 ··········else
118 ······std:​:​cout·<<·"Read·failed:​·"·<<·error.​message()​·<<·"\n";​86 ··········{
119 ····}87 ············std:​:​cout·<<·"Handshake·failed:​·"·<<·error.​message()​·<<·"\n";​
88 ··········​}
89 ········​})​;​
90 ··​}
91
92 ··​void·​send_request()​
93 ··​{
94 ····​std:​:​cout·​<<·​"Enter·​message:​·​";​
95 ····​std:​:​cin.​getline(request_,​·​max_length)​;​
96 ····​size_t·​request_length·​=·​std:​:​strlen(request_)​;​
97
98 ····​asio:​:​async_write(socket_,​
99 ········​asio:​:​buffer(request_,​·​request_length)​,​
100 ········​[this](const·​std:​:​error_code&·​error,​·​std:​:​size_t·​length)​
101 ········​{
102 ··········​if·​(!error)​
103 ··········​{
104 ············​receive_response(leng​th)​;​
105 ··········​}
106 ··········​else
107 ··········​{
108 ············​std:​:​cout·​<<·​"Write·​failed:​·​"·​<<·​error.​message()​·​<<·​"\n";​
109 ··········​}
110 ········​})​;​
111 ··​}
112
113 ··​void·​receive_response(std:​:​size_t·​length)​
114 ··​{
115 ····​asio:​:​async_read(socket_,​
116 ········​asio:​:​buffer(reply_,​·​length)​,​
117 ········​[this](const·​std:​:​error_code&·​error,​·​std:​:​size_t·​length)​
118 ········​{
119 ··········​if·​(!error)​
120 ··········​{
121 ············​std:​:​cout·​<<·​"Reply:​·​";​
122 ············​std:​:​cout.​write(reply_,​·​length)​;​
123 ············​std:​:​cout·​<<·​"\n";​
124 ··········​}
125 ··········​else
126 ··········​{
127 ············​std:​:​cout·​<<·​"Read·​failed:​·​"·​<<·​error.​message()​·​<<·​"\n";​
128 ··········​}
129 ········​})​;​
120 ··​}130 ··​}
121 131
122 private:​132 ··asio:​:​ssl:​:​stream<tcp:​:​socket>·socket_;​
123 ··asio:​:​ssl:​:​stream<asio:​:​ip:​:​tcp:​:​socket>·socket_;​
124 ··​char·​request_[max_length];​133 ··​char·​request_[max_length];​
125 ··​char·​reply_[max_length];​134 ··​char·​reply_[max_length];​
126 };​135 };​
127 136
128 int·​main(int·​argc,​·​char*·​argv[])​137 int·​main(int·​argc,​·​char*·​argv[])​
129 {138 {
130 ··​try139 ··​try
131 ··​{140 ··​{
132 ····​if·​(argc·​!=·​3)​141 ····​if·​(argc·​!=·​3)​
133 ····​{142 ····​{
134 ······​std:​:​cerr·​<<·​"Usage:​·​client·​<host>·​<port>\n";​143 ······​std:​:​cerr·​<<·​"Usage:​·​client·​<host>·​<port>\n";​
135 ······​return·​1;​144 ······​return·​1;​
136 ····​}145 ····​}
137 146
138 ····​asio:​:​io_context·​io_context;​147 ····​asio:​:​io_context·​io_context;​
139 148
140 ····asio:​:​ip:​:​tcp:​:​resolver·​resolver(io_context)​;​149 ····​tcp:​:​resolver·​resolver(io_context)​;​
141 ····​asio:​:​ip:​:​tcp:​:​resolver:​:​results_type·endpoints·=150 ····​auto·endpoints·=·resolver.​resolve(argv[1],​·argv[2])​;​
142 ······resolver.​resolve(argv[1],​·argv[2])​;​
143 151
144 ····​asio:​:​ssl:​:​context·​ctx(asio:​:​ssl:​:​context:​:​sslv23)​;​152 ····​asio:​:​ssl:​:​context·​ctx(asio:​:​ssl:​:​context:​:​sslv23)​;​
145 ····​ctx.​load_verify_file("ca.​pem")​;​153 ····​ctx.​load_verify_file("ca.​pem")​;​
146 154
147 ····​client·​c(io_context,​·​ctx,​·​endpoints)​;​155 ····​client·​c(io_context,​·​ctx,​·​endpoints)​;​
148 156
149 ····​io_context.​run()​;​157 ····​io_context.​run()​;​
150 ··​}158 ··​}
151 ··​catch·​(std:​:​exception&·​e)​159 ··​catch·​(std:​:​exception&·​e)​
152 ··​{160 ··​{
153 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​161 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
154 ··​}162 ··​}
155 163
156 ··​return·​0;​164 ··​return·​0;​
157 }165 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/ssl/server.cpp.html b/include/asio/doc/examples/diffs/ssl/server.cpp.html new file mode 100644 index 0000000..1c1a805 --- /dev/null +++ b/include/asio/doc/examples/diffs/ssl/server.cpp.html @@ -0,0 +1,239 @@ + + + + + + + HTML Diff ssl/server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​ssl/​server.​cppsrc/​examples/​cpp11/​ssl/​server.​cpp
1 /​/​1 /​/​
2 /​/​·​server.​cpp2 /​/​·​server.​cpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<cstdlib>11 #include·​<cstdlib>
12 #include·​<functional>
12 #include·​<iostream>13 #include·​<iostream>
13 #include·​<boost/​bind/​bind.​hpp>
14 #include·​"asio.​hpp"14 #include·​"asio.​hpp"
15 #include·​"asio/​ssl.​hpp"15 #include·​"asio/​ssl.​hpp"
16 16
17 typedef·asio:​:​ssl:​:​stream<asio:​:​ip:​:​tcp:​:​socket>·ssl_socket;​17 using·asio:​:​ip:​:​tcp;​
18 18
19 class·​session19 class·session·:​·public·std:​:​enable_shared_from_th​is<session>
20 {20 {
21 public:​21 public:​
22 ··​session(asio:​:​io_context&·io_context,​22 ··​session(asio:​:​ssl:​:​stream<tcp:​:​socket>·socket)​
23 ······asio:​:​ssl:​:​context&·context)​23 ····:​·socket_(std:​:​move(socket)​)​
24 ····:​·socket_(io_context,​·context)​
25 ··​{24 ··​{
26 ··​}25 ··​}
27 26
28 ··​ssl_socket:​:​lowest_layer_type&·​socket()​
29 ··​{
30 ····​return·​socket_.​lowest_layer()​;​
31 ··​}
32
33 ··​void·​start()​27 ··​void·​start()​
34 ··​{28 ··​{
35 ····socket_.​async_handshake(asio:​:​ssl:​:​stream_base:​:​server,​29 ····do_handshake()​;​
36 ········boost:​:​bind(&session:​:​handle_handshake,​·this,​
37 ··········asio:​:​placeholders:​:​error)​)​;​
38 ··}
39
40 ··void·handle_handshake(cons​t·asio:​:​error_code&·error)​
41 ··{
42 ····if·(!error)​
43 ····{
44 ······socket_.​async_read_some(asio:​:​buffer(data_,​·max_length)​,​
45 ··········boost:​:​bind(&session:​:​handle_read,​·this,​
46 ············asio:​:​placeholders:​:​error,​
47 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​
48 ····}
49 ····else
50 ····{
51 ······delete·this;​
52 ····}
53 ··}
54
55 ··void·handle_read(const·asio:​:​error_code&·error,​
56 ······size_t·bytes_transferred)​
57 ··{
58 ····if·(!error)​
59 ····{
60 ······asio:​:​async_write(socket_,​
61 ··········asio:​:​buffer(data_,​·bytes_transferred)​,​
62 ··········boost:​:​bind(&session:​:​handle_write,​·this,​
63 ············asio:​:​placeholders:​:​error)​)​;​
64 ····}
65 ····else
66 ····{
67 ······delete·this;​
68 ····}
69 ··​}30 ··​}
70 31
71 ··void·handle_write(const·asio:​:​error_code&·error)​32 private:​
33 ··​void·​do_handshake()​
72 ··​{34 ··​{
73 ····if·​(!error)​35 ····auto·self(shared_from_this​()​)​;​
74 ····{36 ····socket_.​async_handshake(asio:​:​ssl:​:​stream_base:​:​server,​·
75 ······socket_.​async_read_some(asio:​:​buffer(data_,​·max_length)​,​37 ········[this,​·self](const·std:​:​error_code&·error)​
76 ··········boost:​:​bind(&session:​:​handle_read,​·this,​38 ········{
77 ············asio:​:​placeholders:​:​error,​39 ··········​if·(!error)​
78 ············asio:​:​placeholders:​:​bytes_transferred)​)​;​40 ··········{
79 ····}41 ············do_read()​;​
80 ····else42 ··········}
81 ····{43 ········})​;​
82 ······delete·this;​44 ··}
83 ····}45
46 ··​void·​do_read()​
47 ··​{
48 ····​auto·​self(shared_from_this​()​)​;​
49 ····​socket_.​async_read_some(asio:​:​buffer(data_)​,​
50 ········​[this,​·​self](const·​std:​:​error_code&·​ec,​·​std:​:​size_t·​length)​
51 ········​{
52 ··········​if·​(!ec)​
53 ··········​{
54 ············​do_write(length)​;​
55 ··········​}
56 ········​})​;​
57 ··​}
58
59 ··​void·​do_write(std:​:​size_t·​length)​
60 ··​{
61 ····​auto·​self(shared_from_this​()​)​;​
62 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer(data_,​·​length)​,​
63 ········​[this,​·​self](const·​std:​:​error_code&·​ec,​
64 ··········​std:​:​size_t·​/​*length*/​)​
65 ········​{
66 ··········​if·​(!ec)​
67 ··········​{
68 ············​do_read()​;​
69 ··········​}
70 ········​})​;​
84 ··​}71 ··​}
85 72
86 private:​73 ··asio:​:​ssl:​:​stream<tcp:​:​socket>·socket_;​
87 ··ssl_socket·socket_;​74 ··char·data_[1024];​
88 ··enum·{·max_length·=·1024·};​
89 ··char·data_[max_length];​
90 };​75 };​
91 76
92 class·​server77 class·​server
93 {78 {
94 public:​79 public:​
95 ··​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​80 ··​server(asio:​:​io_context&·​io_context,​·​unsigned·​short·​port)​
96 ····​:​·​io_context_(io_contex​t)​,​81 ····​:​·acceptor_(io_context,​·tcp:​:​endpoint(tcp:​:​v4()​,​·port)​)​,​
97 ······acceptor_(io_context,​
98 ··········asio:​:​ip:​:​tcp:​:​endpoint(asio:​:​ip:​:​tcp:​:​v4()​,​·port)​)​,​
99 ······​context_(asio:​:​ssl:​:​context:​:​sslv23)​82 ······​context_(asio:​:​ssl:​:​context:​:​sslv23)​
100 ··​{83 ··​{
101 ····​context_.​set_options(84 ····​context_.​set_options(
102 ········​asio:​:​ssl:​:​context:​:​default_workarounds85 ········​asio:​:​ssl:​:​context:​:​default_workarounds
103 ········​|·​asio:​:​ssl:​:​context:​:​no_sslv286 ········​|·​asio:​:​ssl:​:​context:​:​no_sslv2
104 ········​|·​asio:​:​ssl:​:​context:​:​single_dh_use)​;​87 ········​|·​asio:​:​ssl:​:​context:​:​single_dh_use)​;​
105 ····​context_.​set_password_callback​(boost:​:​bind(&server:​:​get_password,​·​this)​)​;​88 ····​context_.​set_password_callback​(std:​:​bind(&server:​:​get_password,​·​this)​)​;​
106 ····​context_.​use_certificate_chain​_file("server.​pem")​;​89 ····​context_.​use_certificate_chain​_file("server.​pem")​;​
107 ····​context_.​use_private_key_file(​"server.​pem",​·​asio:​:​ssl:​:​context:​:​pem)​;​90 ····​context_.​use_private_key_file(​"server.​pem",​·​asio:​:​ssl:​:​context:​:​pem)​;​
108 ····​context_.​use_tmp_dh_file("dh20​48.​pem")​;​91 ····​context_.​use_tmp_dh_file("dh20​48.​pem")​;​
109 92
110 ····start_accept()​;​93 ····do_accept()​;​
111 ··​}94 ··​}
112 95
96 private:​
113 ··​std:​:​string·​get_password()​·​const97 ··​std:​:​string·​get_password()​·​const
114 ··​{98 ··​{
115 ····​return·​"test";​99 ····​return·​"test";​
116 ··​}100 ··​}
117 101
118 ··​void·start_accept()​102 ··​void·do_accept()​
119 ··​{103 ··​{
120 ····session*·new_session·=·new·session(io_context_,​·context_)​;​104 ····acceptor_.​async_accept(
121 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​105 ········[this](const·std:​:​error_code&·error,​·tcp:​:​socket·socket)​
122 ········boost:​:​bind(&server:​:​handle_accept,​·this,​·new_session,​106 ········{
123 ··········asio:​:​placeholders:​:​error)​)​;​107 ··········​if·(!error)​
124 ··}108 ··········{
125 109 ············std:​:​make_shared<session>(​
126 ··void·handle_accept(session​*·new_session,​110 ················asio:​:​ssl:​:​stream<tcp:​:​socket>(
127 ······const·asio:​:​error_code&·error)​111 ··················std:​:​move(socket)​,​·context_)​)​-​>start()​;​
128 ··{112 ··········}
129 ····if·(!error)​
130 ····{
131 ······new_session-​>start()​;​
132 ····}
133 ····else
134 ····{
135 ······delete·new_session;​
136 ····}
137 113
138 ····start_accept()​;​114 ··········do_accept()​;​
115 ········​})​;​
139 ··​}116 ··​}
140 117
141 private:​118 ··tcp:​:​acceptor·acceptor_;​
142 ··asio:​:​io_context&·io_context_;​
143 ··asio:​:​ip:​:​tcp:​:​acceptor·acceptor_;​
144 ··​asio:​:​ssl:​:​context·​context_;​119 ··​asio:​:​ssl:​:​context·​context_;​
145 };​120 };​
146 121
147 int·​main(int·​argc,​·​char*·​argv[])​122 int·​main(int·​argc,​·​char*·​argv[])​
148 {123 {
149 ··​try124 ··​try
150 ··​{125 ··​{
151 ····​if·​(argc·​!=·​2)​126 ····​if·​(argc·​!=·​2)​
152 ····​{127 ····​{
153 ······​std:​:​cerr·​<<·​"Usage:​·​server·​<port>\n";​128 ······​std:​:​cerr·​<<·​"Usage:​·​server·​<port>\n";​
154 ······​return·​1;​129 ······​return·​1;​
155 ····​}130 ····​}
156 131
157 ····​asio:​:​io_context·​io_context;​132 ····​asio:​:​io_context·​io_context;​
158 133
159 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​134 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​
160 ····​server·​s(io_context,​·​atoi(argv[1])​)​;​135 ····​server·​s(io_context,​·​atoi(argv[1])​)​;​
161 136
162 ····​io_context.​run()​;​137 ····​io_context.​run()​;​
163 ··​}138 ··​}
164 ··​catch·​(std:​:​exception&·​e)​139 ··​catch·​(std:​:​exception&·​e)​
165 ··​{140 ··​{
166 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​141 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
167 ··​}142 ··​}
168 143
169 ··​return·​0;​144 ··​return·​0;​
170 }145 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/timeouts/async_tcp_client.cpp.html b/include/asio/doc/examples/diffs/timeouts/async_tcp_client.cpp.html new file mode 100644 index 0000000..4972a5e --- /dev/null +++ b/include/asio/doc/examples/diffs/timeouts/async_tcp_client.cpp.html @@ -0,0 +1,353 @@ + + + + + + + HTML Diff timeouts/async_tcp_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​timeouts/​async_tcp_client.​cppsrc/​examples/​cpp11/​timeouts/​async_tcp_client.​cpp
1 /​/​1 /​/​
2 /​/​·​async_tcp_client.​cpp2 /​/​·​async_tcp_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"asio/​buffer.​hpp"11 #include·​"asio/​buffer.​hpp"
12 #include·​"asio/​io_context.​hpp"12 #include·​"asio/​io_context.​hpp"
13 #include·​"asio/​ip/​tcp.​hpp"13 #include·​"asio/​ip/​tcp.​hpp"
14 #include·​"asio/​read_until.​hpp"14 #include·​"asio/​read_until.​hpp"
15 #include·​"asio/​steady_timer.​hpp"15 #include·​"asio/​steady_timer.​hpp"
16 #include·​"asio/​write.​hpp"16 #include·​"asio/​write.​hpp"
17 #include·​<boost/​bind/​bind.​hpp>17 #include·​<functional>
18 #include·​<iostream>18 #include·​<iostream>
19 #include·​<string>19 #include·​<string>
20 20
21 using·​asio:​:​steady_timer;​21 using·​asio:​:​steady_timer;​
22 using·​asio:​:​ip:​:​tcp;​22 using·​asio:​:​ip:​:​tcp;​
23 using·​std:​:​placeholders:​:​_1;​
24 using·​std:​:​placeholders:​:​_2;​
23 25
24 /​/​26 /​/​
25 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​applying·​the·​concept·​of·​a·​deadline.​27 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​applying·​the·​concept·​of·​a·​deadline.​
26 /​/​·​Some·​asynchronous·​operations·​are·​given·​deadlines·​by·​which·​they·​must·​complete.​28 /​/​·​Some·​asynchronous·​operations·​are·​given·​deadlines·​by·​which·​they·​must·​complete.​
27 /​/​·​Deadlines·​are·​enforced·​by·​an·​"actor"·​that·​persists·​for·​the·​lifetime·​of·​the29 /​/​·​Deadlines·​are·​enforced·​by·​an·​"actor"·​that·​persists·​for·​the·​lifetime·​of·​the
28 /​/​·​client·​object:​30 /​/​·​client·​object:​
29 /​/​31 /​/​
30 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+32 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
31 /​/​··​|················​|33 /​/​··​|················​|
32 /​/​··​|·​check_deadline·​|<-​-​-​+34 /​/​··​|·​check_deadline·​|<-​-​-​+
33 /​/​··​|················​|····​|35 /​/​··​|················​|····​|
34 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|·​async_wait()​36 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|·​async_wait()​
35 /​/​··············​|·········​|37 /​/​··············​|·········​|
36 /​/​··············​+-​-​-​-​-​-​-​-​-​+38 /​/​··············​+-​-​-​-​-​-​-​-​-​+
37 /​/​39 /​/​
38 /​/​·​If·​the·​deadline·​actor·​determines·​that·​the·​deadline·​has·​expired,​·​the·​socket40 /​/​·​If·​the·​deadline·​actor·​determines·​that·​the·​deadline·​has·​expired,​·​the·​socket
39 /​/​·​is·​closed·​and·​any·​outstanding·​operations·​are·​consequently·​cancelled.​41 /​/​·​is·​closed·​and·​any·​outstanding·​operations·​are·​consequently·​cancelled.​
40 /​/​42 /​/​
41 /​/​·​Connection·​establishment·​involves·​trying·​each·​endpoint·​in·​turn·​until·​a43 /​/​·​Connection·​establishment·​involves·​trying·​each·​endpoint·​in·​turn·​until·​a
42 /​/​·​connection·​is·​successful,​·​or·​the·​available·​endpoints·​are·​exhausted.​·​If·​the44 /​/​·​connection·​is·​successful,​·​or·​the·​available·​endpoints·​are·​exhausted.​·​If·​the
43 /​/​·​deadline·​actor·​closes·​the·​socket,​·​the·​connect·​actor·​is·​woken·​up·​and·​moves·​to45 /​/​·​deadline·​actor·​closes·​the·​socket,​·​the·​connect·​actor·​is·​woken·​up·​and·​moves·​to
44 /​/​·​the·​next·​endpoint.​46 /​/​·​the·​next·​endpoint.​
45 /​/​47 /​/​
46 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+48 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
47 /​/​··​|···············​|49 /​/​··​|···············​|
48 /​/​··​|·​start_connect·​|<-​-​-​+50 /​/​··​|·​start_connect·​|<-​-​-​+
49 /​/​··​|···············​|····​|51 /​/​··​|···············​|····​|
50 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|52 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|
51 /​/​···········​|···········​|53 /​/​···········​|···········​|
52 /​/​··​async_-​··​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+54 /​/​··​async_-​··​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
53 /​/​·​connect()​·​|····​|················​|55 /​/​·​connect()​·​|····​|················​|
54 /​/​···········​+-​-​-​>|·​handle_connect·​|56 /​/​···········​+-​-​-​>|·​handle_connect·​|
55 /​/​················​|················​|57 /​/​················​|················​|
56 /​/​················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+58 /​/​················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
57 /​/​··························​:​59 /​/​··························​:​
58 /​/​·​Once·​a·​connection·​is·····​:​60 /​/​·​Once·​a·​connection·​is·····​:​
59 /​/​·​made,​·​the·​connect········​:​61 /​/​·​made,​·​the·​connect········​:​
60 /​/​·​actor·​forks·​in·​two·​-​·····​:​62 /​/​·​actor·​forks·​in·​two·​-​·····​:​
61 /​/​··························​:​63 /​/​··························​:​
62 /​/​·​an·​actor·​for·​reading·····​:​·······​and·​an·​actor·​for64 /​/​·​an·​actor·​for·​reading·····​:​·······​and·​an·​actor·​for
63 /​/​·​inbound·​messages:​········​:​·······​sending·​heartbeats:​65 /​/​·​inbound·​messages:​········​:​·······​sending·​heartbeats:​
64 /​/​··························​:​66 /​/​··························​:​
65 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​+··········​:​··········​+-​-​-​-​-​-​-​-​-​-​-​-​-​+67 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​+··········​:​··········​+-​-​-​-​-​-​-​-​-​-​-​-​-​+
66 /​/​··​|············​|<-​·​-​·​-​·​-​·​-​+-​·​-​·​-​·​-​·​-​>|·············​|68 /​/​··​|············​|<-​·​-​·​-​·​-​·​-​+-​·​-​·​-​·​-​·​-​>|·············​|
67 /​/​··​|·​start_read·​|·····················​|·​start_write·​|<-​-​-​+69 /​/​··​|·​start_read·​|·····················​|·​start_write·​|<-​-​-​+
68 /​/​··​|············​|<-​-​-​+················​|·············​|····​|70 /​/​··​|············​|<-​-​-​+················​|·············​|····​|
69 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​+····​|················​+-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|·​async_wait()​71 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​+····​|················​+-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|·​async_wait()​
70 /​/​··········​|·········​|························​|··········​|72 /​/​··········​|·········​|························​|··········​|
71 /​/​··​async_-​·​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​+·······​async_-​·​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+73 /​/​··​async_-​·​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​+·······​async_-​·​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
72 /​/​···​read_-​·​|····​|·············​|·······​write()​·​|····​|··············​|74 /​/​···​read_-​·​|····​|·············​|·······​write()​·​|····​|··············​|
73 /​/​··​until()​·​+-​-​-​>|·​handle_read·​|···············​+-​-​-​>|·​handle_write·​|75 /​/​··​until()​·​+-​-​-​>|·​handle_read·​|···············​+-​-​-​>|·​handle_write·​|
74 /​/​···············​|·············​|····················​|··············​|76 /​/​···············​|·············​|····················​|··············​|
75 /​/​···············​+-​-​-​-​-​-​-​-​-​-​-​-​-​+····················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+77 /​/​···············​+-​-​-​-​-​-​-​-​-​-​-​-​-​+····················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
76 /​/​78 /​/​
77 /​/​·​The·​input·​actor·​reads·​messages·​from·​the·​socket,​·​where·​messages·​are·​delimited79 /​/​·​The·​input·​actor·​reads·​messages·​from·​the·​socket,​·​where·​messages·​are·​delimited
78 /​/​·​by·​the·​newline·​character.​·​The·​deadline·​for·​a·​complete·​message·​is·​30·​seconds.​80 /​/​·​by·​the·​newline·​character.​·​The·​deadline·​for·​a·​complete·​message·​is·​30·​seconds.​
79 /​/​81 /​/​
80 /​/​·​The·​heartbeat·​actor·​sends·​a·​heartbeat·​(a·​message·​that·​consists·​of·​a·​single82 /​/​·​The·​heartbeat·​actor·​sends·​a·​heartbeat·​(a·​message·​that·​consists·​of·​a·​single
81 /​/​·​newline·​character)​·​every·​10·​seconds.​·​In·​this·​example,​·​no·​deadline·​is·​applied83 /​/​·​newline·​character)​·​every·​10·​seconds.​·​In·​this·​example,​·​no·​deadline·​is·​applied
82 /​/​·​to·​message·​sending.​84 /​/​·​to·​message·​sending.​
83 /​/​85 /​/​
84 class·​client86 class·​client
85 {87 {
86 public:​88 public:​
87 ··​client(asio:​:​io_context&·​io_context)​89 ··​client(asio:​:​io_context&·​io_context)​
88 ····​:​·​stopped_(false)​,​90 ····​:​·​socket_(io_context)​,​
89 ······socket_(io_context)​,​
90 ······​deadline_(io_context)​,​91 ······​deadline_(io_context)​,​
91 ······​heartbeat_timer_(io_c​ontext)​92 ······​heartbeat_timer_(io_c​ontext)​
92 ··​{93 ··​{
93 ··​}94 ··​}
94 95
95 ··​/​/​·​Called·​by·​the·​user·​of·​the·​client·​class·​to·​initiate·​the·​connection·​process.​96 ··​/​/​·​Called·​by·​the·​user·​of·​the·​client·​class·​to·​initiate·​the·​connection·​process.​
96 ··​/​/​·​The·​endpoints·​will·​have·​been·​obtained·​using·​a·​tcp:​:​resolver.​97 ··​/​/​·​The·​endpoints·​will·​have·​been·​obtained·​using·​a·​tcp:​:​resolver.​
97 ··​void·​start(tcp:​:​resolver:​:​results_type·​endpoints)​98 ··​void·​start(tcp:​:​resolver:​:​results_type·​endpoints)​
98 ··​{99 ··​{
99 ····​/​/​·​Start·​the·​connect·​actor.​100 ····​/​/​·​Start·​the·​connect·​actor.​
100 ····​endpoints_·​=·​endpoints;​101 ····​endpoints_·​=·​endpoints;​
101 ····​start_connect(endpoin​ts_.​begin()​)​;​102 ····​start_connect(endpoin​ts_.​begin()​)​;​
102 103
103 ····​/​/​·​Start·​the·​deadline·​actor.​·​You·​will·​note·​that·​we're·​not·​setting·​any104 ····​/​/​·​Start·​the·​deadline·​actor.​·​You·​will·​note·​that·​we're·​not·​setting·​any
104 ····​/​/​·​particular·​deadline·​here.​·​Instead,​·​the·​connect·​and·​input·​actors·​will105 ····​/​/​·​particular·​deadline·​here.​·​Instead,​·​the·​connect·​and·​input·​actors·​will
105 ····​/​/​·​update·​the·​deadline·​prior·​to·​each·​asynchronous·​operation.​106 ····​/​/​·​update·​the·​deadline·​prior·​to·​each·​asynchronous·​operation.​
106 ····​deadline_.​async_wait(boost:​:​bind(&client:​:​check_deadline,​·​this)​)​;​107 ····​deadline_.​async_wait(std:​:​bind(&client:​:​check_deadline,​·​this)​)​;​
107 ··​}108 ··​}
108 109
109 ··​/​/​·​This·​function·​terminates·​all·​the·​actors·​to·​shut·​down·​the·​connection.​·​It110 ··​/​/​·​This·​function·​terminates·​all·​the·​actors·​to·​shut·​down·​the·​connection.​·​It
110 ··​/​/​·​may·​be·​called·​by·​the·​user·​of·​the·​client·​class,​·​or·​by·​the·​class·​itself·​in111 ··​/​/​·​may·​be·​called·​by·​the·​user·​of·​the·​client·​class,​·​or·​by·​the·​class·​itself·​in
111 ··​/​/​·​response·​to·​graceful·​termination·​or·​an·​unrecoverable·​error.​112 ··​/​/​·​response·​to·​graceful·​termination·​or·​an·​unrecoverable·​error.​
112 ··​void·​stop()​113 ··​void·​stop()​
113 ··​{114 ··​{
114 ····​stopped_·​=·​true;​115 ····​stopped_·​=·​true;​
115 ····asio:​:​error_code·​ignored_ec;​116 ····​std:​:​error_code·​ignored_error;​
116 ····​socket_.​close(ignored_ec)​;​117 ····​socket_.​close(ignored_error)​;​
117 ····​deadline_.​cancel()​;​118 ····​deadline_.​cancel()​;​
118 ····​heartbeat_timer_.​cancel()​;​119 ····​heartbeat_timer_.​cancel()​;​
119 ··​}120 ··​}
120 121
121 private:​122 private:​
122 ··​void·​start_connect(tcp:​:​resolver:​:​results_type:​:​iterator·​endpoint_iter)​123 ··​void·​start_connect(tcp:​:​resolver:​:​results_type:​:​iterator·​endpoint_iter)​
123 ··​{124 ··​{
124 ····​if·​(endpoint_iter·​!=·​endpoints_.​end()​)​125 ····​if·​(endpoint_iter·​!=·​endpoints_.​end()​)​
125 ····​{126 ····​{
126 ······​std:​:​cout·​<<·​"Trying·​"·​<<·​endpoint_iter-​>endpoint()​·​<<·​".​.​.​\n";​127 ······​std:​:​cout·​<<·​"Trying·​"·​<<·​endpoint_iter-​>endpoint()​·​<<·​".​.​.​\n";​
127 128
128 ······​/​/​·​Set·​a·​deadline·​for·​the·​connect·​operation.​129 ······​/​/​·​Set·​a·​deadline·​for·​the·​connect·​operation.​
129 ······​deadline_.​expires_after(asio:​:​chrono:​:​seconds(60)​)​;​130 ······​deadline_.​expires_after(std:​:​chrono:​:​seconds(60)​)​;​
130 131
131 ······​/​/​·​Start·​the·​asynchronous·​connect·​operation.​132 ······​/​/​·​Start·​the·​asynchronous·​connect·​operation.​
132 ······​socket_.​async_connect(endpoin​t_iter-​>endpoint()​,​133 ······​socket_.​async_connect(endpoin​t_iter-​>endpoint()​,​
133 ··········boost:​:​bind(&client:​:​handle_connect,​·this,​134 ··········​std:​:​bind(&client:​:​handle_connect,​
134 ············boost:​:​placeholders:​:​_1,​·​endpoint_iter)​)​;​135 ············​this,​·_1,​·​endpoint_iter)​)​;​
135 ····​}136 ····​}
136 ····​else137 ····​else
137 ····​{138 ····​{
138 ······​/​/​·​There·​are·​no·​more·​endpoints·​to·​try.​·​Shut·​down·​the·​client.​139 ······​/​/​·​There·​are·​no·​more·​endpoints·​to·​try.​·​Shut·​down·​the·​client.​
139 ······​stop()​;​140 ······​stop()​;​
140 ····​}141 ····​}
141 ··​}142 ··​}
142 143
143 ··​void·​handle_connect(const·asio:​:​error_code&·​ec,​144 ··​void·​handle_connect(const·​std:​:​error_code&·​error,​
144 ······​tcp:​:​resolver:​:​results_type:​:​iterator·​endpoint_iter)​145 ······​tcp:​:​resolver:​:​results_type:​:​iterator·​endpoint_iter)​
145 ··​{146 ··​{
146 ····​if·​(stopped_)​147 ····​if·​(stopped_)​
147 ······​return;​148 ······​return;​
148 149
149 ····​/​/​·​The·​async_connect()​·​function·​automatically·​opens·​the·​socket·​at·​the·​start150 ····​/​/​·​The·​async_connect()​·​function·​automatically·​opens·​the·​socket·​at·​the·​start
150 ····​/​/​·​of·​the·​asynchronous·​operation.​·​If·​the·​socket·​is·​closed·​at·​this·​time·​then151 ····​/​/​·​of·​the·​asynchronous·​operation.​·​If·​the·​socket·​is·​closed·​at·​this·​time·​then
151 ····​/​/​·​the·​timeout·​handler·​must·​have·​run·​first.​152 ····​/​/​·​the·​timeout·​handler·​must·​have·​run·​first.​
152 ····​if·​(!socket_.​is_open()​)​153 ····​if·​(!socket_.​is_open()​)​
153 ····​{154 ····​{
154 ······​std:​:​cout·​<<·​"Connect·​timed·​out\n";​155 ······​std:​:​cout·​<<·​"Connect·​timed·​out\n";​
155 156
156 ······​/​/​·​Try·​the·​next·​available·​endpoint.​157 ······​/​/​·​Try·​the·​next·​available·​endpoint.​
157 ······​start_connect(++endpo​int_iter)​;​158 ······​start_connect(++endpo​int_iter)​;​
158 ····​}159 ····​}
159 160
160 ····​/​/​·​Check·​if·​the·​connect·​operation·​failed·​before·​the·​deadline·​expired.​161 ····​/​/​·​Check·​if·​the·​connect·​operation·​failed·​before·​the·​deadline·​expired.​
161 ····​else·​if·​(ec)​162 ····​else·​if·​(error)​
162 ····​{163 ····​{
163 ······​std:​:​cout·​<<·​"Connect·​error:​·​"·​<<·​ec.​message()​·​<<·​"\n";​164 ······​std:​:​cout·​<<·​"Connect·​error:​·​"·​<<·​error.​message()​·​<<·​"\n";​
164 165
165 ······​/​/​·​We·​need·​to·​close·​the·​socket·​used·​in·​the·​previous·​connection·​attempt166 ······​/​/​·​We·​need·​to·​close·​the·​socket·​used·​in·​the·​previous·​connection·​attempt
166 ······​/​/​·​before·​starting·​a·​new·​one.​167 ······​/​/​·​before·​starting·​a·​new·​one.​
167 ······​socket_.​close()​;​168 ······​socket_.​close()​;​
168 169
169 ······​/​/​·​Try·​the·​next·​available·​endpoint.​170 ······​/​/​·​Try·​the·​next·​available·​endpoint.​
170 ······​start_connect(++endpo​int_iter)​;​171 ······​start_connect(++endpo​int_iter)​;​
171 ····​}172 ····​}
172 173
173 ····​/​/​·​Otherwise·​we·​have·​successfully·​established·​a·​connection.​174 ····​/​/​·​Otherwise·​we·​have·​successfully·​established·​a·​connection.​
174 ····​else175 ····​else
175 ····​{176 ····​{
176 ······​std:​:​cout·​<<·​"Connected·​to·​"·​<<·​endpoint_iter-​>endpoint()​·​<<·​"\n";​177 ······​std:​:​cout·​<<·​"Connected·​to·​"·​<<·​endpoint_iter-​>endpoint()​·​<<·​"\n";​
177 178
178 ······​/​/​·​Start·​the·​input·​actor.​179 ······​/​/​·​Start·​the·​input·​actor.​
179 ······​start_read()​;​180 ······​start_read()​;​
180 181
181 ······​/​/​·​Start·​the·​heartbeat·​actor.​182 ······​/​/​·​Start·​the·​heartbeat·​actor.​
182 ······​start_write()​;​183 ······​start_write()​;​
183 ····​}184 ····​}
184 ··​}185 ··​}
185 186
186 ··​void·​start_read()​187 ··​void·​start_read()​
187 ··​{188 ··​{
188 ····​/​/​·​Set·​a·​deadline·​for·​the·​read·​operation.​189 ····​/​/​·​Set·​a·​deadline·​for·​the·​read·​operation.​
189 ····​deadline_.​expires_after(asio:​:​chrono:​:​seconds(30)​)​;​190 ····​deadline_.​expires_after(std:​:​chrono:​:​seconds(30)​)​;​
190 191
191 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​read·​a·​newline-​delimited·​message.​192 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​read·​a·​newline-​delimited·​message.​
192 ····​asio:​:​async_read_until(sock​et_,​193 ····​asio:​:​async_read_until(sock​et_,​
193 ········​asio:​:​dynamic_buffer(input_​buffer_)​,​·​'\n',​194 ········​asio:​:​dynamic_buffer(input_​buffer_)​,​·​'\n',​
194 ········boost:​:​bind(&client:​:​handle_read,​·​this,​195 ········​std:​:​bind(&client:​:​handle_read,​·​this,​·_1,​·_2)​)​;​
195 ··········boost:​:​placeholders:​:​_1,​·boost:​:​placeholders:​:​_2)​)​;​
196 ··​}196 ··​}
197 197
198 ··​void·​handle_read(const·asio:​:​error_code&·​ec,​·​std:​:​size_t·​n)​198 ··​void·​handle_read(const·​std:​:​error_code&·​error,​·​std:​:​size_t·​n)​
199 ··​{199 ··​{
200 ····​if·​(stopped_)​200 ····​if·​(stopped_)​
201 ······​return;​201 ······​return;​
202 202
203 ····​if·​(!ec)​203 ····​if·​(!error)​
204 ····​{204 ····​{
205 ······​/​/​·​Extract·​the·​newline-​delimited·​message·​from·​the·​buffer.​205 ······​/​/​·​Extract·​the·​newline-​delimited·​message·​from·​the·​buffer.​
206 ······​std:​:​string·​line(input_buffer_.​substr(0,​·​n·​-​·​1)​)​;​206 ······​std:​:​string·​line(input_buffer_.​substr(0,​·​n·​-​·​1)​)​;​
207 ······​input_buffer_.​erase(0,​·​n)​;​207 ······​input_buffer_.​erase(0,​·​n)​;​
208 208
209 ······​/​/​·​Empty·​messages·​are·​heartbeats·​and·​so·​ignored.​209 ······​/​/​·​Empty·​messages·​are·​heartbeats·​and·​so·​ignored.​
210 ······​if·​(!line.​empty()​)​210 ······​if·​(!line.​empty()​)​
211 ······​{211 ······​{
212 ········​std:​:​cout·​<<·​"Received:​·​"·​<<·​line·​<<·​"\n";​212 ········​std:​:​cout·​<<·​"Received:​·​"·​<<·​line·​<<·​"\n";​
213 ······​}213 ······​}
214 214
215 ······​start_read()​;​215 ······​start_read()​;​
216 ····​}216 ····​}
217 ····​else217 ····​else
218 ····​{218 ····​{
219 ······​std:​:​cout·​<<·​"Error·​on·​receive:​·​"·​<<·​ec.​message()​·​<<·​"\n";​219 ······​std:​:​cout·​<<·​"Error·​on·​receive:​·​"·​<<·​error.​message()​·​<<·​"\n";​
220 220
221 ······​stop()​;​221 ······​stop()​;​
222 ····​}222 ····​}
223 ··​}223 ··​}
224 224
225 ··​void·​start_write()​225 ··​void·​start_write()​
226 ··​{226 ··​{
227 ····​if·​(stopped_)​227 ····​if·​(stopped_)​
228 ······​return;​228 ······​return;​
229 229
230 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​send·​a·​heartbeat·​message.​230 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​send·​a·​heartbeat·​message.​
231 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer("\n",​·​1)​,​231 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer("\n",​·​1)​,​
232 ········boost:​:​bind(&client:​:​handle_write,​·​this,​·boost:​:​placeholders:​:​_1)​)​;​232 ········​std:​:​bind(&client:​:​handle_write,​·​this,​·​_1)​)​;​
233 ··​}233 ··​}
234 234
235 ··​void·​handle_write(const·asio:​:​error_code&·​ec)​235 ··​void·​handle_write(const·​std:​:​error_code&·​error)​
236 ··​{236 ··​{
237 ····​if·​(stopped_)​237 ····​if·​(stopped_)​
238 ······​return;​238 ······​return;​
239 239
240 ····​if·​(!ec)​240 ····​if·​(!error)​
241 ····​{241 ····​{
242 ······​/​/​·​Wait·​10·​seconds·​before·​sending·​the·​next·​heartbeat.​242 ······​/​/​·​Wait·​10·​seconds·​before·​sending·​the·​next·​heartbeat.​
243 ······​heartbeat_timer_.​expires_after(asio:​:​chrono:​:​seconds(10)​)​;​243 ······​heartbeat_timer_.​expires_after(std:​:​chrono:​:​seconds(10)​)​;​
244 ······​heartbeat_timer_.​async_wait(boost:​:​bind(&client:​:​start_write,​·​this)​)​;​244 ······​heartbeat_timer_.​async_wait(std:​:​bind(&client:​:​start_write,​·​this)​)​;​
245 ····​}245 ····​}
246 ····​else246 ····​else
247 ····​{247 ····​{
248 ······​std:​:​cout·​<<·​"Error·​on·​heartbeat:​·​"·​<<·​ec.​message()​·​<<·​"\n";​248 ······​std:​:​cout·​<<·​"Error·​on·​heartbeat:​·​"·​<<·​error.​message()​·​<<·​"\n";​
249 249
250 ······​stop()​;​250 ······​stop()​;​
251 ····​}251 ····​}
252 ··​}252 ··​}
253 253
254 ··​void·​check_deadline()​254 ··​void·​check_deadline()​
255 ··​{255 ··​{
256 ····​if·​(stopped_)​256 ····​if·​(stopped_)​
257 ······​return;​257 ······​return;​
258 258
259 ····​/​/​·​Check·​whether·​the·​deadline·​has·​passed.​·​We·​compare·​the·​deadline·​against259 ····​/​/​·​Check·​whether·​the·​deadline·​has·​passed.​·​We·​compare·​the·​deadline·​against
260 ····​/​/​·​the·​current·​time·​since·​a·​new·​asynchronous·​operation·​may·​have·​moved·​the260 ····​/​/​·​the·​current·​time·​since·​a·​new·​asynchronous·​operation·​may·​have·​moved·​the
261 ····​/​/​·​deadline·​before·​this·​actor·​had·​a·​chance·​to·​run.​261 ····​/​/​·​deadline·​before·​this·​actor·​had·​a·​chance·​to·​run.​
262 ····​if·​(deadline_.​expiry()​·​<=·​steady_timer:​:​clock_type:​:​now()​)​262 ····​if·​(deadline_.​expiry()​·​<=·​steady_timer:​:​clock_type:​:​now()​)​
263 ····​{263 ····​{
264 ······​/​/​·​The·​deadline·​has·​passed.​·​The·​socket·​is·​closed·​so·​that·​any·​outstanding264 ······​/​/​·​The·​deadline·​has·​passed.​·​The·​socket·​is·​closed·​so·​that·​any·​outstanding
265 ······​/​/​·​asynchronous·​operations·​are·​cancelled.​265 ······​/​/​·​asynchronous·​operations·​are·​cancelled.​
266 ······​socket_.​close()​;​266 ······​socket_.​close()​;​
267 267
268 ······​/​/​·​There·​is·​no·​longer·​an·​active·​deadline.​·​The·​expiry·​is·​set·​to·​the268 ······​/​/​·​There·​is·​no·​longer·​an·​active·​deadline.​·​The·​expiry·​is·​set·​to·​the
269 ······​/​/​·​maximum·​time·​point·​so·​that·​the·​actor·​takes·​no·​action·​until·​a·​new269 ······​/​/​·​maximum·​time·​point·​so·​that·​the·​actor·​takes·​no·​action·​until·​a·​new
270 ······​/​/​·​deadline·​is·​set.​270 ······​/​/​·​deadline·​is·​set.​
271 ······​deadline_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​271 ······​deadline_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​
272 ····​}272 ····​}
273 273
274 ····​/​/​·​Put·​the·​actor·​back·​to·​sleep.​274 ····​/​/​·​Put·​the·​actor·​back·​to·​sleep.​
275 ····​deadline_.​async_wait(boost:​:​bind(&client:​:​check_deadline,​·​this)​)​;​275 ····​deadline_.​async_wait(std:​:​bind(&client:​:​check_deadline,​·​this)​)​;​
276 ··​}276 ··​}
277 277
278 private:​278 private:​
279 ··​bool·​stopped_;​279 ··​bool·​stopped_·=·false;​
280 ··​tcp:​:​resolver:​:​results_type·​endpoints_;​280 ··​tcp:​:​resolver:​:​results_type·​endpoints_;​
281 ··​tcp:​:​socket·​socket_;​281 ··​tcp:​:​socket·​socket_;​
282 ··​std:​:​string·​input_buffer_;​282 ··​std:​:​string·​input_buffer_;​
283 ··​steady_timer·​deadline_;​283 ··​steady_timer·​deadline_;​
284 ··​steady_timer·​heartbeat_timer_;​284 ··​steady_timer·​heartbeat_timer_;​
285 };​285 };​
286 286
287 int·​main(int·​argc,​·​char*·​argv[])​287 int·​main(int·​argc,​·​char*·​argv[])​
288 {288 {
289 ··​try289 ··​try
290 ··​{290 ··​{
291 ····​if·​(argc·​!=·​3)​291 ····​if·​(argc·​!=·​3)​
292 ····​{292 ····​{
293 ······​std:​:​cerr·​<<·​"Usage:​·​client·​<host>·​<port>\n";​293 ······​std:​:​cerr·​<<·​"Usage:​·​client·​<host>·​<port>\n";​
294 ······​return·​1;​294 ······​return·​1;​
295 ····​}295 ····​}
296 296
297 ····​asio:​:​io_context·​io_context;​297 ····​asio:​:​io_context·​io_context;​
298 ····​tcp:​:​resolver·​r(io_context)​;​298 ····​tcp:​:​resolver·​r(io_context)​;​
299 ····​client·​c(io_context)​;​299 ····​client·​c(io_context)​;​
300 300
301 ····​c.​start(r.​resolve(argv[1],​·​argv[2])​)​;​301 ····​c.​start(r.​resolve(argv[1],​·​argv[2])​)​;​
302 302
303 ····​io_context.​run()​;​303 ····​io_context.​run()​;​
304 ··​}304 ··​}
305 ··​catch·​(std:​:​exception&·​e)​305 ··​catch·​(std:​:​exception&·​e)​
306 ··​{306 ··​{
307 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​307 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
308 ··​}308 ··​}
309 309
310 ··​return·​0;​310 ··​return·​0;​
311 }311 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/timeouts/blocking_tcp_client.cpp.html b/include/asio/doc/examples/diffs/timeouts/blocking_tcp_client.cpp.html new file mode 100644 index 0000000..48437b8 --- /dev/null +++ b/include/asio/doc/examples/diffs/timeouts/blocking_tcp_client.cpp.html @@ -0,0 +1,246 @@ + + + + + + + HTML Diff timeouts/blocking_tcp_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​timeouts/​blocking_tcp_client.​cppsrc/​examples/​cpp11/​timeouts/​blocking_tcp_client.​cpp
1 /​/​1 /​/​
2 /​/​·​blocking_tcp_client.​cpp2 /​/​·​blocking_tcp_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"asio/​buffer.​hpp"11 #include·​"asio/​buffer.​hpp"
12 #include·​"asio/​connect.​hpp"12 #include·​"asio/​connect.​hpp"
13 #include·​"asio/​io_context.​hpp"13 #include·​"asio/​io_context.​hpp"
14 #include·​"asio/​ip/​tcp.​hpp"14 #include·​"asio/​ip/​tcp.​hpp"
15 #include·​"asio/​read_until.​hpp"15 #include·​"asio/​read_until.​hpp"
16 #include·​"asio/​system_error.​hpp"16 #include·​"asio/​system_error.​hpp"
17 #include·​"asio/​write.​hpp"17 #include·​"asio/​write.​hpp"
18 #include·​<cstdlib>18 #include·​<cstdlib>
19 #include·​<iostream>19 #include·​<iostream>
20 #include·​<string>20 #include·​<string>
21 #include·​<boost/​lambda/​bind.​hpp>
22 #include·​<boost/​lambda/​lambda.​hpp>
23 21
24 using·​asio:​:​ip:​:​tcp;​22 using·​asio:​:​ip:​:​tcp;​
25 using·​boost:​:​lambda:​:​bind;​
26 using·​boost:​:​lambda:​:​var;​
27 using·​boost:​:​lambda:​:​_1;​
28 using·​boost:​:​lambda:​:​_2;​
29 23
30 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​24 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
31 25
32 /​/​26 /​/​
33 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​running·​the·​io_context·​using·​the·​timed27 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​running·​the·​io_context·​using·​the·​timed
34 /​/​·​io_context:​:​run_for()​·​member·​function.​·​Each·​asynchronous·​operation·​is·​given28 /​/​·​io_context:​:​run_for()​·​member·​function.​·​Each·​asynchronous·​operation·​is·​given
35 /​/​·​a·​timeout·​within·​which·​it·​must·​complete.​·​The·​socket·​operations·​themselves29 /​/​·​a·​timeout·​within·​which·​it·​must·​complete.​·​The·​socket·​operations·​themselves
36 /​/​·​use·boost:​:​lambda·function·objects·​as·​completion·​handlers.​·​For·​a·​given30 /​/​·​use·​lambdas·​as·​completion·​handlers.​·​For·​a·​given·socket·operation,​·the·client
37 /​/​·socket·operation,​·​the·​client·​object·runs·the·io_context·​to·block·thread31 /​/​·​object·​runs·​the·io_context·to·block·thread·execution·until·​the·operation
38 /​/​·execution·until·​the·operation·completes·or·​the·timeout·is·reached.​·If·the32 /​/​·​completes·or·​the·timeout·is·reached.​·If·​the·io_context:​:​run_for()​·function
39 /​/​·​io_context:​:​run_for()​·function·​times·​out,​·the·​socket·is·closed·and·the33 /​/​·times·out,​·the·socket·is·closed·and·​the·​outstanding·asynchronous·​operation
40 /​/​·outstanding·asynchronous·operation·​is·​cancelled.​34 /​/​·​is·​cancelled.​
41 /​/​35 /​/​
42 class·​client36 class·​client
43 {37 {
44 public:​38 public:​
45 ··​client()​
46 ····​:​·​socket_(io_context_)​
47 ··​{
48 ··​}
49
50 ··​void·​connect(const·​std:​:​string&·​host,​·​const·​std:​:​string&·​service,​39 ··​void·​connect(const·​std:​:​string&·​host,​·​const·​std:​:​string&·​service,​
51 ······asio:​:​chrono:​:​steady_clock:​:​duration·​timeout)​40 ······​std:​:​chrono:​:​steady_clock:​:​duration·​timeout)​
52 ··​{41 ··​{
53 ····​/​/​·​Resolve·​the·​host·​name·​and·​service·​to·​a·​list·​of·​endpoints.​42 ····​/​/​·​Resolve·​the·​host·​name·​and·​service·​to·​a·​list·​of·​endpoints.​
54 ····​tcp:​:​resolver:​:​results_type·endpoints·=43 ····auto·endpoints·=·​tcp:​:​resolver(io_context_)​.​resolve(host,​·service)​;​
55 ······tcp:​:​resolver(io_context_)​.​resolve(host,​·service)​;​
56 44
57 ····​/​/​·​Start·​the·​asynchronous·​operation·​itself.​·​The·boost:​:​lambda·function45 ····​/​/​·​Start·​the·​asynchronous·​operation·​itself.​·​The·lambda·that·is·used·as·a
58 ····​/​/​·object·is·used·as·a·​callback·and·​will·​update·​the·​ec·​variable·​when·​the46 ····​/​/​·​callback·​will·​update·​the·​error·​variable·​when·​the·operation·completes.​
59 ····​/​/​·operation·completes.​·​The·​blocking_udp_client.​cpp·​example·​shows·​how·​you47 ····​/​/​·​The·​blocking_udp_client.​cpp·​example·​shows·​how·​you·can·use·std:​:​bind
60 ····​/​/​·can·use·boost:​:​bind·​rather·​than·boost:​:​lambda.​48 ····​/​/​·​rather·​than·a·lambda.​
61 ····asio:​:​error_code·​ec;​49 ····​std:​:​error_code·​error;​
62 ····​asio:​:​async_connect(socket_​,​·​endpoints,​·var(ec)​·=·_1)​;​50 ····​asio:​:​async_connect(socket_​,​·​endpoints,​
51 ········​[&](const·​std:​:​error_code&·​result_error,​
52 ············​const·​tcp:​:​endpoint&·​/​*result_endpoint*/​)​
53 ········​{
54 ··········​error·​=·​result_error;​
55 ········​})​;​
63 56
64 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​57 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​
65 ····​run(timeout)​;​58 ····​run(timeout)​;​
66 59
67 ····​/​/​·​Determine·​whether·​a·​connection·​was·​successfully·​established.​60 ····​/​/​·​Determine·​whether·​a·​connection·​was·​successfully·​established.​
68 ····​if·​(ec)​61 ····​if·​(error)​
69 ······​throw·asio:​:​system_error(ec)​;​62 ······​throw·​std:​:​system_error(error)​;​
70 ··​}63 ··​}
71 64
72 ··​std:​:​string·​read_line(asio:​:​chrono:​:​steady_clock:​:​duration·​timeout)​65 ··​std:​:​string·​read_line(std:​:​chrono:​:​steady_clock:​:​duration·​timeout)​
73 ··​{66 ··​{
74 ····​/​/​·​Start·​the·​asynchronous·​operation.​·​The·boost:​:​lambda·function·object·is67 ····​/​/​·​Start·​the·​asynchronous·​operation.​·​The·lambda·that·is·​used·as·a·callback
75 ····​/​/​·used·as·a·callback·and·​will·​update·​the·​ec·​variable·​when·​the·​operation68 ····​/​/​·​will·​update·​the·​error·and·n·​variables·​when·​the·​operation·completes.​·The
76 ····​/​/​·completes.​·The·​blocking_udp_client.​cpp·​example·​shows·​how·​you·​can·​use69 ····​/​/​·​blocking_udp_client.​cpp·​example·​shows·​how·​you·​can·​use·std:​:​bind·rather
77 ····​/​/​·boost:​:​bind·rather·​than·boost:​:​lambda.​70 ····​/​/​·​than·a·lambda.​
78 ····asio:​:​error_code·​ec;​71 ····​std:​:​error_code·​error;​
79 ····​std:​:​size_t·​n·​=·​0;​72 ····​std:​:​size_t·​n·​=·​0;​
80 ····​asio:​:​async_read_until(sock​et_,​73 ····​asio:​:​async_read_until(sock​et_,​
81 ········​asio:​:​dynamic_buffer(input_​buffer_)​,​74 ········​asio:​:​dynamic_buffer(input_​buffer_)​,​·'\n',​
82 ········'\n',​·(var(ec)​·=·_1,​·var(n)​·=·_2)​)​;​75 ········[&](const·std:​:​error_code&·result_error,​
76 ············​std:​:​size_t·​result_n)​
77 ········​{
78 ··········​error·​=·​result_error;​
79 ··········​n·​=·​result_n;​
80 ········​})​;​
83 81
84 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​82 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​
85 ····​run(timeout)​;​83 ····​run(timeout)​;​
86 84
87 ····​/​/​·​Determine·​whether·​the·​read·​completed·​successfully.​85 ····​/​/​·​Determine·​whether·​the·​read·​completed·​successfully.​
88 ····​if·​(ec)​86 ····​if·​(error)​
89 ······​throw·asio:​:​system_error(ec)​;​87 ······​throw·​std:​:​system_error(error)​;​
90 88
91 ····​std:​:​string·​line(input_buffer_.​substr(0,​·​n·​-​·​1)​)​;​89 ····​std:​:​string·​line(input_buffer_.​substr(0,​·​n·​-​·​1)​)​;​
92 ····​input_buffer_.​erase(0,​·​n)​;​90 ····​input_buffer_.​erase(0,​·​n)​;​
93 ····​return·​line;​91 ····​return·​line;​
94 ··​}92 ··​}
95 93
96 ··​void·​write_line(const·​std:​:​string&·​line,​94 ··​void·​write_line(const·​std:​:​string&·​line,​
97 ······asio:​:​chrono:​:​steady_clock:​:​duration·​timeout)​95 ······​std:​:​chrono:​:​steady_clock:​:​duration·​timeout)​
98 ··​{96 ··​{
99 ····​std:​:​string·​data·​=·​line·​+·​"\n";​97 ····​std:​:​string·​data·​=·​line·​+·​"\n";​
100 98
101 ····​/​/​·​Start·​the·​asynchronous·​operation.​·The·boost:​:​lambda·function·object·is99 ····​/​/​·​Start·​the·​asynchronous·​operation·itself.​·The·lambda·that·is·used·as·a
102 ····​/​/​·used·as·a·​callback·and·​will·​update·​the·​ec·​variable·​when·​the·​operation100 ····​/​/​·​callback·​will·​update·​the·​error·​variable·​when·​the·​operation·completes.​
103 ····​/​/​·completes.​·​The·​blocking_udp_client.​cpp·​example·​shows·​how·​you·​can·​use101 ····​/​/​·​The·​blocking_udp_client.​cpp·​example·​shows·​how·​you·​can·​use·std:​:​bind
104 ····​/​/​·boost:​:​bind·​rather·​than·boost:​:​lambda.​102 ····​/​/​·​rather·​than·a·lambda.​
105 ····asio:​:​error_code·​ec;​103 ····​std:​:​error_code·​error;​
106 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer(data)​,​·var(ec)​·=·_1)​;​104 ····​asio:​:​async_write(socket_,​·​asio:​:​buffer(data)​,​
105 ········​[&](const·​std:​:​error_code&·​result_error,​
106 ············​std:​:​size_t·​/​*result_n*/​)​
107 ········​{
108 ··········​error·​=·​result_error;​
109 ········​})​;​
107 110
108 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​111 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​
109 ····​run(timeout)​;​112 ····​run(timeout)​;​
110 113
111 ····​/​/​·​Determine·​whether·​the·​read·​completed·​successfully.​114 ····​/​/​·​Determine·​whether·​the·​read·​completed·​successfully.​
112 ····​if·​(ec)​115 ····​if·​(error)​
113 ······​throw·asio:​:​system_error(ec)​;​116 ······​throw·​std:​:​system_error(error)​;​
114 ··​}117 ··​}
115 118
116 private:​119 private:​
117 ··​void·​run(asio:​:​chrono:​:​steady_clock:​:​duration·​timeout)​120 ··​void·​run(std:​:​chrono:​:​steady_clock:​:​duration·​timeout)​
118 ··​{121 ··​{
119 ····​/​/​·​Restart·​the·​io_context,​·​as·​it·​may·​have·​been·​left·​in·​the·​"stopped"·​state122 ····​/​/​·​Restart·​the·​io_context,​·​as·​it·​may·​have·​been·​left·​in·​the·​"stopped"·​state
120 ····​/​/​·​by·​a·​previous·​operation.​123 ····​/​/​·​by·​a·​previous·​operation.​
121 ····​io_context_.​restart()​;​124 ····​io_context_.​restart()​;​
122 125
123 ····​/​/​·​Block·​until·​the·​asynchronous·​operation·​has·​completed,​·​or·​timed·​out.​·​If126 ····​/​/​·​Block·​until·​the·​asynchronous·​operation·​has·​completed,​·​or·​timed·​out.​·​If
124 ····​/​/​·​the·​pending·​asynchronous·​operation·​is·​a·​composed·​operation,​·​the·​deadline127 ····​/​/​·​the·​pending·​asynchronous·​operation·​is·​a·​composed·​operation,​·​the·​deadline
125 ····​/​/​·​applies·​to·​the·​entire·​operation,​·​rather·​than·​individual·​operations·​on128 ····​/​/​·​applies·​to·​the·​entire·​operation,​·​rather·​than·​individual·​operations·​on
126 ····​/​/​·​the·​socket.​129 ····​/​/​·​the·​socket.​
127 ····​io_context_.​run_for(timeout)​;​130 ····​io_context_.​run_for(timeout)​;​
128 131
129 ····​/​/​·​If·​the·​asynchronous·​operation·​completed·​successfully·​then·​the·​io_context132 ····​/​/​·​If·​the·​asynchronous·​operation·​completed·​successfully·​then·​the·​io_context
130 ····​/​/​·​would·​have·​been·​stopped·​due·​to·​running·​out·​of·​work.​·​If·​it·​was·​not133 ····​/​/​·​would·​have·​been·​stopped·​due·​to·​running·​out·​of·​work.​·​If·​it·​was·​not
131 ····​/​/​·​stopped,​·​then·​the·​io_context:​:​run_for·​call·​must·​have·​timed·​out.​134 ····​/​/​·​stopped,​·​then·​the·​io_context:​:​run_for·​call·​must·​have·​timed·​out.​
132 ····​if·​(!io_context_.​stopped()​)​135 ····​if·​(!io_context_.​stopped()​)​
133 ····​{136 ····​{
134 ······​/​/​·​Close·​the·​socket·​to·​cancel·​the·​outstanding·​asynchronous·​operation.​137 ······​/​/​·​Close·​the·​socket·​to·​cancel·​the·​outstanding·​asynchronous·​operation.​
135 ······​socket_.​close()​;​138 ······​socket_.​close()​;​
136 139
137 ······​/​/​·​Run·​the·​io_context·​again·​until·​the·​operation·​completes.​140 ······​/​/​·​Run·​the·​io_context·​again·​until·​the·​operation·​completes.​
138 ······​io_context_.​run()​;​141 ······​io_context_.​run()​;​
139 ····​}142 ····​}
140 ··​}143 ··​}
141 144
142 ··​asio:​:​io_context·​io_context_;​145 ··​asio:​:​io_context·​io_context_;​
143 ··​tcp:​:​socket·​socket_;​146 ··​tcp:​:​socket·​socket_{io_context_};​
144 ··​std:​:​string·​input_buffer_;​147 ··​std:​:​string·​input_buffer_;​
145 };​148 };​
146 149
147 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​150 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
148 151
149 int·​main(int·​argc,​·​char*·​argv[])​152 int·​main(int·​argc,​·​char*·​argv[])​
150 {153 {
151 ··​try154 ··​try
152 ··​{155 ··​{
153 ····​if·​(argc·​!=·​4)​156 ····​if·​(argc·​!=·​4)​
154 ····​{157 ····​{
155 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_client·​<host>·​<port>·​<message>\n";​158 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_client·​<host>·​<port>·​<message>\n";​
156 ······​return·​1;​159 ······​return·​1;​
157 ····​}160 ····​}
158 161
159 ····​client·​c;​162 ····​client·​c;​
160 ····​c.​connect(argv[1],​·​argv[2],​·asio:​:​chrono:​:​seconds(10)​)​;​163 ····​c.​connect(argv[1],​·​argv[2],​·​std:​:​chrono:​:​seconds(10)​)​;​
161 164
162 ····​asio:​:​chrono:​:​steady_clock:​:​time_point·time_sent·=165 ····​auto·time_sent·=·std:​:​chrono:​:​steady_clock:​:​now()​;​
163 ······asio:​:​chrono:​:​steady_clock:​:​now()​;​
164 166
165 ····​c.​write_line(argv[3],​·asio:​:​chrono:​:​seconds(10)​)​;​167 ····​c.​write_line(argv[3],​·​std:​:​chrono:​:​seconds(10)​)​;​
166 168
167 ····​for·​(;​;​)​169 ····​for·​(;​;​)​
168 ····​{170 ····​{
169 ······​std:​:​string·​line·​=·​c.​read_line(asio:​:​chrono:​:​seconds(10)​)​;​171 ······​std:​:​string·​line·​=·​c.​read_line(std:​:​chrono:​:​seconds(10)​)​;​
170 172
171 ······​/​/​·​Keep·​going·​until·​we·​get·​back·​the·​line·​that·​was·​sent.​173 ······​/​/​·​Keep·​going·​until·​we·​get·​back·​the·​line·​that·​was·​sent.​
172 ······​if·​(line·​==·​argv[3])​174 ······​if·​(line·​==·​argv[3])​
173 ········​break;​175 ········​break;​
174 ····​}176 ····​}
175 177
176 ····​asio:​:​chrono:​:​steady_clock:​:​time_point·time_received·=178 ····​auto·time_received·=·std:​:​chrono:​:​steady_clock:​:​now()​;​
177 ······asio:​:​chrono:​:​steady_clock:​:​now()​;​
178 179
179 ····​std:​:​cout·​<<·​"Round·​trip·​time:​·​";​180 ····​std:​:​cout·​<<·​"Round·​trip·​time:​·​";​
180 ····​std:​:​cout·​<<·asio:​:​chrono:​:​duration_cast<181 ····​std:​:​cout·​<<·​std:​:​chrono:​:​duration_cast<
181 ······asio:​:​chrono:​:​microseconds>(182 ······​std:​:​chrono:​:​microseconds>(
182 ········​time_received·​-​·​time_sent)​.​count()​;​183 ········​time_received·​-​·​time_sent)​.​count()​;​
183 ····​std:​:​cout·​<<·​"·​microseconds\n";​184 ····​std:​:​cout·​<<·​"·​microseconds\n";​
184 ··​}185 ··​}
185 ··​catch·​(std:​:​exception&·​e)​186 ··​catch·​(std:​:​exception&·​e)​
186 ··​{187 ··​{
187 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​188 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
188 ··​}189 ··​}
189 190
190 ··​return·​0;​191 ··​return·​0;​
191 }192 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/timeouts/blocking_token_tcp_client.cpp.html b/include/asio/doc/examples/diffs/timeouts/blocking_token_tcp_client.cpp.html new file mode 100644 index 0000000..b6a7e83 --- /dev/null +++ b/include/asio/doc/examples/diffs/timeouts/blocking_token_tcp_client.cpp.html @@ -0,0 +1,241 @@ + + + + + + + HTML Diff timeouts/blocking_token_tcp_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​timeouts/​blocking_token_tcp_cl​ient.​cppsrc/​examples/​cpp11/​timeouts/​blocking_token_tcp_cl​ient.​cpp
1 /​/​1 /​/​
2 /​/​·​blocking_token_tcp_cl​ient.​cpp2 /​/​·​blocking_token_tcp_cl​ient.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"asio/​connect.​hpp"11 #include·​"asio/​connect.​hpp"
12 #include·​"asio/​io_context.​hpp"12 #include·​"asio/​io_context.​hpp"
13 #include·​"asio/​ip/​tcp.​hpp"13 #include·​"asio/​ip/​tcp.​hpp"
14 #include·​"asio/​read_until.​hpp"14 #include·​"asio/​read_until.​hpp"
15 #include·​"asio/​streambuf.​hpp"15 #include·​"asio/​streambuf.​hpp"
16 #include·​"asio/​system_error.​hpp"16 #include·​"asio/​system_error.​hpp"
17 #include·​"asio/​write.​hpp"17 #include·​"asio/​write.​hpp"
18 #include·​<cstdlib>18 #include·​<cstdlib>
19 #include·​<iostream>19 #include·​<iostream>
20 #include·​<memory>20 #include·​<memory>
21 #include·​<string>21 #include·​<string>
22 22
23 using·​asio:​:​ip:​:​tcp;​23 using·​asio:​:​ip:​:​tcp;​
24 24
25 /​/​·​We·​will·​use·​our·​sockets·​only·​with·​an·​io_context.​25 /​/​·​We·​will·​use·​our·​sockets·​only·​with·​an·​io_context.​
26 typedef·​asio:​:​basic_stream_socket<t​cp,​26 using·tcp_socket·=·​asio:​:​basic_stream_socket<
27 ····​asio:​:​io_context:​:​executor_type>·tcp_socket;​27 ····tcp,​·​asio:​:​io_context:​:​executor_type>;​
28 28
29 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​29 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
30 30
31 /​/​·​A·​custom·​completion·​token·​that·​makes·​asynchronous·​operations·​behave·​as31 /​/​·​A·​custom·​completion·​token·​that·​makes·​asynchronous·​operations·​behave·​as
32 /​/​·​though·​they·​are·​blocking·​calls·​with·​a·​timeout.​32 /​/​·​though·​they·​are·​blocking·​calls·​with·​a·​timeout.​
33 struct·​close_after33 struct·​close_after
34 {34 {
35 ··​close_after(asio:​:​chrono:​:​steady_clock:​:​duration·​t,​·​tcp_socket&·​s)​35 ··​close_after(std:​:​chrono:​:​steady_clock:​:​duration·​t,​·​tcp_socket&·​s)​
36 ····​:​·​timeout_(t)​,​·​socket_(s)​36 ····​:​·​timeout_(t)​,​·​socket_(s)​
37 ··​{37 ··​{
38 ··​}38 ··​}
39 39
40 ··​/​/​·​The·​maximum·​time·​to·​wait·​for·​an·​asynchronous·​operation·​to·​complete.​40 ··​/​/​·​The·​maximum·​time·​to·​wait·​for·​an·​asynchronous·​operation·​to·​complete.​
41 ··asio:​:​chrono:​:​steady_clock:​:​duration·​timeout_;​41 ··​std:​:​chrono:​:​steady_clock:​:​duration·​timeout_;​
42 42
43 ··​/​/​·​The·​socket·​to·​be·​closed·​if·​the·​operation·​does·​not·​complete·​in·​time.​43 ··​/​/​·​The·​socket·​to·​be·​closed·​if·​the·​operation·​does·​not·​complete·​in·​time.​
44 ··​tcp_socket&·​socket_;​44 ··​tcp_socket&·​socket_;​
45 };​45 };​
46 46
47 namespace·​asio·​{47 namespace·​asio·​{
48 48
49 /​/​·​The·​async_result·​template·​is·​specialised·​to·​allow·​the·​close_after·​token·​to49 /​/​·​The·​async_result·​template·​is·​specialised·​to·​allow·​the·​close_after·​token·​to
50 /​/​·​be·​used·​with·​asynchronous·​operations·​that·​have·​a·​completion·​signature·​of50 /​/​·​be·​used·​with·​asynchronous·​operations·​that·​have·​a·​completion·​signature·​of
51 /​/​·​void(error_code,​·​T)​.​·​Generalising·​this·​for·​all·​completion·​signature·​forms·​is51 /​/​·​void(error_code,​·​T)​.​·​Generalising·​this·​for·​all·​completion·​signature·​forms·​is
52 /​/​·​left·​as·​an·​exercise·​for·​the·​reader.​52 /​/​·​left·​as·​an·​exercise·​for·​the·​reader.​
53 template·​<typename·​T>53 template·​<typename·​T>
54 class·​async_result<close_af​ter,​·​void(asio:​:​error_code,​·​T)​>54 class·​async_result<close_af​ter,​·​void(std:​:​error_code,​·​T)​>
55 {55 {
56 public:​56 public:​
57 ··​/​/​·​An·​asynchronous·​operation's·​initiating·​function·​automatically·​creates·​an57 ··​/​/​·​An·​asynchronous·​operation's·​initiating·​function·​automatically·​creates·​an
58 ··​/​/​·​completion_handler_ty​pe·​object·​from·​the·​token.​·​This·​function·​object·​is58 ··​/​/​·​completion_handler_ty​pe·​object·​from·​the·​token.​·​This·​function·​object·​is
59 ··​/​/​·​then·​called·​on·​completion·​of·​the·​asynchronous·​operation.​59 ··​/​/​·​then·​called·​on·​completion·​of·​the·​asynchronous·​operation.​
60 ··​class·​completion_handler_ty​pe60 ··​class·​completion_handler_ty​pe
61 ··​{61 ··​{
62 ··​public:​62 ··​public:​
63 ····​completion_handler_ty​pe(const·​close_after&·​token)​63 ····​completion_handler_ty​pe(const·​close_after&·​token)​
64 ······​:​·​token_(token)​64 ······​:​·​token_(token)​
65 ····​{65 ····​{
66 ····​}66 ····​}
67 67
68 ····​void·​operator()​(asio:​:​error_code·​ec,​·​T·​t)​68 ····​void·​operator()​(const·std:​:​error_code&·​error,​·​T·​t)​
69 ····​{69 ····​{
70 ······​*ec_·​=·​ec;​70 ······​*error_·​=·​error;​
71 ······​*t_·​=·​t;​71 ······​*t_·​=·​t;​
72 ····​}72 ····​}
73 73
74 ··​private:​74 ··​private:​
75 ····​friend·​class·​async_result;​75 ····​friend·​class·​async_result;​
76 ····​close_after·​token_;​76 ····​close_after·​token_;​
77 ····asio:​:​error_code*·​ec_;​77 ····​std:​:​error_code*·​error_;​
78 ····​T*·​t_;​78 ····​T*·​t_;​
79 ··​};​79 ··​};​
80 80
81 ··​/​/​·​The·​async_result·​constructor·​associates·​the·​completion·​handler·​object·​with81 ··​/​/​·​The·​async_result·​constructor·​associates·​the·​completion·​handler·​object·​with
82 ··​/​/​·​the·​result·​of·​the·​initiating·​function.​82 ··​/​/​·​the·​result·​of·​the·​initiating·​function.​
83 ··​explicit·​async_result(completi​on_handler_type&·​h)​83 ··​explicit·​async_result(completi​on_handler_type&·​h)​
84 ····​:​·​timeout_(h.​token_.​timeout_)​,​84 ····​:​·​timeout_(h.​token_.​timeout_)​,​
85 ······​socket_(h.​token_.​socket_)​85 ······​socket_(h.​token_.​socket_)​
86 ··​{86 ··​{
87 ····​h.​ec_·​=·​&ec_;​87 ····​h.​error_·​=·​&error_;​
88 ····​h.​t_·​=·​&t_;​88 ····​h.​t_·​=·​&t_;​
89 ··​}89 ··​}
90 90
91 ··​/​/​·​The·​return_type·​typedef·​determines·​the·​result·​type·​of·​the·​asynchronous91 ··​/​/​·​The·​return_type·​typedef·​determines·​the·​result·​type·​of·​the·​asynchronous
92 ··​/​/​·​operation's·​initiating·​function.​92 ··​/​/​·​operation's·​initiating·​function.​
93 ··​typedef·​T·​return_type;​93 ··​typedef·​T·​return_type;​
94 94
95 ··​/​/​·​The·​get()​·​function·​is·​used·​to·​obtain·​the·​result·​of·​the·​asynchronous95 ··​/​/​·​The·​get()​·​function·​is·​used·​to·​obtain·​the·​result·​of·​the·​asynchronous
96 ··​/​/​·​operation's·​initiating·​function.​·​For·​the·​close_after·​completion·​token,​·​we96 ··​/​/​·​operation's·​initiating·​function.​·​For·​the·​close_after·​completion·​token,​·​we
97 ··​/​/​·​use·​this·​function·​to·​run·​the·​io_context·​until·​the·​operation·​is·​complete.​97 ··​/​/​·​use·​this·​function·​to·​run·​the·​io_context·​until·​the·​operation·​is·​complete.​
98 ··​return_type·​get()​98 ··​return_type·​get()​
99 ··​{99 ··​{
100 ····​asio:​:​io_context&·​io_context·​=·​asio:​:​query(100 ····​asio:​:​io_context&·​io_context·​=·​asio:​:​query(
101 ········​socket_.​get_executor()​,​·​asio:​:​execution:​:​context)​;​101 ········​socket_.​get_executor()​,​·​asio:​:​execution:​:​context)​;​
102 102
103 ····​/​/​·​Restart·​the·​io_context,​·​as·​it·​may·​have·​been·​left·​in·​the·​"stopped"·​state103 ····​/​/​·​Restart·​the·​io_context,​·​as·​it·​may·​have·​been·​left·​in·​the·​"stopped"·​state
104 ····​/​/​·​by·​a·​previous·​operation.​104 ····​/​/​·​by·​a·​previous·​operation.​
105 ····​io_context.​restart()​;​105 ····​io_context.​restart()​;​
106 106
107 ····​/​/​·​Block·​until·​the·​asynchronous·​operation·​has·​completed,​·​or·​timed·​out.​·​If107 ····​/​/​·​Block·​until·​the·​asynchronous·​operation·​has·​completed,​·​or·​timed·​out.​·​If
108 ····​/​/​·​the·​pending·​asynchronous·​operation·​is·​a·​composed·​operation,​·​the·​deadline108 ····​/​/​·​the·​pending·​asynchronous·​operation·​is·​a·​composed·​operation,​·​the·​deadline
109 ····​/​/​·​applies·​to·​the·​entire·​operation,​·​rather·​than·​individual·​operations·​on109 ····​/​/​·​applies·​to·​the·​entire·​operation,​·​rather·​than·​individual·​operations·​on
110 ····​/​/​·​the·​socket.​110 ····​/​/​·​the·​socket.​
111 ····​io_context.​run_for(timeout_)​;​111 ····​io_context.​run_for(timeout_)​;​
112 112
113 ····​/​/​·​If·​the·​asynchronous·​operation·​completed·​successfully·​then·​the·​io_context113 ····​/​/​·​If·​the·​asynchronous·​operation·​completed·​successfully·​then·​the·​io_context
114 ····​/​/​·​would·​have·​been·​stopped·​due·​to·​running·​out·​of·​work.​·​If·​it·​was·​not114 ····​/​/​·​would·​have·​been·​stopped·​due·​to·​running·​out·​of·​work.​·​If·​it·​was·​not
115 ····​/​/​·​stopped,​·​then·​the·​io_context:​:​run_for·​call·​must·​have·​timed·​out·​and·​the115 ····​/​/​·​stopped,​·​then·​the·​io_context:​:​run_for·​call·​must·​have·​timed·​out·​and·​the
116 ····​/​/​·​operation·​is·​still·​incomplete.​116 ····​/​/​·​operation·​is·​still·​incomplete.​
117 ····​if·​(!io_context.​stopped()​)​117 ····​if·​(!io_context.​stopped()​)​
118 ····​{118 ····​{
119 ······​/​/​·​Close·​the·​socket·​to·​cancel·​the·​outstanding·​asynchronous·​operation.​119 ······​/​/​·​Close·​the·​socket·​to·​cancel·​the·​outstanding·​asynchronous·​operation.​
120 ······​socket_.​close()​;​120 ······​socket_.​close()​;​
121 121
122 ······​/​/​·​Run·​the·​io_context·​again·​until·​the·​operation·​completes.​122 ······​/​/​·​Run·​the·​io_context·​again·​until·​the·​operation·​completes.​
123 ······​io_context.​run()​;​123 ······​io_context.​run()​;​
124 ····​}124 ····​}
125 125
126 ····​/​/​·​If·​the·​operation·​failed,​·​throw·​an·​exception.​·​Otherwise·​return·​the·​result.​126 ····​/​/​·​If·​the·​operation·​failed,​·​throw·​an·​exception.​·​Otherwise·​return·​the·​result.​
127 ····​return·​ec_·​?·​throw·asio:​:​system_error(ec_)​·​:​·​t_;​127 ····​return·​error_·​?·​throw·​std:​:​system_error(error_)​·​:​·​t_;​
128 ··​}128 ··​}
129 129
130 private:​130 private:​
131 ··asio:​:​chrono:​:​steady_clock:​:​duration·​timeout_;​131 ··​std:​:​chrono:​:​steady_clock:​:​duration·​timeout_;​
132 ··​tcp_socket&·​socket_;​132 ··​tcp_socket&·​socket_;​
133 ··asio:​:​error_code·​ec_;​133 ··​std:​:​error_code·​error_;​
134 ··​T·​t_;​134 ··​T·​t_;​
135 };​135 };​
136 136
137 }·​/​/​·​namespace·​asio137 }·​/​/​·​namespace·​asio
138 138
139 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​139 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
140 140
141 int·​main(int·​argc,​·​char*·​argv[])​141 int·​main(int·​argc,​·​char*·​argv[])​
142 {142 {
143 ··​try143 ··​try
144 ··​{144 ··​{
145 ····​if·​(argc·​!=·​4)​145 ····​if·​(argc·​!=·​4)​
146 ····​{146 ····​{
147 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_client·​<host>·​<port>·​<message>\n";​147 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_tcp_client·​<host>·​<port>·​<message>\n";​
148 ······​return·​1;​148 ······​return·​1;​
149 ····​}149 ····​}
150 150
151 ····​asio:​:​io_context·​io_context;​151 ····​asio:​:​io_context·​io_context;​
152 152
153 ····​/​/​·​Resolve·​the·​host·​name·​and·​service·​to·​a·​list·​of·​endpoints.​153 ····​/​/​·​Resolve·​the·​host·​name·​and·​service·​to·​a·​list·​of·​endpoints.​
154 ····​tcp:​:​resolver:​:​results_type·endpoints·=154 ····auto·endpoints·=·​tcp:​:​resolver(io_context)​.​resolve(argv[1],​·argv[2])​;​
155 ······tcp:​:​resolver(io_context)​.​resolve(argv[1],​·argv[2])​;​
156 155
157 ····​tcp_socket·​socket(io_context)​;​156 ····​tcp_socket·​socket(io_context)​;​
158 157
159 ····​/​/​·​Run·​an·​asynchronous·​connect·​operation·​with·​a·​timeout.​158 ····​/​/​·​Run·​an·​asynchronous·​connect·​operation·​with·​a·​timeout.​
160 ····​asio:​:​async_connect(socket,​·​endpoints,​159 ····​asio:​:​async_connect(socket,​·​endpoints,​
161 ········​close_after(asio:​:​chrono:​:​seconds(10)​,​·​socket)​)​;​160 ········​close_after(std:​:​chrono:​:​seconds(10)​,​·​socket)​)​;​
162 161
163 ····​asio:​:​chrono:​:​steady_clock:​:​time_point·time_sent·=162 ····​auto·time_sent·=·std:​:​chrono:​:​steady_clock:​:​now()​;​
164 ······asio:​:​chrono:​:​steady_clock:​:​now()​;​
165 163
166 ····​/​/​·​Run·​an·​asynchronous·​write·​operation·​with·​a·​timeout.​164 ····​/​/​·​Run·​an·​asynchronous·​write·​operation·​with·​a·​timeout.​
167 ····​std:​:​string·​msg·​=·​argv[3]·​+·​std:​:​string("\n")​;​165 ····​std:​:​string·​msg·​=·​argv[3]·​+·​std:​:​string("\n")​;​
168 ····​asio:​:​async_write(socket,​·​asio:​:​buffer(msg)​,​166 ····​asio:​:​async_write(socket,​·​asio:​:​buffer(msg)​,​
169 ········​close_after(asio:​:​chrono:​:​seconds(10)​,​·​socket)​)​;​167 ········​close_after(std:​:​chrono:​:​seconds(10)​,​·​socket)​)​;​
170 168
171 ····​for·​(std:​:​string·​input_buffer;​;​)​169 ····​for·​(std:​:​string·​input_buffer;​;​)​
172 ····​{170 ····​{
173 ······​/​/​·​Run·​an·​asynchronous·​read·​operation·​with·​a·​timeout.​171 ······​/​/​·​Run·​an·​asynchronous·​read·​operation·​with·​a·​timeout.​
174 ······​std:​:​size_t·​n·​=·​asio:​:​async_read_until(sock​et,​172 ······​std:​:​size_t·​n·​=·​asio:​:​async_read_until(sock​et,​
175 ··········​asio:​:​dynamic_buffer(input_​buffer)​,​·​'\n',​173 ··········​asio:​:​dynamic_buffer(input_​buffer)​,​·​'\n',​
176 ··········​close_after(asio:​:​chrono:​:​seconds(10)​,​·​socket)​)​;​174 ··········​close_after(std:​:​chrono:​:​seconds(10)​,​·​socket)​)​;​
177 175
178 ······​std:​:​string·​line(input_buffer.​substr(0,​·​n·​-​·​1)​)​;​176 ······​std:​:​string·​line(input_buffer.​substr(0,​·​n·​-​·​1)​)​;​
179 ······​input_buffer.​erase(0,​·​n)​;​177 ······​input_buffer.​erase(0,​·​n)​;​
180 178
181 ······​/​/​·​Keep·​going·​until·​we·​get·​back·​the·​line·​that·​was·​sent.​179 ······​/​/​·​Keep·​going·​until·​we·​get·​back·​the·​line·​that·​was·​sent.​
182 ······​if·​(line·​==·​argv[3])​180 ······​if·​(line·​==·​argv[3])​
183 ········​break;​181 ········​break;​
184 ····​}182 ····​}
185 183
186 ····​asio:​:​chrono:​:​steady_clock:​:​time_point·time_received·=184 ····​auto·time_received·=·std:​:​chrono:​:​steady_clock:​:​now()​;​
187 ······asio:​:​chrono:​:​steady_clock:​:​now()​;​
188 185
189 ····​std:​:​cout·​<<·​"Round·​trip·​time:​·​";​186 ····​std:​:​cout·​<<·​"Round·​trip·​time:​·​";​
190 ····​std:​:​cout·​<<·asio:​:​chrono:​:​duration_cast<187 ····​std:​:​cout·​<<·​std:​:​chrono:​:​duration_cast<
191 ······asio:​:​chrono:​:​microseconds>(188 ······​std:​:​chrono:​:​microseconds>(
192 ········​time_received·​-​·​time_sent)​.​count()​;​189 ········​time_received·​-​·​time_sent)​.​count()​;​
193 ····​std:​:​cout·​<<·​"·​microseconds\n";​190 ····​std:​:​cout·​<<·​"·​microseconds\n";​
194 ··​}191 ··​}
195 ··​catch·​(std:​:​exception&·​e)​192 ··​catch·​(std:​:​exception&·​e)​
196 ··​{193 ··​{
197 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​194 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
198 ··​}195 ··​}
199 196
200 ··​return·​0;​197 ··​return·​0;​
201 }198 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/timeouts/blocking_udp_client.cpp.html b/include/asio/doc/examples/diffs/timeouts/blocking_udp_client.cpp.html new file mode 100644 index 0000000..ddb0407 --- /dev/null +++ b/include/asio/doc/examples/diffs/timeouts/blocking_udp_client.cpp.html @@ -0,0 +1,196 @@ + + + + + + + HTML Diff timeouts/blocking_udp_client.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​timeouts/​blocking_udp_client.​cppsrc/​examples/​cpp11/​timeouts/​blocking_udp_client.​cpp
1 /​/​1 /​/​
2 /​/​·​blocking_udp_client.​cpp2 /​/​·​blocking_udp_client.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~3 /​/​·​~~~~~~~~~~~~~~~~~~~~~​~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​"asio/​buffer.​hpp"11 #include·​"asio/​buffer.​hpp"
12 #include·​"asio/​io_context.​hpp"12 #include·​"asio/​io_context.​hpp"
13 #include·​"asio/​ip/​udp.​hpp"13 #include·​"asio/​ip/​udp.​hpp"
14 #include·​<cstdlib>14 #include·​<cstdlib>
15 #include·​<boost/​bind/​bind.​hpp>15 #include·​<functional>
16 #include·​<iostream>16 #include·​<iostream>
17 17
18 using·​asio:​:​ip:​:​udp;​18 using·​asio:​:​ip:​:​udp;​
19 using·​std:​:​placeholders:​:​_1;​
20 using·​std:​:​placeholders:​:​_2;​
19 21
20 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​22 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
21 23
22 /​/​24 /​/​
23 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​running·​the·​io_context·​using·​the·​timed25 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​running·​the·​io_context·​using·​the·​timed
24 /​/​·​io_context:​:​run_for()​·​member·​function.​·​Each·​asynchronous·​operation·​is·​given26 /​/​·​io_context:​:​run_for()​·​member·​function.​·​Each·​asynchronous·​operation·​is·​given
25 /​/​·​a·​timeout·​within·​which·​it·​must·​complete.​·​The·​socket·​operations·​themselves27 /​/​·​a·​timeout·​within·​which·​it·​must·​complete.​·​The·​socket·​operations·​themselves
26 /​/​·​use·boost:​:​bind·​to·​specify·​the·​completion·​handler:​28 /​/​·​use·​std:​:​bind·​to·​specify·​the·​completion·​handler:​
27 /​/​29 /​/​
28 /​/​···​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+30 /​/​···​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
29 /​/​···​|···············​|31 /​/​···​|···············​|
30 /​/​···​|····​receive····​|32 /​/​···​|····​receive····​|
31 /​/​···​|···············​|33 /​/​···​|···············​|
32 /​/​···​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+34 /​/​···​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
33 /​/​···········​|35 /​/​···········​|
34 /​/​··​async_-​··​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+36 /​/​··​async_-​··​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
35 /​/​·​receive()​·​|····​|················​|37 /​/​·​receive()​·​|····​|················​|
36 /​/​···········​+-​-​-​>|·​handle_receive·​|38 /​/​···········​+-​-​-​>|·​handle_receive·​|
37 /​/​················​|················​|39 /​/​················​|················​|
38 /​/​················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+40 /​/​················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
39 /​/​41 /​/​
40 /​/​·​For·​a·​given·​socket·​operation,​·​the·​client·​object·​runs·​the·​io_context·​to·​block42 /​/​·​For·​a·​given·​socket·​operation,​·​the·​client·​object·​runs·​the·​io_context·​to·​block
41 /​/​·​thread·​execution·​until·​the·​operation·​completes·​or·​the·​timeout·​is·​reached.​·​If43 /​/​·​thread·​execution·​until·​the·​operation·​completes·​or·​the·​timeout·​is·​reached.​·​If
42 /​/​·​the·​io_context:​:​run_for()​·​function·​times·​out,​·​the·​socket·​is·​closed·​and·​the44 /​/​·​the·​io_context:​:​run_for()​·​function·​times·​out,​·​the·​socket·​is·​closed·​and·​the
43 /​/​·​outstanding·​asynchronous·​operation·​is·​cancelled.​45 /​/​·​outstanding·​asynchronous·​operation·​is·​cancelled.​
44 /​/​46 /​/​
45 class·​client47 class·​client
46 {48 {
47 public:​49 public:​
48 ··​client(const·​udp:​:​endpoint&·​listen_endpoint)​50 ··​client(const·​udp:​:​endpoint&·​listen_endpoint)​
49 ····​:​·​socket_(io_context_,​·​listen_endpoint)​51 ····​:​·​socket_(io_context_,​·​listen_endpoint)​
50 ··​{52 ··​{
51 ··​}53 ··​}
52 54
53 ··​std:​:​size_t·​receive(const·​asio:​:​mutable_buffer&·​buffer,​55 ··​std:​:​size_t·​receive(const·​asio:​:​mutable_buffer&·​buffer,​
54 ······asio:​:​chrono:​:​steady_clock:​:​duration·​timeout,​56 ······​std:​:​chrono:​:​steady_clock:​:​duration·​timeout,​
55 ······asio:​:​error_code&·​ec)​57 ······​std:​:​error_code&·​error)​
56 ··​{58 ··​{
57 ····​/​/​·​Start·​the·​asynchronous·​operation.​·​The·​handle_receive·​function·​used·​as·​a59 ····​/​/​·​Start·​the·​asynchronous·​operation.​·​The·​handle_receive·​function·​used·​as·​a
58 ····​/​/​·​callback·​will·​update·​the·​ec·​and·​length·​variables.​60 ····​/​/​·​callback·​will·​update·​the·​error·​and·​length·​variables.​
59 ····​std:​:​size_t·​length·​=·​0;​61 ····​std:​:​size_t·​length·​=·​0;​
60 ····​socket_.​async_receive(asio:​:​buffer(buffer)​,​62 ····​socket_.​async_receive(asio:​:​buffer(buffer)​,​
61 ········boost:​:​bind(&client:​:​handle_receive,​63 ········​std:​:​bind(&client:​:​handle_receive,​·_1,​·_2,​·&error,​·&length)​)​;​
62 ··········boost:​:​placeholders:​:​_1,​·boost:​:​placeholders:​:​_2,​·&ec,​·&length)​)​;​
63 64
64 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​65 ····​/​/​·​Run·​the·​operation·​until·​it·​completes,​·​or·​until·​the·​timeout.​
65 ····​run(timeout)​;​66 ····​run(timeout)​;​
66 67
67 ····​return·​length;​68 ····​return·​length;​
68 ··​}69 ··​}
69 70
70 private:​71 private:​
71 ··​void·​run(asio:​:​chrono:​:​steady_clock:​:​duration·​timeout)​72 ··​void·​run(std:​:​chrono:​:​steady_clock:​:​duration·​timeout)​
72 ··​{73 ··​{
73 ····​/​/​·​Restart·​the·​io_context,​·​as·​it·​may·​have·​been·​left·​in·​the·​"stopped"·​state74 ····​/​/​·​Restart·​the·​io_context,​·​as·​it·​may·​have·​been·​left·​in·​the·​"stopped"·​state
74 ····​/​/​·​by·​a·​previous·​operation.​75 ····​/​/​·​by·​a·​previous·​operation.​
75 ····​io_context_.​restart()​;​76 ····​io_context_.​restart()​;​
76 77
77 ····​/​/​·​Block·​until·​the·​asynchronous·​operation·​has·​completed,​·​or·​timed·​out.​·​If78 ····​/​/​·​Block·​until·​the·​asynchronous·​operation·​has·​completed,​·​or·​timed·​out.​·​If
78 ····​/​/​·​the·​pending·​asynchronous·​operation·​is·​a·​composed·​operation,​·​the·​deadline79 ····​/​/​·​the·​pending·​asynchronous·​operation·​is·​a·​composed·​operation,​·​the·​deadline
79 ····​/​/​·​applies·​to·​the·​entire·​operation,​·​rather·​than·​individual·​operations·​on80 ····​/​/​·​applies·​to·​the·​entire·​operation,​·​rather·​than·​individual·​operations·​on
80 ····​/​/​·​the·​socket.​81 ····​/​/​·​the·​socket.​
81 ····​io_context_.​run_for(timeout)​;​82 ····​io_context_.​run_for(timeout)​;​
82 83
83 ····​/​/​·​If·​the·​asynchronous·​operation·​completed·​successfully·​then·​the·​io_context84 ····​/​/​·​If·​the·​asynchronous·​operation·​completed·​successfully·​then·​the·​io_context
84 ····​/​/​·​would·​have·​been·​stopped·​due·​to·​running·​out·​of·​work.​·​If·​it·​was·​not85 ····​/​/​·​would·​have·​been·​stopped·​due·​to·​running·​out·​of·​work.​·​If·​it·​was·​not
85 ····​/​/​·​stopped,​·​then·​the·​io_context:​:​run_for·​call·​must·​have·​timed·​out.​86 ····​/​/​·​stopped,​·​then·​the·​io_context:​:​run_for·​call·​must·​have·​timed·​out.​
86 ····​if·​(!io_context_.​stopped()​)​87 ····​if·​(!io_context_.​stopped()​)​
87 ····​{88 ····​{
88 ······​/​/​·​Cancel·​the·​outstanding·​asynchronous·​operation.​89 ······​/​/​·​Cancel·​the·​outstanding·​asynchronous·​operation.​
89 ······​socket_.​cancel()​;​90 ······​socket_.​cancel()​;​
90 91
91 ······​/​/​·​Run·​the·​io_context·​again·​until·​the·​operation·​completes.​92 ······​/​/​·​Run·​the·​io_context·​again·​until·​the·​operation·​completes.​
92 ······​io_context_.​run()​;​93 ······​io_context_.​run()​;​
93 ····​}94 ····​}
94 ··​}95 ··​}
95 96
96 ··​static·​void·​handle_receive(97 ··​static·​void·​handle_receive(
97 ······​const·asio:​:​error_code&·​ec,​·​std:​:​size_t·​length,​98 ······​const·​std:​:​error_code&·​error,​·​std:​:​size_t·​length,​
98 ······asio:​:​error_code*·​out_ec,​·​std:​:​size_t*·​out_length)​99 ······​std:​:​error_code*·​out_error,​·​std:​:​size_t*·​out_length)​
99 ··​{100 ··​{
100 ····​*out_ec·​=·​ec;​101 ····​*out_error·​=·​error;​
101 ····​*out_length·​=·​length;​102 ····​*out_length·​=·​length;​
102 ··​}103 ··​}
103 104
104 private:​105 private:​
105 ··​asio:​:​io_context·​io_context_;​106 ··​asio:​:​io_context·​io_context_;​
106 ··​udp:​:​socket·​socket_;​107 ··​udp:​:​socket·​socket_;​
107 };​108 };​
108 109
109 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​110 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
110 111
111 int·​main(int·​argc,​·​char*·​argv[])​112 int·​main(int·​argc,​·​char*·​argv[])​
112 {113 {
113 ··​try114 ··​try
114 ··​{115 ··​{
115 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​116 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​
116 117
117 ····​if·​(argc·​!=·​3)​118 ····​if·​(argc·​!=·​3)​
118 ····​{119 ····​{
119 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_udp_client·​<listen_addr>·​<listen_port>\n";​120 ······​std:​:​cerr·​<<·​"Usage:​·​blocking_udp_client·​<listen_addr>·​<listen_port>\n";​
120 ······​return·​1;​121 ······​return·​1;​
121 ····​}122 ····​}
122 123
123 ····​udp:​:​endpoint·​listen_endpoint(124 ····​udp:​:​endpoint·​listen_endpoint(
124 ········​asio:​:​ip:​:​make_address(argv[1])​,​125 ········​asio:​:​ip:​:​make_address(argv[1])​,​
125 ········​std:​:​atoi(argv[2])​)​;​126 ········​std:​:​atoi(argv[2])​)​;​
126 127
127 ····​client·​c(listen_endpoint)​;​128 ····​client·​c(listen_endpoint)​;​
128 129
129 ····​for·​(;​;​)​130 ····​for·​(;​;​)​
130 ····​{131 ····​{
131 ······​char·​data[1024];​132 ······​char·​data[1024];​
132 ······asio:​:​error_code·​ec;​133 ······​std:​:​error_code·​error;​
133 ······​std:​:​size_t·​n·​=·​c.​receive(asio:​:​buffer(data)​,​134 ······​std:​:​size_t·​n·​=·​c.​receive(asio:​:​buffer(data)​,​
134 ··········asio:​:​chrono:​:​seconds(10)​,​·​ec)​;​135 ··········​std:​:​chrono:​:​seconds(10)​,​·​error)​;​
135 136
136 ······​if·​(ec)​137 ······​if·​(error)​
137 ······​{138 ······​{
138 ········​std:​:​cout·​<<·​"Receive·​error:​·​"·​<<·​ec.​message()​·​<<·​"\n";​·139 ········​std:​:​cout·​<<·​"Receive·​error:​·​"·​<<·​error.​message()​·​<<·​"\n";​·
139 ······​}140 ······​}
140 ······​else141 ······​else
141 ······​{142 ······​{
142 ········​std:​:​cout·​<<·​"Received:​·​";​143 ········​std:​:​cout·​<<·​"Received:​·​";​
143 ········​std:​:​cout.​write(data,​·​n)​;​144 ········​std:​:​cout.​write(data,​·​n)​;​
144 ········​std:​:​cout·​<<·​"\n";​145 ········​std:​:​cout·​<<·​"\n";​
145 ······​}146 ······​}
146 ····​}147 ····​}
147 ··​}148 ··​}
148 ··​catch·​(std:​:​exception&·​e)​149 ··​catch·​(std:​:​exception&·​e)​
149 ··​{150 ··​{
150 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​151 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
151 ··​}152 ··​}
152 153
153 ··​return·​0;​154 ··​return·​0;​
154 }155 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/timeouts/server.cpp.html b/include/asio/doc/examples/diffs/timeouts/server.cpp.html new file mode 100644 index 0000000..c847ae2 --- /dev/null +++ b/include/asio/doc/examples/diffs/timeouts/server.cpp.html @@ -0,0 +1,523 @@ + + + + + + + HTML Diff timeouts/server.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​timeouts/​server.​cppsrc/​examples/​cpp11/​timeouts/​server.​cpp
1 /​/​1 /​/​
2 /​/​·​server.​cpp2 /​/​·​server.​cpp
3 /​/​·​~~~~~~~~~~3 /​/​·​~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<algorithm>11 #include·​<algorithm>
12 #include·​<cstdlib>12 #include·​<cstdlib>
13 #include·​<deque>13 #include·​<deque>
14 #include·​<iostream>14 #include·​<iostream>
15 #include·​<memory>
15 #include·​<set>16 #include·​<set>
16 #include·​<string>17 #include·​<string>
17 #include·​<boost/​bind/​bind.​hpp>
18 #include·​<boost/​shared_ptr.​hpp>
19 #include·​<boost/​enable_shared_from_th​is.​hpp>
20 #include·​"asio/​buffer.​hpp"18 #include·​"asio/​buffer.​hpp"
21 #include·​"asio/​io_context.​hpp"19 #include·​"asio/​io_context.​hpp"
22 #include·​"asio/​ip/​tcp.​hpp"20 #include·​"asio/​ip/​tcp.​hpp"
23 #include·​"asio/​ip/​udp.​hpp"21 #include·​"asio/​ip/​udp.​hpp"
24 #include·​"asio/​read_until.​hpp"22 #include·​"asio/​read_until.​hpp"
25 #include·​"asio/​steady_timer.​hpp"23 #include·​"asio/​steady_timer.​hpp"
26 #include·​"asio/​write.​hpp"24 #include·​"asio/​write.​hpp"
27 25
28 using·​asio:​:​steady_timer;​26 using·​asio:​:​steady_timer;​
29 using·​asio:​:​ip:​:​tcp;​27 using·​asio:​:​ip:​:​tcp;​
30 using·​asio:​:​ip:​:​udp;​28 using·​asio:​:​ip:​:​udp;​
31 29
32 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​30 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
33 31
34 class·​subscriber32 class·​subscriber
35 {33 {
36 public:​34 public:​
37 ··​virtual·​~subscriber()​·{}35 ··​virtual·​~subscriber()​·=·default;​
38 ··​virtual·​void·​deliver(const·​std:​:​string&·​msg)​·​=·​0;​36 ··​virtual·​void·​deliver(const·​std:​:​string&·​msg)​·​=·​0;​
39 };​37 };​
40 38
41 typedef·boost:​:​shared_ptr<subscriber​>·​subscriber_ptr;​39 typedef·​std:​:​shared_ptr<subscriber​>·​subscriber_ptr;​
42 40
43 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​41 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
44 42
45 class·​channel43 class·​channel
46 {44 {
47 public:​45 public:​
48 ··​void·​join(subscriber_ptr·​subscriber)​46 ··​void·​join(subscriber_ptr·​subscriber)​
49 ··​{47 ··​{
50 ····​subscribers_.​insert(subscriber)​;​48 ····​subscribers_.​insert(subscriber)​;​
51 ··​}49 ··​}
52 50
53 ··​void·​leave(subscriber_ptr·​subscriber)​51 ··​void·​leave(subscriber_ptr·​subscriber)​
54 ··​{52 ··​{
55 ····​subscribers_.​erase(subscriber)​;​53 ····​subscribers_.​erase(subscriber)​;​
56 ··​}54 ··​}
57 55
58 ··​void·​deliver(const·​std:​:​string&·​msg)​56 ··​void·​deliver(const·​std:​:​string&·​msg)​
59 ··​{57 ··​{
60 ····std:​:​for_each(subscribers_​.​begin()​,​·​subscribers_.​end()​,​58 ····​for·(const·auto&·s·:​·​subscribers_)​
61 ········boost:​:​bind(&subscriber:​:​deliver,​59 ····{
62 ··········boost:​:​placeholders:​:​_1,​·boost:​:​ref(msg)​)​)​;​60 ······​s-​>deliver(msg)​;​
61 ····​}
63 ··​}62 ··​}
64 63
65 private:​64 private:​
66 ··​std:​:​set<subscriber_ptr>·​subscribers_;​65 ··​std:​:​set<subscriber_ptr>·​subscribers_;​
67 };​66 };​
68 67
69 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​68 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
70 69
71 /​/​70 /​/​
72 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​applying·​the·​concept·​of·​a·​deadline.​71 /​/​·​This·​class·​manages·​socket·​timeouts·​by·​applying·​the·​concept·​of·​a·​deadline.​
73 /​/​·​Some·​asynchronous·​operations·​are·​given·​deadlines·​by·​which·​they·​must·​complete.​72 /​/​·​Some·​asynchronous·​operations·​are·​given·​deadlines·​by·​which·​they·​must·​complete.​
74 /​/​·​Deadlines·​are·​enforced·​by·​two·​"actors"·​that·​persist·​for·​the·​lifetime·​of·​the73 /​/​·​Deadlines·​are·​enforced·​by·​two·​"actors"·​that·​persist·​for·​the·​lifetime·​of·​the
75 /​/​·​session·​object,​·​one·​for·​input·​and·​one·​for·​output:​74 /​/​·​session·​object,​·​one·​for·​input·​and·​one·​for·​output:​
76 /​/​75 /​/​
77 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+·····················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+76 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+······················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
78 /​/​··​|················​|·····················​|················​|77 /​/​··​|················​|······················​|················​|
79 /​/​··​|·​check_deadline·​|<-​-​-​+················​|·​check_deadline·​|<-​-​-​+78 /​/​··​|·​check_deadline·​|<-​-​-​-​-​-​-​+·············​|·​check_deadline·​|<-​-​-​-​-​-​-​+
80 /​/​··​|················​|····|·async_wait()​···​|················​|····|·async_wait()​79 /​/​··​|················​|········|·············​|················​|········|
81 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····|··on·input······​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····|··on·output80 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+········|·············​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+········|
82 /​/​··············​|·········|··deadline··················​|·········|··deadline81 /​/​···············​|············|··························​|············|
83 /​/​··············​+-​-​-​-​-​-​-​-​-​+····························+-​-​-​-​-​-​-​-​-​+82 /​/​··async_wait()​·|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····async_wait()​·|····+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
83 /​/​···​on·​input····​|····​|·····​lambda·····​|·····​on·​output···​|····​|·····​lambda·····​|
84 /​/​···​deadline····​+-​-​-​>|·······​in·······​|·····​deadline····​+-​-​-​>|·······​in·······​|
85 /​/​····················​|·​check_deadline·​|······················​|·​check_deadline·​|
86 /​/​····················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+······················​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
84 /​/​87 /​/​
85 /​/​·​If·​either·​deadline·​actor·​determines·​that·​the·​corresponding·​deadline·​has88 /​/​·​If·​either·​deadline·​actor·​determines·​that·​the·​corresponding·​deadline·​has
86 /​/​·​expired,​·​the·​socket·​is·​closed·​and·​any·​outstanding·​operations·​are·​cancelled.​89 /​/​·​expired,​·​the·​socket·​is·​closed·​and·​any·​outstanding·​operations·​are·​cancelled.​
87 /​/​90 /​/​
88 /​/​·​The·​input·​actor·​reads·​messages·​from·​the·​socket,​·​where·​messages·​are·​delimited91 /​/​·​The·​input·​actor·​reads·​messages·​from·​the·​socket,​·​where·​messages·​are·​delimited
89 /​/​·​by·​the·​newline·​character:​92 /​/​·​by·​the·​newline·​character:​
90 /​/​93 /​/​
91 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​+94 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​+
92 /​/​··​|············​|95 /​/​··​|·············​|
93 /​/​··​|·start_read·​|<-​-​-​+96 /​/​··​|··read_line··​|<-​-​-​-​+
94 /​/​··​|············​|····​|97 /​/​··​|·············​|·····​|
95 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​+····​|98 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​+·····​|
96 /​/​··········​|·········​|99 /​/​··········​|···········​|
97 /​/​··​async_-​·​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​+100 /​/​··​async_-​·​|····​+-​-​-​-​-​-​-​-​-​-​-​-​-​+
98 /​/​···​read_-​·​|····​|·············​|101 /​/​···​read_-​·​|····​|···lambda····​|
99 /​/​··​until()​·​+-​-​-​>|·handle_read·​|102 /​/​··​until()​·​+-​-​-​>|·····in······​|
100 /​/​···············​|·············​|103 /​/​···············​|··read_line··​|
101 /​/​···············​+-​-​-​-​-​-​-​-​-​-​-​-​-​+104 /​/​···············​+-​-​-​-​-​-​-​-​-​-​-​-​-​+
102 /​/​105 /​/​
103 /​/​·​The·​deadline·​for·​receiving·​a·​complete·​message·​is·​30·​seconds.​·​If·​a·​non-​empty106 /​/​·​The·​deadline·​for·​receiving·​a·​complete·​message·​is·​30·​seconds.​·​If·​a·​non-​empty
104 /​/​·​message·​is·​received,​·​it·​is·​delivered·​to·​all·​subscribers.​·​If·​a·​heartbeat·​(a107 /​/​·​message·​is·​received,​·​it·​is·​delivered·​to·​all·​subscribers.​·​If·​a·​heartbeat·​(a
105 /​/​·​message·​that·​consists·​of·​a·​single·​newline·​character)​·​is·​received,​·​a·​heartbeat108 /​/​·​message·​that·​consists·​of·​a·​single·​newline·​character)​·​is·​received,​·​a·​heartbeat
106 /​/​·​is·​enqueued·​for·​the·​client,​·​provided·​there·​are·​no·​other·​messages·​waiting·​to109 /​/​·​is·​enqueued·​for·​the·​client,​·​provided·​there·​are·​no·​other·​messages·​waiting·​to
107 /​/​·​be·​sent.​110 /​/​·​be·​sent.​
108 /​/​111 /​/​
109 /​/​·​The·​output·​actor·​is·​responsible·​for·​sending·​messages·​to·​the·​client:​112 /​/​·​The·​output·​actor·​is·​responsible·​for·​sending·​messages·​to·​the·​client:​
110 /​/​113 /​/​
111 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+114 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
112 /​/​··​|··············​|<-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+115 /​/​··​|················​|<-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
113 /​/​··​|·​await_output·​|······················​|116 /​/​··​|··​await_output··​|······················​|
114 /​/​··​|··············​|<-​-​-​+·················​|117 /​/​··​|················​|<-​-​-​-​-​-​-​+·············​|
115 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····|·················​|118 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+········|·············​|
116 /​/​······|······|········|·async_wait()​····​|119 /​/​····|············|··········|·············​|
117 /​/​······|······​+-​-​-​-​-​-​-​-​+·················​|120 /​/​····|····async_-​·|··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|
118 /​/​······V·································​|121 /​/​····|·····wait()​·|··|·····lambda·····|····​|
119 /​/​··+-​-​-​-​-​-​-​-​-​-​-​-​-​+···············+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+122 /​/​····|············+-​>|·······in·······|····|
120 /​/​··|·············|·async_write()​·|··············​|123 /​/​····|···············|··await_output··|····​|
121 /​/​··​|·start_write·|-​-​-​-​-​-​-​-​-​-​-​-​-​-​>|·handle_write·​|124 /​/​····​|···············+-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​+····​|
122 /​/​··|·············|···············|··············​|125 /​/​····V·····································​|
123 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​+···············​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+126 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+···············​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
127 /​/​··​|··············​|·​async_write()​·​|····​lambda····​|
128 /​/​··​|··​write_line··​|-​-​-​-​-​-​-​-​-​-​-​-​-​-​>|······​in······​|
129 /​/​··​|··············​|···············​|··​write_line··​|
130 /​/​··​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+···············​+-​-​-​-​-​-​-​-​-​-​-​-​-​-​+
124 /​/​131 /​/​
125 /​/​·​The·​output·​actor·​first·​waits·​for·​an·​output·​message·​to·​be·​enqueued.​·​It·​does132 /​/​·​The·​output·​actor·​first·​waits·​for·​an·​output·​message·​to·​be·​enqueued.​·​It·​does
126 /​/​·​this·​by·​using·​a·​steady_timer·​as·​an·​asynchronous·​condition·​variable.​·​The133 /​/​·​this·​by·​using·​a·​steady_timer·​as·​an·​asynchronous·​condition·​variable.​·​The
127 /​/​·​steady_timer·​will·​be·​signalled·​whenever·​the·​output·​queue·​is·​non-​empty.​134 /​/​·​steady_timer·​will·​be·​signalled·​whenever·​the·​output·​queue·​is·​non-​empty.​
128 /​/​135 /​/​
129 /​/​·​Once·​a·​message·​is·​available,​·​it·​is·​sent·​to·​the·​client.​·​The·​deadline·​for136 /​/​·​Once·​a·​message·​is·​available,​·​it·​is·​sent·​to·​the·​client.​·​The·​deadline·​for
130 /​/​·​sending·​a·​complete·​message·​is·​30·​seconds.​·​After·​the·​message·​is·​successfully137 /​/​·​sending·​a·​complete·​message·​is·​30·​seconds.​·​After·​the·​message·​is·​successfully
131 /​/​·​sent,​·​the·​output·​actor·​again·​waits·​for·​the·​output·​queue·​to·​become·​non-​empty.​138 /​/​·​sent,​·​the·​output·​actor·​again·​waits·​for·​the·​output·​queue·​to·​become·​non-​empty.​
132 /​/​139 /​/​
133 class·​tcp_session140 class·​tcp_session
134 ··​:​·​public·​subscriber,​141 ··​:​·​public·​subscriber,​
135 ····​public·boost:​:​enable_shared_from_th​is<tcp_session>142 ····​public·​std:​:​enable_shared_from_th​is<tcp_session>
136 {143 {
137 public:​144 public:​
138 ··​tcp_session(asio:​:​io_context&·io_context,​·​channel&·​ch)​145 ··​tcp_session(tcp:​:​socket·socket,​·​channel&·​ch)​
139 ····​:​·​channel_(ch)​,​146 ····​:​·​channel_(ch)​,​
140 ······​socket_(io_context)​,​147 ······​socket_(std:​:​move(socket)​)​
141 ······input_deadline_(io_co​ntext)​,​
142 ······non_empty_output_queu​e_(io_context)​,​
143 ······output_deadline_(io_c​ontext)​
144 ··​{148 ··​{
145 ····​input_deadline_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​149 ····​input_deadline_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​
146 ····​output_deadline_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​150 ····​output_deadline_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​
147 151
148 ····​/​/​·​The·​non_empty_output_queu​e_·​steady_timer·​is·​set·​to·​the·​maximum·​time152 ····​/​/​·​The·​non_empty_output_queu​e_·​steady_timer·​is·​set·​to·​the·​maximum·​time
149 ····​/​/​·​point·​whenever·​the·​output·​queue·​is·​empty.​·​This·​ensures·​that·​the·​output153 ····​/​/​·​point·​whenever·​the·​output·​queue·​is·​empty.​·​This·​ensures·​that·​the·​output
150 ····​/​/​·​actor·​stays·​asleep·​until·​a·​message·​is·​put·​into·​the·​queue.​154 ····​/​/​·​actor·​stays·​asleep·​until·​a·​message·​is·​put·​into·​the·​queue.​
151 ····​non_empty_output_queu​e_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​155 ····​non_empty_output_queu​e_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​
152 ··​}156 ··​}
153 157
154 ··​tcp:​:​socket&·​socket()​
155 ··​{
156 ····​return·​socket_;​
157 ··​}
158
159 ··​/​/​·​Called·​by·​the·​server·​object·​to·​initiate·​the·​four·​actors.​158 ··​/​/​·​Called·​by·​the·​server·​object·​to·​initiate·​the·​four·​actors.​
160 ··​void·​start()​159 ··​void·​start()​
161 ··​{160 ··​{
162 ····​channel_.​join(shared_from_this​()​)​;​161 ····​channel_.​join(shared_from_this​()​)​;​
163 162
164 ····start_read()​;​163 ····read_line()​;​
165 164 ····check_deadline(input_​deadline_)​;​
166 ····input_deadline_.​async_wait(
167 ········boost:​:​bind(&tcp_session:​:​check_deadline,​
168 ········shared_from_this()​,​·&input_deadline_)​)​;​
169 165
170 ····​await_output()​;​166 ····​await_output()​;​
171 167 ····check_deadline(output​_deadline_)​;​
172 ····output_deadline_.​async_wait(
173 ········boost:​:​bind(&tcp_session:​:​check_deadline,​
174 ········shared_from_this()​,​·&output_deadline_)​)​;​
175 ··​}168 ··​}
176 169
177 private:​170 private:​
178 ··​void·​stop()​171 ··​void·​stop()​
179 ··​{172 ··​{
180 ····​channel_.​leave(shared_from_thi​s()​)​;​173 ····​channel_.​leave(shared_from_thi​s()​)​;​
181 174
182 ····asio:​:​error_code·​ignored_ec;​175 ····​std:​:​error_code·​ignored_error;​
183 ····​socket_.​close(ignored_ec)​;​176 ····​socket_.​close(ignored_error)​;​
184 ····​input_deadline_.​cancel()​;​177 ····​input_deadline_.​cancel()​;​
185 ····​non_empty_output_queu​e_.​cancel()​;​178 ····​non_empty_output_queu​e_.​cancel()​;​
186 ····​output_deadline_.​cancel()​;​179 ····​output_deadline_.​cancel()​;​
187 ··​}180 ··​}
188 181
189 ··​bool·​stopped()​·​const182 ··​bool·​stopped()​·​const
190 ··​{183 ··​{
191 ····​return·​!socket_.​is_open()​;​184 ····​return·​!socket_.​is_open()​;​
192 ··​}185 ··​}
193 186
194 ··​void·​deliver(const·​std:​:​string&·​msg)​187 ··​void·​deliver(const·​std:​:​string&·​msg)​·override
195 ··​{188 ··​{
196 ····​output_queue_.​push_back(msg·​+·​"\n")​;​189 ····​output_queue_.​push_back(msg·​+·​"\n")​;​
197 190
198 ····​/​/​·​Signal·​that·​the·​output·​queue·​contains·​messages.​·​Modifying·​the·​expiry191 ····​/​/​·​Signal·​that·​the·​output·​queue·​contains·​messages.​·​Modifying·​the·​expiry
199 ····​/​/​·​will·​wake·​the·​output·​actor,​·​if·​it·​is·​waiting·​on·​the·​timer.​192 ····​/​/​·​will·​wake·​the·​output·​actor,​·​if·​it·​is·​waiting·​on·​the·​timer.​
200 ····​non_empty_output_queu​e_.​expires_at(steady_tim​er:​:​time_point:​:​min()​)​;​193 ····​non_empty_output_queu​e_.​expires_at(steady_tim​er:​:​time_point:​:​min()​)​;​
201 ··​}194 ··​}
202 195
203 ··​void·start_read()​196 ··​void·read_line()​
204 ··​{197 ··​{
205 ····​/​/​·​Set·​a·​deadline·​for·​the·​read·​operation.​198 ····​/​/​·​Set·​a·​deadline·​for·​the·​read·​operation.​
206 ····​input_deadline_.​expires_after(asio:​:​chrono:​:​seconds(30)​)​;​199 ····​input_deadline_.​expires_after(std:​:​chrono:​:​seconds(30)​)​;​
207 200
208 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​read·​a·​newline-​delimited·​message.​201 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​read·​a·​newline-​delimited·​message.​
202 ····​auto·​self(shared_from_this​()​)​;​
209 ····​asio:​:​async_read_until(sock​et_,​203 ····​asio:​:​async_read_until(sock​et_,​
210 ········​asio:​:​dynamic_buffer(input_​buffer_)​,​·​'\n',​204 ········​asio:​:​dynamic_buffer(input_​buffer_)​,​·​'\n',​
211 ········boost:​:​bind(&tcp_session:​:​handle_read,​·​shared_from_this()​,​205 ········[this,​·self](const·std:​:​error_code&·error,​·​std:​:​size_t·n)​
212 ··········boost:​:​placeholders:​:​_1,​·boost:​:​placeholders:​:​_2)​)​;​
213 ··}
214
215 ··void·handle_read(const·asio:​:​error_code&·ec,​·std:​:​size_t·n)​
216 ··{
217 ····if·(stopped()​)​
218 ······return;​
219
220 ····if·(!ec)​
221 ····{
222 ······/​/​·Extract·the·newline-​delimited·message·from·the·buffer.​
223 ······std:​:​string·msg(input_buffer_.​substr(0,​·n·-​·1)​)​;​
224 ······input_buffer_.​erase(0,​·n)​;​
225
226 ······if·(!msg.​empty()​)​
227 ······{
228 ········channel_.​deliver(msg)​;​
229 ······}
230 ······else
231 ······{
232 ········/​/​·We·received·a·heartbeat·message·from·the·client.​·If·there's·nothing
233 ········/​/​·else·being·sent·or·ready·to·be·sent,​·send·a·heartbeat·right·back.​
234 ········if·(output_queue_.​empty()​)​
235 ········​{206 ········​{
236 ··········​output_queue_.​push_back("\n")​;​207 ··········/​/​·Check·if·the·session·was·stopped·while·the·operation·was·pending.​
237 208 ··········if·(stopped()​)​
238 ··········/​/​·Signal·that·the·output·queue·contains·messages.​·Modifying·the209 ············return;​
239 ··········/​/​·expiry·will·wake·the·output·actor,​·if·it·is·waiting·on·the·timer.​210
240 ··········non_empty_output_queu​e_.​expires_at(steady_tim​er:​:​time_point:​:​min()​)​;​211 ··········​if·(!error)​
241 ········}212 ··········{
242 ······}213 ············/​/​·Extract·the·newline-​delimited·message·from·the·buffer.​
243 214 ············std:​:​string·msg(input_buffer_.​substr(0,​·n·-​·1)​)​;​
244 ······start_read()​;​215 ············input_buffer_.​erase(0,​·n)​;​
245 ····}216
246 ····else217 ············if·(!msg.​empty()​)​
247 ····​{218 ············​{
248 ······stop()​;​219 ··············channel_.​deliver(msg)​;​
249 ····​}220 ············​}
221 ············​else
222 ············​{
223
224 ··············​/​/​·​We·​received·​a·​heartbeat·​message·​from·​the·​client.​·​If·​there's
225 ··············​/​/​·​nothing·​else·​being·​sent·​or·​ready·​to·​be·​sent,​·​send·​a·​heartbeat
226 ··············​/​/​·​right·​back.​
227 ··············​if·​(output_queue_.​empty()​)​
228 ··············​{
229 ················​output_queue_.​push_back("\n")​;​
230
231 ················​/​/​·​Signal·​that·​the·​output·​queue·​contains·​messages.​·​Modifying
232 ················​/​/​·​the·​expiry·​will·​wake·​the·​output·​actor,​·​if·​it·​is·​waiting·​on
233 ················​/​/​·​the·​timer.​
234 ················​non_empty_output_queu​e_.​expires_at(
235 ····················​steady_timer:​:​time_point:​:​min()​)​;​
236 ··············​}
237 ············​}
238
239 ············​read_line()​;​
240 ··········​}
241 ··········​else
242 ··········​{
243 ············​stop()​;​
244 ··········​}
245 ········​})​;​
250 ··​}246 ··​}
251 247
252 ··​void·​await_output()​248 ··​void·​await_output()​
253 ··​{249 ··​{
254 ····if·​(stopped()​)​250 ····auto·self(shared_from_this​()​)​;​
255 ······return;​251 ····non_empty_output_queu​e_.​async_wait(
256 252 ········[this,​·self](const·std:​:​error_code&·/​*error*/​)​
257 ····if·(output_queue_.​empty()​)​253 ········{
258 ····{254 ··········/​/​·Check·if·the·session·was·stopped·while·the·operation·was·pending.​
259 ······/​/​·There·are·no·messages·that·are·ready·to·be·sent.​·The·actor·goes·to255 ··········if·(stopped()​)​
260 ······/​/​·sleep·by·waiting·on·the·non_empty_output_queu​e_·timer.​·When·a·new256 ············return;​
261 ······/​/​·message·is·added,​·the·timer·will·be·modified·and·the·actor·will·wake.​257
262 ······non_empty_output_queu​e_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​258 ··········if·(output_queue_.​empty()​)​
263 ······non_empty_output_queu​e_.​async_wait(259 ··········{
264 ··········boost:​:​bind(&tcp_session:​:​await_output,​·shared_from_this()​)​)​;​260 ············/​/​·There·are·no·messages·that·are·ready·to·be·sent.​·The·actor·goes
265 ····}261 ············/​/​·to·sleep·by·waiting·on·the·non_empty_output_queu​e_·timer.​·When·a
266 ····​else262 ············/​/​·new·message·is·added,​·the·timer·will·be·modified·and·the·actor
267 ····{263 ············/​/​·will·wake.​
268 ······​start_write()​;​264 ············non_empty_output_queu​e_.​expires_at(steady_tim​er:​:​time_point:​:​max()​)​;​
269 ····}265 ············await_output()​;​
266 ··········​}
267 ··········​else
268 ··········​{
269 ············​write_line()​;​
270 ··········​}
271 ········​})​;​
270 ··​}272 ··​}
271 273
272 ··​void·start_write()​274 ··​void·write_line()​
273 ··​{275 ··​{
274 ····​/​/​·​Set·​a·​deadline·​for·​the·​write·​operation.​276 ····​/​/​·​Set·​a·​deadline·​for·​the·​write·​operation.​
275 ····​output_deadline_.​expires_after(asio:​:​chrono:​:​seconds(30)​)​;​277 ····​output_deadline_.​expires_after(std:​:​chrono:​:​seconds(30)​)​;​
276 278
277 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​send·​a·​message.​279 ····​/​/​·​Start·​an·​asynchronous·​operation·​to·​send·​a·​message.​
280 ····​auto·​self(shared_from_this​()​)​;​
278 ····​asio:​:​async_write(socket_,​281 ····​asio:​:​async_write(socket_,​
279 ········​asio:​:​buffer(output_queue_.​front()​)​,​282 ········​asio:​:​buffer(output_queue_.​front()​)​,​
280 ········boost:​:​bind(&tcp_session:​:​handle_write,​283 ········[this,​·self](const·std:​:​error_code&·error,​·std:​:​size_t·/​*n*/​)​
281 ··········shared_from_this()​,​·boost:​:​placeholders:​:​_1)​)​;​284 ········{
282 ··}285 ··········/​/​·Check·if·the·session·was·stopped·while·the·operation·was·pending.​
283 286 ··········if·(stopped()​)​
284 ··void·handle_write(const·asio:​:​error_code&·ec)​287 ············return;​
285 ··{288
286 ····if·(stopped()​)​289 ··········if·(!error)​
287 ······return;​290 ··········{
288 291 ············output_queue_.​pop_front()​;​
289 ····if·(!ec)​292
290 ····{293 ············await_output()​;​
291 ······output_queue_.​pop_front()​;​294 ··········}
292 295 ··········else
293 ······await_output()​;​296 ··········{
294 ····}297 ············stop()​;​
295 ····else298 ··········}
296 ····{299 ········})​;​
297 ······stop()​;​300 ··}
298 ····}301
299 ··}302 ··void·check_deadline(steady​_timer&·deadline)​
300 303 ··{
301 ··void·check_deadline(steady​_timer*·deadline)​304 ····auto·self(shared_from_this​()​)​;​
302 ··{305 ····deadline.​async_wait(
303 ····​if·​(stopped()​)​306 ········[this,​·self,​·&deadline](const·std:​:​error_code&·/​*error*/​)​
304 ······return;​307 ········{
305 308 ··········/​/​·Check·if·the·session·was·stopped·while·the·operation·was·pending.​
306 ····/​/​·Check·whether·the·deadline·has·passed.​·We·compare·the·deadline·against309 ··········if·(stopped()​)​
307 ····/​/​·the·current·time·since·a·new·asynchronous·operation·may·have·moved·the310 ············​return;​
308 ····/​/​·deadline·before·this·actor·had·a·chance·to·run.​311
309 ····if·(deadline-​>expiry()​·<=·​steady_timer:​:​clock_type:​:​now()​)​312 ··········/​/​·Check·whether·the·deadline·has·passed.​·We·compare·the·deadline
310 ····{313 ··········/​/​·against·the·current·time·since·a·new·asynchronous·operation·may
311 ······​/​/​·The·deadline·has·passed.​·Stop·​the·session.​·The·other·actors·will314 ··········​/​/​·have·moved·the·deadline·before·​this·actor·had·a·chance·to·run.​
312 ······/​/​·terminate·as·​soon·as·possible.​315 ··········if·(deadline.​expiry()​·<=·​steady_timer:​:​clock_type:​:​now()​)​
313 ······stop()​;​316 ··········{
314 ····}317 ············/​/​·The·deadline·has·passed.​·Stop·the·session.​·The·other·actors·will
315 ····​else318 ············/​/​·terminate·as·soon·as·possible.​
316 ····{319 ············stop()​;​
317 ······/​/​·Put·the·actor·back·to·sleep.​320 ··········}
318 ······deadline-​>async_wait(321 ··········else
319 ··········boost:​:​bind(&tcp_session:​:​check_deadline,​322 ··········{
320 ··········shared_from_this()​,​·deadline)​)​;​323 ············/​/​·Put·the·actor·back·to·sleep.​
321 ····}324 ············check_deadline(deadli​ne)​;​
325 ··········​}
326 ········​})​;​
322 ··​}327 ··​}
323 328
324 ··​channel&·​channel_;​329 ··​channel&·​channel_;​
325 ··​tcp:​:​socket·​socket_;​330 ··​tcp:​:​socket·​socket_;​
326 ··​std:​:​string·​input_buffer_;​331 ··​std:​:​string·​input_buffer_;​
327 ··​steady_timer·​input_deadline_;​332 ··​steady_timer·​input_deadline_{socke​t_.​get_executor()​};​
328 ··​std:​:​deque<std:​:​string>·​output_queue_;​333 ··​std:​:​deque<std:​:​string>·​output_queue_;​
329 ··​steady_timer·​non_empty_output_queu​e_;​334 ··​steady_timer·​non_empty_output_queu​e_{socket_.​get_executor()​};​
330 ··​steady_timer·​output_deadline_;​335 ··​steady_timer·​output_deadline_{sock​et_.​get_executor()​};​
331 };​336 };​
332 337
333 typedef·boost:​:​shared_ptr<tcp_sessio​n>·​tcp_session_ptr;​338 typedef·​std:​:​shared_ptr<tcp_sessio​n>·​tcp_session_ptr;​
334 339
335 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​340 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
336 341
337 class·​udp_broadcaster342 class·​udp_broadcaster
338 ··​:​·​public·​subscriber343 ··​:​·​public·​subscriber
339 {344 {
340 public:​345 public:​
341 ··​udp_broadcaster(asio:​:​io_context&·​io_context,​346 ··​udp_broadcaster(asio:​:​io_context&·​io_context,​
342 ······​const·​udp:​:​endpoint&·​broadcast_endpoint)​347 ······​const·​udp:​:​endpoint&·​broadcast_endpoint)​
343 ····​:​·​socket_(io_context)​348 ····​:​·​socket_(io_context)​
344 ··​{349 ··​{
345 ····​socket_.​connect(broadcast_end​point)​;​350 ····​socket_.​connect(broadcast_end​point)​;​
346 ····​socket_.​set_option(udp:​:​socket:​:​broadcast(true)​)​;​351 ····​socket_.​set_option(udp:​:​socket:​:​broadcast(true)​)​;​
347 ··​}352 ··​}
348 353
349 private:​354 private:​
350 ··​void·​deliver(const·​std:​:​string&·​msg)​355 ··​void·​deliver(const·​std:​:​string&·​msg)​
351 ··​{356 ··​{
352 ····asio:​:​error_code·​ignored_ec;​357 ····​std:​:​error_code·​ignored_error;​
353 ····​socket_.​send(asio:​:​buffer(msg)​,​·​0,​·​ignored_ec)​;​358 ····​socket_.​send(asio:​:​buffer(msg)​,​·​0,​·​ignored_error)​;​
354 ··​}359 ··​}
355 360
356 ··​udp:​:​socket·​socket_;​361 ··​udp:​:​socket·​socket_;​
357 };​362 };​
358 363
359 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​364 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
360 365
361 class·​server366 class·​server
362 {367 {
363 public:​368 public:​
364 ··​server(asio:​:​io_context&·​io_context,​369 ··​server(asio:​:​io_context&·​io_context,​
365 ······​const·​tcp:​:​endpoint&·​listen_endpoint,​370 ······​const·​tcp:​:​endpoint&·​listen_endpoint,​
366 ······​const·​udp:​:​endpoint&·​broadcast_endpoint)​371 ······​const·​udp:​:​endpoint&·​broadcast_endpoint)​
367 ····​:​·​io_context_(io_contex​t)​,​372 ····​:​·​io_context_(io_contex​t)​,​
368 ······​acceptor_(io_context,​·​listen_endpoint)​373 ······​acceptor_(io_context,​·​listen_endpoint)​
369 ··​{374 ··​{
370 ····subscriber_ptr·bc(new·udp_broadcaster(io_co​ntext_,​·broadcast_endpoint)​)​;​375 ····​channel_.​join(
371 ····channel_.​join(bc)​;​376 ········std:​:​make_shared<udp_broad​caster>(
377 ··········​io_context_,​·​broadcast_endpoint)​)​;​
372 378
373 ····start_accept()​;​379 ····​accept()​;​
374 ··​}380 ··​}
375 381
376 ··void·start_accept()​382 private:​
377 ··{383 ··void·accept()​
378 ····tcp_session_ptr·new_session(new·tcp_session(io_contex​t_,​·channel_)​)​;​
379
380 ····acceptor_.​async_accept(new_sess​ion-​>socket()​,​
381 ········boost:​:​bind(&server:​:​handle_accept,​
382 ··········this,​·new_session,​·boost:​:​placeholders:​:​_1)​)​;​
383 ··}
384
385 ··void·handle_accept(tcp_ses​sion_ptr·session,​
386 ······const·asio:​:​error_code&·ec)​
387 ··​{384 ··​{
388 ····if·(!ec)​385 ····acceptor_.​async_accept(
389 ····{386 ········[this](const·std:​:​error_code&·error,​·tcp:​:​socket·socket)​
390 ······session-​>start()​;​387 ········{
391 ····}388 ··········if·(!error)​
389 ··········​{
390 ············​std:​:​make_shared<tcp_sessi​on>(std:​:​move(socket)​,​·​channel_)​-​>start()​;​
391 ··········​}
392 392
393 ····start_accept()​;​393 ··········accept()​;​
394 ········​})​;​
394 ··​}395 ··​}
395 396
396 private:​
397 ··​asio:​:​io_context&·​io_context_;​397 ··​asio:​:​io_context&·​io_context_;​
398 ··​tcp:​:​acceptor·​acceptor_;​398 ··​tcp:​:​acceptor·​acceptor_;​
399 ··​channel·​channel_;​399 ··​channel·​channel_;​
400 };​400 };​
401 401
402 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​402 /​/​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​-​
403 403
404 int·​main(int·​argc,​·​char*·​argv[])​404 int·​main(int·​argc,​·​char*·​argv[])​
405 {405 {
406 ··​try406 ··​try
407 ··​{407 ··​{
408 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​408 ····​using·​namespace·​std;​·​/​/​·​For·​atoi.​
409 409
410 ····​if·​(argc·​!=·​4)​410 ····​if·​(argc·​!=·​4)​
411 ····​{411 ····​{
412 ······​std:​:​cerr·​<<·​"Usage:​·​server·​<listen_port>·​<bcast_address>·​<bcast_port>\n";​412 ······​std:​:​cerr·​<<·​"Usage:​·​server·​<listen_port>·​<bcast_address>·​<bcast_port>\n";​
413 ······​return·​1;​413 ······​return·​1;​
414 ····​}414 ····​}
415 415
416 ····​asio:​:​io_context·​io_context;​416 ····​asio:​:​io_context·​io_context;​
417 417
418 ····​tcp:​:​endpoint·​listen_endpoint(tcp:​:​v4()​,​·​atoi(argv[1])​)​;​418 ····​tcp:​:​endpoint·​listen_endpoint(tcp:​:​v4()​,​·​atoi(argv[1])​)​;​
419 419
420 ····​udp:​:​endpoint·​broadcast_endpoint(420 ····​udp:​:​endpoint·​broadcast_endpoint(
421 ········​asio:​:​ip:​:​make_address(argv[2])​,​·​atoi(argv[3])​)​;​421 ········​asio:​:​ip:​:​make_address(argv[2])​,​·​atoi(argv[3])​)​;​
422 422
423 ····​server·​s(io_context,​·​listen_endpoint,​·​broadcast_endpoint)​;​423 ····​server·​s(io_context,​·​listen_endpoint,​·​broadcast_endpoint)​;​
424 424
425 ····​io_context.​run()​;​425 ····​io_context.​run()​;​
426 ··​}426 ··​}
427 ··​catch·​(std:​:​exception&·​e)​427 ··​catch·​(std:​:​exception&·​e)​
428 ··​{428 ··​{
429 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​429 ····​std:​:​cerr·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
430 ··​}430 ··​}
431 431
432 ··​return·​0;​432 ··​return·​0;​
433 }433 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/examples/diffs/timers/time_t_timer.cpp.html b/include/asio/doc/examples/diffs/timers/time_t_timer.cpp.html new file mode 100644 index 0000000..82fc9f6 --- /dev/null +++ b/include/asio/doc/examples/diffs/timers/time_t_timer.cpp.html @@ -0,0 +1,151 @@ + + + + + + + HTML Diff timers/time_t_timer.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src/​examples/​cpp03/​timers/​time_t_timer.​cppsrc/​examples/​cpp11/​timers/​time_t_timer.​cpp
1 /​/​1 /​/​
2 /​/​·​time_t_timer.​cpp2 /​/​·​time_t_timer.​cpp
3 /​/​·​~~~~~~~~~~~~~~~~3 /​/​·​~~~~~~~~~~~~~~~~
4 /​/​4 /​/​
5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​5 /​/​·​Copyright·​(c)​·​2003-​2020·​Christopher·​M.​·​Kohlhoff·​(chris·​at·​kohlhoff·​dot·​com)​
6 /​/​6 /​/​
7 /​/​·​Distributed·​under·​the·​Boost·​Software·​License,​·​Version·​1.​0.​·​(See·​accompanying7 /​/​·​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)​8 /​/​·​file·​LICENSE_1_0.​txt·​or·​copy·​at·​http:​/​/​www.​boost.​org/​LICENSE_1_0.​txt)​
9 /​/​9 /​/​
10 10
11 #include·​<asio.​hpp>11 #include·​<asio.​hpp>
12 #include·​<ctime>12 #include·​<ctime>
13 #include·​<chrono>
13 #include·​<iostream>14 #include·​<iostream>
14 15
15 /​/​·​A·​custom·​implementation·​of·​the·​Clock·​concept·​from·​the·​standard·​C++·​library.​16 /​/​·​A·​custom·​implementation·​of·​the·​Clock·​concept·​from·​the·​standard·​C++·​library.​
16 struct·​time_t_clock17 struct·​time_t_clock
17 {18 {
18 ··​/​/​·​The·​duration·​type.​19 ··​/​/​·​The·​duration·​type.​
19 ··​typedef·asio:​:​chrono:​:​steady_clock:​:​duration·​duration;​20 ··​typedef·​std:​:​chrono:​:​steady_clock:​:​duration·​duration;​
20 21
21 ··​/​/​·​The·​duration's·​underlying·​arithmetic·​representation.​22 ··​/​/​·​The·​duration's·​underlying·​arithmetic·​representation.​
22 ··​typedef·​duration:​:​rep·​rep;​23 ··​typedef·​duration:​:​rep·​rep;​
23 24
24 ··​/​/​·​The·​ratio·​representing·​the·​duration's·​tick·​period.​25 ··​/​/​·​The·​ratio·​representing·​the·​duration's·​tick·​period.​
25 ··​typedef·​duration:​:​period·​period;​26 ··​typedef·​duration:​:​period·​period;​
26 27
27 ··​/​/​·​An·​absolute·​time·​point·​represented·​using·​the·​clock.​28 ··​/​/​·​An·​absolute·​time·​point·​represented·​using·​the·​clock.​
28 ··​typedef·asio:​:​chrono:​:​time_point<time_t_clo​ck>·​time_point;​29 ··​typedef·​std:​:​chrono:​:​time_point<time_t_clo​ck>·​time_point;​
29 30
30 ··​/​/​·​The·​clock·​is·​not·​monotonically·​increasing.​31 ··​/​/​·​The·​clock·​is·​not·​monotonically·​increasing.​
31 ··​static·​const·​bool·​is_steady·​=·​false;​32 ··​static·​constexpr·​bool·​is_steady·​=·​false;​
32 33
33 ··​/​/​·​Get·​the·​current·​time.​34 ··​/​/​·​Get·​the·​current·​time.​
34 ··​static·​time_point·​now()​35 ··​static·​time_point·​now()​·noexcept
35 ··​{36 ··​{
36 ····​return·​time_point()​·​+·asio:​:​chrono:​:​seconds(std:​:​time(0)​)​;​37 ····​return·​time_point()​·​+·​std:​:​chrono:​:​seconds(std:​:​time(0)​)​;​
37 ··​}38 ··​}
38 };​39 };​
39 40
40 /​/​·​The·​asio:​:​basic_waitable_timer·​template·​accepts·​an·​optional·​WaitTraits41 /​/​·​The·​asio:​:​basic_waitable_timer·​template·​accepts·​an·​optional·​WaitTraits
41 /​/​·​template·​parameter.​·​The·​underlying·​time_t·​clock·​has·​one-​second·​granularity,​42 /​/​·​template·​parameter.​·​The·​underlying·​time_t·​clock·​has·​one-​second·​granularity,​
42 /​/​·​so·​these·​traits·​may·​be·​customised·​to·​reduce·​the·​latency·​between·​the·​clock43 /​/​·​so·​these·​traits·​may·​be·​customised·​to·​reduce·​the·​latency·​between·​the·​clock
43 /​/​·​ticking·​over·​and·​a·​wait·​operation's·​completion.​·​When·​the·​timeout·​is·​near44 /​/​·​ticking·​over·​and·​a·​wait·​operation's·​completion.​·​When·​the·​timeout·​is·​near
44 /​/​·​(less·​than·​one·​second·​away)​·​we·​poll·​the·​clock·​more·​frequently·​to·​detect·​the45 /​/​·​(less·​than·​one·​second·​away)​·​we·​poll·​the·​clock·​more·​frequently·​to·​detect·​the
45 /​/​·​time·​change·​closer·​to·​when·​it·​occurs.​·​The·​user·​can·​select·​the·​appropriate46 /​/​·​time·​change·​closer·​to·​when·​it·​occurs.​·​The·​user·​can·​select·​the·​appropriate
46 /​/​·​trade·​off·​between·​accuracy·​and·​the·​increased·​CPU·​cost·​of·​polling.​·​In·​extreme47 /​/​·​trade·​off·​between·​accuracy·​and·​the·​increased·​CPU·​cost·​of·​polling.​·​In·​extreme
47 /​/​·​cases,​·​a·​zero·​duration·​may·​be·​returned·​to·​make·​the·​timers·​as·​accurate·​as48 /​/​·​cases,​·​a·​zero·​duration·​may·​be·​returned·​to·​make·​the·​timers·​as·​accurate·​as
48 /​/​·​possible,​·​albeit·​with·​100%·​CPU·​usage.​49 /​/​·​possible,​·​albeit·​with·​100%·​CPU·​usage.​
49 struct·​time_t_wait_traits50 struct·​time_t_wait_traits
50 {51 {
51 ··​/​/​·​Determine·​how·​long·​until·​the·​clock·​should·​be·​next·​polled·​to·​determine52 ··​/​/​·​Determine·​how·​long·​until·​the·​clock·​should·​be·​next·​polled·​to·​determine
52 ··​/​/​·​whether·​the·​duration·​has·​elapsed.​53 ··​/​/​·​whether·​the·​duration·​has·​elapsed.​
53 ··​static·​time_t_clock:​:​duration·​to_wait_duration(54 ··​static·​time_t_clock:​:​duration·​to_wait_duration(
54 ······​const·​time_t_clock:​:​duration&·​d)​55 ······​const·​time_t_clock:​:​duration&·​d)​
55 ··​{56 ··​{
56 ····​if·​(d·​>·asio:​:​chrono:​:​seconds(1)​)​57 ····​if·​(d·​>·​std:​:​chrono:​:​seconds(1)​)​
57 ······​return·​d·​-​·asio:​:​chrono:​:​seconds(1)​;​58 ······​return·​d·​-​·​std:​:​chrono:​:​seconds(1)​;​
58 ····​else·​if·​(d·​>·asio:​:​chrono:​:​seconds(0)​)​59 ····​else·​if·​(d·​>·​std:​:​chrono:​:​seconds(0)​)​
59 ······​return·asio:​:​chrono:​:​milliseconds(10)​;​60 ······​return·​std:​:​chrono:​:​milliseconds(10)​;​
60 ····​else61 ····​else
61 ······​return·asio:​:​chrono:​:​seconds(0)​;​62 ······​return·​std:​:​chrono:​:​seconds(0)​;​
62 ··​}63 ··​}
63 64
64 ··​/​/​·​Determine·​how·​long·​until·​the·​clock·​should·​be·​next·​polled·​to·​determine65 ··​/​/​·​Determine·​how·​long·​until·​the·​clock·​should·​be·​next·​polled·​to·​determine
65 ··​/​/​·​whether·​the·​absoluate·​time·​has·​been·​reached.​66 ··​/​/​·​whether·​the·​absoluate·​time·​has·​been·​reached.​
66 ··​static·​time_t_clock:​:​duration·​to_wait_duration(67 ··​static·​time_t_clock:​:​duration·​to_wait_duration(
67 ······​const·​time_t_clock:​:​time_point&·​t)​68 ······​const·​time_t_clock:​:​time_point&·​t)​
68 ··​{69 ··​{
69 ····​return·​to_wait_duration(t·​-​·​time_t_clock:​:​now()​)​;​70 ····​return·​to_wait_duration(t·​-​·​time_t_clock:​:​now()​)​;​
70 ··​}71 ··​}
71 };​72 };​
72 73
73 typedef·​asio:​:​basic_waitable_timer<​74 typedef·​asio:​:​basic_waitable_timer<​
74 ··​time_t_clock,​·​time_t_wait_traits>·​time_t_timer;​75 ··​time_t_clock,​·​time_t_wait_traits>·​time_t_timer;​
75 76
76 void·​handle_timeout(const·​asio:​:​error_code&)​
77 {
78 ··​std:​:​cout·​<<·​"handle_timeout\n";​
79 }
80
81 int·​main()​77 int·​main()​
82 {78 {
83 ··​try79 ··​try
84 ··​{80 ··​{
85 ····​asio:​:​io_context·​io_context;​81 ····​asio:​:​io_context·​io_context;​
86 82
87 ····​time_t_timer·​timer(io_context)​;​83 ····​time_t_timer·​timer(io_context)​;​
88 84
89 ····​timer.​expires_after(asio:​:​chrono:​:​seconds(5)​)​;​85 ····​timer.​expires_after(std:​:​chrono:​:​seconds(5)​)​;​
90 ····​std:​:​cout·​<<·​"Starting·​synchronous·​wait\n";​86 ····​std:​:​cout·​<<·​"Starting·​synchronous·​wait\n";​
91 ····​timer.​wait()​;​87 ····​timer.​wait()​;​
92 ····​std:​:​cout·​<<·​"Finished·​synchronous·​wait\n";​88 ····​std:​:​cout·​<<·​"Finished·​synchronous·​wait\n";​
93 89
94 ····​timer.​expires_after(asio:​:​chrono:​:​seconds(5)​)​;​90 ····​timer.​expires_after(std:​:​chrono:​:​seconds(5)​)​;​
95 ····​std:​:​cout·​<<·​"Starting·​asynchronous·​wait\n";​91 ····​std:​:​cout·​<<·​"Starting·​asynchronous·​wait\n";​
96 ····​timer.​async_wait(&handle_ti​meout)​;​92 ····​timer.​async_wait(
93 ········​[](const·​std:​:​error_code&·​/​*error*/​)​
94 ········​{
95 ··········​std:​:​cout·​<<·​"timeout\n";​
96 ········​})​;​
97 ····​io_context.​run()​;​97 ····​io_context.​run()​;​
98 ····​std:​:​cout·​<<·​"Finished·​asynchronous·​wait\n";​98 ····​std:​:​cout·​<<·​"Finished·​asynchronous·​wait\n";​
99 ··​}99 ··​}
100 ··​catch·​(std:​:​exception&·​e)​100 ··​catch·​(std:​:​exception&·​e)​
101 ··​{101 ··​{
102 ····​std:​:​cout·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​102 ····​std:​:​cout·​<<·​"Exception:​·​"·​<<·​e.​what()​·​<<·​"\n";​
103 ··​}103 ··​}
104 104
105 ··​return·​0;​105 ··​return·​0;​
106 }106 }
+ +
+

Modified at 15.08.2020. HTML formatting created by diff2html.

+
+ diff --git a/include/asio/doc/home.png b/include/asio/doc/home.png new file mode 100644 index 0000000..5584aac Binary files /dev/null and b/include/asio/doc/home.png differ diff --git a/include/asio/doc/important.png b/include/asio/doc/important.png new file mode 100644 index 0000000..12c90f6 Binary files /dev/null and b/include/asio/doc/important.png differ diff --git a/include/asio/doc/index.html b/include/asio/doc/index.html new file mode 100644 index 0000000..bd47e7e --- /dev/null +++ b/include/asio/doc/index.html @@ -0,0 +1,86 @@ + + + +Asio + + + + + + +
asio C++ library
+
+
Next
+
+
+

+Asio

+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+

+ Asio is a cross-platform C++ library for network and low-level I/O programming + that provides developers with a consistent asynchronous model using a modern + C++ approach. +

+
+

+
+
Overview
+

+ An overview of the features included in Asio, plus rationale and design + information. +

+
Using Asio
+

+ How to use Asio in your applications. Includes information on library dependencies + and supported platforms. +

+
Tutorial
+

+ A tutorial that introduces the fundamental concepts required to use Asio, + and shows how to use Asio to develop simple client and server programs. +

+
Examples
+

+ Examples that illustrate the use of Asio in more complex applications. +

+
Reference
+

+ Detailed class and function reference. +

+
Networking TS Compatibility
+

+ Description of changes to provide compatibility with the "C++ Extensions + for Networking" Technical Specification. +

+
Proposed Standard Executors +
+

+ Description of Asio's support for the proposed standard executors library. +

+
Revision History
+

+ Log of Asio changes made in each release. +

+
Index
+

+ Book-style text index of Asio documentation. +

+
+
+
+ + + +

Last revised: August 15, 2020 at 01:45:25 GMT

+
+
Next
+ + diff --git a/include/asio/doc/next.png b/include/asio/doc/next.png new file mode 100644 index 0000000..59800b4 Binary files /dev/null and b/include/asio/doc/next.png differ diff --git a/include/asio/doc/next_disabled.png b/include/asio/doc/next_disabled.png new file mode 100644 index 0000000..10a8c59 Binary files /dev/null and b/include/asio/doc/next_disabled.png differ diff --git a/include/asio/doc/note.png b/include/asio/doc/note.png new file mode 100644 index 0000000..d0c3c64 Binary files /dev/null and b/include/asio/doc/note.png differ diff --git a/include/asio/doc/prev.png b/include/asio/doc/prev.png new file mode 100644 index 0000000..d88a40f Binary files /dev/null and b/include/asio/doc/prev.png differ diff --git a/include/asio/doc/prev_disabled.png b/include/asio/doc/prev_disabled.png new file mode 100644 index 0000000..ab3c17e Binary files /dev/null and b/include/asio/doc/prev_disabled.png differ diff --git a/include/asio/doc/proactor.png b/include/asio/doc/proactor.png new file mode 100644 index 0000000..a0653b0 Binary files /dev/null and b/include/asio/doc/proactor.png differ diff --git a/include/asio/doc/standalone_HTML.manifest b/include/asio/doc/standalone_HTML.manifest new file mode 100644 index 0000000..26478dd --- /dev/null +++ b/include/asio/doc/standalone_HTML.manifest @@ -0,0 +1,3601 @@ +index.html +asio/overview.html +asio/overview/rationale.html +asio/overview/core.html +asio/overview/core/basics.html +asio/overview/core/async.html +asio/overview/core/threads.html +asio/overview/core/strands.html +asio/overview/core/buffers.html +asio/overview/core/streams.html +asio/overview/core/reactor.html +asio/overview/core/line_based.html +asio/overview/core/allocation.html +asio/overview/core/handler_tracking.html +asio/overview/core/concurrency_hint.html +asio/overview/core/coroutine.html +asio/overview/core/spawn.html +asio/overview/core/coroutines_ts.html +asio/overview/networking.html +asio/overview/networking/protocols.html +asio/overview/networking/other_protocols.html +asio/overview/networking/iostreams.html +asio/overview/networking/bsd_sockets.html +asio/overview/timers.html +asio/overview/serial_ports.html +asio/overview/signals.html +asio/overview/posix.html +asio/overview/posix/local.html +asio/overview/posix/stream_descriptor.html +asio/overview/posix/fork.html +asio/overview/windows.html +asio/overview/windows/stream_handle.html +asio/overview/windows/random_access_handle.html +asio/overview/windows/object_handle.html +asio/overview/ssl.html +asio/overview/cpp2011.html +asio/overview/cpp2011/system_error.html +asio/overview/cpp2011/move_objects.html +asio/overview/cpp2011/move_handlers.html +asio/overview/cpp2011/variadic.html +asio/overview/cpp2011/array.html +asio/overview/cpp2011/atomic.html +asio/overview/cpp2011/shared_ptr.html +asio/overview/cpp2011/chrono.html +asio/overview/cpp2011/futures.html +asio/overview/implementation.html +asio/using.html +asio/tutorial.html +asio/tutorial/tuttimer1.html +asio/tutorial/tuttimer1/src.html +asio/tutorial/tuttimer2.html +asio/tutorial/tuttimer2/src.html +asio/tutorial/tuttimer3.html +asio/tutorial/tuttimer3/src.html +asio/tutorial/tuttimer4.html +asio/tutorial/tuttimer4/src.html +asio/tutorial/tuttimer5.html +asio/tutorial/tuttimer5/src.html +asio/tutorial/tutdaytime1.html +asio/tutorial/tutdaytime1/src.html +asio/tutorial/tutdaytime2.html +asio/tutorial/tutdaytime2/src.html +asio/tutorial/tutdaytime3.html +asio/tutorial/tutdaytime3/src.html +asio/tutorial/tutdaytime4.html +asio/tutorial/tutdaytime4/src.html +asio/tutorial/tutdaytime5.html +asio/tutorial/tutdaytime5/src.html +asio/tutorial/tutdaytime6.html +asio/tutorial/tutdaytime6/src.html +asio/tutorial/tutdaytime7.html +asio/tutorial/tutdaytime7/src.html +asio/tutorial/boost_bind.html +asio/examples.html +asio/examples/cpp03_examples.html +asio/examples/cpp11_examples.html +asio/examples/cpp14_examples.html +asio/examples/cpp17_examples.html +asio/reference.html +asio/reference/asynchronous_operations.html +asio/reference/read_write_operations.html +asio/reference/synchronous_socket_operations.html +asio/reference/asynchronous_socket_operations.html +asio/reference/AcceptableProtocol.html +asio/reference/AcceptHandler.html +asio/reference/AsyncRandomAccessReadDevice.html +asio/reference/AsyncRandomAccessWriteDevice.html +asio/reference/AsyncReadStream.html +asio/reference/AsyncWriteStream.html +asio/reference/BufferedHandshakeHandler.html +asio/reference/CompletionCondition.html +asio/reference/CompletionHandler.html +asio/reference/ConnectCondition.html +asio/reference/ConnectHandler.html +asio/reference/ConstBufferSequence.html +asio/reference/DynamicBuffer.html +asio/reference/DynamicBuffer_v1.html +asio/reference/DynamicBuffer_v2.html +asio/reference/Endpoint.html +asio/reference/EndpointSequence.html +asio/reference/ExecutionContext.html +asio/reference/Executor1.html +asio/reference/GettableSerialPortOption.html +asio/reference/GettableSocketOption.html +asio/reference/Handler.html +asio/reference/HandshakeHandler.html +asio/reference/InternetProtocol.html +asio/reference/IoControlCommand.html +asio/reference/IoObjectService.html +asio/reference/IteratorConnectHandler.html +asio/reference/LegacyCompletionHandler.html +asio/reference/MoveAcceptHandler.html +asio/reference/MutableBufferSequence.html +asio/reference/OperationState.html +asio/reference/ProtoAllocator.html +asio/reference/Protocol.html +asio/reference/RangeConnectHandler.html +asio/reference/ReadHandler.html +asio/reference/Receiver.html +asio/reference/ResolveHandler.html +asio/reference/Scheduler.html +asio/reference/Sender.html +asio/reference/Service.html +asio/reference/SettableSerialPortOption.html +asio/reference/SettableSocketOption.html +asio/reference/ShutdownHandler.html +asio/reference/SignalHandler.html +asio/reference/SyncRandomAccessReadDevice.html +asio/reference/SyncRandomAccessWriteDevice.html +asio/reference/SyncReadStream.html +asio/reference/SyncWriteStream.html +asio/reference/TimeTraits.html +asio/reference/WaitHandler.html +asio/reference/WaitTraits.html +asio/reference/WriteHandler.html +asio/reference/any_io_executor.html +asio/reference/asio_handler_allocate.html +asio/reference/asio_handler_deallocate.html +asio/reference/asio_handler_invoke.html +asio/reference/asio_handler_invoke/overload1.html +asio/reference/asio_handler_invoke/overload2.html +asio/reference/asio_handler_is_continuation.html +asio/reference/associated_allocator.html +asio/reference/associated_allocator/get.html +asio/reference/associated_allocator/type.html +asio/reference/associated_executor.html +asio/reference/associated_executor/get.html +asio/reference/associated_executor/type.html +asio/reference/async_completion.html +asio/reference/async_completion/async_completion.html +asio/reference/async_completion/completion_handler.html +asio/reference/async_completion/completion_handler_type.html +asio/reference/async_completion/result.html +asio/reference/async_compose.html +asio/reference/async_connect.html +asio/reference/async_connect/overload1.html +asio/reference/async_connect/overload2.html +asio/reference/async_connect/overload3.html +asio/reference/async_connect/overload4.html +asio/reference/async_connect/overload5.html +asio/reference/async_connect/overload6.html +asio/reference/async_initiate.html +asio/reference/async_read.html +asio/reference/async_read/overload1.html +asio/reference/async_read/overload2.html +asio/reference/async_read/overload3.html +asio/reference/async_read/overload4.html +asio/reference/async_read/overload5.html +asio/reference/async_read/overload6.html +asio/reference/async_read/overload7.html +asio/reference/async_read/overload8.html +asio/reference/async_read_at.html +asio/reference/async_read_at/overload1.html +asio/reference/async_read_at/overload2.html +asio/reference/async_read_at/overload3.html +asio/reference/async_read_at/overload4.html +asio/reference/async_read_until.html +asio/reference/async_read_until/overload1.html +asio/reference/async_read_until/overload2.html +asio/reference/async_read_until/overload3.html +asio/reference/async_read_until/overload4.html +asio/reference/async_read_until/overload5.html +asio/reference/async_read_until/overload6.html +asio/reference/async_read_until/overload7.html +asio/reference/async_read_until/overload8.html +asio/reference/async_read_until/overload9.html +asio/reference/async_read_until/overload10.html +asio/reference/async_read_until/overload11.html +asio/reference/async_read_until/overload12.html +asio/reference/async_result.html +asio/reference/async_result/async_result.html +asio/reference/async_result/completion_handler_type.html +asio/reference/async_result/get.html +asio/reference/async_result/initiate.html +asio/reference/async_result/return_type.html +asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_.html +asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/async_result.html +asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/completion_handler_type.html +asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/get.html +asio/reference/async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/return_type.html +asio/reference/async_write.html +asio/reference/async_write/overload1.html +asio/reference/async_write/overload2.html +asio/reference/async_write/overload3.html +asio/reference/async_write/overload4.html +asio/reference/async_write/overload5.html +asio/reference/async_write/overload6.html +asio/reference/async_write/overload7.html +asio/reference/async_write/overload8.html +asio/reference/async_write_at.html +asio/reference/async_write_at/overload1.html +asio/reference/async_write_at/overload2.html +asio/reference/async_write_at/overload3.html +asio/reference/async_write_at/overload4.html +asio/reference/awaitable.html +asio/reference/awaitable/awaitable.html +asio/reference/awaitable/awaitable/overload1.html +asio/reference/awaitable/awaitable/overload2.html +asio/reference/awaitable/executor_type.html +asio/reference/awaitable/valid.html +asio/reference/awaitable/value_type.html +asio/reference/awaitable/_awaitable.html +asio/reference/bad_executor.html +asio/reference/bad_executor/bad_executor.html +asio/reference/bad_executor/what.html +asio/reference/basic_datagram_socket.html +asio/reference/basic_datagram_socket/assign.html +asio/reference/basic_datagram_socket/assign/overload1.html +asio/reference/basic_datagram_socket/assign/overload2.html +asio/reference/basic_datagram_socket/async_connect.html +asio/reference/basic_datagram_socket/async_receive.html +asio/reference/basic_datagram_socket/async_receive/overload1.html +asio/reference/basic_datagram_socket/async_receive/overload2.html +asio/reference/basic_datagram_socket/async_receive_from.html +asio/reference/basic_datagram_socket/async_receive_from/overload1.html +asio/reference/basic_datagram_socket/async_receive_from/overload2.html +asio/reference/basic_datagram_socket/async_send.html +asio/reference/basic_datagram_socket/async_send/overload1.html +asio/reference/basic_datagram_socket/async_send/overload2.html +asio/reference/basic_datagram_socket/async_send_to.html +asio/reference/basic_datagram_socket/async_send_to/overload1.html +asio/reference/basic_datagram_socket/async_send_to/overload2.html +asio/reference/basic_datagram_socket/async_wait.html +asio/reference/basic_datagram_socket/at_mark.html +asio/reference/basic_datagram_socket/at_mark/overload1.html +asio/reference/basic_datagram_socket/at_mark/overload2.html +asio/reference/basic_datagram_socket/available.html +asio/reference/basic_datagram_socket/available/overload1.html +asio/reference/basic_datagram_socket/available/overload2.html +asio/reference/basic_datagram_socket/basic_datagram_socket.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload1.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload2.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload3.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload4.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload5.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload6.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload7.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload8.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload9.html +asio/reference/basic_datagram_socket/basic_datagram_socket/overload10.html +asio/reference/basic_datagram_socket/bind.html +asio/reference/basic_datagram_socket/bind/overload1.html +asio/reference/basic_datagram_socket/bind/overload2.html +asio/reference/basic_datagram_socket/broadcast.html +asio/reference/basic_datagram_socket/bytes_readable.html +asio/reference/basic_datagram_socket/cancel.html +asio/reference/basic_datagram_socket/cancel/overload1.html +asio/reference/basic_datagram_socket/cancel/overload2.html +asio/reference/basic_datagram_socket/close.html +asio/reference/basic_datagram_socket/close/overload1.html +asio/reference/basic_datagram_socket/close/overload2.html +asio/reference/basic_datagram_socket/connect.html +asio/reference/basic_datagram_socket/connect/overload1.html +asio/reference/basic_datagram_socket/connect/overload2.html +asio/reference/basic_datagram_socket/debug.html +asio/reference/basic_datagram_socket/do_not_route.html +asio/reference/basic_datagram_socket/enable_connection_aborted.html +asio/reference/basic_datagram_socket/endpoint_type.html +asio/reference/basic_datagram_socket/executor_type.html +asio/reference/basic_datagram_socket/get_executor.html +asio/reference/basic_datagram_socket/get_option.html +asio/reference/basic_datagram_socket/get_option/overload1.html +asio/reference/basic_datagram_socket/get_option/overload2.html +asio/reference/basic_datagram_socket/io_control.html +asio/reference/basic_datagram_socket/io_control/overload1.html +asio/reference/basic_datagram_socket/io_control/overload2.html +asio/reference/basic_datagram_socket/is_open.html +asio/reference/basic_datagram_socket/keep_alive.html +asio/reference/basic_datagram_socket/linger.html +asio/reference/basic_datagram_socket/local_endpoint.html +asio/reference/basic_datagram_socket/local_endpoint/overload1.html +asio/reference/basic_datagram_socket/local_endpoint/overload2.html +asio/reference/basic_datagram_socket/lowest_layer.html +asio/reference/basic_datagram_socket/lowest_layer/overload1.html +asio/reference/basic_datagram_socket/lowest_layer/overload2.html +asio/reference/basic_datagram_socket/lowest_layer_type.html +asio/reference/basic_datagram_socket/max_connections.html +asio/reference/basic_datagram_socket/max_listen_connections.html +asio/reference/basic_datagram_socket/message_do_not_route.html +asio/reference/basic_datagram_socket/message_end_of_record.html +asio/reference/basic_datagram_socket/message_flags.html +asio/reference/basic_datagram_socket/message_out_of_band.html +asio/reference/basic_datagram_socket/message_peek.html +asio/reference/basic_datagram_socket/native_handle.html +asio/reference/basic_datagram_socket/native_handle_type.html +asio/reference/basic_datagram_socket/native_non_blocking.html +asio/reference/basic_datagram_socket/native_non_blocking/overload1.html +asio/reference/basic_datagram_socket/native_non_blocking/overload2.html +asio/reference/basic_datagram_socket/native_non_blocking/overload3.html +asio/reference/basic_datagram_socket/non_blocking.html +asio/reference/basic_datagram_socket/non_blocking/overload1.html +asio/reference/basic_datagram_socket/non_blocking/overload2.html +asio/reference/basic_datagram_socket/non_blocking/overload3.html +asio/reference/basic_datagram_socket/open.html +asio/reference/basic_datagram_socket/open/overload1.html +asio/reference/basic_datagram_socket/open/overload2.html +asio/reference/basic_datagram_socket/operator_eq_.html +asio/reference/basic_datagram_socket/operator_eq_/overload1.html +asio/reference/basic_datagram_socket/operator_eq_/overload2.html +asio/reference/basic_datagram_socket/out_of_band_inline.html +asio/reference/basic_datagram_socket/protocol_type.html +asio/reference/basic_datagram_socket/receive.html +asio/reference/basic_datagram_socket/receive/overload1.html +asio/reference/basic_datagram_socket/receive/overload2.html +asio/reference/basic_datagram_socket/receive/overload3.html +asio/reference/basic_datagram_socket/receive_buffer_size.html +asio/reference/basic_datagram_socket/receive_from.html +asio/reference/basic_datagram_socket/receive_from/overload1.html +asio/reference/basic_datagram_socket/receive_from/overload2.html +asio/reference/basic_datagram_socket/receive_from/overload3.html +asio/reference/basic_datagram_socket/receive_low_watermark.html +asio/reference/basic_datagram_socket/release.html +asio/reference/basic_datagram_socket/release/overload1.html +asio/reference/basic_datagram_socket/release/overload2.html +asio/reference/basic_datagram_socket/remote_endpoint.html +asio/reference/basic_datagram_socket/remote_endpoint/overload1.html +asio/reference/basic_datagram_socket/remote_endpoint/overload2.html +asio/reference/basic_datagram_socket/reuse_address.html +asio/reference/basic_datagram_socket/send.html +asio/reference/basic_datagram_socket/send/overload1.html +asio/reference/basic_datagram_socket/send/overload2.html +asio/reference/basic_datagram_socket/send/overload3.html +asio/reference/basic_datagram_socket/send_buffer_size.html +asio/reference/basic_datagram_socket/send_low_watermark.html +asio/reference/basic_datagram_socket/send_to.html +asio/reference/basic_datagram_socket/send_to/overload1.html +asio/reference/basic_datagram_socket/send_to/overload2.html +asio/reference/basic_datagram_socket/send_to/overload3.html +asio/reference/basic_datagram_socket/set_option.html +asio/reference/basic_datagram_socket/set_option/overload1.html +asio/reference/basic_datagram_socket/set_option/overload2.html +asio/reference/basic_datagram_socket/shutdown.html +asio/reference/basic_datagram_socket/shutdown/overload1.html +asio/reference/basic_datagram_socket/shutdown/overload2.html +asio/reference/basic_datagram_socket/shutdown_type.html +asio/reference/basic_datagram_socket/wait.html +asio/reference/basic_datagram_socket/wait/overload1.html +asio/reference/basic_datagram_socket/wait/overload2.html +asio/reference/basic_datagram_socket/wait_type.html +asio/reference/basic_datagram_socket/_basic_datagram_socket.html +asio/reference/basic_datagram_socket__rebind_executor.html +asio/reference/basic_datagram_socket__rebind_executor/other.html +asio/reference/basic_deadline_timer.html +asio/reference/basic_deadline_timer/async_wait.html +asio/reference/basic_deadline_timer/basic_deadline_timer.html +asio/reference/basic_deadline_timer/basic_deadline_timer/overload1.html +asio/reference/basic_deadline_timer/basic_deadline_timer/overload2.html +asio/reference/basic_deadline_timer/basic_deadline_timer/overload3.html +asio/reference/basic_deadline_timer/basic_deadline_timer/overload4.html +asio/reference/basic_deadline_timer/basic_deadline_timer/overload5.html +asio/reference/basic_deadline_timer/basic_deadline_timer/overload6.html +asio/reference/basic_deadline_timer/basic_deadline_timer/overload7.html +asio/reference/basic_deadline_timer/cancel.html +asio/reference/basic_deadline_timer/cancel/overload1.html +asio/reference/basic_deadline_timer/cancel/overload2.html +asio/reference/basic_deadline_timer/cancel_one.html +asio/reference/basic_deadline_timer/cancel_one/overload1.html +asio/reference/basic_deadline_timer/cancel_one/overload2.html +asio/reference/basic_deadline_timer/duration_type.html +asio/reference/basic_deadline_timer/executor_type.html +asio/reference/basic_deadline_timer/expires_at.html +asio/reference/basic_deadline_timer/expires_at/overload1.html +asio/reference/basic_deadline_timer/expires_at/overload2.html +asio/reference/basic_deadline_timer/expires_at/overload3.html +asio/reference/basic_deadline_timer/expires_from_now.html +asio/reference/basic_deadline_timer/expires_from_now/overload1.html +asio/reference/basic_deadline_timer/expires_from_now/overload2.html +asio/reference/basic_deadline_timer/expires_from_now/overload3.html +asio/reference/basic_deadline_timer/get_executor.html +asio/reference/basic_deadline_timer/operator_eq_.html +asio/reference/basic_deadline_timer/time_type.html +asio/reference/basic_deadline_timer/traits_type.html +asio/reference/basic_deadline_timer/wait.html +asio/reference/basic_deadline_timer/wait/overload1.html +asio/reference/basic_deadline_timer/wait/overload2.html +asio/reference/basic_deadline_timer/_basic_deadline_timer.html +asio/reference/basic_deadline_timer__rebind_executor.html +asio/reference/basic_deadline_timer__rebind_executor/other.html +asio/reference/basic_io_object.html +asio/reference/basic_io_object/basic_io_object.html +asio/reference/basic_io_object/basic_io_object/overload1.html +asio/reference/basic_io_object/basic_io_object/overload2.html +asio/reference/basic_io_object/basic_io_object/overload3.html +asio/reference/basic_io_object/executor_type.html +asio/reference/basic_io_object/get_executor.html +asio/reference/basic_io_object/get_implementation.html +asio/reference/basic_io_object/get_implementation/overload1.html +asio/reference/basic_io_object/get_implementation/overload2.html +asio/reference/basic_io_object/get_io_context.html +asio/reference/basic_io_object/get_io_service.html +asio/reference/basic_io_object/get_service.html +asio/reference/basic_io_object/get_service/overload1.html +asio/reference/basic_io_object/get_service/overload2.html +asio/reference/basic_io_object/implementation_type.html +asio/reference/basic_io_object/operator_eq_.html +asio/reference/basic_io_object/service_type.html +asio/reference/basic_io_object/_basic_io_object.html +asio/reference/basic_raw_socket.html +asio/reference/basic_raw_socket/assign.html +asio/reference/basic_raw_socket/assign/overload1.html +asio/reference/basic_raw_socket/assign/overload2.html +asio/reference/basic_raw_socket/async_connect.html +asio/reference/basic_raw_socket/async_receive.html +asio/reference/basic_raw_socket/async_receive/overload1.html +asio/reference/basic_raw_socket/async_receive/overload2.html +asio/reference/basic_raw_socket/async_receive_from.html +asio/reference/basic_raw_socket/async_receive_from/overload1.html +asio/reference/basic_raw_socket/async_receive_from/overload2.html +asio/reference/basic_raw_socket/async_send.html +asio/reference/basic_raw_socket/async_send/overload1.html +asio/reference/basic_raw_socket/async_send/overload2.html +asio/reference/basic_raw_socket/async_send_to.html +asio/reference/basic_raw_socket/async_send_to/overload1.html +asio/reference/basic_raw_socket/async_send_to/overload2.html +asio/reference/basic_raw_socket/async_wait.html +asio/reference/basic_raw_socket/at_mark.html +asio/reference/basic_raw_socket/at_mark/overload1.html +asio/reference/basic_raw_socket/at_mark/overload2.html +asio/reference/basic_raw_socket/available.html +asio/reference/basic_raw_socket/available/overload1.html +asio/reference/basic_raw_socket/available/overload2.html +asio/reference/basic_raw_socket/basic_raw_socket.html +asio/reference/basic_raw_socket/basic_raw_socket/overload1.html +asio/reference/basic_raw_socket/basic_raw_socket/overload2.html +asio/reference/basic_raw_socket/basic_raw_socket/overload3.html +asio/reference/basic_raw_socket/basic_raw_socket/overload4.html +asio/reference/basic_raw_socket/basic_raw_socket/overload5.html +asio/reference/basic_raw_socket/basic_raw_socket/overload6.html +asio/reference/basic_raw_socket/basic_raw_socket/overload7.html +asio/reference/basic_raw_socket/basic_raw_socket/overload8.html +asio/reference/basic_raw_socket/basic_raw_socket/overload9.html +asio/reference/basic_raw_socket/basic_raw_socket/overload10.html +asio/reference/basic_raw_socket/bind.html +asio/reference/basic_raw_socket/bind/overload1.html +asio/reference/basic_raw_socket/bind/overload2.html +asio/reference/basic_raw_socket/broadcast.html +asio/reference/basic_raw_socket/bytes_readable.html +asio/reference/basic_raw_socket/cancel.html +asio/reference/basic_raw_socket/cancel/overload1.html +asio/reference/basic_raw_socket/cancel/overload2.html +asio/reference/basic_raw_socket/close.html +asio/reference/basic_raw_socket/close/overload1.html +asio/reference/basic_raw_socket/close/overload2.html +asio/reference/basic_raw_socket/connect.html +asio/reference/basic_raw_socket/connect/overload1.html +asio/reference/basic_raw_socket/connect/overload2.html +asio/reference/basic_raw_socket/debug.html +asio/reference/basic_raw_socket/do_not_route.html +asio/reference/basic_raw_socket/enable_connection_aborted.html +asio/reference/basic_raw_socket/endpoint_type.html +asio/reference/basic_raw_socket/executor_type.html +asio/reference/basic_raw_socket/get_executor.html +asio/reference/basic_raw_socket/get_option.html +asio/reference/basic_raw_socket/get_option/overload1.html +asio/reference/basic_raw_socket/get_option/overload2.html +asio/reference/basic_raw_socket/io_control.html +asio/reference/basic_raw_socket/io_control/overload1.html +asio/reference/basic_raw_socket/io_control/overload2.html +asio/reference/basic_raw_socket/is_open.html +asio/reference/basic_raw_socket/keep_alive.html +asio/reference/basic_raw_socket/linger.html +asio/reference/basic_raw_socket/local_endpoint.html +asio/reference/basic_raw_socket/local_endpoint/overload1.html +asio/reference/basic_raw_socket/local_endpoint/overload2.html +asio/reference/basic_raw_socket/lowest_layer.html +asio/reference/basic_raw_socket/lowest_layer/overload1.html +asio/reference/basic_raw_socket/lowest_layer/overload2.html +asio/reference/basic_raw_socket/lowest_layer_type.html +asio/reference/basic_raw_socket/max_connections.html +asio/reference/basic_raw_socket/max_listen_connections.html +asio/reference/basic_raw_socket/message_do_not_route.html +asio/reference/basic_raw_socket/message_end_of_record.html +asio/reference/basic_raw_socket/message_flags.html +asio/reference/basic_raw_socket/message_out_of_band.html +asio/reference/basic_raw_socket/message_peek.html +asio/reference/basic_raw_socket/native_handle.html +asio/reference/basic_raw_socket/native_handle_type.html +asio/reference/basic_raw_socket/native_non_blocking.html +asio/reference/basic_raw_socket/native_non_blocking/overload1.html +asio/reference/basic_raw_socket/native_non_blocking/overload2.html +asio/reference/basic_raw_socket/native_non_blocking/overload3.html +asio/reference/basic_raw_socket/non_blocking.html +asio/reference/basic_raw_socket/non_blocking/overload1.html +asio/reference/basic_raw_socket/non_blocking/overload2.html +asio/reference/basic_raw_socket/non_blocking/overload3.html +asio/reference/basic_raw_socket/open.html +asio/reference/basic_raw_socket/open/overload1.html +asio/reference/basic_raw_socket/open/overload2.html +asio/reference/basic_raw_socket/operator_eq_.html +asio/reference/basic_raw_socket/operator_eq_/overload1.html +asio/reference/basic_raw_socket/operator_eq_/overload2.html +asio/reference/basic_raw_socket/out_of_band_inline.html +asio/reference/basic_raw_socket/protocol_type.html +asio/reference/basic_raw_socket/receive.html +asio/reference/basic_raw_socket/receive/overload1.html +asio/reference/basic_raw_socket/receive/overload2.html +asio/reference/basic_raw_socket/receive/overload3.html +asio/reference/basic_raw_socket/receive_buffer_size.html +asio/reference/basic_raw_socket/receive_from.html +asio/reference/basic_raw_socket/receive_from/overload1.html +asio/reference/basic_raw_socket/receive_from/overload2.html +asio/reference/basic_raw_socket/receive_from/overload3.html +asio/reference/basic_raw_socket/receive_low_watermark.html +asio/reference/basic_raw_socket/release.html +asio/reference/basic_raw_socket/release/overload1.html +asio/reference/basic_raw_socket/release/overload2.html +asio/reference/basic_raw_socket/remote_endpoint.html +asio/reference/basic_raw_socket/remote_endpoint/overload1.html +asio/reference/basic_raw_socket/remote_endpoint/overload2.html +asio/reference/basic_raw_socket/reuse_address.html +asio/reference/basic_raw_socket/send.html +asio/reference/basic_raw_socket/send/overload1.html +asio/reference/basic_raw_socket/send/overload2.html +asio/reference/basic_raw_socket/send/overload3.html +asio/reference/basic_raw_socket/send_buffer_size.html +asio/reference/basic_raw_socket/send_low_watermark.html +asio/reference/basic_raw_socket/send_to.html +asio/reference/basic_raw_socket/send_to/overload1.html +asio/reference/basic_raw_socket/send_to/overload2.html +asio/reference/basic_raw_socket/send_to/overload3.html +asio/reference/basic_raw_socket/set_option.html +asio/reference/basic_raw_socket/set_option/overload1.html +asio/reference/basic_raw_socket/set_option/overload2.html +asio/reference/basic_raw_socket/shutdown.html +asio/reference/basic_raw_socket/shutdown/overload1.html +asio/reference/basic_raw_socket/shutdown/overload2.html +asio/reference/basic_raw_socket/shutdown_type.html +asio/reference/basic_raw_socket/wait.html +asio/reference/basic_raw_socket/wait/overload1.html +asio/reference/basic_raw_socket/wait/overload2.html +asio/reference/basic_raw_socket/wait_type.html +asio/reference/basic_raw_socket/_basic_raw_socket.html +asio/reference/basic_raw_socket__rebind_executor.html +asio/reference/basic_raw_socket__rebind_executor/other.html +asio/reference/basic_seq_packet_socket.html +asio/reference/basic_seq_packet_socket/assign.html +asio/reference/basic_seq_packet_socket/assign/overload1.html +asio/reference/basic_seq_packet_socket/assign/overload2.html +asio/reference/basic_seq_packet_socket/async_connect.html +asio/reference/basic_seq_packet_socket/async_receive.html +asio/reference/basic_seq_packet_socket/async_receive/overload1.html +asio/reference/basic_seq_packet_socket/async_receive/overload2.html +asio/reference/basic_seq_packet_socket/async_send.html +asio/reference/basic_seq_packet_socket/async_wait.html +asio/reference/basic_seq_packet_socket/at_mark.html +asio/reference/basic_seq_packet_socket/at_mark/overload1.html +asio/reference/basic_seq_packet_socket/at_mark/overload2.html +asio/reference/basic_seq_packet_socket/available.html +asio/reference/basic_seq_packet_socket/available/overload1.html +asio/reference/basic_seq_packet_socket/available/overload2.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload1.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload2.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload3.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload4.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload5.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload6.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload7.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload8.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload9.html +asio/reference/basic_seq_packet_socket/basic_seq_packet_socket/overload10.html +asio/reference/basic_seq_packet_socket/bind.html +asio/reference/basic_seq_packet_socket/bind/overload1.html +asio/reference/basic_seq_packet_socket/bind/overload2.html +asio/reference/basic_seq_packet_socket/broadcast.html +asio/reference/basic_seq_packet_socket/bytes_readable.html +asio/reference/basic_seq_packet_socket/cancel.html +asio/reference/basic_seq_packet_socket/cancel/overload1.html +asio/reference/basic_seq_packet_socket/cancel/overload2.html +asio/reference/basic_seq_packet_socket/close.html +asio/reference/basic_seq_packet_socket/close/overload1.html +asio/reference/basic_seq_packet_socket/close/overload2.html +asio/reference/basic_seq_packet_socket/connect.html +asio/reference/basic_seq_packet_socket/connect/overload1.html +asio/reference/basic_seq_packet_socket/connect/overload2.html +asio/reference/basic_seq_packet_socket/debug.html +asio/reference/basic_seq_packet_socket/do_not_route.html +asio/reference/basic_seq_packet_socket/enable_connection_aborted.html +asio/reference/basic_seq_packet_socket/endpoint_type.html +asio/reference/basic_seq_packet_socket/executor_type.html +asio/reference/basic_seq_packet_socket/get_executor.html +asio/reference/basic_seq_packet_socket/get_option.html +asio/reference/basic_seq_packet_socket/get_option/overload1.html +asio/reference/basic_seq_packet_socket/get_option/overload2.html +asio/reference/basic_seq_packet_socket/io_control.html +asio/reference/basic_seq_packet_socket/io_control/overload1.html +asio/reference/basic_seq_packet_socket/io_control/overload2.html +asio/reference/basic_seq_packet_socket/is_open.html +asio/reference/basic_seq_packet_socket/keep_alive.html +asio/reference/basic_seq_packet_socket/linger.html +asio/reference/basic_seq_packet_socket/local_endpoint.html +asio/reference/basic_seq_packet_socket/local_endpoint/overload1.html +asio/reference/basic_seq_packet_socket/local_endpoint/overload2.html +asio/reference/basic_seq_packet_socket/lowest_layer.html +asio/reference/basic_seq_packet_socket/lowest_layer/overload1.html +asio/reference/basic_seq_packet_socket/lowest_layer/overload2.html +asio/reference/basic_seq_packet_socket/lowest_layer_type.html +asio/reference/basic_seq_packet_socket/max_connections.html +asio/reference/basic_seq_packet_socket/max_listen_connections.html +asio/reference/basic_seq_packet_socket/message_do_not_route.html +asio/reference/basic_seq_packet_socket/message_end_of_record.html +asio/reference/basic_seq_packet_socket/message_flags.html +asio/reference/basic_seq_packet_socket/message_out_of_band.html +asio/reference/basic_seq_packet_socket/message_peek.html +asio/reference/basic_seq_packet_socket/native_handle.html +asio/reference/basic_seq_packet_socket/native_handle_type.html +asio/reference/basic_seq_packet_socket/native_non_blocking.html +asio/reference/basic_seq_packet_socket/native_non_blocking/overload1.html +asio/reference/basic_seq_packet_socket/native_non_blocking/overload2.html +asio/reference/basic_seq_packet_socket/native_non_blocking/overload3.html +asio/reference/basic_seq_packet_socket/non_blocking.html +asio/reference/basic_seq_packet_socket/non_blocking/overload1.html +asio/reference/basic_seq_packet_socket/non_blocking/overload2.html +asio/reference/basic_seq_packet_socket/non_blocking/overload3.html +asio/reference/basic_seq_packet_socket/open.html +asio/reference/basic_seq_packet_socket/open/overload1.html +asio/reference/basic_seq_packet_socket/open/overload2.html +asio/reference/basic_seq_packet_socket/operator_eq_.html +asio/reference/basic_seq_packet_socket/operator_eq_/overload1.html +asio/reference/basic_seq_packet_socket/operator_eq_/overload2.html +asio/reference/basic_seq_packet_socket/out_of_band_inline.html +asio/reference/basic_seq_packet_socket/protocol_type.html +asio/reference/basic_seq_packet_socket/receive.html +asio/reference/basic_seq_packet_socket/receive/overload1.html +asio/reference/basic_seq_packet_socket/receive/overload2.html +asio/reference/basic_seq_packet_socket/receive/overload3.html +asio/reference/basic_seq_packet_socket/receive_buffer_size.html +asio/reference/basic_seq_packet_socket/receive_low_watermark.html +asio/reference/basic_seq_packet_socket/release.html +asio/reference/basic_seq_packet_socket/release/overload1.html +asio/reference/basic_seq_packet_socket/release/overload2.html +asio/reference/basic_seq_packet_socket/remote_endpoint.html +asio/reference/basic_seq_packet_socket/remote_endpoint/overload1.html +asio/reference/basic_seq_packet_socket/remote_endpoint/overload2.html +asio/reference/basic_seq_packet_socket/reuse_address.html +asio/reference/basic_seq_packet_socket/send.html +asio/reference/basic_seq_packet_socket/send/overload1.html +asio/reference/basic_seq_packet_socket/send/overload2.html +asio/reference/basic_seq_packet_socket/send_buffer_size.html +asio/reference/basic_seq_packet_socket/send_low_watermark.html +asio/reference/basic_seq_packet_socket/set_option.html +asio/reference/basic_seq_packet_socket/set_option/overload1.html +asio/reference/basic_seq_packet_socket/set_option/overload2.html +asio/reference/basic_seq_packet_socket/shutdown.html +asio/reference/basic_seq_packet_socket/shutdown/overload1.html +asio/reference/basic_seq_packet_socket/shutdown/overload2.html +asio/reference/basic_seq_packet_socket/shutdown_type.html +asio/reference/basic_seq_packet_socket/wait.html +asio/reference/basic_seq_packet_socket/wait/overload1.html +asio/reference/basic_seq_packet_socket/wait/overload2.html +asio/reference/basic_seq_packet_socket/wait_type.html +asio/reference/basic_seq_packet_socket/_basic_seq_packet_socket.html +asio/reference/basic_seq_packet_socket__rebind_executor.html +asio/reference/basic_seq_packet_socket__rebind_executor/other.html +asio/reference/basic_serial_port.html +asio/reference/basic_serial_port/assign.html +asio/reference/basic_serial_port/assign/overload1.html +asio/reference/basic_serial_port/assign/overload2.html +asio/reference/basic_serial_port/async_read_some.html +asio/reference/basic_serial_port/async_write_some.html +asio/reference/basic_serial_port/basic_serial_port.html +asio/reference/basic_serial_port/basic_serial_port/overload1.html +asio/reference/basic_serial_port/basic_serial_port/overload2.html +asio/reference/basic_serial_port/basic_serial_port/overload3.html +asio/reference/basic_serial_port/basic_serial_port/overload4.html +asio/reference/basic_serial_port/basic_serial_port/overload5.html +asio/reference/basic_serial_port/basic_serial_port/overload6.html +asio/reference/basic_serial_port/basic_serial_port/overload7.html +asio/reference/basic_serial_port/basic_serial_port/overload8.html +asio/reference/basic_serial_port/basic_serial_port/overload9.html +asio/reference/basic_serial_port/cancel.html +asio/reference/basic_serial_port/cancel/overload1.html +asio/reference/basic_serial_port/cancel/overload2.html +asio/reference/basic_serial_port/close.html +asio/reference/basic_serial_port/close/overload1.html +asio/reference/basic_serial_port/close/overload2.html +asio/reference/basic_serial_port/executor_type.html +asio/reference/basic_serial_port/get_executor.html +asio/reference/basic_serial_port/get_option.html +asio/reference/basic_serial_port/get_option/overload1.html +asio/reference/basic_serial_port/get_option/overload2.html +asio/reference/basic_serial_port/is_open.html +asio/reference/basic_serial_port/lowest_layer.html +asio/reference/basic_serial_port/lowest_layer/overload1.html +asio/reference/basic_serial_port/lowest_layer/overload2.html +asio/reference/basic_serial_port/lowest_layer_type.html +asio/reference/basic_serial_port/native_handle.html +asio/reference/basic_serial_port/native_handle_type.html +asio/reference/basic_serial_port/open.html +asio/reference/basic_serial_port/open/overload1.html +asio/reference/basic_serial_port/open/overload2.html +asio/reference/basic_serial_port/operator_eq_.html +asio/reference/basic_serial_port/read_some.html +asio/reference/basic_serial_port/read_some/overload1.html +asio/reference/basic_serial_port/read_some/overload2.html +asio/reference/basic_serial_port/send_break.html +asio/reference/basic_serial_port/send_break/overload1.html +asio/reference/basic_serial_port/send_break/overload2.html +asio/reference/basic_serial_port/set_option.html +asio/reference/basic_serial_port/set_option/overload1.html +asio/reference/basic_serial_port/set_option/overload2.html +asio/reference/basic_serial_port/write_some.html +asio/reference/basic_serial_port/write_some/overload1.html +asio/reference/basic_serial_port/write_some/overload2.html +asio/reference/basic_serial_port/_basic_serial_port.html +asio/reference/basic_serial_port__rebind_executor.html +asio/reference/basic_serial_port__rebind_executor/other.html +asio/reference/basic_signal_set.html +asio/reference/basic_signal_set/add.html +asio/reference/basic_signal_set/add/overload1.html +asio/reference/basic_signal_set/add/overload2.html +asio/reference/basic_signal_set/async_wait.html +asio/reference/basic_signal_set/basic_signal_set.html +asio/reference/basic_signal_set/basic_signal_set/overload1.html +asio/reference/basic_signal_set/basic_signal_set/overload2.html +asio/reference/basic_signal_set/basic_signal_set/overload3.html +asio/reference/basic_signal_set/basic_signal_set/overload4.html +asio/reference/basic_signal_set/basic_signal_set/overload5.html +asio/reference/basic_signal_set/basic_signal_set/overload6.html +asio/reference/basic_signal_set/basic_signal_set/overload7.html +asio/reference/basic_signal_set/basic_signal_set/overload8.html +asio/reference/basic_signal_set/cancel.html +asio/reference/basic_signal_set/cancel/overload1.html +asio/reference/basic_signal_set/cancel/overload2.html +asio/reference/basic_signal_set/clear.html +asio/reference/basic_signal_set/clear/overload1.html +asio/reference/basic_signal_set/clear/overload2.html +asio/reference/basic_signal_set/executor_type.html +asio/reference/basic_signal_set/get_executor.html +asio/reference/basic_signal_set/remove.html +asio/reference/basic_signal_set/remove/overload1.html +asio/reference/basic_signal_set/remove/overload2.html +asio/reference/basic_signal_set/_basic_signal_set.html +asio/reference/basic_signal_set__rebind_executor.html +asio/reference/basic_signal_set__rebind_executor/other.html +asio/reference/basic_socket.html +asio/reference/basic_socket/assign.html +asio/reference/basic_socket/assign/overload1.html +asio/reference/basic_socket/assign/overload2.html +asio/reference/basic_socket/async_connect.html +asio/reference/basic_socket/async_wait.html +asio/reference/basic_socket/at_mark.html +asio/reference/basic_socket/at_mark/overload1.html +asio/reference/basic_socket/at_mark/overload2.html +asio/reference/basic_socket/available.html +asio/reference/basic_socket/available/overload1.html +asio/reference/basic_socket/available/overload2.html +asio/reference/basic_socket/basic_socket.html +asio/reference/basic_socket/basic_socket/overload1.html +asio/reference/basic_socket/basic_socket/overload2.html +asio/reference/basic_socket/basic_socket/overload3.html +asio/reference/basic_socket/basic_socket/overload4.html +asio/reference/basic_socket/basic_socket/overload5.html +asio/reference/basic_socket/basic_socket/overload6.html +asio/reference/basic_socket/basic_socket/overload7.html +asio/reference/basic_socket/basic_socket/overload8.html +asio/reference/basic_socket/basic_socket/overload9.html +asio/reference/basic_socket/basic_socket/overload10.html +asio/reference/basic_socket/bind.html +asio/reference/basic_socket/bind/overload1.html +asio/reference/basic_socket/bind/overload2.html +asio/reference/basic_socket/broadcast.html +asio/reference/basic_socket/bytes_readable.html +asio/reference/basic_socket/cancel.html +asio/reference/basic_socket/cancel/overload1.html +asio/reference/basic_socket/cancel/overload2.html +asio/reference/basic_socket/close.html +asio/reference/basic_socket/close/overload1.html +asio/reference/basic_socket/close/overload2.html +asio/reference/basic_socket/connect.html +asio/reference/basic_socket/connect/overload1.html +asio/reference/basic_socket/connect/overload2.html +asio/reference/basic_socket/debug.html +asio/reference/basic_socket/do_not_route.html +asio/reference/basic_socket/enable_connection_aborted.html +asio/reference/basic_socket/endpoint_type.html +asio/reference/basic_socket/executor_type.html +asio/reference/basic_socket/get_executor.html +asio/reference/basic_socket/get_option.html +asio/reference/basic_socket/get_option/overload1.html +asio/reference/basic_socket/get_option/overload2.html +asio/reference/basic_socket/io_control.html +asio/reference/basic_socket/io_control/overload1.html +asio/reference/basic_socket/io_control/overload2.html +asio/reference/basic_socket/is_open.html +asio/reference/basic_socket/keep_alive.html +asio/reference/basic_socket/linger.html +asio/reference/basic_socket/local_endpoint.html +asio/reference/basic_socket/local_endpoint/overload1.html +asio/reference/basic_socket/local_endpoint/overload2.html +asio/reference/basic_socket/lowest_layer.html +asio/reference/basic_socket/lowest_layer/overload1.html +asio/reference/basic_socket/lowest_layer/overload2.html +asio/reference/basic_socket/lowest_layer_type.html +asio/reference/basic_socket/max_connections.html +asio/reference/basic_socket/max_listen_connections.html +asio/reference/basic_socket/message_do_not_route.html +asio/reference/basic_socket/message_end_of_record.html +asio/reference/basic_socket/message_flags.html +asio/reference/basic_socket/message_out_of_band.html +asio/reference/basic_socket/message_peek.html +asio/reference/basic_socket/native_handle.html +asio/reference/basic_socket/native_handle_type.html +asio/reference/basic_socket/native_non_blocking.html +asio/reference/basic_socket/native_non_blocking/overload1.html +asio/reference/basic_socket/native_non_blocking/overload2.html +asio/reference/basic_socket/native_non_blocking/overload3.html +asio/reference/basic_socket/non_blocking.html +asio/reference/basic_socket/non_blocking/overload1.html +asio/reference/basic_socket/non_blocking/overload2.html +asio/reference/basic_socket/non_blocking/overload3.html +asio/reference/basic_socket/open.html +asio/reference/basic_socket/open/overload1.html +asio/reference/basic_socket/open/overload2.html +asio/reference/basic_socket/operator_eq_.html +asio/reference/basic_socket/operator_eq_/overload1.html +asio/reference/basic_socket/operator_eq_/overload2.html +asio/reference/basic_socket/out_of_band_inline.html +asio/reference/basic_socket/protocol_type.html +asio/reference/basic_socket/receive_buffer_size.html +asio/reference/basic_socket/receive_low_watermark.html +asio/reference/basic_socket/release.html +asio/reference/basic_socket/release/overload1.html +asio/reference/basic_socket/release/overload2.html +asio/reference/basic_socket/remote_endpoint.html +asio/reference/basic_socket/remote_endpoint/overload1.html +asio/reference/basic_socket/remote_endpoint/overload2.html +asio/reference/basic_socket/reuse_address.html +asio/reference/basic_socket/send_buffer_size.html +asio/reference/basic_socket/send_low_watermark.html +asio/reference/basic_socket/set_option.html +asio/reference/basic_socket/set_option/overload1.html +asio/reference/basic_socket/set_option/overload2.html +asio/reference/basic_socket/shutdown.html +asio/reference/basic_socket/shutdown/overload1.html +asio/reference/basic_socket/shutdown/overload2.html +asio/reference/basic_socket/shutdown_type.html +asio/reference/basic_socket/wait.html +asio/reference/basic_socket/wait/overload1.html +asio/reference/basic_socket/wait/overload2.html +asio/reference/basic_socket/wait_type.html +asio/reference/basic_socket/_basic_socket.html +asio/reference/basic_socket__rebind_executor.html +asio/reference/basic_socket__rebind_executor/other.html +asio/reference/basic_socket_acceptor.html +asio/reference/basic_socket_acceptor/accept.html +asio/reference/basic_socket_acceptor/accept/overload1.html +asio/reference/basic_socket_acceptor/accept/overload2.html +asio/reference/basic_socket_acceptor/accept/overload3.html +asio/reference/basic_socket_acceptor/accept/overload4.html +asio/reference/basic_socket_acceptor/accept/overload5.html +asio/reference/basic_socket_acceptor/accept/overload6.html +asio/reference/basic_socket_acceptor/accept/overload7.html +asio/reference/basic_socket_acceptor/accept/overload8.html +asio/reference/basic_socket_acceptor/accept/overload9.html +asio/reference/basic_socket_acceptor/accept/overload10.html +asio/reference/basic_socket_acceptor/accept/overload11.html +asio/reference/basic_socket_acceptor/accept/overload12.html +asio/reference/basic_socket_acceptor/accept/overload13.html +asio/reference/basic_socket_acceptor/accept/overload14.html +asio/reference/basic_socket_acceptor/accept/overload15.html +asio/reference/basic_socket_acceptor/accept/overload16.html +asio/reference/basic_socket_acceptor/assign.html +asio/reference/basic_socket_acceptor/assign/overload1.html +asio/reference/basic_socket_acceptor/assign/overload2.html +asio/reference/basic_socket_acceptor/async_accept.html +asio/reference/basic_socket_acceptor/async_accept/overload1.html +asio/reference/basic_socket_acceptor/async_accept/overload2.html +asio/reference/basic_socket_acceptor/async_accept/overload3.html +asio/reference/basic_socket_acceptor/async_accept/overload4.html +asio/reference/basic_socket_acceptor/async_accept/overload5.html +asio/reference/basic_socket_acceptor/async_accept/overload6.html +asio/reference/basic_socket_acceptor/async_accept/overload7.html +asio/reference/basic_socket_acceptor/async_accept/overload8.html +asio/reference/basic_socket_acceptor/async_wait.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload1.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload2.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload3.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload4.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload5.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload6.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload7.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload8.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload9.html +asio/reference/basic_socket_acceptor/basic_socket_acceptor/overload10.html +asio/reference/basic_socket_acceptor/bind.html +asio/reference/basic_socket_acceptor/bind/overload1.html +asio/reference/basic_socket_acceptor/bind/overload2.html +asio/reference/basic_socket_acceptor/broadcast.html +asio/reference/basic_socket_acceptor/bytes_readable.html +asio/reference/basic_socket_acceptor/cancel.html +asio/reference/basic_socket_acceptor/cancel/overload1.html +asio/reference/basic_socket_acceptor/cancel/overload2.html +asio/reference/basic_socket_acceptor/close.html +asio/reference/basic_socket_acceptor/close/overload1.html +asio/reference/basic_socket_acceptor/close/overload2.html +asio/reference/basic_socket_acceptor/debug.html +asio/reference/basic_socket_acceptor/do_not_route.html +asio/reference/basic_socket_acceptor/enable_connection_aborted.html +asio/reference/basic_socket_acceptor/endpoint_type.html +asio/reference/basic_socket_acceptor/executor_type.html +asio/reference/basic_socket_acceptor/get_executor.html +asio/reference/basic_socket_acceptor/get_option.html +asio/reference/basic_socket_acceptor/get_option/overload1.html +asio/reference/basic_socket_acceptor/get_option/overload2.html +asio/reference/basic_socket_acceptor/io_control.html +asio/reference/basic_socket_acceptor/io_control/overload1.html +asio/reference/basic_socket_acceptor/io_control/overload2.html +asio/reference/basic_socket_acceptor/is_open.html +asio/reference/basic_socket_acceptor/keep_alive.html +asio/reference/basic_socket_acceptor/linger.html +asio/reference/basic_socket_acceptor/listen.html +asio/reference/basic_socket_acceptor/listen/overload1.html +asio/reference/basic_socket_acceptor/listen/overload2.html +asio/reference/basic_socket_acceptor/local_endpoint.html +asio/reference/basic_socket_acceptor/local_endpoint/overload1.html +asio/reference/basic_socket_acceptor/local_endpoint/overload2.html +asio/reference/basic_socket_acceptor/max_connections.html +asio/reference/basic_socket_acceptor/max_listen_connections.html +asio/reference/basic_socket_acceptor/message_do_not_route.html +asio/reference/basic_socket_acceptor/message_end_of_record.html +asio/reference/basic_socket_acceptor/message_flags.html +asio/reference/basic_socket_acceptor/message_out_of_band.html +asio/reference/basic_socket_acceptor/message_peek.html +asio/reference/basic_socket_acceptor/native_handle.html +asio/reference/basic_socket_acceptor/native_handle_type.html +asio/reference/basic_socket_acceptor/native_non_blocking.html +asio/reference/basic_socket_acceptor/native_non_blocking/overload1.html +asio/reference/basic_socket_acceptor/native_non_blocking/overload2.html +asio/reference/basic_socket_acceptor/native_non_blocking/overload3.html +asio/reference/basic_socket_acceptor/non_blocking.html +asio/reference/basic_socket_acceptor/non_blocking/overload1.html +asio/reference/basic_socket_acceptor/non_blocking/overload2.html +asio/reference/basic_socket_acceptor/non_blocking/overload3.html +asio/reference/basic_socket_acceptor/open.html +asio/reference/basic_socket_acceptor/open/overload1.html +asio/reference/basic_socket_acceptor/open/overload2.html +asio/reference/basic_socket_acceptor/operator_eq_.html +asio/reference/basic_socket_acceptor/operator_eq_/overload1.html +asio/reference/basic_socket_acceptor/operator_eq_/overload2.html +asio/reference/basic_socket_acceptor/out_of_band_inline.html +asio/reference/basic_socket_acceptor/protocol_type.html +asio/reference/basic_socket_acceptor/receive_buffer_size.html +asio/reference/basic_socket_acceptor/receive_low_watermark.html +asio/reference/basic_socket_acceptor/release.html +asio/reference/basic_socket_acceptor/release/overload1.html +asio/reference/basic_socket_acceptor/release/overload2.html +asio/reference/basic_socket_acceptor/reuse_address.html +asio/reference/basic_socket_acceptor/send_buffer_size.html +asio/reference/basic_socket_acceptor/send_low_watermark.html +asio/reference/basic_socket_acceptor/set_option.html +asio/reference/basic_socket_acceptor/set_option/overload1.html +asio/reference/basic_socket_acceptor/set_option/overload2.html +asio/reference/basic_socket_acceptor/shutdown_type.html +asio/reference/basic_socket_acceptor/wait.html +asio/reference/basic_socket_acceptor/wait/overload1.html +asio/reference/basic_socket_acceptor/wait/overload2.html +asio/reference/basic_socket_acceptor/wait_type.html +asio/reference/basic_socket_acceptor/_basic_socket_acceptor.html +asio/reference/basic_socket_acceptor__rebind_executor.html +asio/reference/basic_socket_acceptor__rebind_executor/other.html +asio/reference/basic_socket_iostream.html +asio/reference/basic_socket_iostream/basic_socket_iostream.html +asio/reference/basic_socket_iostream/basic_socket_iostream/overload1.html +asio/reference/basic_socket_iostream/basic_socket_iostream/overload2.html +asio/reference/basic_socket_iostream/basic_socket_iostream/overload3.html +asio/reference/basic_socket_iostream/basic_socket_iostream/overload4.html +asio/reference/basic_socket_iostream/clock_type.html +asio/reference/basic_socket_iostream/close.html +asio/reference/basic_socket_iostream/connect.html +asio/reference/basic_socket_iostream/duration.html +asio/reference/basic_socket_iostream/duration_type.html +asio/reference/basic_socket_iostream/endpoint_type.html +asio/reference/basic_socket_iostream/error.html +asio/reference/basic_socket_iostream/expires_after.html +asio/reference/basic_socket_iostream/expires_at.html +asio/reference/basic_socket_iostream/expires_at/overload1.html +asio/reference/basic_socket_iostream/expires_at/overload2.html +asio/reference/basic_socket_iostream/expires_from_now.html +asio/reference/basic_socket_iostream/expires_from_now/overload1.html +asio/reference/basic_socket_iostream/expires_from_now/overload2.html +asio/reference/basic_socket_iostream/expiry.html +asio/reference/basic_socket_iostream/operator_eq_.html +asio/reference/basic_socket_iostream/protocol_type.html +asio/reference/basic_socket_iostream/rdbuf.html +asio/reference/basic_socket_iostream/socket.html +asio/reference/basic_socket_iostream/time_point.html +asio/reference/basic_socket_iostream/time_type.html +asio/reference/basic_socket_streambuf.html +asio/reference/basic_socket_streambuf/basic_socket_streambuf.html +asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload1.html +asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload2.html +asio/reference/basic_socket_streambuf/basic_socket_streambuf/overload3.html +asio/reference/basic_socket_streambuf/clock_type.html +asio/reference/basic_socket_streambuf/close.html +asio/reference/basic_socket_streambuf/connect.html +asio/reference/basic_socket_streambuf/connect/overload1.html +asio/reference/basic_socket_streambuf/connect/overload2.html +asio/reference/basic_socket_streambuf/duration.html +asio/reference/basic_socket_streambuf/duration_type.html +asio/reference/basic_socket_streambuf/endpoint_type.html +asio/reference/basic_socket_streambuf/error.html +asio/reference/basic_socket_streambuf/expires_after.html +asio/reference/basic_socket_streambuf/expires_at.html +asio/reference/basic_socket_streambuf/expires_at/overload1.html +asio/reference/basic_socket_streambuf/expires_at/overload2.html +asio/reference/basic_socket_streambuf/expires_from_now.html +asio/reference/basic_socket_streambuf/expires_from_now/overload1.html +asio/reference/basic_socket_streambuf/expires_from_now/overload2.html +asio/reference/basic_socket_streambuf/expiry.html +asio/reference/basic_socket_streambuf/operator_eq_.html +asio/reference/basic_socket_streambuf/overflow.html +asio/reference/basic_socket_streambuf/protocol_type.html +asio/reference/basic_socket_streambuf/puberror.html +asio/reference/basic_socket_streambuf/setbuf.html +asio/reference/basic_socket_streambuf/socket.html +asio/reference/basic_socket_streambuf/sync.html +asio/reference/basic_socket_streambuf/time_point.html +asio/reference/basic_socket_streambuf/time_type.html +asio/reference/basic_socket_streambuf/underflow.html +asio/reference/basic_socket_streambuf/_basic_socket_streambuf.html +asio/reference/basic_stream_socket.html +asio/reference/basic_stream_socket/assign.html +asio/reference/basic_stream_socket/assign/overload1.html +asio/reference/basic_stream_socket/assign/overload2.html +asio/reference/basic_stream_socket/async_connect.html +asio/reference/basic_stream_socket/async_read_some.html +asio/reference/basic_stream_socket/async_receive.html +asio/reference/basic_stream_socket/async_receive/overload1.html +asio/reference/basic_stream_socket/async_receive/overload2.html +asio/reference/basic_stream_socket/async_send.html +asio/reference/basic_stream_socket/async_send/overload1.html +asio/reference/basic_stream_socket/async_send/overload2.html +asio/reference/basic_stream_socket/async_wait.html +asio/reference/basic_stream_socket/async_write_some.html +asio/reference/basic_stream_socket/at_mark.html +asio/reference/basic_stream_socket/at_mark/overload1.html +asio/reference/basic_stream_socket/at_mark/overload2.html +asio/reference/basic_stream_socket/available.html +asio/reference/basic_stream_socket/available/overload1.html +asio/reference/basic_stream_socket/available/overload2.html +asio/reference/basic_stream_socket/basic_stream_socket.html +asio/reference/basic_stream_socket/basic_stream_socket/overload1.html +asio/reference/basic_stream_socket/basic_stream_socket/overload2.html +asio/reference/basic_stream_socket/basic_stream_socket/overload3.html +asio/reference/basic_stream_socket/basic_stream_socket/overload4.html +asio/reference/basic_stream_socket/basic_stream_socket/overload5.html +asio/reference/basic_stream_socket/basic_stream_socket/overload6.html +asio/reference/basic_stream_socket/basic_stream_socket/overload7.html +asio/reference/basic_stream_socket/basic_stream_socket/overload8.html +asio/reference/basic_stream_socket/basic_stream_socket/overload9.html +asio/reference/basic_stream_socket/basic_stream_socket/overload10.html +asio/reference/basic_stream_socket/bind.html +asio/reference/basic_stream_socket/bind/overload1.html +asio/reference/basic_stream_socket/bind/overload2.html +asio/reference/basic_stream_socket/broadcast.html +asio/reference/basic_stream_socket/bytes_readable.html +asio/reference/basic_stream_socket/cancel.html +asio/reference/basic_stream_socket/cancel/overload1.html +asio/reference/basic_stream_socket/cancel/overload2.html +asio/reference/basic_stream_socket/close.html +asio/reference/basic_stream_socket/close/overload1.html +asio/reference/basic_stream_socket/close/overload2.html +asio/reference/basic_stream_socket/connect.html +asio/reference/basic_stream_socket/connect/overload1.html +asio/reference/basic_stream_socket/connect/overload2.html +asio/reference/basic_stream_socket/debug.html +asio/reference/basic_stream_socket/do_not_route.html +asio/reference/basic_stream_socket/enable_connection_aborted.html +asio/reference/basic_stream_socket/endpoint_type.html +asio/reference/basic_stream_socket/executor_type.html +asio/reference/basic_stream_socket/get_executor.html +asio/reference/basic_stream_socket/get_option.html +asio/reference/basic_stream_socket/get_option/overload1.html +asio/reference/basic_stream_socket/get_option/overload2.html +asio/reference/basic_stream_socket/io_control.html +asio/reference/basic_stream_socket/io_control/overload1.html +asio/reference/basic_stream_socket/io_control/overload2.html +asio/reference/basic_stream_socket/is_open.html +asio/reference/basic_stream_socket/keep_alive.html +asio/reference/basic_stream_socket/linger.html +asio/reference/basic_stream_socket/local_endpoint.html +asio/reference/basic_stream_socket/local_endpoint/overload1.html +asio/reference/basic_stream_socket/local_endpoint/overload2.html +asio/reference/basic_stream_socket/lowest_layer.html +asio/reference/basic_stream_socket/lowest_layer/overload1.html +asio/reference/basic_stream_socket/lowest_layer/overload2.html +asio/reference/basic_stream_socket/lowest_layer_type.html +asio/reference/basic_stream_socket/max_connections.html +asio/reference/basic_stream_socket/max_listen_connections.html +asio/reference/basic_stream_socket/message_do_not_route.html +asio/reference/basic_stream_socket/message_end_of_record.html +asio/reference/basic_stream_socket/message_flags.html +asio/reference/basic_stream_socket/message_out_of_band.html +asio/reference/basic_stream_socket/message_peek.html +asio/reference/basic_stream_socket/native_handle.html +asio/reference/basic_stream_socket/native_handle_type.html +asio/reference/basic_stream_socket/native_non_blocking.html +asio/reference/basic_stream_socket/native_non_blocking/overload1.html +asio/reference/basic_stream_socket/native_non_blocking/overload2.html +asio/reference/basic_stream_socket/native_non_blocking/overload3.html +asio/reference/basic_stream_socket/non_blocking.html +asio/reference/basic_stream_socket/non_blocking/overload1.html +asio/reference/basic_stream_socket/non_blocking/overload2.html +asio/reference/basic_stream_socket/non_blocking/overload3.html +asio/reference/basic_stream_socket/open.html +asio/reference/basic_stream_socket/open/overload1.html +asio/reference/basic_stream_socket/open/overload2.html +asio/reference/basic_stream_socket/operator_eq_.html +asio/reference/basic_stream_socket/operator_eq_/overload1.html +asio/reference/basic_stream_socket/operator_eq_/overload2.html +asio/reference/basic_stream_socket/out_of_band_inline.html +asio/reference/basic_stream_socket/protocol_type.html +asio/reference/basic_stream_socket/read_some.html +asio/reference/basic_stream_socket/read_some/overload1.html +asio/reference/basic_stream_socket/read_some/overload2.html +asio/reference/basic_stream_socket/receive.html +asio/reference/basic_stream_socket/receive/overload1.html +asio/reference/basic_stream_socket/receive/overload2.html +asio/reference/basic_stream_socket/receive/overload3.html +asio/reference/basic_stream_socket/receive_buffer_size.html +asio/reference/basic_stream_socket/receive_low_watermark.html +asio/reference/basic_stream_socket/release.html +asio/reference/basic_stream_socket/release/overload1.html +asio/reference/basic_stream_socket/release/overload2.html +asio/reference/basic_stream_socket/remote_endpoint.html +asio/reference/basic_stream_socket/remote_endpoint/overload1.html +asio/reference/basic_stream_socket/remote_endpoint/overload2.html +asio/reference/basic_stream_socket/reuse_address.html +asio/reference/basic_stream_socket/send.html +asio/reference/basic_stream_socket/send/overload1.html +asio/reference/basic_stream_socket/send/overload2.html +asio/reference/basic_stream_socket/send/overload3.html +asio/reference/basic_stream_socket/send_buffer_size.html +asio/reference/basic_stream_socket/send_low_watermark.html +asio/reference/basic_stream_socket/set_option.html +asio/reference/basic_stream_socket/set_option/overload1.html +asio/reference/basic_stream_socket/set_option/overload2.html +asio/reference/basic_stream_socket/shutdown.html +asio/reference/basic_stream_socket/shutdown/overload1.html +asio/reference/basic_stream_socket/shutdown/overload2.html +asio/reference/basic_stream_socket/shutdown_type.html +asio/reference/basic_stream_socket/wait.html +asio/reference/basic_stream_socket/wait/overload1.html +asio/reference/basic_stream_socket/wait/overload2.html +asio/reference/basic_stream_socket/wait_type.html +asio/reference/basic_stream_socket/write_some.html +asio/reference/basic_stream_socket/write_some/overload1.html +asio/reference/basic_stream_socket/write_some/overload2.html +asio/reference/basic_stream_socket/_basic_stream_socket.html +asio/reference/basic_stream_socket__rebind_executor.html +asio/reference/basic_stream_socket__rebind_executor/other.html +asio/reference/basic_streambuf.html +asio/reference/basic_streambuf/basic_streambuf.html +asio/reference/basic_streambuf/capacity.html +asio/reference/basic_streambuf/commit.html +asio/reference/basic_streambuf/const_buffers_type.html +asio/reference/basic_streambuf/consume.html +asio/reference/basic_streambuf/data.html +asio/reference/basic_streambuf/max_size.html +asio/reference/basic_streambuf/mutable_buffers_type.html +asio/reference/basic_streambuf/overflow.html +asio/reference/basic_streambuf/prepare.html +asio/reference/basic_streambuf/reserve.html +asio/reference/basic_streambuf/size.html +asio/reference/basic_streambuf/underflow.html +asio/reference/basic_streambuf_ref.html +asio/reference/basic_streambuf_ref/basic_streambuf_ref.html +asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload1.html +asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload2.html +asio/reference/basic_streambuf_ref/basic_streambuf_ref/overload3.html +asio/reference/basic_streambuf_ref/capacity.html +asio/reference/basic_streambuf_ref/commit.html +asio/reference/basic_streambuf_ref/const_buffers_type.html +asio/reference/basic_streambuf_ref/consume.html +asio/reference/basic_streambuf_ref/data.html +asio/reference/basic_streambuf_ref/max_size.html +asio/reference/basic_streambuf_ref/mutable_buffers_type.html +asio/reference/basic_streambuf_ref/prepare.html +asio/reference/basic_streambuf_ref/size.html +asio/reference/basic_system_executor.html +asio/reference/basic_system_executor/basic_system_executor.html +asio/reference/basic_system_executor/context.html +asio/reference/basic_system_executor/defer.html +asio/reference/basic_system_executor/dispatch.html +asio/reference/basic_system_executor/execute.html +asio/reference/basic_system_executor/on_work_finished.html +asio/reference/basic_system_executor/on_work_started.html +asio/reference/basic_system_executor/operator_not__eq_.html +asio/reference/basic_system_executor/operator_eq__eq_.html +asio/reference/basic_system_executor/post.html +asio/reference/basic_system_executor/query.html +asio/reference/basic_system_executor/query/overload1.html +asio/reference/basic_system_executor/query/overload2.html +asio/reference/basic_system_executor/query/overload3.html +asio/reference/basic_system_executor/query__static.html +asio/reference/basic_system_executor/query__static/overload1.html +asio/reference/basic_system_executor/query__static/overload2.html +asio/reference/basic_system_executor/query__static/overload3.html +asio/reference/basic_system_executor/query__static/overload4.html +asio/reference/basic_system_executor/require.html +asio/reference/basic_system_executor/require/overload1.html +asio/reference/basic_system_executor/require/overload2.html +asio/reference/basic_system_executor/require/overload3.html +asio/reference/basic_system_executor/require/overload4.html +asio/reference/basic_system_executor/require/overload5.html +asio/reference/basic_system_executor/require/overload6.html +asio/reference/basic_system_executor/require/overload7.html +asio/reference/basic_waitable_timer.html +asio/reference/basic_waitable_timer/async_wait.html +asio/reference/basic_waitable_timer/basic_waitable_timer.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload1.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload2.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload3.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload4.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload5.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload6.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload7.html +asio/reference/basic_waitable_timer/basic_waitable_timer/overload8.html +asio/reference/basic_waitable_timer/cancel.html +asio/reference/basic_waitable_timer/cancel/overload1.html +asio/reference/basic_waitable_timer/cancel/overload2.html +asio/reference/basic_waitable_timer/cancel_one.html +asio/reference/basic_waitable_timer/cancel_one/overload1.html +asio/reference/basic_waitable_timer/cancel_one/overload2.html +asio/reference/basic_waitable_timer/clock_type.html +asio/reference/basic_waitable_timer/duration.html +asio/reference/basic_waitable_timer/executor_type.html +asio/reference/basic_waitable_timer/expires_after.html +asio/reference/basic_waitable_timer/expires_at.html +asio/reference/basic_waitable_timer/expires_at/overload1.html +asio/reference/basic_waitable_timer/expires_at/overload2.html +asio/reference/basic_waitable_timer/expires_at/overload3.html +asio/reference/basic_waitable_timer/expires_from_now.html +asio/reference/basic_waitable_timer/expires_from_now/overload1.html +asio/reference/basic_waitable_timer/expires_from_now/overload2.html +asio/reference/basic_waitable_timer/expires_from_now/overload3.html +asio/reference/basic_waitable_timer/expiry.html +asio/reference/basic_waitable_timer/get_executor.html +asio/reference/basic_waitable_timer/operator_eq_.html +asio/reference/basic_waitable_timer/operator_eq_/overload1.html +asio/reference/basic_waitable_timer/operator_eq_/overload2.html +asio/reference/basic_waitable_timer/time_point.html +asio/reference/basic_waitable_timer/traits_type.html +asio/reference/basic_waitable_timer/wait.html +asio/reference/basic_waitable_timer/wait/overload1.html +asio/reference/basic_waitable_timer/wait/overload2.html +asio/reference/basic_waitable_timer/_basic_waitable_timer.html +asio/reference/basic_waitable_timer__rebind_executor.html +asio/reference/basic_waitable_timer__rebind_executor/other.html +asio/reference/basic_yield_context.html +asio/reference/basic_yield_context/basic_yield_context.html +asio/reference/basic_yield_context/basic_yield_context/overload1.html +asio/reference/basic_yield_context/basic_yield_context/overload2.html +asio/reference/basic_yield_context/callee_type.html +asio/reference/basic_yield_context/caller_type.html +asio/reference/basic_yield_context/operator_lb__rb_.html +asio/reference/bind_executor.html +asio/reference/bind_executor/overload1.html +asio/reference/bind_executor/overload2.html +asio/reference/buffer.html +asio/reference/buffer/overload1.html +asio/reference/buffer/overload2.html +asio/reference/buffer/overload3.html +asio/reference/buffer/overload4.html +asio/reference/buffer/overload5.html +asio/reference/buffer/overload6.html +asio/reference/buffer/overload7.html +asio/reference/buffer/overload8.html +asio/reference/buffer/overload9.html +asio/reference/buffer/overload10.html +asio/reference/buffer/overload11.html +asio/reference/buffer/overload12.html +asio/reference/buffer/overload13.html +asio/reference/buffer/overload14.html +asio/reference/buffer/overload15.html +asio/reference/buffer/overload16.html +asio/reference/buffer/overload17.html +asio/reference/buffer/overload18.html +asio/reference/buffer/overload19.html +asio/reference/buffer/overload20.html +asio/reference/buffer/overload21.html +asio/reference/buffer/overload22.html +asio/reference/buffer/overload23.html +asio/reference/buffer/overload24.html +asio/reference/buffer/overload25.html +asio/reference/buffer/overload26.html +asio/reference/buffer/overload27.html +asio/reference/buffer/overload28.html +asio/reference/buffer/overload29.html +asio/reference/buffer/overload30.html +asio/reference/buffer/overload31.html +asio/reference/buffer/overload32.html +asio/reference/buffer_cast.html +asio/reference/buffer_cast/overload1.html +asio/reference/buffer_cast/overload2.html +asio/reference/buffer_copy.html +asio/reference/buffer_copy/overload1.html +asio/reference/buffer_copy/overload2.html +asio/reference/buffer_sequence_begin.html +asio/reference/buffer_sequence_begin/overload1.html +asio/reference/buffer_sequence_begin/overload2.html +asio/reference/buffer_sequence_begin/overload3.html +asio/reference/buffer_sequence_begin/overload4.html +asio/reference/buffer_sequence_end.html +asio/reference/buffer_sequence_end/overload1.html +asio/reference/buffer_sequence_end/overload2.html +asio/reference/buffer_sequence_end/overload3.html +asio/reference/buffer_sequence_end/overload4.html +asio/reference/buffer_size.html +asio/reference/buffered_read_stream.html +asio/reference/buffered_read_stream/async_fill.html +asio/reference/buffered_read_stream/async_read_some.html +asio/reference/buffered_read_stream/async_write_some.html +asio/reference/buffered_read_stream/buffered_read_stream.html +asio/reference/buffered_read_stream/buffered_read_stream/overload1.html +asio/reference/buffered_read_stream/buffered_read_stream/overload2.html +asio/reference/buffered_read_stream/close.html +asio/reference/buffered_read_stream/close/overload1.html +asio/reference/buffered_read_stream/close/overload2.html +asio/reference/buffered_read_stream/default_buffer_size.html +asio/reference/buffered_read_stream/executor_type.html +asio/reference/buffered_read_stream/fill.html +asio/reference/buffered_read_stream/fill/overload1.html +asio/reference/buffered_read_stream/fill/overload2.html +asio/reference/buffered_read_stream/get_executor.html +asio/reference/buffered_read_stream/in_avail.html +asio/reference/buffered_read_stream/in_avail/overload1.html +asio/reference/buffered_read_stream/in_avail/overload2.html +asio/reference/buffered_read_stream/lowest_layer.html +asio/reference/buffered_read_stream/lowest_layer/overload1.html +asio/reference/buffered_read_stream/lowest_layer/overload2.html +asio/reference/buffered_read_stream/lowest_layer_type.html +asio/reference/buffered_read_stream/next_layer.html +asio/reference/buffered_read_stream/next_layer_type.html +asio/reference/buffered_read_stream/peek.html +asio/reference/buffered_read_stream/peek/overload1.html +asio/reference/buffered_read_stream/peek/overload2.html +asio/reference/buffered_read_stream/read_some.html +asio/reference/buffered_read_stream/read_some/overload1.html +asio/reference/buffered_read_stream/read_some/overload2.html +asio/reference/buffered_read_stream/write_some.html +asio/reference/buffered_read_stream/write_some/overload1.html +asio/reference/buffered_read_stream/write_some/overload2.html +asio/reference/buffered_stream.html +asio/reference/buffered_stream/async_fill.html +asio/reference/buffered_stream/async_flush.html +asio/reference/buffered_stream/async_read_some.html +asio/reference/buffered_stream/async_write_some.html +asio/reference/buffered_stream/buffered_stream.html +asio/reference/buffered_stream/buffered_stream/overload1.html +asio/reference/buffered_stream/buffered_stream/overload2.html +asio/reference/buffered_stream/close.html +asio/reference/buffered_stream/close/overload1.html +asio/reference/buffered_stream/close/overload2.html +asio/reference/buffered_stream/executor_type.html +asio/reference/buffered_stream/fill.html +asio/reference/buffered_stream/fill/overload1.html +asio/reference/buffered_stream/fill/overload2.html +asio/reference/buffered_stream/flush.html +asio/reference/buffered_stream/flush/overload1.html +asio/reference/buffered_stream/flush/overload2.html +asio/reference/buffered_stream/get_executor.html +asio/reference/buffered_stream/in_avail.html +asio/reference/buffered_stream/in_avail/overload1.html +asio/reference/buffered_stream/in_avail/overload2.html +asio/reference/buffered_stream/lowest_layer.html +asio/reference/buffered_stream/lowest_layer/overload1.html +asio/reference/buffered_stream/lowest_layer/overload2.html +asio/reference/buffered_stream/lowest_layer_type.html +asio/reference/buffered_stream/next_layer.html +asio/reference/buffered_stream/next_layer_type.html +asio/reference/buffered_stream/peek.html +asio/reference/buffered_stream/peek/overload1.html +asio/reference/buffered_stream/peek/overload2.html +asio/reference/buffered_stream/read_some.html +asio/reference/buffered_stream/read_some/overload1.html +asio/reference/buffered_stream/read_some/overload2.html +asio/reference/buffered_stream/write_some.html +asio/reference/buffered_stream/write_some/overload1.html +asio/reference/buffered_stream/write_some/overload2.html +asio/reference/buffered_write_stream.html +asio/reference/buffered_write_stream/async_flush.html +asio/reference/buffered_write_stream/async_read_some.html +asio/reference/buffered_write_stream/async_write_some.html +asio/reference/buffered_write_stream/buffered_write_stream.html +asio/reference/buffered_write_stream/buffered_write_stream/overload1.html +asio/reference/buffered_write_stream/buffered_write_stream/overload2.html +asio/reference/buffered_write_stream/close.html +asio/reference/buffered_write_stream/close/overload1.html +asio/reference/buffered_write_stream/close/overload2.html +asio/reference/buffered_write_stream/default_buffer_size.html +asio/reference/buffered_write_stream/executor_type.html +asio/reference/buffered_write_stream/flush.html +asio/reference/buffered_write_stream/flush/overload1.html +asio/reference/buffered_write_stream/flush/overload2.html +asio/reference/buffered_write_stream/get_executor.html +asio/reference/buffered_write_stream/in_avail.html +asio/reference/buffered_write_stream/in_avail/overload1.html +asio/reference/buffered_write_stream/in_avail/overload2.html +asio/reference/buffered_write_stream/lowest_layer.html +asio/reference/buffered_write_stream/lowest_layer/overload1.html +asio/reference/buffered_write_stream/lowest_layer/overload2.html +asio/reference/buffered_write_stream/lowest_layer_type.html +asio/reference/buffered_write_stream/next_layer.html +asio/reference/buffered_write_stream/next_layer_type.html +asio/reference/buffered_write_stream/peek.html +asio/reference/buffered_write_stream/peek/overload1.html +asio/reference/buffered_write_stream/peek/overload2.html +asio/reference/buffered_write_stream/read_some.html +asio/reference/buffered_write_stream/read_some/overload1.html +asio/reference/buffered_write_stream/read_some/overload2.html +asio/reference/buffered_write_stream/write_some.html +asio/reference/buffered_write_stream/write_some/overload1.html +asio/reference/buffered_write_stream/write_some/overload2.html +asio/reference/buffers_begin.html +asio/reference/buffers_end.html +asio/reference/buffers_iterator.html +asio/reference/buffers_iterator/begin.html +asio/reference/buffers_iterator/buffers_iterator.html +asio/reference/buffers_iterator/difference_type.html +asio/reference/buffers_iterator/end.html +asio/reference/buffers_iterator/iterator_category.html +asio/reference/buffers_iterator/operator__star_.html +asio/reference/buffers_iterator/operator_not__eq_.html +asio/reference/buffers_iterator/operator_plus_.html +asio/reference/buffers_iterator/operator_plus_/overload1.html +asio/reference/buffers_iterator/operator_plus_/overload2.html +asio/reference/buffers_iterator/operator_plus__plus_.html +asio/reference/buffers_iterator/operator_plus__plus_/overload1.html +asio/reference/buffers_iterator/operator_plus__plus_/overload2.html +asio/reference/buffers_iterator/operator_plus__eq_.html +asio/reference/buffers_iterator/operator_minus_.html +asio/reference/buffers_iterator/operator_minus_/overload1.html +asio/reference/buffers_iterator/operator_minus_/overload2.html +asio/reference/buffers_iterator/operator_minus__minus_.html +asio/reference/buffers_iterator/operator_minus__minus_/overload1.html +asio/reference/buffers_iterator/operator_minus__minus_/overload2.html +asio/reference/buffers_iterator/operator_minus__eq_.html +asio/reference/buffers_iterator/operator_arrow_.html +asio/reference/buffers_iterator/operator_lt_.html +asio/reference/buffers_iterator/operator_lt__eq_.html +asio/reference/buffers_iterator/operator_eq__eq_.html +asio/reference/buffers_iterator/operator_gt_.html +asio/reference/buffers_iterator/operator_gt__eq_.html +asio/reference/buffers_iterator/operator_lb__rb_.html +asio/reference/buffers_iterator/pointer.html +asio/reference/buffers_iterator/reference.html +asio/reference/buffers_iterator/value_type.html +asio/reference/can_prefer.html +asio/reference/can_query.html +asio/reference/can_require.html +asio/reference/can_require_concept.html +asio/reference/co_spawn.html +asio/reference/co_spawn/overload1.html +asio/reference/co_spawn/overload2.html +asio/reference/co_spawn/overload3.html +asio/reference/co_spawn/overload4.html +asio/reference/co_spawn/overload5.html +asio/reference/co_spawn/overload6.html +asio/reference/connect.html +asio/reference/connect/overload1.html +asio/reference/connect/overload2.html +asio/reference/connect/overload3.html +asio/reference/connect/overload4.html +asio/reference/connect/overload5.html +asio/reference/connect/overload6.html +asio/reference/connect/overload7.html +asio/reference/connect/overload8.html +asio/reference/connect/overload9.html +asio/reference/connect/overload10.html +asio/reference/connect/overload11.html +asio/reference/connect/overload12.html +asio/reference/const_buffer.html +asio/reference/const_buffer/const_buffer.html +asio/reference/const_buffer/const_buffer/overload1.html +asio/reference/const_buffer/const_buffer/overload2.html +asio/reference/const_buffer/const_buffer/overload3.html +asio/reference/const_buffer/data.html +asio/reference/const_buffer/operator_plus_.html +asio/reference/const_buffer/operator_plus_/overload1.html +asio/reference/const_buffer/operator_plus_/overload2.html +asio/reference/const_buffer/operator_plus__eq_.html +asio/reference/const_buffer/size.html +asio/reference/const_buffers_1.html +asio/reference/const_buffers_1/begin.html +asio/reference/const_buffers_1/const_buffers_1.html +asio/reference/const_buffers_1/const_buffers_1/overload1.html +asio/reference/const_buffers_1/const_buffers_1/overload2.html +asio/reference/const_buffers_1/const_iterator.html +asio/reference/const_buffers_1/data.html +asio/reference/const_buffers_1/end.html +asio/reference/const_buffers_1/operator_plus_.html +asio/reference/const_buffers_1/operator_plus_/overload1.html +asio/reference/const_buffers_1/operator_plus_/overload2.html +asio/reference/const_buffers_1/operator_plus__eq_.html +asio/reference/const_buffers_1/size.html +asio/reference/const_buffers_1/value_type.html +asio/reference/coroutine.html +asio/reference/coroutine/coroutine.html +asio/reference/coroutine/is_child.html +asio/reference/coroutine/is_complete.html +asio/reference/coroutine/is_parent.html +asio/reference/deadline_timer.html +asio/reference/default_completion_token.html +asio/reference/default_completion_token/type.html +asio/reference/defer.html +asio/reference/defer/overload1.html +asio/reference/defer/overload2.html +asio/reference/defer/overload3.html +asio/reference/detached.html +asio/reference/detached_t.html +asio/reference/detached_t/as_default_on.html +asio/reference/detached_t/detached_t.html +asio/reference/detached_t__executor_with_default.html +asio/reference/detached_t__executor_with_default/default_completion_token_type.html +asio/reference/detached_t__executor_with_default/executor_with_default.html +asio/reference/detached_t__executor_with_default/executor_with_default/overload1.html +asio/reference/detached_t__executor_with_default/executor_with_default/overload2.html +asio/reference/dispatch.html +asio/reference/dispatch/overload1.html +asio/reference/dispatch/overload2.html +asio/reference/dispatch/overload3.html +asio/reference/dynamic_buffer.html +asio/reference/dynamic_buffer/overload1.html +asio/reference/dynamic_buffer/overload2.html +asio/reference/dynamic_buffer/overload3.html +asio/reference/dynamic_buffer/overload4.html +asio/reference/dynamic_string_buffer.html +asio/reference/dynamic_string_buffer/capacity.html +asio/reference/dynamic_string_buffer/commit.html +asio/reference/dynamic_string_buffer/const_buffers_type.html +asio/reference/dynamic_string_buffer/consume.html +asio/reference/dynamic_string_buffer/data.html +asio/reference/dynamic_string_buffer/data/overload1.html +asio/reference/dynamic_string_buffer/data/overload2.html +asio/reference/dynamic_string_buffer/data/overload3.html +asio/reference/dynamic_string_buffer/dynamic_string_buffer.html +asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload1.html +asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload2.html +asio/reference/dynamic_string_buffer/dynamic_string_buffer/overload3.html +asio/reference/dynamic_string_buffer/grow.html +asio/reference/dynamic_string_buffer/max_size.html +asio/reference/dynamic_string_buffer/mutable_buffers_type.html +asio/reference/dynamic_string_buffer/prepare.html +asio/reference/dynamic_string_buffer/shrink.html +asio/reference/dynamic_string_buffer/size.html +asio/reference/dynamic_vector_buffer.html +asio/reference/dynamic_vector_buffer/capacity.html +asio/reference/dynamic_vector_buffer/commit.html +asio/reference/dynamic_vector_buffer/const_buffers_type.html +asio/reference/dynamic_vector_buffer/consume.html +asio/reference/dynamic_vector_buffer/data.html +asio/reference/dynamic_vector_buffer/data/overload1.html +asio/reference/dynamic_vector_buffer/data/overload2.html +asio/reference/dynamic_vector_buffer/data/overload3.html +asio/reference/dynamic_vector_buffer/dynamic_vector_buffer.html +asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload1.html +asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload2.html +asio/reference/dynamic_vector_buffer/dynamic_vector_buffer/overload3.html +asio/reference/dynamic_vector_buffer/grow.html +asio/reference/dynamic_vector_buffer/max_size.html +asio/reference/dynamic_vector_buffer/mutable_buffers_type.html +asio/reference/dynamic_vector_buffer/prepare.html +asio/reference/dynamic_vector_buffer/shrink.html +asio/reference/dynamic_vector_buffer/size.html +asio/reference/error__addrinfo_category.html +asio/reference/error__addrinfo_errors.html +asio/reference/error__basic_errors.html +asio/reference/error__get_addrinfo_category.html +asio/reference/error__get_misc_category.html +asio/reference/error__get_netdb_category.html +asio/reference/error__get_ssl_category.html +asio/reference/error__get_system_category.html +asio/reference/error__make_error_code.html +asio/reference/error__make_error_code/overload1.html +asio/reference/error__make_error_code/overload2.html +asio/reference/error__make_error_code/overload3.html +asio/reference/error__make_error_code/overload4.html +asio/reference/error__make_error_code/overload5.html +asio/reference/error__misc_category.html +asio/reference/error__misc_errors.html +asio/reference/error__netdb_category.html +asio/reference/error__netdb_errors.html +asio/reference/error__ssl_category.html +asio/reference/error__ssl_errors.html +asio/reference/error__system_category.html +asio/reference/error_category.html +asio/reference/error_category/message.html +asio/reference/error_category/name.html +asio/reference/error_category/operator_not__eq_.html +asio/reference/error_category/operator_eq__eq_.html +asio/reference/error_category/_error_category.html +asio/reference/error_code.html +asio/reference/error_code/assign.html +asio/reference/error_code/category.html +asio/reference/error_code/clear.html +asio/reference/error_code/error_code.html +asio/reference/error_code/error_code/overload1.html +asio/reference/error_code/error_code/overload2.html +asio/reference/error_code/error_code/overload3.html +asio/reference/error_code/message.html +asio/reference/error_code/operator_unspecified_bool_type.html +asio/reference/error_code/operator_not_.html +asio/reference/error_code/operator_not__eq_.html +asio/reference/error_code/operator_eq__eq_.html +asio/reference/error_code/unspecified_bool_true.html +asio/reference/error_code/unspecified_bool_type.html +asio/reference/error_code/value.html +asio/reference/error_code__unspecified_bool_type_t.html +asio/reference/execution__allocator.html +asio/reference/execution__allocator_t.html +asio/reference/execution__allocator_t/allocator_t.html +asio/reference/execution__allocator_t/is_applicable_property_v.html +asio/reference/execution__allocator_t/is_preferable.html +asio/reference/execution__allocator_t/is_requirable.html +asio/reference/execution__allocator_t/value.html +asio/reference/execution__any_executor.html +asio/reference/execution__any_executor/any_executor.html +asio/reference/execution__any_executor/any_executor/overload1.html +asio/reference/execution__any_executor/any_executor/overload2.html +asio/reference/execution__any_executor/any_executor/overload3.html +asio/reference/execution__any_executor/any_executor/overload4.html +asio/reference/execution__any_executor/any_executor/overload5.html +asio/reference/execution__any_executor/any_executor/overload6.html +asio/reference/execution__any_executor/context.html +asio/reference/execution__any_executor/execute.html +asio/reference/execution__any_executor/operator_bool.html +asio/reference/execution__any_executor/operator_not__eq_.html +asio/reference/execution__any_executor/operator_not__eq_/overload1.html +asio/reference/execution__any_executor/operator_not__eq_/overload2.html +asio/reference/execution__any_executor/operator_not__eq_/overload3.html +asio/reference/execution__any_executor/operator_eq_.html +asio/reference/execution__any_executor/operator_eq_/overload1.html +asio/reference/execution__any_executor/operator_eq_/overload2.html +asio/reference/execution__any_executor/operator_eq_/overload3.html +asio/reference/execution__any_executor/operator_eq_/overload4.html +asio/reference/execution__any_executor/operator_eq__eq_.html +asio/reference/execution__any_executor/operator_eq__eq_/overload1.html +asio/reference/execution__any_executor/operator_eq__eq_/overload2.html +asio/reference/execution__any_executor/operator_eq__eq_/overload3.html +asio/reference/execution__any_executor/prefer.html +asio/reference/execution__any_executor/query.html +asio/reference/execution__any_executor/require.html +asio/reference/execution__any_executor/swap.html +asio/reference/execution__any_executor/target.html +asio/reference/execution__any_executor/target/overload1.html +asio/reference/execution__any_executor/target/overload2.html +asio/reference/execution__any_executor/target_type.html +asio/reference/execution__any_executor/_any_executor.html +asio/reference/execution__bad_executor.html +asio/reference/execution__bad_executor/bad_executor.html +asio/reference/execution__bad_executor/what.html +asio/reference/execution__blocking.html +asio/reference/execution__blocking_adaptation.html +asio/reference/execution__blocking_adaptation_t.html +asio/reference/execution__blocking_adaptation_t/allowed.html +asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t.html +asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload1.html +asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload2.html +asio/reference/execution__blocking_adaptation_t/blocking_adaptation_t/overload3.html +asio/reference/execution__blocking_adaptation_t/disallowed.html +asio/reference/execution__blocking_adaptation_t/is_applicable_property_v.html +asio/reference/execution__blocking_adaptation_t/is_preferable.html +asio/reference/execution__blocking_adaptation_t/is_requirable.html +asio/reference/execution__blocking_adaptation_t/operator_not__eq_.html +asio/reference/execution__blocking_adaptation_t/operator_eq__eq_.html +asio/reference/execution__blocking_adaptation_t/polymorphic_query_result_type.html +asio/reference/execution__blocking_adaptation_t__allowed_t.html +asio/reference/execution__blocking_adaptation_t__allowed_t/allowed_t.html +asio/reference/execution__blocking_adaptation_t__allowed_t/is_applicable_property_v.html +asio/reference/execution__blocking_adaptation_t__allowed_t/is_preferable.html +asio/reference/execution__blocking_adaptation_t__allowed_t/is_requirable.html +asio/reference/execution__blocking_adaptation_t__allowed_t/polymorphic_query_result_type.html +asio/reference/execution__blocking_adaptation_t__allowed_t/value.html +asio/reference/execution__blocking_adaptation_t__disallowed_t.html +asio/reference/execution__blocking_adaptation_t__disallowed_t/disallowed_t.html +asio/reference/execution__blocking_adaptation_t__disallowed_t/is_applicable_property_v.html +asio/reference/execution__blocking_adaptation_t__disallowed_t/is_preferable.html +asio/reference/execution__blocking_adaptation_t__disallowed_t/is_requirable.html +asio/reference/execution__blocking_adaptation_t__disallowed_t/polymorphic_query_result_type.html +asio/reference/execution__blocking_adaptation_t__disallowed_t/value.html +asio/reference/execution__blocking_t.html +asio/reference/execution__blocking_t/always.html +asio/reference/execution__blocking_t/blocking_t.html +asio/reference/execution__blocking_t/blocking_t/overload1.html +asio/reference/execution__blocking_t/blocking_t/overload2.html +asio/reference/execution__blocking_t/blocking_t/overload3.html +asio/reference/execution__blocking_t/blocking_t/overload4.html +asio/reference/execution__blocking_t/is_applicable_property_v.html +asio/reference/execution__blocking_t/is_preferable.html +asio/reference/execution__blocking_t/is_requirable.html +asio/reference/execution__blocking_t/never.html +asio/reference/execution__blocking_t/operator_not__eq_.html +asio/reference/execution__blocking_t/operator_eq__eq_.html +asio/reference/execution__blocking_t/polymorphic_query_result_type.html +asio/reference/execution__blocking_t/possibly.html +asio/reference/execution__blocking_t__always_t.html +asio/reference/execution__blocking_t__always_t/always_t.html +asio/reference/execution__blocking_t__always_t/is_applicable_property_v.html +asio/reference/execution__blocking_t__always_t/is_preferable.html +asio/reference/execution__blocking_t__always_t/is_requirable.html +asio/reference/execution__blocking_t__always_t/polymorphic_query_result_type.html +asio/reference/execution__blocking_t__always_t/value.html +asio/reference/execution__blocking_t__never_t.html +asio/reference/execution__blocking_t__never_t/is_applicable_property_v.html +asio/reference/execution__blocking_t__never_t/is_preferable.html +asio/reference/execution__blocking_t__never_t/is_requirable.html +asio/reference/execution__blocking_t__never_t/never_t.html +asio/reference/execution__blocking_t__never_t/polymorphic_query_result_type.html +asio/reference/execution__blocking_t__never_t/value.html +asio/reference/execution__blocking_t__possibly_t.html +asio/reference/execution__blocking_t__possibly_t/is_applicable_property_v.html +asio/reference/execution__blocking_t__possibly_t/is_preferable.html +asio/reference/execution__blocking_t__possibly_t/is_requirable.html +asio/reference/execution__blocking_t__possibly_t/polymorphic_query_result_type.html +asio/reference/execution__blocking_t__possibly_t/possibly_t.html +asio/reference/execution__blocking_t__possibly_t/value.html +asio/reference/execution__bulk_execute.html +asio/reference/execution__bulk_guarantee.html +asio/reference/execution__bulk_guarantee_t.html +asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t.html +asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload1.html +asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload2.html +asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload3.html +asio/reference/execution__bulk_guarantee_t/bulk_guarantee_t/overload4.html +asio/reference/execution__bulk_guarantee_t/is_applicable_property_v.html +asio/reference/execution__bulk_guarantee_t/is_preferable.html +asio/reference/execution__bulk_guarantee_t/is_requirable.html +asio/reference/execution__bulk_guarantee_t/operator_not__eq_.html +asio/reference/execution__bulk_guarantee_t/operator_eq__eq_.html +asio/reference/execution__bulk_guarantee_t/parallel.html +asio/reference/execution__bulk_guarantee_t/polymorphic_query_result_type.html +asio/reference/execution__bulk_guarantee_t/sequenced.html +asio/reference/execution__bulk_guarantee_t/unsequenced.html +asio/reference/execution__bulk_guarantee_t__parallel_t.html +asio/reference/execution__bulk_guarantee_t__parallel_t/is_applicable_property_v.html +asio/reference/execution__bulk_guarantee_t__parallel_t/is_preferable.html +asio/reference/execution__bulk_guarantee_t__parallel_t/is_requirable.html +asio/reference/execution__bulk_guarantee_t__parallel_t/parallel_t.html +asio/reference/execution__bulk_guarantee_t__parallel_t/polymorphic_query_result_type.html +asio/reference/execution__bulk_guarantee_t__parallel_t/value.html +asio/reference/execution__bulk_guarantee_t__sequenced_t.html +asio/reference/execution__bulk_guarantee_t__sequenced_t/is_applicable_property_v.html +asio/reference/execution__bulk_guarantee_t__sequenced_t/is_preferable.html +asio/reference/execution__bulk_guarantee_t__sequenced_t/is_requirable.html +asio/reference/execution__bulk_guarantee_t__sequenced_t/polymorphic_query_result_type.html +asio/reference/execution__bulk_guarantee_t__sequenced_t/sequenced_t.html +asio/reference/execution__bulk_guarantee_t__sequenced_t/value.html +asio/reference/execution__bulk_guarantee_t__unsequenced_t.html +asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_applicable_property_v.html +asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_preferable.html +asio/reference/execution__bulk_guarantee_t__unsequenced_t/is_requirable.html +asio/reference/execution__bulk_guarantee_t__unsequenced_t/polymorphic_query_result_type.html +asio/reference/execution__bulk_guarantee_t__unsequenced_t/unsequenced_t.html +asio/reference/execution__bulk_guarantee_t__unsequenced_t/value.html +asio/reference/execution__can_bulk_execute.html +asio/reference/execution__can_connect.html +asio/reference/execution__can_execute.html +asio/reference/execution__can_schedule.html +asio/reference/execution__can_set_done.html +asio/reference/execution__can_set_error.html +asio/reference/execution__can_set_value.html +asio/reference/execution__can_start.html +asio/reference/execution__can_submit.html +asio/reference/execution__connect.html +asio/reference/execution__connect_result.html +asio/reference/execution__connect_result/type.html +asio/reference/execution__context.html +asio/reference/execution__context_as.html +asio/reference/execution__context_as_t.html +asio/reference/execution__context_as_t/is_applicable_property_v.html +asio/reference/execution__context_as_t/is_preferable.html +asio/reference/execution__context_as_t/is_requirable.html +asio/reference/execution__context_as_t/polymorphic_query_result_type.html +asio/reference/execution__context_t.html +asio/reference/execution__context_t/is_applicable_property_v.html +asio/reference/execution__context_t/is_preferable.html +asio/reference/execution__context_t/is_requirable.html +asio/reference/execution__context_t/polymorphic_query_result_type.html +asio/reference/execution__execute.html +asio/reference/execution__executor_index.html +asio/reference/execution__executor_index/type.html +asio/reference/execution__executor_shape.html +asio/reference/execution__executor_shape/type.html +asio/reference/execution__invocable_archetype.html +asio/reference/execution__invocable_archetype/operator_lp__rp_.html +asio/reference/execution__is_executor.html +asio/reference/execution__is_executor_of.html +asio/reference/execution__is_nothrow_receiver_of.html +asio/reference/execution__is_operation_state.html +asio/reference/execution__is_receiver.html +asio/reference/execution__is_receiver_of.html +asio/reference/execution__is_scheduler.html +asio/reference/execution__is_sender.html +asio/reference/execution__is_sender_to.html +asio/reference/execution__is_typed_sender.html +asio/reference/execution__mapping.html +asio/reference/execution__mapping_t.html +asio/reference/execution__mapping_t/is_applicable_property_v.html +asio/reference/execution__mapping_t/is_preferable.html +asio/reference/execution__mapping_t/is_requirable.html +asio/reference/execution__mapping_t/mapping_t.html +asio/reference/execution__mapping_t/mapping_t/overload1.html +asio/reference/execution__mapping_t/mapping_t/overload2.html +asio/reference/execution__mapping_t/mapping_t/overload3.html +asio/reference/execution__mapping_t/mapping_t/overload4.html +asio/reference/execution__mapping_t/new_thread.html +asio/reference/execution__mapping_t/operator_not__eq_.html +asio/reference/execution__mapping_t/operator_eq__eq_.html +asio/reference/execution__mapping_t/other.html +asio/reference/execution__mapping_t/polymorphic_query_result_type.html +asio/reference/execution__mapping_t/thread.html +asio/reference/execution__mapping_t__new_thread_t.html +asio/reference/execution__mapping_t__new_thread_t/is_applicable_property_v.html +asio/reference/execution__mapping_t__new_thread_t/is_preferable.html +asio/reference/execution__mapping_t__new_thread_t/is_requirable.html +asio/reference/execution__mapping_t__new_thread_t/new_thread_t.html +asio/reference/execution__mapping_t__new_thread_t/polymorphic_query_result_type.html +asio/reference/execution__mapping_t__new_thread_t/value.html +asio/reference/execution__mapping_t__other_t.html +asio/reference/execution__mapping_t__other_t/is_applicable_property_v.html +asio/reference/execution__mapping_t__other_t/is_preferable.html +asio/reference/execution__mapping_t__other_t/is_requirable.html +asio/reference/execution__mapping_t__other_t/other_t.html +asio/reference/execution__mapping_t__other_t/polymorphic_query_result_type.html +asio/reference/execution__mapping_t__other_t/value.html +asio/reference/execution__mapping_t__thread_t.html +asio/reference/execution__mapping_t__thread_t/is_applicable_property_v.html +asio/reference/execution__mapping_t__thread_t/is_preferable.html +asio/reference/execution__mapping_t__thread_t/is_requirable.html +asio/reference/execution__mapping_t__thread_t/polymorphic_query_result_type.html +asio/reference/execution__mapping_t__thread_t/thread_t.html +asio/reference/execution__mapping_t__thread_t/value.html +asio/reference/execution__occupancy.html +asio/reference/execution__occupancy_t.html +asio/reference/execution__occupancy_t/is_applicable_property_v.html +asio/reference/execution__occupancy_t/is_preferable.html +asio/reference/execution__occupancy_t/is_requirable.html +asio/reference/execution__occupancy_t/polymorphic_query_result_type.html +asio/reference/execution__outstanding_work.html +asio/reference/execution__outstanding_work_t.html +asio/reference/execution__outstanding_work_t/is_applicable_property_v.html +asio/reference/execution__outstanding_work_t/is_preferable.html +asio/reference/execution__outstanding_work_t/is_requirable.html +asio/reference/execution__outstanding_work_t/operator_not__eq_.html +asio/reference/execution__outstanding_work_t/operator_eq__eq_.html +asio/reference/execution__outstanding_work_t/outstanding_work_t.html +asio/reference/execution__outstanding_work_t/outstanding_work_t/overload1.html +asio/reference/execution__outstanding_work_t/outstanding_work_t/overload2.html +asio/reference/execution__outstanding_work_t/outstanding_work_t/overload3.html +asio/reference/execution__outstanding_work_t/polymorphic_query_result_type.html +asio/reference/execution__outstanding_work_t/tracked.html +asio/reference/execution__outstanding_work_t/untracked.html +asio/reference/execution__outstanding_work_t__tracked_t.html +asio/reference/execution__outstanding_work_t__tracked_t/is_applicable_property_v.html +asio/reference/execution__outstanding_work_t__tracked_t/is_preferable.html +asio/reference/execution__outstanding_work_t__tracked_t/is_requirable.html +asio/reference/execution__outstanding_work_t__tracked_t/polymorphic_query_result_type.html +asio/reference/execution__outstanding_work_t__tracked_t/tracked_t.html +asio/reference/execution__outstanding_work_t__tracked_t/value.html +asio/reference/execution__outstanding_work_t__untracked_t.html +asio/reference/execution__outstanding_work_t__untracked_t/is_applicable_property_v.html +asio/reference/execution__outstanding_work_t__untracked_t/is_preferable.html +asio/reference/execution__outstanding_work_t__untracked_t/is_requirable.html +asio/reference/execution__outstanding_work_t__untracked_t/polymorphic_query_result_type.html +asio/reference/execution__outstanding_work_t__untracked_t/untracked_t.html +asio/reference/execution__outstanding_work_t__untracked_t/value.html +asio/reference/execution__prefer_only.html +asio/reference/execution__prefer_only/is_applicable_property_v.html +asio/reference/execution__prefer_only/is_preferable.html +asio/reference/execution__prefer_only/is_requirable.html +asio/reference/execution__prefer_only/polymorphic_query_result_type.html +asio/reference/execution__receiver_invocation_error.html +asio/reference/execution__receiver_invocation_error/receiver_invocation_error.html +asio/reference/execution__relationship.html +asio/reference/execution__relationship_t.html +asio/reference/execution__relationship_t/continuation.html +asio/reference/execution__relationship_t/fork.html +asio/reference/execution__relationship_t/is_applicable_property_v.html +asio/reference/execution__relationship_t/is_preferable.html +asio/reference/execution__relationship_t/is_requirable.html +asio/reference/execution__relationship_t/operator_not__eq_.html +asio/reference/execution__relationship_t/operator_eq__eq_.html +asio/reference/execution__relationship_t/polymorphic_query_result_type.html +asio/reference/execution__relationship_t/relationship_t.html +asio/reference/execution__relationship_t/relationship_t/overload1.html +asio/reference/execution__relationship_t/relationship_t/overload2.html +asio/reference/execution__relationship_t/relationship_t/overload3.html +asio/reference/execution__relationship_t__continuation_t.html +asio/reference/execution__relationship_t__continuation_t/continuation_t.html +asio/reference/execution__relationship_t__continuation_t/is_applicable_property_v.html +asio/reference/execution__relationship_t__continuation_t/is_preferable.html +asio/reference/execution__relationship_t__continuation_t/is_requirable.html +asio/reference/execution__relationship_t__continuation_t/polymorphic_query_result_type.html +asio/reference/execution__relationship_t__continuation_t/value.html +asio/reference/execution__relationship_t__fork_t.html +asio/reference/execution__relationship_t__fork_t/fork_t.html +asio/reference/execution__relationship_t__fork_t/is_applicable_property_v.html +asio/reference/execution__relationship_t__fork_t/is_preferable.html +asio/reference/execution__relationship_t__fork_t/is_requirable.html +asio/reference/execution__relationship_t__fork_t/polymorphic_query_result_type.html +asio/reference/execution__relationship_t__fork_t/value.html +asio/reference/execution__schedule.html +asio/reference/execution__sender_base.html +asio/reference/execution__sender_traits.html +asio/reference/execution__set_done.html +asio/reference/execution__set_error.html +asio/reference/execution__set_value.html +asio/reference/execution__start.html +asio/reference/execution__submit.html +asio/reference/execution_context.html +asio/reference/execution_context/add_service.html +asio/reference/execution_context/destroy.html +asio/reference/execution_context/execution_context.html +asio/reference/execution_context/fork_event.html +asio/reference/execution_context/has_service.html +asio/reference/execution_context/make_service.html +asio/reference/execution_context/notify_fork.html +asio/reference/execution_context/shutdown.html +asio/reference/execution_context/use_service.html +asio/reference/execution_context/use_service/overload1.html +asio/reference/execution_context/use_service/overload2.html +asio/reference/execution_context/_execution_context.html +asio/reference/execution_context__id.html +asio/reference/execution_context__id/id.html +asio/reference/execution_context__service.html +asio/reference/execution_context__service/context.html +asio/reference/execution_context__service/service.html +asio/reference/execution_context__service/_service.html +asio/reference/execution_context__service/notify_fork.html +asio/reference/execution_context__service/shutdown.html +asio/reference/executor.html +asio/reference/executor/context.html +asio/reference/executor/defer.html +asio/reference/executor/dispatch.html +asio/reference/executor/executor.html +asio/reference/executor/executor/overload1.html +asio/reference/executor/executor/overload2.html +asio/reference/executor/executor/overload3.html +asio/reference/executor/executor/overload4.html +asio/reference/executor/executor/overload5.html +asio/reference/executor/executor/overload6.html +asio/reference/executor/on_work_finished.html +asio/reference/executor/on_work_started.html +asio/reference/executor/operator_unspecified_bool_type.html +asio/reference/executor/operator_not__eq_.html +asio/reference/executor/operator_eq_.html +asio/reference/executor/operator_eq_/overload1.html +asio/reference/executor/operator_eq_/overload2.html +asio/reference/executor/operator_eq_/overload3.html +asio/reference/executor/operator_eq_/overload4.html +asio/reference/executor/operator_eq__eq_.html +asio/reference/executor/post.html +asio/reference/executor/target.html +asio/reference/executor/target/overload1.html +asio/reference/executor/target/overload2.html +asio/reference/executor/target_type.html +asio/reference/executor/unspecified_bool_true.html +asio/reference/executor/unspecified_bool_type.html +asio/reference/executor/_executor.html +asio/reference/executor__unspecified_bool_type_t.html +asio/reference/executor_arg.html +asio/reference/executor_arg_t.html +asio/reference/executor_arg_t/executor_arg_t.html +asio/reference/executor_binder.html +asio/reference/executor_binder/argument_type.html +asio/reference/executor_binder/executor_binder.html +asio/reference/executor_binder/executor_binder/overload1.html +asio/reference/executor_binder/executor_binder/overload2.html +asio/reference/executor_binder/executor_binder/overload3.html +asio/reference/executor_binder/executor_binder/overload4.html +asio/reference/executor_binder/executor_binder/overload5.html +asio/reference/executor_binder/executor_binder/overload6.html +asio/reference/executor_binder/executor_binder/overload7.html +asio/reference/executor_binder/executor_binder/overload8.html +asio/reference/executor_binder/executor_binder/overload9.html +asio/reference/executor_binder/executor_type.html +asio/reference/executor_binder/first_argument_type.html +asio/reference/executor_binder/get.html +asio/reference/executor_binder/get/overload1.html +asio/reference/executor_binder/get/overload2.html +asio/reference/executor_binder/get_executor.html +asio/reference/executor_binder/operator_lp__rp_.html +asio/reference/executor_binder/operator_lp__rp_/overload1.html +asio/reference/executor_binder/operator_lp__rp_/overload2.html +asio/reference/executor_binder/result_type.html +asio/reference/executor_binder/second_argument_type.html +asio/reference/executor_binder/target_type.html +asio/reference/executor_binder/_executor_binder.html +asio/reference/executor_work_guard.html +asio/reference/executor_work_guard/executor_type.html +asio/reference/executor_work_guard/executor_work_guard.html +asio/reference/executor_work_guard/executor_work_guard/overload1.html +asio/reference/executor_work_guard/executor_work_guard/overload2.html +asio/reference/executor_work_guard/executor_work_guard/overload3.html +asio/reference/executor_work_guard/get_executor.html +asio/reference/executor_work_guard/owns_work.html +asio/reference/executor_work_guard/reset.html +asio/reference/executor_work_guard/_executor_work_guard.html +asio/reference/generic__basic_endpoint.html +asio/reference/generic__basic_endpoint/basic_endpoint.html +asio/reference/generic__basic_endpoint/basic_endpoint/overload1.html +asio/reference/generic__basic_endpoint/basic_endpoint/overload2.html +asio/reference/generic__basic_endpoint/basic_endpoint/overload3.html +asio/reference/generic__basic_endpoint/basic_endpoint/overload4.html +asio/reference/generic__basic_endpoint/capacity.html +asio/reference/generic__basic_endpoint/data.html +asio/reference/generic__basic_endpoint/data/overload1.html +asio/reference/generic__basic_endpoint/data/overload2.html +asio/reference/generic__basic_endpoint/data_type.html +asio/reference/generic__basic_endpoint/operator_not__eq_.html +asio/reference/generic__basic_endpoint/operator_lt_.html +asio/reference/generic__basic_endpoint/operator_lt__eq_.html +asio/reference/generic__basic_endpoint/operator_eq_.html +asio/reference/generic__basic_endpoint/operator_eq__eq_.html +asio/reference/generic__basic_endpoint/operator_gt_.html +asio/reference/generic__basic_endpoint/operator_gt__eq_.html +asio/reference/generic__basic_endpoint/protocol.html +asio/reference/generic__basic_endpoint/protocol_type.html +asio/reference/generic__basic_endpoint/resize.html +asio/reference/generic__basic_endpoint/size.html +asio/reference/generic__datagram_protocol.html +asio/reference/generic__datagram_protocol/datagram_protocol.html +asio/reference/generic__datagram_protocol/datagram_protocol/overload1.html +asio/reference/generic__datagram_protocol/datagram_protocol/overload2.html +asio/reference/generic__datagram_protocol/endpoint.html +asio/reference/generic__datagram_protocol/family.html +asio/reference/generic__datagram_protocol/operator_not__eq_.html +asio/reference/generic__datagram_protocol/operator_eq__eq_.html +asio/reference/generic__datagram_protocol/protocol.html +asio/reference/generic__datagram_protocol/socket.html +asio/reference/generic__datagram_protocol/type.html +asio/reference/generic__raw_protocol.html +asio/reference/generic__raw_protocol/endpoint.html +asio/reference/generic__raw_protocol/family.html +asio/reference/generic__raw_protocol/operator_not__eq_.html +asio/reference/generic__raw_protocol/operator_eq__eq_.html +asio/reference/generic__raw_protocol/protocol.html +asio/reference/generic__raw_protocol/raw_protocol.html +asio/reference/generic__raw_protocol/raw_protocol/overload1.html +asio/reference/generic__raw_protocol/raw_protocol/overload2.html +asio/reference/generic__raw_protocol/socket.html +asio/reference/generic__raw_protocol/type.html +asio/reference/generic__seq_packet_protocol.html +asio/reference/generic__seq_packet_protocol/endpoint.html +asio/reference/generic__seq_packet_protocol/family.html +asio/reference/generic__seq_packet_protocol/operator_not__eq_.html +asio/reference/generic__seq_packet_protocol/operator_eq__eq_.html +asio/reference/generic__seq_packet_protocol/protocol.html +asio/reference/generic__seq_packet_protocol/seq_packet_protocol.html +asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload1.html +asio/reference/generic__seq_packet_protocol/seq_packet_protocol/overload2.html +asio/reference/generic__seq_packet_protocol/socket.html +asio/reference/generic__seq_packet_protocol/type.html +asio/reference/generic__stream_protocol.html +asio/reference/generic__stream_protocol/endpoint.html +asio/reference/generic__stream_protocol/family.html +asio/reference/generic__stream_protocol/iostream.html +asio/reference/generic__stream_protocol/operator_not__eq_.html +asio/reference/generic__stream_protocol/operator_eq__eq_.html +asio/reference/generic__stream_protocol/protocol.html +asio/reference/generic__stream_protocol/socket.html +asio/reference/generic__stream_protocol/stream_protocol.html +asio/reference/generic__stream_protocol/stream_protocol/overload1.html +asio/reference/generic__stream_protocol/stream_protocol/overload2.html +asio/reference/generic__stream_protocol/type.html +asio/reference/get_associated_allocator.html +asio/reference/get_associated_allocator/overload1.html +asio/reference/get_associated_allocator/overload2.html +asio/reference/get_associated_executor.html +asio/reference/get_associated_executor/overload1.html +asio/reference/get_associated_executor/overload2.html +asio/reference/get_associated_executor/overload3.html +asio/reference/high_resolution_timer.html +asio/reference/invalid_service_owner.html +asio/reference/invalid_service_owner/invalid_service_owner.html +asio/reference/io_context.html +asio/reference/io_context/add_service.html +asio/reference/io_context/count_type.html +asio/reference/io_context/destroy.html +asio/reference/io_context/dispatch.html +asio/reference/io_context/executor_type.html +asio/reference/io_context/fork_event.html +asio/reference/io_context/get_executor.html +asio/reference/io_context/has_service.html +asio/reference/io_context/io_context.html +asio/reference/io_context/io_context/overload1.html +asio/reference/io_context/io_context/overload2.html +asio/reference/io_context/make_service.html +asio/reference/io_context/notify_fork.html +asio/reference/io_context/poll.html +asio/reference/io_context/poll/overload1.html +asio/reference/io_context/poll/overload2.html +asio/reference/io_context/poll_one.html +asio/reference/io_context/poll_one/overload1.html +asio/reference/io_context/poll_one/overload2.html +asio/reference/io_context/post.html +asio/reference/io_context/reset.html +asio/reference/io_context/restart.html +asio/reference/io_context/run.html +asio/reference/io_context/run/overload1.html +asio/reference/io_context/run/overload2.html +asio/reference/io_context/run_for.html +asio/reference/io_context/run_one.html +asio/reference/io_context/run_one/overload1.html +asio/reference/io_context/run_one/overload2.html +asio/reference/io_context/run_one_for.html +asio/reference/io_context/run_one_until.html +asio/reference/io_context/run_until.html +asio/reference/io_context/shutdown.html +asio/reference/io_context/stop.html +asio/reference/io_context/stopped.html +asio/reference/io_context/use_service.html +asio/reference/io_context/use_service/overload1.html +asio/reference/io_context/use_service/overload2.html +asio/reference/io_context/wrap.html +asio/reference/io_context/_io_context.html +asio/reference/io_context__basic_executor_type.html +asio/reference/io_context__basic_executor_type/basic_executor_type.html +asio/reference/io_context__basic_executor_type/basic_executor_type/overload1.html +asio/reference/io_context__basic_executor_type/basic_executor_type/overload2.html +asio/reference/io_context__basic_executor_type/context.html +asio/reference/io_context__basic_executor_type/defer.html +asio/reference/io_context__basic_executor_type/dispatch.html +asio/reference/io_context__basic_executor_type/execute.html +asio/reference/io_context__basic_executor_type/on_work_finished.html +asio/reference/io_context__basic_executor_type/on_work_started.html +asio/reference/io_context__basic_executor_type/operator_not__eq_.html +asio/reference/io_context__basic_executor_type/operator_eq_.html +asio/reference/io_context__basic_executor_type/operator_eq_/overload1.html +asio/reference/io_context__basic_executor_type/operator_eq_/overload2.html +asio/reference/io_context__basic_executor_type/operator_eq__eq_.html +asio/reference/io_context__basic_executor_type/post.html +asio/reference/io_context__basic_executor_type/query.html +asio/reference/io_context__basic_executor_type/query/overload1.html +asio/reference/io_context__basic_executor_type/query/overload2.html +asio/reference/io_context__basic_executor_type/query/overload3.html +asio/reference/io_context__basic_executor_type/query/overload4.html +asio/reference/io_context__basic_executor_type/query/overload5.html +asio/reference/io_context__basic_executor_type/query__static.html +asio/reference/io_context__basic_executor_type/query__static/overload1.html +asio/reference/io_context__basic_executor_type/query__static/overload2.html +asio/reference/io_context__basic_executor_type/require.html +asio/reference/io_context__basic_executor_type/require/overload1.html +asio/reference/io_context__basic_executor_type/require/overload2.html +asio/reference/io_context__basic_executor_type/require/overload3.html +asio/reference/io_context__basic_executor_type/require/overload4.html +asio/reference/io_context__basic_executor_type/require/overload5.html +asio/reference/io_context__basic_executor_type/require/overload6.html +asio/reference/io_context__basic_executor_type/require/overload7.html +asio/reference/io_context__basic_executor_type/require/overload8.html +asio/reference/io_context__basic_executor_type/running_in_this_thread.html +asio/reference/io_context__basic_executor_type/_basic_executor_type.html +asio/reference/io_context__service.html +asio/reference/io_context__service/get_io_context.html +asio/reference/io_context__service/service.html +asio/reference/io_context__service/_service.html +asio/reference/io_context__strand.html +asio/reference/io_context__strand/context.html +asio/reference/io_context__strand/defer.html +asio/reference/io_context__strand/dispatch.html +asio/reference/io_context__strand/dispatch/overload1.html +asio/reference/io_context__strand/dispatch/overload2.html +asio/reference/io_context__strand/on_work_finished.html +asio/reference/io_context__strand/on_work_started.html +asio/reference/io_context__strand/operator_not__eq_.html +asio/reference/io_context__strand/operator_eq__eq_.html +asio/reference/io_context__strand/post.html +asio/reference/io_context__strand/post/overload1.html +asio/reference/io_context__strand/post/overload2.html +asio/reference/io_context__strand/running_in_this_thread.html +asio/reference/io_context__strand/strand.html +asio/reference/io_context__strand/wrap.html +asio/reference/io_context__strand/_strand.html +asio/reference/io_context__work.html +asio/reference/io_context__work/get_io_context.html +asio/reference/io_context__work/work.html +asio/reference/io_context__work/work/overload1.html +asio/reference/io_context__work/work/overload2.html +asio/reference/io_context__work/_work.html +asio/reference/io_service.html +asio/reference/ip__address.html +asio/reference/ip__address/address.html +asio/reference/ip__address/address/overload1.html +asio/reference/ip__address/address/overload2.html +asio/reference/ip__address/address/overload3.html +asio/reference/ip__address/address/overload4.html +asio/reference/ip__address/from_string.html +asio/reference/ip__address/from_string/overload1.html +asio/reference/ip__address/from_string/overload2.html +asio/reference/ip__address/from_string/overload3.html +asio/reference/ip__address/from_string/overload4.html +asio/reference/ip__address/is_loopback.html +asio/reference/ip__address/is_multicast.html +asio/reference/ip__address/is_unspecified.html +asio/reference/ip__address/is_v4.html +asio/reference/ip__address/is_v6.html +asio/reference/ip__address/make_address.html +asio/reference/ip__address/make_address/overload1.html +asio/reference/ip__address/make_address/overload2.html +asio/reference/ip__address/make_address/overload3.html +asio/reference/ip__address/make_address/overload4.html +asio/reference/ip__address/make_address/overload5.html +asio/reference/ip__address/make_address/overload6.html +asio/reference/ip__address/operator_not__eq_.html +asio/reference/ip__address/operator_lt_.html +asio/reference/ip__address/operator_lt__lt_.html +asio/reference/ip__address/operator_lt__eq_.html +asio/reference/ip__address/operator_eq_.html +asio/reference/ip__address/operator_eq_/overload1.html +asio/reference/ip__address/operator_eq_/overload2.html +asio/reference/ip__address/operator_eq_/overload3.html +asio/reference/ip__address/operator_eq__eq_.html +asio/reference/ip__address/operator_gt_.html +asio/reference/ip__address/operator_gt__eq_.html +asio/reference/ip__address/to_string.html +asio/reference/ip__address/to_string/overload1.html +asio/reference/ip__address/to_string/overload2.html +asio/reference/ip__address/to_v4.html +asio/reference/ip__address/to_v6.html +asio/reference/ip__address_v4.html +asio/reference/ip__address_v4/address_v4.html +asio/reference/ip__address_v4/address_v4/overload1.html +asio/reference/ip__address_v4/address_v4/overload2.html +asio/reference/ip__address_v4/address_v4/overload3.html +asio/reference/ip__address_v4/address_v4/overload4.html +asio/reference/ip__address_v4/any.html +asio/reference/ip__address_v4/broadcast.html +asio/reference/ip__address_v4/broadcast/overload1.html +asio/reference/ip__address_v4/broadcast/overload2.html +asio/reference/ip__address_v4/bytes_type.html +asio/reference/ip__address_v4/from_string.html +asio/reference/ip__address_v4/from_string/overload1.html +asio/reference/ip__address_v4/from_string/overload2.html +asio/reference/ip__address_v4/from_string/overload3.html +asio/reference/ip__address_v4/from_string/overload4.html +asio/reference/ip__address_v4/is_class_a.html +asio/reference/ip__address_v4/is_class_b.html +asio/reference/ip__address_v4/is_class_c.html +asio/reference/ip__address_v4/is_loopback.html +asio/reference/ip__address_v4/is_multicast.html +asio/reference/ip__address_v4/is_unspecified.html +asio/reference/ip__address_v4/loopback.html +asio/reference/ip__address_v4/make_address_v4.html +asio/reference/ip__address_v4/make_address_v4/overload1.html +asio/reference/ip__address_v4/make_address_v4/overload2.html +asio/reference/ip__address_v4/make_address_v4/overload3.html +asio/reference/ip__address_v4/make_address_v4/overload4.html +asio/reference/ip__address_v4/make_address_v4/overload5.html +asio/reference/ip__address_v4/make_address_v4/overload6.html +asio/reference/ip__address_v4/make_address_v4/overload7.html +asio/reference/ip__address_v4/make_address_v4/overload8.html +asio/reference/ip__address_v4/make_address_v4/overload9.html +asio/reference/ip__address_v4/make_network_v4.html +asio/reference/ip__address_v4/make_network_v4/overload1.html +asio/reference/ip__address_v4/make_network_v4/overload2.html +asio/reference/ip__address_v4/netmask.html +asio/reference/ip__address_v4/operator_not__eq_.html +asio/reference/ip__address_v4/operator_lt_.html +asio/reference/ip__address_v4/operator_lt__lt_.html +asio/reference/ip__address_v4/operator_lt__lt_/overload1.html +asio/reference/ip__address_v4/operator_lt__lt_/overload2.html +asio/reference/ip__address_v4/operator_lt__eq_.html +asio/reference/ip__address_v4/operator_eq_.html +asio/reference/ip__address_v4/operator_eq__eq_.html +asio/reference/ip__address_v4/operator_gt_.html +asio/reference/ip__address_v4/operator_gt__eq_.html +asio/reference/ip__address_v4/to_bytes.html +asio/reference/ip__address_v4/to_string.html +asio/reference/ip__address_v4/to_string/overload1.html +asio/reference/ip__address_v4/to_string/overload2.html +asio/reference/ip__address_v4/to_uint.html +asio/reference/ip__address_v4/to_ulong.html +asio/reference/ip__address_v4/uint_type.html +asio/reference/ip__address_v4_iterator.html +asio/reference/ip__address_v4_range.html +asio/reference/ip__address_v6.html +asio/reference/ip__address_v6/address_v6.html +asio/reference/ip__address_v6/address_v6/overload1.html +asio/reference/ip__address_v6/address_v6/overload2.html +asio/reference/ip__address_v6/address_v6/overload3.html +asio/reference/ip__address_v6/any.html +asio/reference/ip__address_v6/bytes_type.html +asio/reference/ip__address_v6/from_string.html +asio/reference/ip__address_v6/from_string/overload1.html +asio/reference/ip__address_v6/from_string/overload2.html +asio/reference/ip__address_v6/from_string/overload3.html +asio/reference/ip__address_v6/from_string/overload4.html +asio/reference/ip__address_v6/is_link_local.html +asio/reference/ip__address_v6/is_loopback.html +asio/reference/ip__address_v6/is_multicast.html +asio/reference/ip__address_v6/is_multicast_global.html +asio/reference/ip__address_v6/is_multicast_link_local.html +asio/reference/ip__address_v6/is_multicast_node_local.html +asio/reference/ip__address_v6/is_multicast_org_local.html +asio/reference/ip__address_v6/is_multicast_site_local.html +asio/reference/ip__address_v6/is_site_local.html +asio/reference/ip__address_v6/is_unspecified.html +asio/reference/ip__address_v6/is_v4_compatible.html +asio/reference/ip__address_v6/is_v4_mapped.html +asio/reference/ip__address_v6/loopback.html +asio/reference/ip__address_v6/make_address_v6.html +asio/reference/ip__address_v6/make_address_v6/overload1.html +asio/reference/ip__address_v6/make_address_v6/overload2.html +asio/reference/ip__address_v6/make_address_v6/overload3.html +asio/reference/ip__address_v6/make_address_v6/overload4.html +asio/reference/ip__address_v6/make_address_v6/overload5.html +asio/reference/ip__address_v6/make_address_v6/overload6.html +asio/reference/ip__address_v6/make_address_v6/overload7.html +asio/reference/ip__address_v6/make_address_v6/overload8.html +asio/reference/ip__address_v6/make_network_v6.html +asio/reference/ip__address_v6/operator_not__eq_.html +asio/reference/ip__address_v6/operator_lt_.html +asio/reference/ip__address_v6/operator_lt__lt_.html +asio/reference/ip__address_v6/operator_lt__lt_/overload1.html +asio/reference/ip__address_v6/operator_lt__lt_/overload2.html +asio/reference/ip__address_v6/operator_lt__eq_.html +asio/reference/ip__address_v6/operator_eq_.html +asio/reference/ip__address_v6/operator_eq__eq_.html +asio/reference/ip__address_v6/operator_gt_.html +asio/reference/ip__address_v6/operator_gt__eq_.html +asio/reference/ip__address_v6/scope_id.html +asio/reference/ip__address_v6/scope_id/overload1.html +asio/reference/ip__address_v6/scope_id/overload2.html +asio/reference/ip__address_v6/to_bytes.html +asio/reference/ip__address_v6/to_string.html +asio/reference/ip__address_v6/to_string/overload1.html +asio/reference/ip__address_v6/to_string/overload2.html +asio/reference/ip__address_v6/to_v4.html +asio/reference/ip__address_v6/v4_compatible.html +asio/reference/ip__address_v6/v4_mapped.html +asio/reference/ip__address_v6_iterator.html +asio/reference/ip__address_v6_range.html +asio/reference/ip__bad_address_cast.html +asio/reference/ip__bad_address_cast/bad_address_cast.html +asio/reference/ip__bad_address_cast/what.html +asio/reference/ip__bad_address_cast/_bad_address_cast.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload1.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/basic_address_iterator/overload2.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/difference_type.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/iterator_category.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator__star_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_not__eq_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload1.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_plus__plus_/overload2.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload1.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_minus__minus_/overload2.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_arrow_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/operator_eq__eq_.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/pointer.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/reference.html +asio/reference/ip__basic_address_iterator_lt__address_v4__gt_/value_type.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload1.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/basic_address_iterator/overload2.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/difference_type.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/iterator_category.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator__star_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_not__eq_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload1.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_plus__plus_/overload2.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload1.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_minus__minus_/overload2.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_arrow_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/operator_eq__eq_.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/pointer.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/reference.html +asio/reference/ip__basic_address_iterator_lt__address_v6__gt_/value_type.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload1.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload2.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/basic_address_range/overload3.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/begin.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/empty.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/end.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/find.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/iterator.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/operator_eq_.html +asio/reference/ip__basic_address_range_lt__address_v4__gt_/size.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload1.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload2.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/basic_address_range/overload3.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/begin.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/empty.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/end.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/find.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/iterator.html +asio/reference/ip__basic_address_range_lt__address_v6__gt_/operator_eq_.html +asio/reference/ip__basic_endpoint.html +asio/reference/ip__basic_endpoint/address.html +asio/reference/ip__basic_endpoint/address/overload1.html +asio/reference/ip__basic_endpoint/address/overload2.html +asio/reference/ip__basic_endpoint/basic_endpoint.html +asio/reference/ip__basic_endpoint/basic_endpoint/overload1.html +asio/reference/ip__basic_endpoint/basic_endpoint/overload2.html +asio/reference/ip__basic_endpoint/basic_endpoint/overload3.html +asio/reference/ip__basic_endpoint/basic_endpoint/overload4.html +asio/reference/ip__basic_endpoint/basic_endpoint/overload5.html +asio/reference/ip__basic_endpoint/capacity.html +asio/reference/ip__basic_endpoint/data.html +asio/reference/ip__basic_endpoint/data/overload1.html +asio/reference/ip__basic_endpoint/data/overload2.html +asio/reference/ip__basic_endpoint/data_type.html +asio/reference/ip__basic_endpoint/operator_not__eq_.html +asio/reference/ip__basic_endpoint/operator_lt_.html +asio/reference/ip__basic_endpoint/operator_lt__lt_.html +asio/reference/ip__basic_endpoint/operator_lt__eq_.html +asio/reference/ip__basic_endpoint/operator_eq_.html +asio/reference/ip__basic_endpoint/operator_eq_/overload1.html +asio/reference/ip__basic_endpoint/operator_eq_/overload2.html +asio/reference/ip__basic_endpoint/operator_eq__eq_.html +asio/reference/ip__basic_endpoint/operator_gt_.html +asio/reference/ip__basic_endpoint/operator_gt__eq_.html +asio/reference/ip__basic_endpoint/port.html +asio/reference/ip__basic_endpoint/port/overload1.html +asio/reference/ip__basic_endpoint/port/overload2.html +asio/reference/ip__basic_endpoint/protocol.html +asio/reference/ip__basic_endpoint/protocol_type.html +asio/reference/ip__basic_endpoint/resize.html +asio/reference/ip__basic_endpoint/size.html +asio/reference/ip__basic_resolver.html +asio/reference/ip__basic_resolver/address_configured.html +asio/reference/ip__basic_resolver/all_matching.html +asio/reference/ip__basic_resolver/async_resolve.html +asio/reference/ip__basic_resolver/async_resolve/overload1.html +asio/reference/ip__basic_resolver/async_resolve/overload2.html +asio/reference/ip__basic_resolver/async_resolve/overload3.html +asio/reference/ip__basic_resolver/async_resolve/overload4.html +asio/reference/ip__basic_resolver/async_resolve/overload5.html +asio/reference/ip__basic_resolver/async_resolve/overload6.html +asio/reference/ip__basic_resolver/basic_resolver.html +asio/reference/ip__basic_resolver/basic_resolver/overload1.html +asio/reference/ip__basic_resolver/basic_resolver/overload2.html +asio/reference/ip__basic_resolver/basic_resolver/overload3.html +asio/reference/ip__basic_resolver/cancel.html +asio/reference/ip__basic_resolver/canonical_name.html +asio/reference/ip__basic_resolver/endpoint_type.html +asio/reference/ip__basic_resolver/executor_type.html +asio/reference/ip__basic_resolver/flags.html +asio/reference/ip__basic_resolver/get_executor.html +asio/reference/ip__basic_resolver/iterator.html +asio/reference/ip__basic_resolver/numeric_host.html +asio/reference/ip__basic_resolver/numeric_service.html +asio/reference/ip__basic_resolver/operator_eq_.html +asio/reference/ip__basic_resolver/passive.html +asio/reference/ip__basic_resolver/protocol_type.html +asio/reference/ip__basic_resolver/query.html +asio/reference/ip__basic_resolver/resolve.html +asio/reference/ip__basic_resolver/resolve/overload1.html +asio/reference/ip__basic_resolver/resolve/overload2.html +asio/reference/ip__basic_resolver/resolve/overload3.html +asio/reference/ip__basic_resolver/resolve/overload4.html +asio/reference/ip__basic_resolver/resolve/overload5.html +asio/reference/ip__basic_resolver/resolve/overload6.html +asio/reference/ip__basic_resolver/resolve/overload7.html +asio/reference/ip__basic_resolver/resolve/overload8.html +asio/reference/ip__basic_resolver/resolve/overload9.html +asio/reference/ip__basic_resolver/resolve/overload10.html +asio/reference/ip__basic_resolver/resolve/overload11.html +asio/reference/ip__basic_resolver/resolve/overload12.html +asio/reference/ip__basic_resolver/results_type.html +asio/reference/ip__basic_resolver/v4_mapped.html +asio/reference/ip__basic_resolver/_basic_resolver.html +asio/reference/ip__basic_resolver__rebind_executor.html +asio/reference/ip__basic_resolver__rebind_executor/other.html +asio/reference/ip__basic_resolver_entry.html +asio/reference/ip__basic_resolver_entry/basic_resolver_entry.html +asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload1.html +asio/reference/ip__basic_resolver_entry/basic_resolver_entry/overload2.html +asio/reference/ip__basic_resolver_entry/endpoint.html +asio/reference/ip__basic_resolver_entry/endpoint_type.html +asio/reference/ip__basic_resolver_entry/host_name.html +asio/reference/ip__basic_resolver_entry/host_name/overload1.html +asio/reference/ip__basic_resolver_entry/host_name/overload2.html +asio/reference/ip__basic_resolver_entry/operator_endpoint_type.html +asio/reference/ip__basic_resolver_entry/protocol_type.html +asio/reference/ip__basic_resolver_entry/service_name.html +asio/reference/ip__basic_resolver_entry/service_name/overload1.html +asio/reference/ip__basic_resolver_entry/service_name/overload2.html +asio/reference/ip__basic_resolver_iterator.html +asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator.html +asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload1.html +asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload2.html +asio/reference/ip__basic_resolver_iterator/basic_resolver_iterator/overload3.html +asio/reference/ip__basic_resolver_iterator/dereference.html +asio/reference/ip__basic_resolver_iterator/difference_type.html +asio/reference/ip__basic_resolver_iterator/equal.html +asio/reference/ip__basic_resolver_iterator/increment.html +asio/reference/ip__basic_resolver_iterator/index_.html +asio/reference/ip__basic_resolver_iterator/iterator_category.html +asio/reference/ip__basic_resolver_iterator/operator__star_.html +asio/reference/ip__basic_resolver_iterator/operator_not__eq_.html +asio/reference/ip__basic_resolver_iterator/operator_plus__plus_.html +asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload1.html +asio/reference/ip__basic_resolver_iterator/operator_plus__plus_/overload2.html +asio/reference/ip__basic_resolver_iterator/operator_arrow_.html +asio/reference/ip__basic_resolver_iterator/operator_eq_.html +asio/reference/ip__basic_resolver_iterator/operator_eq_/overload1.html +asio/reference/ip__basic_resolver_iterator/operator_eq_/overload2.html +asio/reference/ip__basic_resolver_iterator/operator_eq__eq_.html +asio/reference/ip__basic_resolver_iterator/pointer.html +asio/reference/ip__basic_resolver_iterator/reference.html +asio/reference/ip__basic_resolver_iterator/value_type.html +asio/reference/ip__basic_resolver_iterator/values_.html +asio/reference/ip__basic_resolver_query.html +asio/reference/ip__basic_resolver_query/address_configured.html +asio/reference/ip__basic_resolver_query/all_matching.html +asio/reference/ip__basic_resolver_query/basic_resolver_query.html +asio/reference/ip__basic_resolver_query/basic_resolver_query/overload1.html +asio/reference/ip__basic_resolver_query/basic_resolver_query/overload2.html +asio/reference/ip__basic_resolver_query/basic_resolver_query/overload3.html +asio/reference/ip__basic_resolver_query/basic_resolver_query/overload4.html +asio/reference/ip__basic_resolver_query/canonical_name.html +asio/reference/ip__basic_resolver_query/flags.html +asio/reference/ip__basic_resolver_query/hints.html +asio/reference/ip__basic_resolver_query/host_name.html +asio/reference/ip__basic_resolver_query/numeric_host.html +asio/reference/ip__basic_resolver_query/numeric_service.html +asio/reference/ip__basic_resolver_query/passive.html +asio/reference/ip__basic_resolver_query/protocol_type.html +asio/reference/ip__basic_resolver_query/service_name.html +asio/reference/ip__basic_resolver_query/v4_mapped.html +asio/reference/ip__basic_resolver_results.html +asio/reference/ip__basic_resolver_results/basic_resolver_results.html +asio/reference/ip__basic_resolver_results/basic_resolver_results/overload1.html +asio/reference/ip__basic_resolver_results/basic_resolver_results/overload2.html +asio/reference/ip__basic_resolver_results/basic_resolver_results/overload3.html +asio/reference/ip__basic_resolver_results/begin.html +asio/reference/ip__basic_resolver_results/cbegin.html +asio/reference/ip__basic_resolver_results/cend.html +asio/reference/ip__basic_resolver_results/const_iterator.html +asio/reference/ip__basic_resolver_results/const_reference.html +asio/reference/ip__basic_resolver_results/dereference.html +asio/reference/ip__basic_resolver_results/difference_type.html +asio/reference/ip__basic_resolver_results/empty.html +asio/reference/ip__basic_resolver_results/end.html +asio/reference/ip__basic_resolver_results/endpoint_type.html +asio/reference/ip__basic_resolver_results/equal.html +asio/reference/ip__basic_resolver_results/increment.html +asio/reference/ip__basic_resolver_results/index_.html +asio/reference/ip__basic_resolver_results/iterator.html +asio/reference/ip__basic_resolver_results/iterator_category.html +asio/reference/ip__basic_resolver_results/max_size.html +asio/reference/ip__basic_resolver_results/operator__star_.html +asio/reference/ip__basic_resolver_results/operator_not__eq_.html +asio/reference/ip__basic_resolver_results/operator_not__eq_/overload1.html +asio/reference/ip__basic_resolver_results/operator_not__eq_/overload2.html +asio/reference/ip__basic_resolver_results/operator_plus__plus_.html +asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload1.html +asio/reference/ip__basic_resolver_results/operator_plus__plus_/overload2.html +asio/reference/ip__basic_resolver_results/operator_arrow_.html +asio/reference/ip__basic_resolver_results/operator_eq_.html +asio/reference/ip__basic_resolver_results/operator_eq_/overload1.html +asio/reference/ip__basic_resolver_results/operator_eq_/overload2.html +asio/reference/ip__basic_resolver_results/operator_eq__eq_.html +asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload1.html +asio/reference/ip__basic_resolver_results/operator_eq__eq_/overload2.html +asio/reference/ip__basic_resolver_results/pointer.html +asio/reference/ip__basic_resolver_results/protocol_type.html +asio/reference/ip__basic_resolver_results/reference.html +asio/reference/ip__basic_resolver_results/size.html +asio/reference/ip__basic_resolver_results/size_type.html +asio/reference/ip__basic_resolver_results/swap.html +asio/reference/ip__basic_resolver_results/value_type.html +asio/reference/ip__basic_resolver_results/values_.html +asio/reference/ip__host_name.html +asio/reference/ip__host_name/overload1.html +asio/reference/ip__host_name/overload2.html +asio/reference/ip__icmp.html +asio/reference/ip__icmp/endpoint.html +asio/reference/ip__icmp/family.html +asio/reference/ip__icmp/operator_not__eq_.html +asio/reference/ip__icmp/operator_eq__eq_.html +asio/reference/ip__icmp/protocol.html +asio/reference/ip__icmp/resolver.html +asio/reference/ip__icmp/socket.html +asio/reference/ip__icmp/type.html +asio/reference/ip__icmp/v4.html +asio/reference/ip__icmp/v6.html +asio/reference/ip__multicast__enable_loopback.html +asio/reference/ip__multicast__hops.html +asio/reference/ip__multicast__join_group.html +asio/reference/ip__multicast__leave_group.html +asio/reference/ip__multicast__outbound_interface.html +asio/reference/ip__network_v4.html +asio/reference/ip__network_v4/address.html +asio/reference/ip__network_v4/broadcast.html +asio/reference/ip__network_v4/canonical.html +asio/reference/ip__network_v4/hosts.html +asio/reference/ip__network_v4/is_host.html +asio/reference/ip__network_v4/is_subnet_of.html +asio/reference/ip__network_v4/make_network_v4.html +asio/reference/ip__network_v4/make_network_v4/overload1.html +asio/reference/ip__network_v4/make_network_v4/overload2.html +asio/reference/ip__network_v4/make_network_v4/overload3.html +asio/reference/ip__network_v4/make_network_v4/overload4.html +asio/reference/ip__network_v4/make_network_v4/overload5.html +asio/reference/ip__network_v4/make_network_v4/overload6.html +asio/reference/ip__network_v4/netmask.html +asio/reference/ip__network_v4/network.html +asio/reference/ip__network_v4/network_v4.html +asio/reference/ip__network_v4/network_v4/overload1.html +asio/reference/ip__network_v4/network_v4/overload2.html +asio/reference/ip__network_v4/network_v4/overload3.html +asio/reference/ip__network_v4/network_v4/overload4.html +asio/reference/ip__network_v4/operator_not__eq_.html +asio/reference/ip__network_v4/operator_eq_.html +asio/reference/ip__network_v4/operator_eq__eq_.html +asio/reference/ip__network_v4/prefix_length.html +asio/reference/ip__network_v4/to_string.html +asio/reference/ip__network_v4/to_string/overload1.html +asio/reference/ip__network_v4/to_string/overload2.html +asio/reference/ip__network_v6.html +asio/reference/ip__network_v6/address.html +asio/reference/ip__network_v6/canonical.html +asio/reference/ip__network_v6/hosts.html +asio/reference/ip__network_v6/is_host.html +asio/reference/ip__network_v6/is_subnet_of.html +asio/reference/ip__network_v6/make_network_v6.html +asio/reference/ip__network_v6/make_network_v6/overload1.html +asio/reference/ip__network_v6/make_network_v6/overload2.html +asio/reference/ip__network_v6/make_network_v6/overload3.html +asio/reference/ip__network_v6/make_network_v6/overload4.html +asio/reference/ip__network_v6/make_network_v6/overload5.html +asio/reference/ip__network_v6/make_network_v6/overload6.html +asio/reference/ip__network_v6/network.html +asio/reference/ip__network_v6/network_v6.html +asio/reference/ip__network_v6/network_v6/overload1.html +asio/reference/ip__network_v6/network_v6/overload2.html +asio/reference/ip__network_v6/network_v6/overload3.html +asio/reference/ip__network_v6/operator_not__eq_.html +asio/reference/ip__network_v6/operator_eq_.html +asio/reference/ip__network_v6/operator_eq__eq_.html +asio/reference/ip__network_v6/prefix_length.html +asio/reference/ip__network_v6/to_string.html +asio/reference/ip__network_v6/to_string/overload1.html +asio/reference/ip__network_v6/to_string/overload2.html +asio/reference/ip__resolver_base.html +asio/reference/ip__resolver_base/address_configured.html +asio/reference/ip__resolver_base/all_matching.html +asio/reference/ip__resolver_base/canonical_name.html +asio/reference/ip__resolver_base/flags.html +asio/reference/ip__resolver_base/numeric_host.html +asio/reference/ip__resolver_base/numeric_service.html +asio/reference/ip__resolver_base/passive.html +asio/reference/ip__resolver_base/v4_mapped.html +asio/reference/ip__resolver_base/_resolver_base.html +asio/reference/ip__resolver_query_base.html +asio/reference/ip__resolver_query_base/address_configured.html +asio/reference/ip__resolver_query_base/all_matching.html +asio/reference/ip__resolver_query_base/canonical_name.html +asio/reference/ip__resolver_query_base/flags.html +asio/reference/ip__resolver_query_base/numeric_host.html +asio/reference/ip__resolver_query_base/numeric_service.html +asio/reference/ip__resolver_query_base/passive.html +asio/reference/ip__resolver_query_base/v4_mapped.html +asio/reference/ip__resolver_query_base/_resolver_query_base.html +asio/reference/ip__tcp.html +asio/reference/ip__tcp/acceptor.html +asio/reference/ip__tcp/endpoint.html +asio/reference/ip__tcp/family.html +asio/reference/ip__tcp/iostream.html +asio/reference/ip__tcp/no_delay.html +asio/reference/ip__tcp/operator_not__eq_.html +asio/reference/ip__tcp/operator_eq__eq_.html +asio/reference/ip__tcp/protocol.html +asio/reference/ip__tcp/resolver.html +asio/reference/ip__tcp/socket.html +asio/reference/ip__tcp/type.html +asio/reference/ip__tcp/v4.html +asio/reference/ip__tcp/v6.html +asio/reference/ip__udp.html +asio/reference/ip__udp/endpoint.html +asio/reference/ip__udp/family.html +asio/reference/ip__udp/operator_not__eq_.html +asio/reference/ip__udp/operator_eq__eq_.html +asio/reference/ip__udp/protocol.html +asio/reference/ip__udp/resolver.html +asio/reference/ip__udp/socket.html +asio/reference/ip__udp/type.html +asio/reference/ip__udp/v4.html +asio/reference/ip__udp/v6.html +asio/reference/ip__unicast__hops.html +asio/reference/ip__v4_mapped_t.html +asio/reference/ip__v6_only.html +asio/reference/is_applicable_property.html +asio/reference/is_const_buffer_sequence.html +asio/reference/is_dynamic_buffer.html +asio/reference/is_dynamic_buffer_v1.html +asio/reference/is_dynamic_buffer_v2.html +asio/reference/is_endpoint_sequence.html +asio/reference/is_endpoint_sequence/value.html +asio/reference/is_executor.html +asio/reference/is_match_condition.html +asio/reference/is_match_condition/value.html +asio/reference/is_mutable_buffer_sequence.html +asio/reference/is_nothrow_prefer.html +asio/reference/is_nothrow_query.html +asio/reference/is_nothrow_require.html +asio/reference/is_nothrow_require_concept.html +asio/reference/is_read_buffered.html +asio/reference/is_read_buffered/value.html +asio/reference/is_write_buffered.html +asio/reference/is_write_buffered/value.html +asio/reference/local__basic_endpoint.html +asio/reference/local__basic_endpoint/basic_endpoint.html +asio/reference/local__basic_endpoint/basic_endpoint/overload1.html +asio/reference/local__basic_endpoint/basic_endpoint/overload2.html +asio/reference/local__basic_endpoint/basic_endpoint/overload3.html +asio/reference/local__basic_endpoint/basic_endpoint/overload4.html +asio/reference/local__basic_endpoint/capacity.html +asio/reference/local__basic_endpoint/data.html +asio/reference/local__basic_endpoint/data/overload1.html +asio/reference/local__basic_endpoint/data/overload2.html +asio/reference/local__basic_endpoint/data_type.html +asio/reference/local__basic_endpoint/operator_not__eq_.html +asio/reference/local__basic_endpoint/operator_lt_.html +asio/reference/local__basic_endpoint/operator_lt__lt_.html +asio/reference/local__basic_endpoint/operator_lt__eq_.html +asio/reference/local__basic_endpoint/operator_eq_.html +asio/reference/local__basic_endpoint/operator_eq__eq_.html +asio/reference/local__basic_endpoint/operator_gt_.html +asio/reference/local__basic_endpoint/operator_gt__eq_.html +asio/reference/local__basic_endpoint/path.html +asio/reference/local__basic_endpoint/path/overload1.html +asio/reference/local__basic_endpoint/path/overload2.html +asio/reference/local__basic_endpoint/path/overload3.html +asio/reference/local__basic_endpoint/protocol.html +asio/reference/local__basic_endpoint/protocol_type.html +asio/reference/local__basic_endpoint/resize.html +asio/reference/local__basic_endpoint/size.html +asio/reference/local__connect_pair.html +asio/reference/local__connect_pair/overload1.html +asio/reference/local__connect_pair/overload2.html +asio/reference/local__datagram_protocol.html +asio/reference/local__datagram_protocol/endpoint.html +asio/reference/local__datagram_protocol/family.html +asio/reference/local__datagram_protocol/protocol.html +asio/reference/local__datagram_protocol/socket.html +asio/reference/local__datagram_protocol/type.html +asio/reference/local__stream_protocol.html +asio/reference/local__stream_protocol/acceptor.html +asio/reference/local__stream_protocol/endpoint.html +asio/reference/local__stream_protocol/family.html +asio/reference/local__stream_protocol/iostream.html +asio/reference/local__stream_protocol/protocol.html +asio/reference/local__stream_protocol/socket.html +asio/reference/local__stream_protocol/type.html +asio/reference/make_strand.html +asio/reference/make_strand/overload1.html +asio/reference/make_strand/overload2.html +asio/reference/make_work_guard.html +asio/reference/make_work_guard/overload1.html +asio/reference/make_work_guard/overload2.html +asio/reference/make_work_guard/overload3.html +asio/reference/make_work_guard/overload4.html +asio/reference/make_work_guard/overload5.html +asio/reference/multiple_exceptions.html +asio/reference/multiple_exceptions/first_exception.html +asio/reference/multiple_exceptions/multiple_exceptions.html +asio/reference/multiple_exceptions/what.html +asio/reference/mutable_buffer.html +asio/reference/mutable_buffer/data.html +asio/reference/mutable_buffer/mutable_buffer.html +asio/reference/mutable_buffer/mutable_buffer/overload1.html +asio/reference/mutable_buffer/mutable_buffer/overload2.html +asio/reference/mutable_buffer/operator_plus_.html +asio/reference/mutable_buffer/operator_plus_/overload1.html +asio/reference/mutable_buffer/operator_plus_/overload2.html +asio/reference/mutable_buffer/operator_plus__eq_.html +asio/reference/mutable_buffer/size.html +asio/reference/mutable_buffers_1.html +asio/reference/mutable_buffers_1/begin.html +asio/reference/mutable_buffers_1/const_iterator.html +asio/reference/mutable_buffers_1/data.html +asio/reference/mutable_buffers_1/end.html +asio/reference/mutable_buffers_1/mutable_buffers_1.html +asio/reference/mutable_buffers_1/mutable_buffers_1/overload1.html +asio/reference/mutable_buffers_1/mutable_buffers_1/overload2.html +asio/reference/mutable_buffers_1/operator_plus_.html +asio/reference/mutable_buffers_1/operator_plus_/overload1.html +asio/reference/mutable_buffers_1/operator_plus_/overload2.html +asio/reference/mutable_buffers_1/operator_plus__eq_.html +asio/reference/mutable_buffers_1/size.html +asio/reference/mutable_buffers_1/value_type.html +asio/reference/null_buffers.html +asio/reference/null_buffers/begin.html +asio/reference/null_buffers/const_iterator.html +asio/reference/null_buffers/end.html +asio/reference/null_buffers/value_type.html +asio/reference/operator_lt__lt_.html +asio/reference/placeholders__bytes_transferred.html +asio/reference/placeholders__endpoint.html +asio/reference/placeholders__error.html +asio/reference/placeholders__iterator.html +asio/reference/placeholders__results.html +asio/reference/placeholders__signal_number.html +asio/reference/posix__basic_descriptor.html +asio/reference/posix__basic_descriptor/assign.html +asio/reference/posix__basic_descriptor/assign/overload1.html +asio/reference/posix__basic_descriptor/assign/overload2.html +asio/reference/posix__basic_descriptor/async_wait.html +asio/reference/posix__basic_descriptor/basic_descriptor.html +asio/reference/posix__basic_descriptor/basic_descriptor/overload1.html +asio/reference/posix__basic_descriptor/basic_descriptor/overload2.html +asio/reference/posix__basic_descriptor/basic_descriptor/overload3.html +asio/reference/posix__basic_descriptor/basic_descriptor/overload4.html +asio/reference/posix__basic_descriptor/basic_descriptor/overload5.html +asio/reference/posix__basic_descriptor/bytes_readable.html +asio/reference/posix__basic_descriptor/cancel.html +asio/reference/posix__basic_descriptor/cancel/overload1.html +asio/reference/posix__basic_descriptor/cancel/overload2.html +asio/reference/posix__basic_descriptor/close.html +asio/reference/posix__basic_descriptor/close/overload1.html +asio/reference/posix__basic_descriptor/close/overload2.html +asio/reference/posix__basic_descriptor/executor_type.html +asio/reference/posix__basic_descriptor/get_executor.html +asio/reference/posix__basic_descriptor/io_control.html +asio/reference/posix__basic_descriptor/io_control/overload1.html +asio/reference/posix__basic_descriptor/io_control/overload2.html +asio/reference/posix__basic_descriptor/is_open.html +asio/reference/posix__basic_descriptor/lowest_layer.html +asio/reference/posix__basic_descriptor/lowest_layer/overload1.html +asio/reference/posix__basic_descriptor/lowest_layer/overload2.html +asio/reference/posix__basic_descriptor/lowest_layer_type.html +asio/reference/posix__basic_descriptor/native_handle.html +asio/reference/posix__basic_descriptor/native_handle_type.html +asio/reference/posix__basic_descriptor/native_non_blocking.html +asio/reference/posix__basic_descriptor/native_non_blocking/overload1.html +asio/reference/posix__basic_descriptor/native_non_blocking/overload2.html +asio/reference/posix__basic_descriptor/native_non_blocking/overload3.html +asio/reference/posix__basic_descriptor/non_blocking.html +asio/reference/posix__basic_descriptor/non_blocking/overload1.html +asio/reference/posix__basic_descriptor/non_blocking/overload2.html +asio/reference/posix__basic_descriptor/non_blocking/overload3.html +asio/reference/posix__basic_descriptor/operator_eq_.html +asio/reference/posix__basic_descriptor/release.html +asio/reference/posix__basic_descriptor/wait.html +asio/reference/posix__basic_descriptor/wait/overload1.html +asio/reference/posix__basic_descriptor/wait/overload2.html +asio/reference/posix__basic_descriptor/wait_type.html +asio/reference/posix__basic_descriptor/_basic_descriptor.html +asio/reference/posix__basic_descriptor__rebind_executor.html +asio/reference/posix__basic_descriptor__rebind_executor/other.html +asio/reference/posix__basic_stream_descriptor.html +asio/reference/posix__basic_stream_descriptor/assign.html +asio/reference/posix__basic_stream_descriptor/assign/overload1.html +asio/reference/posix__basic_stream_descriptor/assign/overload2.html +asio/reference/posix__basic_stream_descriptor/async_read_some.html +asio/reference/posix__basic_stream_descriptor/async_wait.html +asio/reference/posix__basic_stream_descriptor/async_write_some.html +asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor.html +asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload1.html +asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload2.html +asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload3.html +asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload4.html +asio/reference/posix__basic_stream_descriptor/basic_stream_descriptor/overload5.html +asio/reference/posix__basic_stream_descriptor/bytes_readable.html +asio/reference/posix__basic_stream_descriptor/cancel.html +asio/reference/posix__basic_stream_descriptor/cancel/overload1.html +asio/reference/posix__basic_stream_descriptor/cancel/overload2.html +asio/reference/posix__basic_stream_descriptor/close.html +asio/reference/posix__basic_stream_descriptor/close/overload1.html +asio/reference/posix__basic_stream_descriptor/close/overload2.html +asio/reference/posix__basic_stream_descriptor/executor_type.html +asio/reference/posix__basic_stream_descriptor/get_executor.html +asio/reference/posix__basic_stream_descriptor/io_control.html +asio/reference/posix__basic_stream_descriptor/io_control/overload1.html +asio/reference/posix__basic_stream_descriptor/io_control/overload2.html +asio/reference/posix__basic_stream_descriptor/is_open.html +asio/reference/posix__basic_stream_descriptor/lowest_layer.html +asio/reference/posix__basic_stream_descriptor/lowest_layer/overload1.html +asio/reference/posix__basic_stream_descriptor/lowest_layer/overload2.html +asio/reference/posix__basic_stream_descriptor/lowest_layer_type.html +asio/reference/posix__basic_stream_descriptor/native_handle.html +asio/reference/posix__basic_stream_descriptor/native_handle_type.html +asio/reference/posix__basic_stream_descriptor/native_non_blocking.html +asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload1.html +asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload2.html +asio/reference/posix__basic_stream_descriptor/native_non_blocking/overload3.html +asio/reference/posix__basic_stream_descriptor/non_blocking.html +asio/reference/posix__basic_stream_descriptor/non_blocking/overload1.html +asio/reference/posix__basic_stream_descriptor/non_blocking/overload2.html +asio/reference/posix__basic_stream_descriptor/non_blocking/overload3.html +asio/reference/posix__basic_stream_descriptor/operator_eq_.html +asio/reference/posix__basic_stream_descriptor/read_some.html +asio/reference/posix__basic_stream_descriptor/read_some/overload1.html +asio/reference/posix__basic_stream_descriptor/read_some/overload2.html +asio/reference/posix__basic_stream_descriptor/release.html +asio/reference/posix__basic_stream_descriptor/wait.html +asio/reference/posix__basic_stream_descriptor/wait/overload1.html +asio/reference/posix__basic_stream_descriptor/wait/overload2.html +asio/reference/posix__basic_stream_descriptor/wait_type.html +asio/reference/posix__basic_stream_descriptor/write_some.html +asio/reference/posix__basic_stream_descriptor/write_some/overload1.html +asio/reference/posix__basic_stream_descriptor/write_some/overload2.html +asio/reference/posix__basic_stream_descriptor__rebind_executor.html +asio/reference/posix__basic_stream_descriptor__rebind_executor/other.html +asio/reference/posix__descriptor.html +asio/reference/posix__descriptor_base.html +asio/reference/posix__descriptor_base/bytes_readable.html +asio/reference/posix__descriptor_base/wait_type.html +asio/reference/posix__descriptor_base/_descriptor_base.html +asio/reference/posix__stream_descriptor.html +asio/reference/post.html +asio/reference/post/overload1.html +asio/reference/post/overload2.html +asio/reference/post/overload3.html +asio/reference/prefer.html +asio/reference/prefer_result.html +asio/reference/prefer_result/type.html +asio/reference/query.html +asio/reference/query_result.html +asio/reference/query_result/type.html +asio/reference/read.html +asio/reference/read/overload1.html +asio/reference/read/overload2.html +asio/reference/read/overload3.html +asio/reference/read/overload4.html +asio/reference/read/overload5.html +asio/reference/read/overload6.html +asio/reference/read/overload7.html +asio/reference/read/overload8.html +asio/reference/read/overload9.html +asio/reference/read/overload10.html +asio/reference/read/overload11.html +asio/reference/read/overload12.html +asio/reference/read/overload13.html +asio/reference/read/overload14.html +asio/reference/read/overload15.html +asio/reference/read/overload16.html +asio/reference/read_at.html +asio/reference/read_at/overload1.html +asio/reference/read_at/overload2.html +asio/reference/read_at/overload3.html +asio/reference/read_at/overload4.html +asio/reference/read_at/overload5.html +asio/reference/read_at/overload6.html +asio/reference/read_at/overload7.html +asio/reference/read_at/overload8.html +asio/reference/read_until.html +asio/reference/read_until/overload1.html +asio/reference/read_until/overload2.html +asio/reference/read_until/overload3.html +asio/reference/read_until/overload4.html +asio/reference/read_until/overload5.html +asio/reference/read_until/overload6.html +asio/reference/read_until/overload7.html +asio/reference/read_until/overload8.html +asio/reference/read_until/overload9.html +asio/reference/read_until/overload10.html +asio/reference/read_until/overload11.html +asio/reference/read_until/overload12.html +asio/reference/read_until/overload13.html +asio/reference/read_until/overload14.html +asio/reference/read_until/overload15.html +asio/reference/read_until/overload16.html +asio/reference/read_until/overload17.html +asio/reference/read_until/overload18.html +asio/reference/read_until/overload19.html +asio/reference/read_until/overload20.html +asio/reference/read_until/overload21.html +asio/reference/read_until/overload22.html +asio/reference/read_until/overload23.html +asio/reference/read_until/overload24.html +asio/reference/redirect_error.html +asio/reference/redirect_error_t.html +asio/reference/redirect_error_t/ec_.html +asio/reference/redirect_error_t/redirect_error_t.html +asio/reference/redirect_error_t/token_.html +asio/reference/require.html +asio/reference/require_concept.html +asio/reference/require_concept_result.html +asio/reference/require_concept_result/type.html +asio/reference/require_result.html +asio/reference/require_result/type.html +asio/reference/resolver_errc__try_again.html +asio/reference/serial_port.html +asio/reference/serial_port_base.html +asio/reference/serial_port_base/_serial_port_base.html +asio/reference/serial_port_base__baud_rate.html +asio/reference/serial_port_base__baud_rate/baud_rate.html +asio/reference/serial_port_base__baud_rate/load.html +asio/reference/serial_port_base__baud_rate/store.html +asio/reference/serial_port_base__baud_rate/value.html +asio/reference/serial_port_base__character_size.html +asio/reference/serial_port_base__character_size/character_size.html +asio/reference/serial_port_base__character_size/load.html +asio/reference/serial_port_base__character_size/store.html +asio/reference/serial_port_base__character_size/value.html +asio/reference/serial_port_base__flow_control.html +asio/reference/serial_port_base__flow_control/flow_control.html +asio/reference/serial_port_base__flow_control/load.html +asio/reference/serial_port_base__flow_control/store.html +asio/reference/serial_port_base__flow_control/type.html +asio/reference/serial_port_base__flow_control/value.html +asio/reference/serial_port_base__parity.html +asio/reference/serial_port_base__parity/load.html +asio/reference/serial_port_base__parity/parity.html +asio/reference/serial_port_base__parity/store.html +asio/reference/serial_port_base__parity/type.html +asio/reference/serial_port_base__parity/value.html +asio/reference/serial_port_base__stop_bits.html +asio/reference/serial_port_base__stop_bits/load.html +asio/reference/serial_port_base__stop_bits/stop_bits.html +asio/reference/serial_port_base__stop_bits/store.html +asio/reference/serial_port_base__stop_bits/type.html +asio/reference/serial_port_base__stop_bits/value.html +asio/reference/service_already_exists.html +asio/reference/service_already_exists/service_already_exists.html +asio/reference/signal_set.html +asio/reference/socket_base.html +asio/reference/socket_base/broadcast.html +asio/reference/socket_base/bytes_readable.html +asio/reference/socket_base/debug.html +asio/reference/socket_base/do_not_route.html +asio/reference/socket_base/enable_connection_aborted.html +asio/reference/socket_base/keep_alive.html +asio/reference/socket_base/linger.html +asio/reference/socket_base/max_connections.html +asio/reference/socket_base/max_listen_connections.html +asio/reference/socket_base/message_do_not_route.html +asio/reference/socket_base/message_end_of_record.html +asio/reference/socket_base/message_flags.html +asio/reference/socket_base/message_out_of_band.html +asio/reference/socket_base/message_peek.html +asio/reference/socket_base/out_of_band_inline.html +asio/reference/socket_base/receive_buffer_size.html +asio/reference/socket_base/receive_low_watermark.html +asio/reference/socket_base/reuse_address.html +asio/reference/socket_base/send_buffer_size.html +asio/reference/socket_base/send_low_watermark.html +asio/reference/socket_base/shutdown_type.html +asio/reference/socket_base/wait_type.html +asio/reference/socket_base/_socket_base.html +asio/reference/spawn.html +asio/reference/spawn/overload1.html +asio/reference/spawn/overload2.html +asio/reference/spawn/overload3.html +asio/reference/spawn/overload4.html +asio/reference/spawn/overload5.html +asio/reference/spawn/overload6.html +asio/reference/spawn/overload7.html +asio/reference/ssl__context.html +asio/reference/ssl__context/add_certificate_authority.html +asio/reference/ssl__context/add_certificate_authority/overload1.html +asio/reference/ssl__context/add_certificate_authority/overload2.html +asio/reference/ssl__context/add_verify_path.html +asio/reference/ssl__context/add_verify_path/overload1.html +asio/reference/ssl__context/add_verify_path/overload2.html +asio/reference/ssl__context/clear_options.html +asio/reference/ssl__context/clear_options/overload1.html +asio/reference/ssl__context/clear_options/overload2.html +asio/reference/ssl__context/context.html +asio/reference/ssl__context/context/overload1.html +asio/reference/ssl__context/context/overload2.html +asio/reference/ssl__context/context/overload3.html +asio/reference/ssl__context/default_workarounds.html +asio/reference/ssl__context/file_format.html +asio/reference/ssl__context/load_verify_file.html +asio/reference/ssl__context/load_verify_file/overload1.html +asio/reference/ssl__context/load_verify_file/overload2.html +asio/reference/ssl__context/method.html +asio/reference/ssl__context/native_handle.html +asio/reference/ssl__context/native_handle_type.html +asio/reference/ssl__context/no_compression.html +asio/reference/ssl__context/no_sslv2.html +asio/reference/ssl__context/no_sslv3.html +asio/reference/ssl__context/no_tlsv1.html +asio/reference/ssl__context/no_tlsv1_1.html +asio/reference/ssl__context/no_tlsv1_2.html +asio/reference/ssl__context/no_tlsv1_3.html +asio/reference/ssl__context/operator_eq_.html +asio/reference/ssl__context/options.html +asio/reference/ssl__context/password_purpose.html +asio/reference/ssl__context/set_default_verify_paths.html +asio/reference/ssl__context/set_default_verify_paths/overload1.html +asio/reference/ssl__context/set_default_verify_paths/overload2.html +asio/reference/ssl__context/set_options.html +asio/reference/ssl__context/set_options/overload1.html +asio/reference/ssl__context/set_options/overload2.html +asio/reference/ssl__context/set_password_callback.html +asio/reference/ssl__context/set_password_callback/overload1.html +asio/reference/ssl__context/set_password_callback/overload2.html +asio/reference/ssl__context/set_verify_callback.html +asio/reference/ssl__context/set_verify_callback/overload1.html +asio/reference/ssl__context/set_verify_callback/overload2.html +asio/reference/ssl__context/set_verify_depth.html +asio/reference/ssl__context/set_verify_depth/overload1.html +asio/reference/ssl__context/set_verify_depth/overload2.html +asio/reference/ssl__context/set_verify_mode.html +asio/reference/ssl__context/set_verify_mode/overload1.html +asio/reference/ssl__context/set_verify_mode/overload2.html +asio/reference/ssl__context/single_dh_use.html +asio/reference/ssl__context/use_certificate.html +asio/reference/ssl__context/use_certificate/overload1.html +asio/reference/ssl__context/use_certificate/overload2.html +asio/reference/ssl__context/use_certificate_chain.html +asio/reference/ssl__context/use_certificate_chain/overload1.html +asio/reference/ssl__context/use_certificate_chain/overload2.html +asio/reference/ssl__context/use_certificate_chain_file.html +asio/reference/ssl__context/use_certificate_chain_file/overload1.html +asio/reference/ssl__context/use_certificate_chain_file/overload2.html +asio/reference/ssl__context/use_certificate_file.html +asio/reference/ssl__context/use_certificate_file/overload1.html +asio/reference/ssl__context/use_certificate_file/overload2.html +asio/reference/ssl__context/use_private_key.html +asio/reference/ssl__context/use_private_key/overload1.html +asio/reference/ssl__context/use_private_key/overload2.html +asio/reference/ssl__context/use_private_key_file.html +asio/reference/ssl__context/use_private_key_file/overload1.html +asio/reference/ssl__context/use_private_key_file/overload2.html +asio/reference/ssl__context/use_rsa_private_key.html +asio/reference/ssl__context/use_rsa_private_key/overload1.html +asio/reference/ssl__context/use_rsa_private_key/overload2.html +asio/reference/ssl__context/use_rsa_private_key_file.html +asio/reference/ssl__context/use_rsa_private_key_file/overload1.html +asio/reference/ssl__context/use_rsa_private_key_file/overload2.html +asio/reference/ssl__context/use_tmp_dh.html +asio/reference/ssl__context/use_tmp_dh/overload1.html +asio/reference/ssl__context/use_tmp_dh/overload2.html +asio/reference/ssl__context/use_tmp_dh_file.html +asio/reference/ssl__context/use_tmp_dh_file/overload1.html +asio/reference/ssl__context/use_tmp_dh_file/overload2.html +asio/reference/ssl__context/_context.html +asio/reference/ssl__context_base.html +asio/reference/ssl__context_base/default_workarounds.html +asio/reference/ssl__context_base/file_format.html +asio/reference/ssl__context_base/method.html +asio/reference/ssl__context_base/no_compression.html +asio/reference/ssl__context_base/no_sslv2.html +asio/reference/ssl__context_base/no_sslv3.html +asio/reference/ssl__context_base/no_tlsv1.html +asio/reference/ssl__context_base/no_tlsv1_1.html +asio/reference/ssl__context_base/no_tlsv1_2.html +asio/reference/ssl__context_base/no_tlsv1_3.html +asio/reference/ssl__context_base/options.html +asio/reference/ssl__context_base/password_purpose.html +asio/reference/ssl__context_base/single_dh_use.html +asio/reference/ssl__context_base/_context_base.html +asio/reference/ssl__error__get_stream_category.html +asio/reference/ssl__error__make_error_code.html +asio/reference/ssl__error__stream_category.html +asio/reference/ssl__error__stream_errors.html +asio/reference/ssl__host_name_verification.html +asio/reference/ssl__host_name_verification/host_name_verification.html +asio/reference/ssl__host_name_verification/operator_lp__rp_.html +asio/reference/ssl__host_name_verification/result_type.html +asio/reference/ssl__rfc2818_verification.html +asio/reference/ssl__rfc2818_verification/operator_lp__rp_.html +asio/reference/ssl__rfc2818_verification/result_type.html +asio/reference/ssl__rfc2818_verification/rfc2818_verification.html +asio/reference/ssl__stream.html +asio/reference/ssl__stream/async_handshake.html +asio/reference/ssl__stream/async_handshake/overload1.html +asio/reference/ssl__stream/async_handshake/overload2.html +asio/reference/ssl__stream/async_read_some.html +asio/reference/ssl__stream/async_shutdown.html +asio/reference/ssl__stream/async_write_some.html +asio/reference/ssl__stream/executor_type.html +asio/reference/ssl__stream/get_executor.html +asio/reference/ssl__stream/handshake.html +asio/reference/ssl__stream/handshake/overload1.html +asio/reference/ssl__stream/handshake/overload2.html +asio/reference/ssl__stream/handshake/overload3.html +asio/reference/ssl__stream/handshake/overload4.html +asio/reference/ssl__stream/handshake_type.html +asio/reference/ssl__stream/lowest_layer.html +asio/reference/ssl__stream/lowest_layer/overload1.html +asio/reference/ssl__stream/lowest_layer/overload2.html +asio/reference/ssl__stream/lowest_layer_type.html +asio/reference/ssl__stream/native_handle.html +asio/reference/ssl__stream/native_handle_type.html +asio/reference/ssl__stream/next_layer.html +asio/reference/ssl__stream/next_layer/overload1.html +asio/reference/ssl__stream/next_layer/overload2.html +asio/reference/ssl__stream/next_layer_type.html +asio/reference/ssl__stream/read_some.html +asio/reference/ssl__stream/read_some/overload1.html +asio/reference/ssl__stream/read_some/overload2.html +asio/reference/ssl__stream/set_verify_callback.html +asio/reference/ssl__stream/set_verify_callback/overload1.html +asio/reference/ssl__stream/set_verify_callback/overload2.html +asio/reference/ssl__stream/set_verify_depth.html +asio/reference/ssl__stream/set_verify_depth/overload1.html +asio/reference/ssl__stream/set_verify_depth/overload2.html +asio/reference/ssl__stream/set_verify_mode.html +asio/reference/ssl__stream/set_verify_mode/overload1.html +asio/reference/ssl__stream/set_verify_mode/overload2.html +asio/reference/ssl__stream/shutdown.html +asio/reference/ssl__stream/shutdown/overload1.html +asio/reference/ssl__stream/shutdown/overload2.html +asio/reference/ssl__stream/stream.html +asio/reference/ssl__stream/stream/overload1.html +asio/reference/ssl__stream/stream/overload2.html +asio/reference/ssl__stream/write_some.html +asio/reference/ssl__stream/write_some/overload1.html +asio/reference/ssl__stream/write_some/overload2.html +asio/reference/ssl__stream/_stream.html +asio/reference/ssl__stream__impl_struct.html +asio/reference/ssl__stream__impl_struct/ssl.html +asio/reference/ssl__stream_base.html +asio/reference/ssl__stream_base/handshake_type.html +asio/reference/ssl__stream_base/_stream_base.html +asio/reference/ssl__verify_client_once.html +asio/reference/ssl__verify_context.html +asio/reference/ssl__verify_context/native_handle.html +asio/reference/ssl__verify_context/native_handle_type.html +asio/reference/ssl__verify_context/verify_context.html +asio/reference/ssl__verify_fail_if_no_peer_cert.html +asio/reference/ssl__verify_mode.html +asio/reference/ssl__verify_none.html +asio/reference/ssl__verify_peer.html +asio/reference/static_thread_pool.html +asio/reference/steady_timer.html +asio/reference/strand.html +asio/reference/strand/defer.html +asio/reference/strand/dispatch.html +asio/reference/strand/execute.html +asio/reference/strand/get_inner_executor.html +asio/reference/strand/inner_executor_type.html +asio/reference/strand/operator_not__eq_.html +asio/reference/strand/operator_eq_.html +asio/reference/strand/operator_eq_/overload1.html +asio/reference/strand/operator_eq_/overload2.html +asio/reference/strand/operator_eq_/overload3.html +asio/reference/strand/operator_eq_/overload4.html +asio/reference/strand/operator_eq__eq_.html +asio/reference/strand/post.html +asio/reference/strand/prefer.html +asio/reference/strand/query.html +asio/reference/strand/require.html +asio/reference/strand/running_in_this_thread.html +asio/reference/strand/strand.html +asio/reference/strand/strand/overload1.html +asio/reference/strand/strand/overload2.html +asio/reference/strand/strand/overload3.html +asio/reference/strand/strand/overload4.html +asio/reference/strand/strand/overload5.html +asio/reference/strand/strand/overload6.html +asio/reference/strand/_strand.html +asio/reference/streambuf.html +asio/reference/system_category.html +asio/reference/system_context.html +asio/reference/system_context/add_service.html +asio/reference/system_context/destroy.html +asio/reference/system_context/executor_type.html +asio/reference/system_context/fork_event.html +asio/reference/system_context/get_executor.html +asio/reference/system_context/has_service.html +asio/reference/system_context/join.html +asio/reference/system_context/make_service.html +asio/reference/system_context/notify_fork.html +asio/reference/system_context/shutdown.html +asio/reference/system_context/stop.html +asio/reference/system_context/stopped.html +asio/reference/system_context/use_service.html +asio/reference/system_context/use_service/overload1.html +asio/reference/system_context/use_service/overload2.html +asio/reference/system_context/_system_context.html +asio/reference/system_error.html +asio/reference/system_error/code.html +asio/reference/system_error/operator_eq_.html +asio/reference/system_error/system_error.html +asio/reference/system_error/system_error/overload1.html +asio/reference/system_error/system_error/overload2.html +asio/reference/system_error/system_error/overload3.html +asio/reference/system_error/what.html +asio/reference/system_error/_system_error.html +asio/reference/system_executor.html +asio/reference/system_timer.html +asio/reference/this_coro__executor.html +asio/reference/this_coro__executor_t.html +asio/reference/this_coro__executor_t/executor_t.html +asio/reference/thread.html +asio/reference/thread/join.html +asio/reference/thread/thread.html +asio/reference/thread/_thread.html +asio/reference/thread_pool.html +asio/reference/thread_pool/add_service.html +asio/reference/thread_pool/attach.html +asio/reference/thread_pool/destroy.html +asio/reference/thread_pool/executor.html +asio/reference/thread_pool/executor_type.html +asio/reference/thread_pool/fork_event.html +asio/reference/thread_pool/get_executor.html +asio/reference/thread_pool/has_service.html +asio/reference/thread_pool/join.html +asio/reference/thread_pool/make_service.html +asio/reference/thread_pool/notify_fork.html +asio/reference/thread_pool/scheduler.html +asio/reference/thread_pool/scheduler_type.html +asio/reference/thread_pool/shutdown.html +asio/reference/thread_pool/stop.html +asio/reference/thread_pool/thread_pool.html +asio/reference/thread_pool/thread_pool/overload1.html +asio/reference/thread_pool/thread_pool/overload2.html +asio/reference/thread_pool/use_service.html +asio/reference/thread_pool/use_service/overload1.html +asio/reference/thread_pool/use_service/overload2.html +asio/reference/thread_pool/wait.html +asio/reference/thread_pool/_thread_pool.html +asio/reference/thread_pool__basic_executor_type.html +asio/reference/thread_pool__basic_executor_type/basic_executor_type.html +asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload1.html +asio/reference/thread_pool__basic_executor_type/basic_executor_type/overload2.html +asio/reference/thread_pool__basic_executor_type/bulk_execute.html +asio/reference/thread_pool__basic_executor_type/connect.html +asio/reference/thread_pool__basic_executor_type/context.html +asio/reference/thread_pool__basic_executor_type/defer.html +asio/reference/thread_pool__basic_executor_type/dispatch.html +asio/reference/thread_pool__basic_executor_type/execute.html +asio/reference/thread_pool__basic_executor_type/index_type.html +asio/reference/thread_pool__basic_executor_type/on_work_finished.html +asio/reference/thread_pool__basic_executor_type/on_work_started.html +asio/reference/thread_pool__basic_executor_type/operator_not__eq_.html +asio/reference/thread_pool__basic_executor_type/operator_eq_.html +asio/reference/thread_pool__basic_executor_type/operator_eq_/overload1.html +asio/reference/thread_pool__basic_executor_type/operator_eq_/overload2.html +asio/reference/thread_pool__basic_executor_type/operator_eq__eq_.html +asio/reference/thread_pool__basic_executor_type/post.html +asio/reference/thread_pool__basic_executor_type/query.html +asio/reference/thread_pool__basic_executor_type/query/overload1.html +asio/reference/thread_pool__basic_executor_type/query/overload2.html +asio/reference/thread_pool__basic_executor_type/query/overload3.html +asio/reference/thread_pool__basic_executor_type/query/overload4.html +asio/reference/thread_pool__basic_executor_type/query/overload5.html +asio/reference/thread_pool__basic_executor_type/query/overload6.html +asio/reference/thread_pool__basic_executor_type/query__static.html +asio/reference/thread_pool__basic_executor_type/query__static/overload1.html +asio/reference/thread_pool__basic_executor_type/query__static/overload2.html +asio/reference/thread_pool__basic_executor_type/query__static/overload3.html +asio/reference/thread_pool__basic_executor_type/require.html +asio/reference/thread_pool__basic_executor_type/require/overload1.html +asio/reference/thread_pool__basic_executor_type/require/overload2.html +asio/reference/thread_pool__basic_executor_type/require/overload3.html +asio/reference/thread_pool__basic_executor_type/require/overload4.html +asio/reference/thread_pool__basic_executor_type/require/overload5.html +asio/reference/thread_pool__basic_executor_type/require/overload6.html +asio/reference/thread_pool__basic_executor_type/require/overload7.html +asio/reference/thread_pool__basic_executor_type/require/overload8.html +asio/reference/thread_pool__basic_executor_type/require/overload9.html +asio/reference/thread_pool__basic_executor_type/running_in_this_thread.html +asio/reference/thread_pool__basic_executor_type/schedule.html +asio/reference/thread_pool__basic_executor_type/sender_type.html +asio/reference/thread_pool__basic_executor_type/shape_type.html +asio/reference/thread_pool__basic_executor_type/_basic_executor_type.html +asio/reference/time_traits_lt__ptime__gt_.html +asio/reference/time_traits_lt__ptime__gt_/add.html +asio/reference/time_traits_lt__ptime__gt_/duration_type.html +asio/reference/time_traits_lt__ptime__gt_/less_than.html +asio/reference/time_traits_lt__ptime__gt_/now.html +asio/reference/time_traits_lt__ptime__gt_/subtract.html +asio/reference/time_traits_lt__ptime__gt_/time_type.html +asio/reference/time_traits_lt__ptime__gt_/to_posix_duration.html +asio/reference/transfer_all.html +asio/reference/transfer_at_least.html +asio/reference/transfer_exactly.html +asio/reference/use_awaitable.html +asio/reference/use_awaitable_t.html +asio/reference/use_awaitable_t/as_default_on.html +asio/reference/use_awaitable_t/use_awaitable_t.html +asio/reference/use_awaitable_t/use_awaitable_t/overload1.html +asio/reference/use_awaitable_t/use_awaitable_t/overload2.html +asio/reference/use_awaitable_t__executor_with_default.html +asio/reference/use_awaitable_t__executor_with_default/default_completion_token_type.html +asio/reference/use_awaitable_t__executor_with_default/executor_with_default.html +asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload1.html +asio/reference/use_awaitable_t__executor_with_default/executor_with_default/overload2.html +asio/reference/use_future.html +asio/reference/use_future_t.html +asio/reference/use_future_t/allocator_type.html +asio/reference/use_future_t/get_allocator.html +asio/reference/use_future_t/operator_lp__rp_.html +asio/reference/use_future_t/operator_lb__rb_.html +asio/reference/use_future_t/rebind.html +asio/reference/use_future_t/use_future_t.html +asio/reference/use_future_t/use_future_t/overload1.html +asio/reference/use_future_t/use_future_t/overload2.html +asio/reference/uses_executor.html +asio/reference/wait_traits.html +asio/reference/wait_traits/to_wait_duration.html +asio/reference/wait_traits/to_wait_duration/overload1.html +asio/reference/wait_traits/to_wait_duration/overload2.html +asio/reference/windows__basic_object_handle.html +asio/reference/windows__basic_object_handle/assign.html +asio/reference/windows__basic_object_handle/assign/overload1.html +asio/reference/windows__basic_object_handle/assign/overload2.html +asio/reference/windows__basic_object_handle/async_wait.html +asio/reference/windows__basic_object_handle/basic_object_handle.html +asio/reference/windows__basic_object_handle/basic_object_handle/overload1.html +asio/reference/windows__basic_object_handle/basic_object_handle/overload2.html +asio/reference/windows__basic_object_handle/basic_object_handle/overload3.html +asio/reference/windows__basic_object_handle/basic_object_handle/overload4.html +asio/reference/windows__basic_object_handle/basic_object_handle/overload5.html +asio/reference/windows__basic_object_handle/cancel.html +asio/reference/windows__basic_object_handle/cancel/overload1.html +asio/reference/windows__basic_object_handle/cancel/overload2.html +asio/reference/windows__basic_object_handle/close.html +asio/reference/windows__basic_object_handle/close/overload1.html +asio/reference/windows__basic_object_handle/close/overload2.html +asio/reference/windows__basic_object_handle/executor_type.html +asio/reference/windows__basic_object_handle/get_executor.html +asio/reference/windows__basic_object_handle/is_open.html +asio/reference/windows__basic_object_handle/lowest_layer.html +asio/reference/windows__basic_object_handle/lowest_layer/overload1.html +asio/reference/windows__basic_object_handle/lowest_layer/overload2.html +asio/reference/windows__basic_object_handle/lowest_layer_type.html +asio/reference/windows__basic_object_handle/native_handle.html +asio/reference/windows__basic_object_handle/native_handle_type.html +asio/reference/windows__basic_object_handle/operator_eq_.html +asio/reference/windows__basic_object_handle/wait.html +asio/reference/windows__basic_object_handle/wait/overload1.html +asio/reference/windows__basic_object_handle/wait/overload2.html +asio/reference/windows__basic_object_handle__rebind_executor.html +asio/reference/windows__basic_object_handle__rebind_executor/other.html +asio/reference/windows__basic_overlapped_handle.html +asio/reference/windows__basic_overlapped_handle/assign.html +asio/reference/windows__basic_overlapped_handle/assign/overload1.html +asio/reference/windows__basic_overlapped_handle/assign/overload2.html +asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle.html +asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload1.html +asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload2.html +asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload3.html +asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload4.html +asio/reference/windows__basic_overlapped_handle/basic_overlapped_handle/overload5.html +asio/reference/windows__basic_overlapped_handle/cancel.html +asio/reference/windows__basic_overlapped_handle/cancel/overload1.html +asio/reference/windows__basic_overlapped_handle/cancel/overload2.html +asio/reference/windows__basic_overlapped_handle/close.html +asio/reference/windows__basic_overlapped_handle/close/overload1.html +asio/reference/windows__basic_overlapped_handle/close/overload2.html +asio/reference/windows__basic_overlapped_handle/executor_type.html +asio/reference/windows__basic_overlapped_handle/get_executor.html +asio/reference/windows__basic_overlapped_handle/is_open.html +asio/reference/windows__basic_overlapped_handle/lowest_layer.html +asio/reference/windows__basic_overlapped_handle/lowest_layer/overload1.html +asio/reference/windows__basic_overlapped_handle/lowest_layer/overload2.html +asio/reference/windows__basic_overlapped_handle/lowest_layer_type.html +asio/reference/windows__basic_overlapped_handle/native_handle.html +asio/reference/windows__basic_overlapped_handle/native_handle_type.html +asio/reference/windows__basic_overlapped_handle/operator_eq_.html +asio/reference/windows__basic_overlapped_handle/_basic_overlapped_handle.html +asio/reference/windows__basic_overlapped_handle__rebind_executor.html +asio/reference/windows__basic_overlapped_handle__rebind_executor/other.html +asio/reference/windows__basic_random_access_handle.html +asio/reference/windows__basic_random_access_handle/assign.html +asio/reference/windows__basic_random_access_handle/assign/overload1.html +asio/reference/windows__basic_random_access_handle/assign/overload2.html +asio/reference/windows__basic_random_access_handle/async_read_some_at.html +asio/reference/windows__basic_random_access_handle/async_write_some_at.html +asio/reference/windows__basic_random_access_handle/basic_random_access_handle.html +asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload1.html +asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload2.html +asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload3.html +asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload4.html +asio/reference/windows__basic_random_access_handle/basic_random_access_handle/overload5.html +asio/reference/windows__basic_random_access_handle/cancel.html +asio/reference/windows__basic_random_access_handle/cancel/overload1.html +asio/reference/windows__basic_random_access_handle/cancel/overload2.html +asio/reference/windows__basic_random_access_handle/close.html +asio/reference/windows__basic_random_access_handle/close/overload1.html +asio/reference/windows__basic_random_access_handle/close/overload2.html +asio/reference/windows__basic_random_access_handle/executor_type.html +asio/reference/windows__basic_random_access_handle/get_executor.html +asio/reference/windows__basic_random_access_handle/is_open.html +asio/reference/windows__basic_random_access_handle/lowest_layer.html +asio/reference/windows__basic_random_access_handle/lowest_layer/overload1.html +asio/reference/windows__basic_random_access_handle/lowest_layer/overload2.html +asio/reference/windows__basic_random_access_handle/lowest_layer_type.html +asio/reference/windows__basic_random_access_handle/native_handle.html +asio/reference/windows__basic_random_access_handle/native_handle_type.html +asio/reference/windows__basic_random_access_handle/operator_eq_.html +asio/reference/windows__basic_random_access_handle/read_some_at.html +asio/reference/windows__basic_random_access_handle/read_some_at/overload1.html +asio/reference/windows__basic_random_access_handle/read_some_at/overload2.html +asio/reference/windows__basic_random_access_handle/write_some_at.html +asio/reference/windows__basic_random_access_handle/write_some_at/overload1.html +asio/reference/windows__basic_random_access_handle/write_some_at/overload2.html +asio/reference/windows__basic_random_access_handle__rebind_executor.html +asio/reference/windows__basic_random_access_handle__rebind_executor/other.html +asio/reference/windows__basic_stream_handle.html +asio/reference/windows__basic_stream_handle/assign.html +asio/reference/windows__basic_stream_handle/assign/overload1.html +asio/reference/windows__basic_stream_handle/assign/overload2.html +asio/reference/windows__basic_stream_handle/async_read_some.html +asio/reference/windows__basic_stream_handle/async_write_some.html +asio/reference/windows__basic_stream_handle/basic_stream_handle.html +asio/reference/windows__basic_stream_handle/basic_stream_handle/overload1.html +asio/reference/windows__basic_stream_handle/basic_stream_handle/overload2.html +asio/reference/windows__basic_stream_handle/basic_stream_handle/overload3.html +asio/reference/windows__basic_stream_handle/basic_stream_handle/overload4.html +asio/reference/windows__basic_stream_handle/basic_stream_handle/overload5.html +asio/reference/windows__basic_stream_handle/cancel.html +asio/reference/windows__basic_stream_handle/cancel/overload1.html +asio/reference/windows__basic_stream_handle/cancel/overload2.html +asio/reference/windows__basic_stream_handle/close.html +asio/reference/windows__basic_stream_handle/close/overload1.html +asio/reference/windows__basic_stream_handle/close/overload2.html +asio/reference/windows__basic_stream_handle/executor_type.html +asio/reference/windows__basic_stream_handle/get_executor.html +asio/reference/windows__basic_stream_handle/is_open.html +asio/reference/windows__basic_stream_handle/lowest_layer.html +asio/reference/windows__basic_stream_handle/lowest_layer/overload1.html +asio/reference/windows__basic_stream_handle/lowest_layer/overload2.html +asio/reference/windows__basic_stream_handle/lowest_layer_type.html +asio/reference/windows__basic_stream_handle/native_handle.html +asio/reference/windows__basic_stream_handle/native_handle_type.html +asio/reference/windows__basic_stream_handle/operator_eq_.html +asio/reference/windows__basic_stream_handle/read_some.html +asio/reference/windows__basic_stream_handle/read_some/overload1.html +asio/reference/windows__basic_stream_handle/read_some/overload2.html +asio/reference/windows__basic_stream_handle/write_some.html +asio/reference/windows__basic_stream_handle/write_some/overload1.html +asio/reference/windows__basic_stream_handle/write_some/overload2.html +asio/reference/windows__basic_stream_handle__rebind_executor.html +asio/reference/windows__basic_stream_handle__rebind_executor/other.html +asio/reference/windows__object_handle.html +asio/reference/windows__overlapped_handle.html +asio/reference/windows__overlapped_ptr.html +asio/reference/windows__overlapped_ptr/complete.html +asio/reference/windows__overlapped_ptr/get.html +asio/reference/windows__overlapped_ptr/get/overload1.html +asio/reference/windows__overlapped_ptr/get/overload2.html +asio/reference/windows__overlapped_ptr/overlapped_ptr.html +asio/reference/windows__overlapped_ptr/overlapped_ptr/overload1.html +asio/reference/windows__overlapped_ptr/overlapped_ptr/overload2.html +asio/reference/windows__overlapped_ptr/overlapped_ptr/overload3.html +asio/reference/windows__overlapped_ptr/release.html +asio/reference/windows__overlapped_ptr/reset.html +asio/reference/windows__overlapped_ptr/reset/overload1.html +asio/reference/windows__overlapped_ptr/reset/overload2.html +asio/reference/windows__overlapped_ptr/reset/overload3.html +asio/reference/windows__overlapped_ptr/_overlapped_ptr.html +asio/reference/windows__random_access_handle.html +asio/reference/windows__stream_handle.html +asio/reference/write.html +asio/reference/write/overload1.html +asio/reference/write/overload2.html +asio/reference/write/overload3.html +asio/reference/write/overload4.html +asio/reference/write/overload5.html +asio/reference/write/overload6.html +asio/reference/write/overload7.html +asio/reference/write/overload8.html +asio/reference/write/overload9.html +asio/reference/write/overload10.html +asio/reference/write/overload11.html +asio/reference/write/overload12.html +asio/reference/write/overload13.html +asio/reference/write/overload14.html +asio/reference/write/overload15.html +asio/reference/write/overload16.html +asio/reference/write_at.html +asio/reference/write_at/overload1.html +asio/reference/write_at/overload2.html +asio/reference/write_at/overload3.html +asio/reference/write_at/overload4.html +asio/reference/write_at/overload5.html +asio/reference/write_at/overload6.html +asio/reference/write_at/overload7.html +asio/reference/write_at/overload8.html +asio/reference/yield_context.html +asio/net_ts.html +asio/std_executors.html +asio/history.html +asio/index.html diff --git a/include/asio/doc/sync_op.png b/include/asio/doc/sync_op.png new file mode 100644 index 0000000..baa5a56 Binary files /dev/null and b/include/asio/doc/sync_op.png differ diff --git a/include/asio/doc/tip.png b/include/asio/doc/tip.png new file mode 100644 index 0000000..5c4aab3 Binary files /dev/null and b/include/asio/doc/tip.png differ diff --git a/include/asio/doc/up.png b/include/asio/doc/up.png new file mode 100644 index 0000000..17d9c3e Binary files /dev/null and b/include/asio/doc/up.png differ diff --git a/include/asio/doc/up_disabled.png b/include/asio/doc/up_disabled.png new file mode 100644 index 0000000..e22bc87 Binary files /dev/null and b/include/asio/doc/up_disabled.png differ diff --git a/include/asio/doc/warning.png b/include/asio/doc/warning.png new file mode 100644 index 0000000..1c33db8 Binary files /dev/null and b/include/asio/doc/warning.png differ diff --git a/include/asio/include/Makefile.am b/include/asio/include/Makefile.am new file mode 100644 index 0000000..265e37e --- /dev/null +++ b/include/asio/include/Makefile.am @@ -0,0 +1,564 @@ +# find . -name "*.*pp" | sed -e 's/^\.\///' | sed -e 's/^.*$/ & \\/' | sort +nobase_include_HEADERS = \ + asio/any_io_executor.hpp \ + asio/associated_allocator.hpp \ + asio/associated_executor.hpp \ + asio/async_result.hpp \ + asio/awaitable.hpp \ + asio/basic_datagram_socket.hpp \ + asio/basic_deadline_timer.hpp \ + asio/basic_io_object.hpp \ + asio/basic_raw_socket.hpp \ + asio/basic_seq_packet_socket.hpp \ + asio/basic_serial_port.hpp \ + asio/basic_signal_set.hpp \ + asio/basic_socket_acceptor.hpp \ + asio/basic_socket.hpp \ + asio/basic_socket_iostream.hpp \ + asio/basic_socket_streambuf.hpp \ + asio/basic_streambuf_fwd.hpp \ + asio/basic_streambuf.hpp \ + asio/basic_stream_socket.hpp \ + asio/basic_waitable_timer.hpp \ + asio/bind_executor.hpp \ + asio/buffered_read_stream_fwd.hpp \ + asio/buffered_read_stream.hpp \ + asio/buffered_stream_fwd.hpp \ + asio/buffered_stream.hpp \ + asio/buffered_write_stream_fwd.hpp \ + asio/buffered_write_stream.hpp \ + asio/buffer.hpp \ + asio/buffers_iterator.hpp \ + asio/co_spawn.hpp \ + asio/completion_condition.hpp \ + asio/compose.hpp \ + asio/connect.hpp \ + asio/coroutine.hpp \ + asio/deadline_timer.hpp \ + asio/defer.hpp \ + asio/detached.hpp \ + asio/detail/array_fwd.hpp \ + asio/detail/array.hpp \ + asio/detail/assert.hpp \ + asio/detail/atomic_count.hpp \ + asio/detail/base_from_completion_cond.hpp \ + asio/detail/bind_handler.hpp \ + asio/detail/blocking_executor_op.hpp \ + asio/detail/buffered_stream_storage.hpp \ + asio/detail/buffer_resize_guard.hpp \ + asio/detail/buffer_sequence_adapter.hpp \ + asio/detail/bulk_executor_op.hpp \ + asio/detail/call_stack.hpp \ + asio/detail/chrono.hpp \ + asio/detail/chrono_time_traits.hpp \ + asio/detail/completion_handler.hpp \ + asio/detail/concurrency_hint.hpp \ + asio/detail/conditionally_enabled_event.hpp \ + asio/detail/conditionally_enabled_mutex.hpp \ + asio/detail/config.hpp \ + asio/detail/consuming_buffers.hpp \ + asio/detail/cstddef.hpp \ + asio/detail/cstdint.hpp \ + asio/detail/date_time_fwd.hpp \ + asio/detail/deadline_timer_service.hpp \ + asio/detail/dependent_type.hpp \ + asio/detail/descriptor_ops.hpp \ + asio/detail/descriptor_read_op.hpp \ + asio/detail/descriptor_write_op.hpp \ + asio/detail/dev_poll_reactor.hpp \ + asio/detail/epoll_reactor.hpp \ + asio/detail/eventfd_select_interrupter.hpp \ + asio/detail/event.hpp \ + asio/detail/executor_function.hpp \ + asio/detail/executor_op.hpp \ + asio/detail/fd_set_adapter.hpp \ + asio/detail/fenced_block.hpp \ + asio/detail/functional.hpp \ + asio/detail/future.hpp \ + asio/detail/gcc_arm_fenced_block.hpp \ + asio/detail/gcc_hppa_fenced_block.hpp \ + asio/detail/gcc_sync_fenced_block.hpp \ + asio/detail/gcc_x86_fenced_block.hpp \ + asio/detail/global.hpp \ + asio/detail/handler_alloc_helpers.hpp \ + asio/detail/handler_cont_helpers.hpp \ + asio/detail/handler_invoke_helpers.hpp \ + asio/detail/handler_tracking.hpp \ + asio/detail/handler_type_requirements.hpp \ + asio/detail/handler_work.hpp \ + asio/detail/hash_map.hpp \ + asio/detail/impl/buffer_sequence_adapter.ipp \ + asio/detail/impl/descriptor_ops.ipp \ + asio/detail/impl/dev_poll_reactor.hpp \ + asio/detail/impl/dev_poll_reactor.ipp \ + asio/detail/impl/epoll_reactor.hpp \ + asio/detail/impl/epoll_reactor.ipp \ + asio/detail/impl/eventfd_select_interrupter.ipp \ + asio/detail/impl/handler_tracking.ipp \ + asio/detail/impl/kqueue_reactor.hpp \ + asio/detail/impl/kqueue_reactor.ipp \ + asio/detail/impl/null_event.ipp \ + asio/detail/impl/pipe_select_interrupter.ipp \ + asio/detail/impl/posix_event.ipp \ + asio/detail/impl/posix_mutex.ipp \ + asio/detail/impl/posix_thread.ipp \ + asio/detail/impl/posix_tss_ptr.ipp \ + asio/detail/impl/reactive_descriptor_service.ipp \ + asio/detail/impl/reactive_serial_port_service.ipp \ + asio/detail/impl/reactive_socket_service_base.ipp \ + asio/detail/impl/resolver_service_base.ipp \ + asio/detail/impl/scheduler.ipp \ + asio/detail/impl/select_reactor.hpp \ + asio/detail/impl/select_reactor.ipp \ + asio/detail/impl/service_registry.hpp \ + asio/detail/impl/service_registry.ipp \ + asio/detail/impl/signal_set_service.ipp \ + asio/detail/impl/socket_ops.ipp \ + asio/detail/impl/socket_select_interrupter.ipp \ + asio/detail/impl/strand_executor_service.hpp \ + asio/detail/impl/strand_executor_service.ipp \ + asio/detail/impl/strand_service.hpp \ + asio/detail/impl/strand_service.ipp \ + asio/detail/impl/throw_error.ipp \ + asio/detail/impl/timer_queue_ptime.ipp \ + asio/detail/impl/timer_queue_set.ipp \ + asio/detail/impl/win_event.ipp \ + asio/detail/impl/win_iocp_handle_service.ipp \ + asio/detail/impl/win_iocp_io_context.hpp \ + asio/detail/impl/win_iocp_io_context.ipp \ + asio/detail/impl/win_iocp_serial_port_service.ipp \ + asio/detail/impl/win_iocp_socket_service_base.ipp \ + asio/detail/impl/win_mutex.ipp \ + asio/detail/impl/win_object_handle_service.ipp \ + asio/detail/impl/winrt_ssocket_service_base.ipp \ + asio/detail/impl/winrt_timer_scheduler.hpp \ + asio/detail/impl/winrt_timer_scheduler.ipp \ + asio/detail/impl/winsock_init.ipp \ + asio/detail/impl/win_static_mutex.ipp \ + asio/detail/impl/win_thread.ipp \ + asio/detail/impl/win_tss_ptr.ipp \ + asio/detail/io_control.hpp \ + asio/detail/io_object_impl.hpp \ + asio/detail/is_buffer_sequence.hpp \ + asio/detail/is_executor.hpp \ + asio/detail/keyword_tss_ptr.hpp \ + asio/detail/kqueue_reactor.hpp \ + asio/detail/limits.hpp \ + asio/detail/local_free_on_block_exit.hpp \ + asio/detail/macos_fenced_block.hpp \ + asio/detail/memory.hpp \ + asio/detail/mutex.hpp \ + asio/detail/non_const_lvalue.hpp \ + asio/detail/noncopyable.hpp \ + asio/detail/null_event.hpp \ + asio/detail/null_fenced_block.hpp \ + asio/detail/null_global.hpp \ + asio/detail/null_mutex.hpp \ + asio/detail/null_reactor.hpp \ + asio/detail/null_signal_blocker.hpp \ + asio/detail/null_socket_service.hpp \ + asio/detail/null_static_mutex.hpp \ + asio/detail/null_thread.hpp \ + asio/detail/null_tss_ptr.hpp \ + asio/detail/object_pool.hpp \ + asio/detail/old_win_sdk_compat.hpp \ + asio/detail/operation.hpp \ + asio/detail/op_queue.hpp \ + asio/detail/pipe_select_interrupter.hpp \ + asio/detail/pop_options.hpp \ + asio/detail/posix_event.hpp \ + asio/detail/posix_fd_set_adapter.hpp \ + asio/detail/posix_global.hpp \ + asio/detail/posix_mutex.hpp \ + asio/detail/posix_signal_blocker.hpp \ + asio/detail/posix_static_mutex.hpp \ + asio/detail/posix_thread.hpp \ + asio/detail/posix_tss_ptr.hpp \ + asio/detail/push_options.hpp \ + asio/detail/reactive_descriptor_service.hpp \ + asio/detail/reactive_null_buffers_op.hpp \ + asio/detail/reactive_serial_port_service.hpp \ + asio/detail/reactive_socket_accept_op.hpp \ + asio/detail/reactive_socket_connect_op.hpp \ + asio/detail/reactive_socket_recvfrom_op.hpp \ + asio/detail/reactive_socket_recvmsg_op.hpp \ + asio/detail/reactive_socket_recv_op.hpp \ + asio/detail/reactive_socket_send_op.hpp \ + asio/detail/reactive_socket_sendto_op.hpp \ + asio/detail/reactive_socket_service_base.hpp \ + asio/detail/reactive_socket_service.hpp \ + asio/detail/reactive_wait_op.hpp \ + asio/detail/reactor_fwd.hpp \ + asio/detail/reactor.hpp \ + asio/detail/reactor_op.hpp \ + asio/detail/reactor_op_queue.hpp \ + asio/detail/recycling_allocator.hpp \ + asio/detail/regex_fwd.hpp \ + asio/detail/resolve_endpoint_op.hpp \ + asio/detail/resolve_op.hpp \ + asio/detail/resolve_query_op.hpp \ + asio/detail/resolver_service_base.hpp \ + asio/detail/resolver_service.hpp \ + asio/detail/scheduler.hpp \ + asio/detail/scheduler_operation.hpp \ + asio/detail/scheduler_thread_info.hpp \ + asio/detail/scoped_lock.hpp \ + asio/detail/scoped_ptr.hpp \ + asio/detail/select_interrupter.hpp \ + asio/detail/select_reactor.hpp \ + asio/detail/service_registry.hpp \ + asio/detail/signal_blocker.hpp \ + asio/detail/signal_handler.hpp \ + asio/detail/signal_init.hpp \ + asio/detail/signal_op.hpp \ + asio/detail/signal_set_service.hpp \ + asio/detail/socket_holder.hpp \ + asio/detail/socket_ops.hpp \ + asio/detail/socket_option.hpp \ + asio/detail/socket_select_interrupter.hpp \ + asio/detail/socket_types.hpp \ + asio/detail/solaris_fenced_block.hpp \ + asio/detail/source_location.hpp \ + asio/detail/static_mutex.hpp \ + asio/detail/std_event.hpp \ + asio/detail/std_fenced_block.hpp \ + asio/detail/std_global.hpp \ + asio/detail/std_mutex.hpp \ + asio/detail/std_static_mutex.hpp \ + asio/detail/std_thread.hpp \ + asio/detail/strand_executor_service.hpp \ + asio/detail/strand_service.hpp \ + asio/detail/string_view.hpp \ + asio/detail/thread_context.hpp \ + asio/detail/thread_group.hpp \ + asio/detail/thread.hpp \ + asio/detail/thread_info_base.hpp \ + asio/detail/throw_error.hpp \ + asio/detail/throw_exception.hpp \ + asio/detail/timer_queue_base.hpp \ + asio/detail/timer_queue.hpp \ + asio/detail/timer_queue_ptime.hpp \ + asio/detail/timer_queue_set.hpp \ + asio/detail/timer_scheduler_fwd.hpp \ + asio/detail/timer_scheduler.hpp \ + asio/detail/tss_ptr.hpp \ + asio/detail/type_traits.hpp \ + asio/detail/variadic_templates.hpp \ + asio/detail/wait_handler.hpp \ + asio/detail/wait_op.hpp \ + asio/detail/winapp_thread.hpp \ + asio/detail/wince_thread.hpp \ + asio/detail/win_event.hpp \ + asio/detail/win_fd_set_adapter.hpp \ + asio/detail/win_fenced_block.hpp \ + asio/detail/win_global.hpp \ + asio/detail/win_iocp_handle_read_op.hpp \ + asio/detail/win_iocp_handle_service.hpp \ + asio/detail/win_iocp_handle_write_op.hpp \ + asio/detail/win_iocp_io_context.hpp \ + asio/detail/win_iocp_null_buffers_op.hpp \ + asio/detail/win_iocp_operation.hpp \ + asio/detail/win_iocp_overlapped_op.hpp \ + asio/detail/win_iocp_overlapped_ptr.hpp \ + asio/detail/win_iocp_serial_port_service.hpp \ + asio/detail/win_iocp_socket_accept_op.hpp \ + asio/detail/win_iocp_socket_connect_op.hpp \ + asio/detail/win_iocp_socket_recvfrom_op.hpp \ + asio/detail/win_iocp_socket_recvmsg_op.hpp \ + asio/detail/win_iocp_socket_recv_op.hpp \ + asio/detail/win_iocp_socket_send_op.hpp \ + asio/detail/win_iocp_socket_service_base.hpp \ + asio/detail/win_iocp_socket_service.hpp \ + asio/detail/win_iocp_thread_info.hpp \ + asio/detail/win_iocp_wait_op.hpp \ + asio/detail/win_mutex.hpp \ + asio/detail/win_object_handle_service.hpp \ + asio/detail/winrt_async_manager.hpp \ + asio/detail/winrt_async_op.hpp \ + asio/detail/winrt_resolve_op.hpp \ + asio/detail/winrt_resolver_service.hpp \ + asio/detail/winrt_socket_connect_op.hpp \ + asio/detail/winrt_socket_recv_op.hpp \ + asio/detail/winrt_socket_send_op.hpp \ + asio/detail/winrt_ssocket_service_base.hpp \ + asio/detail/winrt_ssocket_service.hpp \ + asio/detail/winrt_timer_scheduler.hpp \ + asio/detail/winrt_utils.hpp \ + asio/detail/winsock_init.hpp \ + asio/detail/win_static_mutex.hpp \ + asio/detail/win_thread.hpp \ + asio/detail/win_tss_ptr.hpp \ + asio/detail/work_dispatcher.hpp \ + asio/detail/wrapped_handler.hpp \ + asio/dispatch.hpp \ + asio/error_code.hpp \ + asio/error.hpp \ + asio/execution.hpp \ + asio/execution_context.hpp \ + asio/execution/allocator.hpp \ + asio/execution/any_executor.hpp \ + asio/execution/bad_executor.hpp \ + asio/execution/blocking.hpp \ + asio/execution/blocking_adaptation.hpp \ + asio/execution/bulk_execute.hpp \ + asio/execution/bulk_guarantee.hpp \ + asio/execution/connect.hpp \ + asio/execution/context.hpp \ + asio/execution/context_as.hpp \ + asio/execution/detail/as_invocable.hpp \ + asio/execution/detail/as_operation.hpp \ + asio/execution/detail/as_receiver.hpp \ + asio/execution/detail/bulk_sender.hpp \ + asio/execution/detail/void_receiver.hpp \ + asio/execution/detail/submit_receiver.hpp \ + asio/execution/execute.hpp \ + asio/execution/executor.hpp \ + asio/execution/impl/bad_executor.ipp \ + asio/execution/impl/receiver_invocation_error.ipp \ + asio/execution/invocable_archetype.hpp \ + asio/execution/mapping.hpp \ + asio/execution/occupancy.hpp \ + asio/execution/operation_state.hpp \ + asio/execution/outstanding_work.hpp \ + asio/execution/prefer_only.hpp \ + asio/execution/receiver.hpp \ + asio/execution/receiver_invocation_error.hpp \ + asio/execution/relationship.hpp \ + asio/execution/schedule.hpp \ + asio/execution/scheduler.hpp \ + asio/execution/sender.hpp \ + asio/execution/set_done.hpp \ + asio/execution/set_error.hpp \ + asio/execution/set_value.hpp \ + asio/execution/start.hpp \ + asio/execution/submit.hpp \ + asio/executor.hpp \ + asio/executor_work_guard.hpp \ + asio/generic/basic_endpoint.hpp \ + asio/generic/datagram_protocol.hpp \ + asio/generic/detail/endpoint.hpp \ + asio/generic/detail/impl/endpoint.ipp \ + asio/generic/raw_protocol.hpp \ + asio/generic/seq_packet_protocol.hpp \ + asio/generic/stream_protocol.hpp \ + asio/handler_alloc_hook.hpp \ + asio/handler_continuation_hook.hpp \ + asio/handler_invoke_hook.hpp \ + asio/high_resolution_timer.hpp \ + asio.hpp \ + asio/impl/awaitable.hpp \ + asio/impl/buffered_read_stream.hpp \ + asio/impl/buffered_write_stream.hpp \ + asio/impl/co_spawn.hpp \ + asio/impl/compose.hpp \ + asio/impl/connect.hpp \ + asio/impl/defer.hpp \ + asio/impl/detached.hpp \ + asio/impl/dispatch.hpp \ + asio/impl/error_code.ipp \ + asio/impl/error.ipp \ + asio/impl/execution_context.hpp \ + asio/impl/execution_context.ipp \ + asio/impl/executor.hpp \ + asio/impl/executor.ipp \ + asio/impl/handler_alloc_hook.ipp \ + asio/impl/io_context.hpp \ + asio/impl/io_context.ipp \ + asio/impl/multiple_exceptions.ipp \ + asio/impl/post.hpp \ + asio/impl/read_at.hpp \ + asio/impl/read.hpp \ + asio/impl/read_until.hpp \ + asio/impl/redirect_error.hpp \ + asio/impl/serial_port_base.hpp \ + asio/impl/serial_port_base.ipp \ + asio/impl/spawn.hpp \ + asio/impl/src.cpp \ + asio/impl/src.hpp \ + asio/impl/system_context.hpp \ + asio/impl/system_context.ipp \ + asio/impl/system_executor.hpp \ + asio/impl/thread_pool.hpp \ + asio/impl/thread_pool.ipp \ + asio/impl/use_awaitable.hpp \ + asio/impl/use_future.hpp \ + asio/impl/write_at.hpp \ + asio/impl/write.hpp \ + asio/io_context.hpp \ + asio/io_context_strand.hpp \ + asio/io_service.hpp \ + asio/io_service_strand.hpp \ + asio/ip/address.hpp \ + asio/ip/address_v4.hpp \ + asio/ip/address_v4_iterator.hpp \ + asio/ip/address_v4_range.hpp \ + asio/ip/address_v6.hpp \ + asio/ip/address_v6_iterator.hpp \ + asio/ip/address_v6_range.hpp \ + asio/ip/bad_address_cast.hpp \ + asio/ip/basic_endpoint.hpp \ + asio/ip/basic_resolver_entry.hpp \ + asio/ip/basic_resolver.hpp \ + asio/ip/basic_resolver_iterator.hpp \ + asio/ip/basic_resolver_query.hpp \ + asio/ip/basic_resolver_results.hpp \ + asio/ip/detail/endpoint.hpp \ + asio/ip/detail/impl/endpoint.ipp \ + asio/ip/detail/socket_option.hpp \ + asio/ip/host_name.hpp \ + asio/ip/icmp.hpp \ + asio/ip/impl/address.hpp \ + asio/ip/impl/address.ipp \ + asio/ip/impl/address_v4.hpp \ + asio/ip/impl/address_v4.ipp \ + asio/ip/impl/address_v6.hpp \ + asio/ip/impl/address_v6.ipp \ + asio/ip/impl/basic_endpoint.hpp \ + asio/ip/impl/host_name.ipp \ + asio/ip/impl/network_v4.hpp \ + asio/ip/impl/network_v4.ipp \ + asio/ip/impl/network_v6.hpp \ + asio/ip/impl/network_v6.ipp \ + asio/ip/multicast.hpp \ + asio/ip/network_v4.hpp \ + asio/ip/network_v6.hpp \ + asio/ip/resolver_base.hpp \ + asio/ip/resolver_query_base.hpp \ + asio/ip/tcp.hpp \ + asio/ip/udp.hpp \ + asio/ip/unicast.hpp \ + asio/ip/v6_only.hpp \ + asio/is_applicable_property.hpp \ + asio/is_executor.hpp \ + asio/is_read_buffered.hpp \ + asio/is_write_buffered.hpp \ + asio/local/basic_endpoint.hpp \ + asio/local/connect_pair.hpp \ + asio/local/datagram_protocol.hpp \ + asio/local/detail/endpoint.hpp \ + asio/local/detail/impl/endpoint.ipp \ + asio/local/stream_protocol.hpp \ + asio/multiple_exceptions.hpp \ + asio/packaged_task.hpp \ + asio/placeholders.hpp \ + asio/posix/basic_descriptor.hpp \ + asio/posix/basic_stream_descriptor.hpp \ + asio/posix/descriptor_base.hpp \ + asio/posix/descriptor.hpp \ + asio/posix/stream_descriptor.hpp \ + asio/post.hpp \ + asio/prefer.hpp \ + asio/query.hpp \ + asio/read_at.hpp \ + asio/read.hpp \ + asio/read_until.hpp \ + asio/redirect_error.hpp \ + asio/require.hpp \ + asio/require_concept.hpp \ + asio/serial_port_base.hpp \ + asio/serial_port.hpp \ + asio/signal_set.hpp \ + asio/socket_base.hpp \ + asio/spawn.hpp \ + asio/ssl/context_base.hpp \ + asio/ssl/context.hpp \ + asio/ssl/detail/buffered_handshake_op.hpp \ + asio/ssl/detail/engine.hpp \ + asio/ssl/detail/handshake_op.hpp \ + asio/ssl/detail/impl/engine.ipp \ + asio/ssl/detail/impl/openssl_init.ipp \ + asio/ssl/detail/io.hpp \ + asio/ssl/detail/openssl_init.hpp \ + asio/ssl/detail/openssl_types.hpp \ + asio/ssl/detail/password_callback.hpp \ + asio/ssl/detail/read_op.hpp \ + asio/ssl/detail/shutdown_op.hpp \ + asio/ssl/detail/stream_core.hpp \ + asio/ssl/detail/verify_callback.hpp \ + asio/ssl/detail/write_op.hpp \ + asio/ssl/error.hpp \ + asio/ssl.hpp \ + asio/ssl/host_name_verification.hpp \ + asio/ssl/impl/context.hpp \ + asio/ssl/impl/context.ipp \ + asio/ssl/impl/error.ipp \ + asio/ssl/impl/host_name_verification.ipp \ + asio/ssl/impl/rfc2818_verification.ipp \ + asio/ssl/impl/src.hpp \ + asio/ssl/rfc2818_verification.hpp \ + asio/ssl/stream_base.hpp \ + asio/ssl/stream.hpp \ + asio/ssl/verify_context.hpp \ + asio/ssl/verify_mode.hpp \ + asio/static_thread_pool.hpp \ + asio/steady_timer.hpp \ + asio/strand.hpp \ + asio/streambuf.hpp \ + asio/system_context.hpp \ + asio/system_error.hpp \ + asio/system_executor.hpp \ + asio/system_timer.hpp \ + asio/this_coro.hpp \ + asio/thread.hpp \ + asio/thread_pool.hpp \ + asio/time_traits.hpp \ + asio/traits/bulk_execute_free.hpp \ + asio/traits/bulk_execute_member.hpp \ + asio/traits/connect_free.hpp \ + asio/traits/connect_member.hpp \ + asio/traits/equality_comparable.hpp \ + asio/traits/execute_free.hpp \ + asio/traits/execute_member.hpp \ + asio/traits/prefer_free.hpp \ + asio/traits/prefer_member.hpp \ + asio/traits/query_free.hpp \ + asio/traits/query_member.hpp \ + asio/traits/query_static_constexpr_member.hpp \ + asio/traits/require_concept_free.hpp \ + asio/traits/require_concept_member.hpp \ + asio/traits/require_free.hpp \ + asio/traits/require_member.hpp \ + asio/traits/schedule_free.hpp \ + asio/traits/schedule_member.hpp \ + asio/traits/set_done_free.hpp \ + asio/traits/set_done_member.hpp \ + asio/traits/set_error_free.hpp \ + asio/traits/set_error_member.hpp \ + asio/traits/set_value_free.hpp \ + asio/traits/set_value_member.hpp \ + asio/traits/start_free.hpp \ + asio/traits/start_member.hpp \ + asio/traits/static_query.hpp \ + asio/traits/static_require.hpp \ + asio/traits/static_require_concept.hpp \ + asio/traits/submit_free.hpp \ + asio/traits/submit_member.hpp \ + asio/ts/buffer.hpp \ + asio/ts/executor.hpp \ + asio/ts/internet.hpp \ + asio/ts/io_context.hpp \ + asio/ts/netfwd.hpp \ + asio/ts/net.hpp \ + asio/ts/socket.hpp \ + asio/ts/timer.hpp \ + asio/unyield.hpp \ + asio/use_awaitable.hpp \ + asio/use_future.hpp \ + asio/uses_executor.hpp \ + asio/version.hpp \ + asio/wait_traits.hpp \ + asio/windows/basic_object_handle.hpp \ + asio/windows/basic_overlapped_handle.hpp \ + asio/windows/basic_random_access_handle.hpp \ + asio/windows/basic_stream_handle.hpp \ + asio/windows/object_handle.hpp \ + asio/windows/overlapped_handle.hpp \ + asio/windows/overlapped_ptr.hpp \ + asio/windows/random_access_handle.hpp \ + asio/windows/stream_handle.hpp \ + asio/write_at.hpp \ + asio/write.hpp \ + asio/yield.hpp + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in diff --git a/include/asio/include/Makefile.in b/include/asio/include/Makefile.in new file mode 100644 index 0000000..3a221ee --- /dev/null +++ b/include/asio/include/Makefile.in @@ -0,0 +1,1103 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(nobase_include_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(includedir)" +HEADERS = $(nobase_include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# find . -name "*.*pp" | sed -e 's/^\.\///' | sed -e 's/^.*$/ & \\/' | sort +nobase_include_HEADERS = \ + asio/any_io_executor.hpp \ + asio/associated_allocator.hpp \ + asio/associated_executor.hpp \ + asio/async_result.hpp \ + asio/awaitable.hpp \ + asio/basic_datagram_socket.hpp \ + asio/basic_deadline_timer.hpp \ + asio/basic_io_object.hpp \ + asio/basic_raw_socket.hpp \ + asio/basic_seq_packet_socket.hpp \ + asio/basic_serial_port.hpp \ + asio/basic_signal_set.hpp \ + asio/basic_socket_acceptor.hpp \ + asio/basic_socket.hpp \ + asio/basic_socket_iostream.hpp \ + asio/basic_socket_streambuf.hpp \ + asio/basic_streambuf_fwd.hpp \ + asio/basic_streambuf.hpp \ + asio/basic_stream_socket.hpp \ + asio/basic_waitable_timer.hpp \ + asio/bind_executor.hpp \ + asio/buffered_read_stream_fwd.hpp \ + asio/buffered_read_stream.hpp \ + asio/buffered_stream_fwd.hpp \ + asio/buffered_stream.hpp \ + asio/buffered_write_stream_fwd.hpp \ + asio/buffered_write_stream.hpp \ + asio/buffer.hpp \ + asio/buffers_iterator.hpp \ + asio/co_spawn.hpp \ + asio/completion_condition.hpp \ + asio/compose.hpp \ + asio/connect.hpp \ + asio/coroutine.hpp \ + asio/deadline_timer.hpp \ + asio/defer.hpp \ + asio/detached.hpp \ + asio/detail/array_fwd.hpp \ + asio/detail/array.hpp \ + asio/detail/assert.hpp \ + asio/detail/atomic_count.hpp \ + asio/detail/base_from_completion_cond.hpp \ + asio/detail/bind_handler.hpp \ + asio/detail/blocking_executor_op.hpp \ + asio/detail/buffered_stream_storage.hpp \ + asio/detail/buffer_resize_guard.hpp \ + asio/detail/buffer_sequence_adapter.hpp \ + asio/detail/bulk_executor_op.hpp \ + asio/detail/call_stack.hpp \ + asio/detail/chrono.hpp \ + asio/detail/chrono_time_traits.hpp \ + asio/detail/completion_handler.hpp \ + asio/detail/concurrency_hint.hpp \ + asio/detail/conditionally_enabled_event.hpp \ + asio/detail/conditionally_enabled_mutex.hpp \ + asio/detail/config.hpp \ + asio/detail/consuming_buffers.hpp \ + asio/detail/cstddef.hpp \ + asio/detail/cstdint.hpp \ + asio/detail/date_time_fwd.hpp \ + asio/detail/deadline_timer_service.hpp \ + asio/detail/dependent_type.hpp \ + asio/detail/descriptor_ops.hpp \ + asio/detail/descriptor_read_op.hpp \ + asio/detail/descriptor_write_op.hpp \ + asio/detail/dev_poll_reactor.hpp \ + asio/detail/epoll_reactor.hpp \ + asio/detail/eventfd_select_interrupter.hpp \ + asio/detail/event.hpp \ + asio/detail/executor_function.hpp \ + asio/detail/executor_op.hpp \ + asio/detail/fd_set_adapter.hpp \ + asio/detail/fenced_block.hpp \ + asio/detail/functional.hpp \ + asio/detail/future.hpp \ + asio/detail/gcc_arm_fenced_block.hpp \ + asio/detail/gcc_hppa_fenced_block.hpp \ + asio/detail/gcc_sync_fenced_block.hpp \ + asio/detail/gcc_x86_fenced_block.hpp \ + asio/detail/global.hpp \ + asio/detail/handler_alloc_helpers.hpp \ + asio/detail/handler_cont_helpers.hpp \ + asio/detail/handler_invoke_helpers.hpp \ + asio/detail/handler_tracking.hpp \ + asio/detail/handler_type_requirements.hpp \ + asio/detail/handler_work.hpp \ + asio/detail/hash_map.hpp \ + asio/detail/impl/buffer_sequence_adapter.ipp \ + asio/detail/impl/descriptor_ops.ipp \ + asio/detail/impl/dev_poll_reactor.hpp \ + asio/detail/impl/dev_poll_reactor.ipp \ + asio/detail/impl/epoll_reactor.hpp \ + asio/detail/impl/epoll_reactor.ipp \ + asio/detail/impl/eventfd_select_interrupter.ipp \ + asio/detail/impl/handler_tracking.ipp \ + asio/detail/impl/kqueue_reactor.hpp \ + asio/detail/impl/kqueue_reactor.ipp \ + asio/detail/impl/null_event.ipp \ + asio/detail/impl/pipe_select_interrupter.ipp \ + asio/detail/impl/posix_event.ipp \ + asio/detail/impl/posix_mutex.ipp \ + asio/detail/impl/posix_thread.ipp \ + asio/detail/impl/posix_tss_ptr.ipp \ + asio/detail/impl/reactive_descriptor_service.ipp \ + asio/detail/impl/reactive_serial_port_service.ipp \ + asio/detail/impl/reactive_socket_service_base.ipp \ + asio/detail/impl/resolver_service_base.ipp \ + asio/detail/impl/scheduler.ipp \ + asio/detail/impl/select_reactor.hpp \ + asio/detail/impl/select_reactor.ipp \ + asio/detail/impl/service_registry.hpp \ + asio/detail/impl/service_registry.ipp \ + asio/detail/impl/signal_set_service.ipp \ + asio/detail/impl/socket_ops.ipp \ + asio/detail/impl/socket_select_interrupter.ipp \ + asio/detail/impl/strand_executor_service.hpp \ + asio/detail/impl/strand_executor_service.ipp \ + asio/detail/impl/strand_service.hpp \ + asio/detail/impl/strand_service.ipp \ + asio/detail/impl/throw_error.ipp \ + asio/detail/impl/timer_queue_ptime.ipp \ + asio/detail/impl/timer_queue_set.ipp \ + asio/detail/impl/win_event.ipp \ + asio/detail/impl/win_iocp_handle_service.ipp \ + asio/detail/impl/win_iocp_io_context.hpp \ + asio/detail/impl/win_iocp_io_context.ipp \ + asio/detail/impl/win_iocp_serial_port_service.ipp \ + asio/detail/impl/win_iocp_socket_service_base.ipp \ + asio/detail/impl/win_mutex.ipp \ + asio/detail/impl/win_object_handle_service.ipp \ + asio/detail/impl/winrt_ssocket_service_base.ipp \ + asio/detail/impl/winrt_timer_scheduler.hpp \ + asio/detail/impl/winrt_timer_scheduler.ipp \ + asio/detail/impl/winsock_init.ipp \ + asio/detail/impl/win_static_mutex.ipp \ + asio/detail/impl/win_thread.ipp \ + asio/detail/impl/win_tss_ptr.ipp \ + asio/detail/io_control.hpp \ + asio/detail/io_object_impl.hpp \ + asio/detail/is_buffer_sequence.hpp \ + asio/detail/is_executor.hpp \ + asio/detail/keyword_tss_ptr.hpp \ + asio/detail/kqueue_reactor.hpp \ + asio/detail/limits.hpp \ + asio/detail/local_free_on_block_exit.hpp \ + asio/detail/macos_fenced_block.hpp \ + asio/detail/memory.hpp \ + asio/detail/mutex.hpp \ + asio/detail/non_const_lvalue.hpp \ + asio/detail/noncopyable.hpp \ + asio/detail/null_event.hpp \ + asio/detail/null_fenced_block.hpp \ + asio/detail/null_global.hpp \ + asio/detail/null_mutex.hpp \ + asio/detail/null_reactor.hpp \ + asio/detail/null_signal_blocker.hpp \ + asio/detail/null_socket_service.hpp \ + asio/detail/null_static_mutex.hpp \ + asio/detail/null_thread.hpp \ + asio/detail/null_tss_ptr.hpp \ + asio/detail/object_pool.hpp \ + asio/detail/old_win_sdk_compat.hpp \ + asio/detail/operation.hpp \ + asio/detail/op_queue.hpp \ + asio/detail/pipe_select_interrupter.hpp \ + asio/detail/pop_options.hpp \ + asio/detail/posix_event.hpp \ + asio/detail/posix_fd_set_adapter.hpp \ + asio/detail/posix_global.hpp \ + asio/detail/posix_mutex.hpp \ + asio/detail/posix_signal_blocker.hpp \ + asio/detail/posix_static_mutex.hpp \ + asio/detail/posix_thread.hpp \ + asio/detail/posix_tss_ptr.hpp \ + asio/detail/push_options.hpp \ + asio/detail/reactive_descriptor_service.hpp \ + asio/detail/reactive_null_buffers_op.hpp \ + asio/detail/reactive_serial_port_service.hpp \ + asio/detail/reactive_socket_accept_op.hpp \ + asio/detail/reactive_socket_connect_op.hpp \ + asio/detail/reactive_socket_recvfrom_op.hpp \ + asio/detail/reactive_socket_recvmsg_op.hpp \ + asio/detail/reactive_socket_recv_op.hpp \ + asio/detail/reactive_socket_send_op.hpp \ + asio/detail/reactive_socket_sendto_op.hpp \ + asio/detail/reactive_socket_service_base.hpp \ + asio/detail/reactive_socket_service.hpp \ + asio/detail/reactive_wait_op.hpp \ + asio/detail/reactor_fwd.hpp \ + asio/detail/reactor.hpp \ + asio/detail/reactor_op.hpp \ + asio/detail/reactor_op_queue.hpp \ + asio/detail/recycling_allocator.hpp \ + asio/detail/regex_fwd.hpp \ + asio/detail/resolve_endpoint_op.hpp \ + asio/detail/resolve_op.hpp \ + asio/detail/resolve_query_op.hpp \ + asio/detail/resolver_service_base.hpp \ + asio/detail/resolver_service.hpp \ + asio/detail/scheduler.hpp \ + asio/detail/scheduler_operation.hpp \ + asio/detail/scheduler_thread_info.hpp \ + asio/detail/scoped_lock.hpp \ + asio/detail/scoped_ptr.hpp \ + asio/detail/select_interrupter.hpp \ + asio/detail/select_reactor.hpp \ + asio/detail/service_registry.hpp \ + asio/detail/signal_blocker.hpp \ + asio/detail/signal_handler.hpp \ + asio/detail/signal_init.hpp \ + asio/detail/signal_op.hpp \ + asio/detail/signal_set_service.hpp \ + asio/detail/socket_holder.hpp \ + asio/detail/socket_ops.hpp \ + asio/detail/socket_option.hpp \ + asio/detail/socket_select_interrupter.hpp \ + asio/detail/socket_types.hpp \ + asio/detail/solaris_fenced_block.hpp \ + asio/detail/source_location.hpp \ + asio/detail/static_mutex.hpp \ + asio/detail/std_event.hpp \ + asio/detail/std_fenced_block.hpp \ + asio/detail/std_global.hpp \ + asio/detail/std_mutex.hpp \ + asio/detail/std_static_mutex.hpp \ + asio/detail/std_thread.hpp \ + asio/detail/strand_executor_service.hpp \ + asio/detail/strand_service.hpp \ + asio/detail/string_view.hpp \ + asio/detail/thread_context.hpp \ + asio/detail/thread_group.hpp \ + asio/detail/thread.hpp \ + asio/detail/thread_info_base.hpp \ + asio/detail/throw_error.hpp \ + asio/detail/throw_exception.hpp \ + asio/detail/timer_queue_base.hpp \ + asio/detail/timer_queue.hpp \ + asio/detail/timer_queue_ptime.hpp \ + asio/detail/timer_queue_set.hpp \ + asio/detail/timer_scheduler_fwd.hpp \ + asio/detail/timer_scheduler.hpp \ + asio/detail/tss_ptr.hpp \ + asio/detail/type_traits.hpp \ + asio/detail/variadic_templates.hpp \ + asio/detail/wait_handler.hpp \ + asio/detail/wait_op.hpp \ + asio/detail/winapp_thread.hpp \ + asio/detail/wince_thread.hpp \ + asio/detail/win_event.hpp \ + asio/detail/win_fd_set_adapter.hpp \ + asio/detail/win_fenced_block.hpp \ + asio/detail/win_global.hpp \ + asio/detail/win_iocp_handle_read_op.hpp \ + asio/detail/win_iocp_handle_service.hpp \ + asio/detail/win_iocp_handle_write_op.hpp \ + asio/detail/win_iocp_io_context.hpp \ + asio/detail/win_iocp_null_buffers_op.hpp \ + asio/detail/win_iocp_operation.hpp \ + asio/detail/win_iocp_overlapped_op.hpp \ + asio/detail/win_iocp_overlapped_ptr.hpp \ + asio/detail/win_iocp_serial_port_service.hpp \ + asio/detail/win_iocp_socket_accept_op.hpp \ + asio/detail/win_iocp_socket_connect_op.hpp \ + asio/detail/win_iocp_socket_recvfrom_op.hpp \ + asio/detail/win_iocp_socket_recvmsg_op.hpp \ + asio/detail/win_iocp_socket_recv_op.hpp \ + asio/detail/win_iocp_socket_send_op.hpp \ + asio/detail/win_iocp_socket_service_base.hpp \ + asio/detail/win_iocp_socket_service.hpp \ + asio/detail/win_iocp_thread_info.hpp \ + asio/detail/win_iocp_wait_op.hpp \ + asio/detail/win_mutex.hpp \ + asio/detail/win_object_handle_service.hpp \ + asio/detail/winrt_async_manager.hpp \ + asio/detail/winrt_async_op.hpp \ + asio/detail/winrt_resolve_op.hpp \ + asio/detail/winrt_resolver_service.hpp \ + asio/detail/winrt_socket_connect_op.hpp \ + asio/detail/winrt_socket_recv_op.hpp \ + asio/detail/winrt_socket_send_op.hpp \ + asio/detail/winrt_ssocket_service_base.hpp \ + asio/detail/winrt_ssocket_service.hpp \ + asio/detail/winrt_timer_scheduler.hpp \ + asio/detail/winrt_utils.hpp \ + asio/detail/winsock_init.hpp \ + asio/detail/win_static_mutex.hpp \ + asio/detail/win_thread.hpp \ + asio/detail/win_tss_ptr.hpp \ + asio/detail/work_dispatcher.hpp \ + asio/detail/wrapped_handler.hpp \ + asio/dispatch.hpp \ + asio/error_code.hpp \ + asio/error.hpp \ + asio/execution.hpp \ + asio/execution_context.hpp \ + asio/execution/allocator.hpp \ + asio/execution/any_executor.hpp \ + asio/execution/bad_executor.hpp \ + asio/execution/blocking.hpp \ + asio/execution/blocking_adaptation.hpp \ + asio/execution/bulk_execute.hpp \ + asio/execution/bulk_guarantee.hpp \ + asio/execution/connect.hpp \ + asio/execution/context.hpp \ + asio/execution/context_as.hpp \ + asio/execution/detail/as_invocable.hpp \ + asio/execution/detail/as_operation.hpp \ + asio/execution/detail/as_receiver.hpp \ + asio/execution/detail/bulk_sender.hpp \ + asio/execution/detail/void_receiver.hpp \ + asio/execution/detail/submit_receiver.hpp \ + asio/execution/execute.hpp \ + asio/execution/executor.hpp \ + asio/execution/impl/bad_executor.ipp \ + asio/execution/impl/receiver_invocation_error.ipp \ + asio/execution/invocable_archetype.hpp \ + asio/execution/mapping.hpp \ + asio/execution/occupancy.hpp \ + asio/execution/operation_state.hpp \ + asio/execution/outstanding_work.hpp \ + asio/execution/prefer_only.hpp \ + asio/execution/receiver.hpp \ + asio/execution/receiver_invocation_error.hpp \ + asio/execution/relationship.hpp \ + asio/execution/schedule.hpp \ + asio/execution/scheduler.hpp \ + asio/execution/sender.hpp \ + asio/execution/set_done.hpp \ + asio/execution/set_error.hpp \ + asio/execution/set_value.hpp \ + asio/execution/start.hpp \ + asio/execution/submit.hpp \ + asio/executor.hpp \ + asio/executor_work_guard.hpp \ + asio/generic/basic_endpoint.hpp \ + asio/generic/datagram_protocol.hpp \ + asio/generic/detail/endpoint.hpp \ + asio/generic/detail/impl/endpoint.ipp \ + asio/generic/raw_protocol.hpp \ + asio/generic/seq_packet_protocol.hpp \ + asio/generic/stream_protocol.hpp \ + asio/handler_alloc_hook.hpp \ + asio/handler_continuation_hook.hpp \ + asio/handler_invoke_hook.hpp \ + asio/high_resolution_timer.hpp \ + asio.hpp \ + asio/impl/awaitable.hpp \ + asio/impl/buffered_read_stream.hpp \ + asio/impl/buffered_write_stream.hpp \ + asio/impl/co_spawn.hpp \ + asio/impl/compose.hpp \ + asio/impl/connect.hpp \ + asio/impl/defer.hpp \ + asio/impl/detached.hpp \ + asio/impl/dispatch.hpp \ + asio/impl/error_code.ipp \ + asio/impl/error.ipp \ + asio/impl/execution_context.hpp \ + asio/impl/execution_context.ipp \ + asio/impl/executor.hpp \ + asio/impl/executor.ipp \ + asio/impl/handler_alloc_hook.ipp \ + asio/impl/io_context.hpp \ + asio/impl/io_context.ipp \ + asio/impl/multiple_exceptions.ipp \ + asio/impl/post.hpp \ + asio/impl/read_at.hpp \ + asio/impl/read.hpp \ + asio/impl/read_until.hpp \ + asio/impl/redirect_error.hpp \ + asio/impl/serial_port_base.hpp \ + asio/impl/serial_port_base.ipp \ + asio/impl/spawn.hpp \ + asio/impl/src.cpp \ + asio/impl/src.hpp \ + asio/impl/system_context.hpp \ + asio/impl/system_context.ipp \ + asio/impl/system_executor.hpp \ + asio/impl/thread_pool.hpp \ + asio/impl/thread_pool.ipp \ + asio/impl/use_awaitable.hpp \ + asio/impl/use_future.hpp \ + asio/impl/write_at.hpp \ + asio/impl/write.hpp \ + asio/io_context.hpp \ + asio/io_context_strand.hpp \ + asio/io_service.hpp \ + asio/io_service_strand.hpp \ + asio/ip/address.hpp \ + asio/ip/address_v4.hpp \ + asio/ip/address_v4_iterator.hpp \ + asio/ip/address_v4_range.hpp \ + asio/ip/address_v6.hpp \ + asio/ip/address_v6_iterator.hpp \ + asio/ip/address_v6_range.hpp \ + asio/ip/bad_address_cast.hpp \ + asio/ip/basic_endpoint.hpp \ + asio/ip/basic_resolver_entry.hpp \ + asio/ip/basic_resolver.hpp \ + asio/ip/basic_resolver_iterator.hpp \ + asio/ip/basic_resolver_query.hpp \ + asio/ip/basic_resolver_results.hpp \ + asio/ip/detail/endpoint.hpp \ + asio/ip/detail/impl/endpoint.ipp \ + asio/ip/detail/socket_option.hpp \ + asio/ip/host_name.hpp \ + asio/ip/icmp.hpp \ + asio/ip/impl/address.hpp \ + asio/ip/impl/address.ipp \ + asio/ip/impl/address_v4.hpp \ + asio/ip/impl/address_v4.ipp \ + asio/ip/impl/address_v6.hpp \ + asio/ip/impl/address_v6.ipp \ + asio/ip/impl/basic_endpoint.hpp \ + asio/ip/impl/host_name.ipp \ + asio/ip/impl/network_v4.hpp \ + asio/ip/impl/network_v4.ipp \ + asio/ip/impl/network_v6.hpp \ + asio/ip/impl/network_v6.ipp \ + asio/ip/multicast.hpp \ + asio/ip/network_v4.hpp \ + asio/ip/network_v6.hpp \ + asio/ip/resolver_base.hpp \ + asio/ip/resolver_query_base.hpp \ + asio/ip/tcp.hpp \ + asio/ip/udp.hpp \ + asio/ip/unicast.hpp \ + asio/ip/v6_only.hpp \ + asio/is_applicable_property.hpp \ + asio/is_executor.hpp \ + asio/is_read_buffered.hpp \ + asio/is_write_buffered.hpp \ + asio/local/basic_endpoint.hpp \ + asio/local/connect_pair.hpp \ + asio/local/datagram_protocol.hpp \ + asio/local/detail/endpoint.hpp \ + asio/local/detail/impl/endpoint.ipp \ + asio/local/stream_protocol.hpp \ + asio/multiple_exceptions.hpp \ + asio/packaged_task.hpp \ + asio/placeholders.hpp \ + asio/posix/basic_descriptor.hpp \ + asio/posix/basic_stream_descriptor.hpp \ + asio/posix/descriptor_base.hpp \ + asio/posix/descriptor.hpp \ + asio/posix/stream_descriptor.hpp \ + asio/post.hpp \ + asio/prefer.hpp \ + asio/query.hpp \ + asio/read_at.hpp \ + asio/read.hpp \ + asio/read_until.hpp \ + asio/redirect_error.hpp \ + asio/require.hpp \ + asio/require_concept.hpp \ + asio/serial_port_base.hpp \ + asio/serial_port.hpp \ + asio/signal_set.hpp \ + asio/socket_base.hpp \ + asio/spawn.hpp \ + asio/ssl/context_base.hpp \ + asio/ssl/context.hpp \ + asio/ssl/detail/buffered_handshake_op.hpp \ + asio/ssl/detail/engine.hpp \ + asio/ssl/detail/handshake_op.hpp \ + asio/ssl/detail/impl/engine.ipp \ + asio/ssl/detail/impl/openssl_init.ipp \ + asio/ssl/detail/io.hpp \ + asio/ssl/detail/openssl_init.hpp \ + asio/ssl/detail/openssl_types.hpp \ + asio/ssl/detail/password_callback.hpp \ + asio/ssl/detail/read_op.hpp \ + asio/ssl/detail/shutdown_op.hpp \ + asio/ssl/detail/stream_core.hpp \ + asio/ssl/detail/verify_callback.hpp \ + asio/ssl/detail/write_op.hpp \ + asio/ssl/error.hpp \ + asio/ssl.hpp \ + asio/ssl/host_name_verification.hpp \ + asio/ssl/impl/context.hpp \ + asio/ssl/impl/context.ipp \ + asio/ssl/impl/error.ipp \ + asio/ssl/impl/host_name_verification.ipp \ + asio/ssl/impl/rfc2818_verification.ipp \ + asio/ssl/impl/src.hpp \ + asio/ssl/rfc2818_verification.hpp \ + asio/ssl/stream_base.hpp \ + asio/ssl/stream.hpp \ + asio/ssl/verify_context.hpp \ + asio/ssl/verify_mode.hpp \ + asio/static_thread_pool.hpp \ + asio/steady_timer.hpp \ + asio/strand.hpp \ + asio/streambuf.hpp \ + asio/system_context.hpp \ + asio/system_error.hpp \ + asio/system_executor.hpp \ + asio/system_timer.hpp \ + asio/this_coro.hpp \ + asio/thread.hpp \ + asio/thread_pool.hpp \ + asio/time_traits.hpp \ + asio/traits/bulk_execute_free.hpp \ + asio/traits/bulk_execute_member.hpp \ + asio/traits/connect_free.hpp \ + asio/traits/connect_member.hpp \ + asio/traits/equality_comparable.hpp \ + asio/traits/execute_free.hpp \ + asio/traits/execute_member.hpp \ + asio/traits/prefer_free.hpp \ + asio/traits/prefer_member.hpp \ + asio/traits/query_free.hpp \ + asio/traits/query_member.hpp \ + asio/traits/query_static_constexpr_member.hpp \ + asio/traits/require_concept_free.hpp \ + asio/traits/require_concept_member.hpp \ + asio/traits/require_free.hpp \ + asio/traits/require_member.hpp \ + asio/traits/schedule_free.hpp \ + asio/traits/schedule_member.hpp \ + asio/traits/set_done_free.hpp \ + asio/traits/set_done_member.hpp \ + asio/traits/set_error_free.hpp \ + asio/traits/set_error_member.hpp \ + asio/traits/set_value_free.hpp \ + asio/traits/set_value_member.hpp \ + asio/traits/start_free.hpp \ + asio/traits/start_member.hpp \ + asio/traits/static_query.hpp \ + asio/traits/static_require.hpp \ + asio/traits/static_require_concept.hpp \ + asio/traits/submit_free.hpp \ + asio/traits/submit_member.hpp \ + asio/ts/buffer.hpp \ + asio/ts/executor.hpp \ + asio/ts/internet.hpp \ + asio/ts/io_context.hpp \ + asio/ts/netfwd.hpp \ + asio/ts/net.hpp \ + asio/ts/socket.hpp \ + asio/ts/timer.hpp \ + asio/unyield.hpp \ + asio/use_awaitable.hpp \ + asio/use_future.hpp \ + asio/uses_executor.hpp \ + asio/version.hpp \ + asio/wait_traits.hpp \ + asio/windows/basic_object_handle.hpp \ + asio/windows/basic_overlapped_handle.hpp \ + asio/windows/basic_random_access_handle.hpp \ + asio/windows/basic_stream_handle.hpp \ + asio/windows/object_handle.hpp \ + asio/windows/overlapped_handle.hpp \ + asio/windows/overlapped_ptr.hpp \ + asio/windows/random_access_handle.hpp \ + asio/windows/stream_handle.hpp \ + asio/write_at.hpp \ + asio/write.hpp \ + asio/yield.hpp + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-nobase_includeHEADERS: $(nobase_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + $(am__nobase_list) | while read dir files; do \ + xfiles=; for file in $$files; do \ + if test -f "$$file"; then xfiles="$$xfiles $$file"; \ + else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ + test -z "$$xfiles" || { \ + test "x$$dir" = x. || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ + echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ + $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ + done + +uninstall-nobase_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-nobase_includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-nobase_includeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + cscopelist-am ctags ctags-am distclean distclean-generic \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-nobase_includeHEADERS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-nobase_includeHEADERS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/include/asio/include/asio.hpp b/include/asio/include/asio.hpp new file mode 100644 index 0000000..345aec7 --- /dev/null +++ b/include/asio/include/asio.hpp @@ -0,0 +1,182 @@ +// +// asio.hpp +// ~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_HPP +#define ASIO_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/associated_allocator.hpp" +#include "asio/associated_executor.hpp" +#include "asio/async_result.hpp" +#include "asio/awaitable.hpp" +#include "asio/basic_datagram_socket.hpp" +#include "asio/basic_deadline_timer.hpp" +#include "asio/basic_io_object.hpp" +#include "asio/basic_raw_socket.hpp" +#include "asio/basic_seq_packet_socket.hpp" +#include "asio/basic_serial_port.hpp" +#include "asio/basic_signal_set.hpp" +#include "asio/basic_socket.hpp" +#include "asio/basic_socket_acceptor.hpp" +#include "asio/basic_socket_iostream.hpp" +#include "asio/basic_socket_streambuf.hpp" +#include "asio/basic_stream_socket.hpp" +#include "asio/basic_streambuf.hpp" +#include "asio/basic_waitable_timer.hpp" +#include "asio/bind_executor.hpp" +#include "asio/buffer.hpp" +#include "asio/buffered_read_stream_fwd.hpp" +#include "asio/buffered_read_stream.hpp" +#include "asio/buffered_stream_fwd.hpp" +#include "asio/buffered_stream.hpp" +#include "asio/buffered_write_stream_fwd.hpp" +#include "asio/buffered_write_stream.hpp" +#include "asio/buffers_iterator.hpp" +#include "asio/co_spawn.hpp" +#include "asio/completion_condition.hpp" +#include "asio/compose.hpp" +#include "asio/connect.hpp" +#include "asio/coroutine.hpp" +#include "asio/deadline_timer.hpp" +#include "asio/defer.hpp" +#include "asio/detached.hpp" +#include "asio/dispatch.hpp" +#include "asio/error.hpp" +#include "asio/error_code.hpp" +#include "asio/execution.hpp" +#include "asio/execution/allocator.hpp" +#include "asio/execution/any_executor.hpp" +#include "asio/execution/blocking.hpp" +#include "asio/execution/blocking_adaptation.hpp" +#include "asio/execution/bulk_execute.hpp" +#include "asio/execution/bulk_guarantee.hpp" +#include "asio/execution/connect.hpp" +#include "asio/execution/context.hpp" +#include "asio/execution/context_as.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/invocable_archetype.hpp" +#include "asio/execution/mapping.hpp" +#include "asio/execution/occupancy.hpp" +#include "asio/execution/operation_state.hpp" +#include "asio/execution/outstanding_work.hpp" +#include "asio/execution/prefer_only.hpp" +#include "asio/execution/receiver.hpp" +#include "asio/execution/receiver_invocation_error.hpp" +#include "asio/execution/relationship.hpp" +#include "asio/execution/schedule.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/execution/set_done.hpp" +#include "asio/execution/set_error.hpp" +#include "asio/execution/set_value.hpp" +#include "asio/execution/start.hpp" +#include "asio/execution_context.hpp" +#include "asio/executor.hpp" +#include "asio/executor_work_guard.hpp" +#include "asio/generic/basic_endpoint.hpp" +#include "asio/generic/datagram_protocol.hpp" +#include "asio/generic/raw_protocol.hpp" +#include "asio/generic/seq_packet_protocol.hpp" +#include "asio/generic/stream_protocol.hpp" +#include "asio/handler_alloc_hook.hpp" +#include "asio/handler_continuation_hook.hpp" +#include "asio/handler_invoke_hook.hpp" +#include "asio/high_resolution_timer.hpp" +#include "asio/io_context.hpp" +#include "asio/io_context_strand.hpp" +#include "asio/io_service.hpp" +#include "asio/io_service_strand.hpp" +#include "asio/ip/address.hpp" +#include "asio/ip/address_v4.hpp" +#include "asio/ip/address_v4_iterator.hpp" +#include "asio/ip/address_v4_range.hpp" +#include "asio/ip/address_v6.hpp" +#include "asio/ip/address_v6_iterator.hpp" +#include "asio/ip/address_v6_range.hpp" +#include "asio/ip/network_v4.hpp" +#include "asio/ip/network_v6.hpp" +#include "asio/ip/bad_address_cast.hpp" +#include "asio/ip/basic_endpoint.hpp" +#include "asio/ip/basic_resolver.hpp" +#include "asio/ip/basic_resolver_entry.hpp" +#include "asio/ip/basic_resolver_iterator.hpp" +#include "asio/ip/basic_resolver_query.hpp" +#include "asio/ip/host_name.hpp" +#include "asio/ip/icmp.hpp" +#include "asio/ip/multicast.hpp" +#include "asio/ip/resolver_base.hpp" +#include "asio/ip/resolver_query_base.hpp" +#include "asio/ip/tcp.hpp" +#include "asio/ip/udp.hpp" +#include "asio/ip/unicast.hpp" +#include "asio/ip/v6_only.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/is_executor.hpp" +#include "asio/is_read_buffered.hpp" +#include "asio/is_write_buffered.hpp" +#include "asio/local/basic_endpoint.hpp" +#include "asio/local/connect_pair.hpp" +#include "asio/local/datagram_protocol.hpp" +#include "asio/local/stream_protocol.hpp" +#include "asio/multiple_exceptions.hpp" +#include "asio/packaged_task.hpp" +#include "asio/placeholders.hpp" +#include "asio/posix/basic_descriptor.hpp" +#include "asio/posix/basic_stream_descriptor.hpp" +#include "asio/posix/descriptor.hpp" +#include "asio/posix/descriptor_base.hpp" +#include "asio/posix/stream_descriptor.hpp" +#include "asio/post.hpp" +#include "asio/prefer.hpp" +#include "asio/query.hpp" +#include "asio/read.hpp" +#include "asio/read_at.hpp" +#include "asio/read_until.hpp" +#include "asio/redirect_error.hpp" +#include "asio/require.hpp" +#include "asio/require_concept.hpp" +#include "asio/serial_port.hpp" +#include "asio/serial_port_base.hpp" +#include "asio/signal_set.hpp" +#include "asio/socket_base.hpp" +#include "asio/static_thread_pool.hpp" +#include "asio/steady_timer.hpp" +#include "asio/strand.hpp" +#include "asio/streambuf.hpp" +#include "asio/system_context.hpp" +#include "asio/system_error.hpp" +#include "asio/system_executor.hpp" +#include "asio/system_timer.hpp" +#include "asio/this_coro.hpp" +#include "asio/thread.hpp" +#include "asio/thread_pool.hpp" +#include "asio/time_traits.hpp" +#include "asio/use_awaitable.hpp" +#include "asio/use_future.hpp" +#include "asio/uses_executor.hpp" +#include "asio/version.hpp" +#include "asio/wait_traits.hpp" +#include "asio/windows/basic_object_handle.hpp" +#include "asio/windows/basic_overlapped_handle.hpp" +#include "asio/windows/basic_random_access_handle.hpp" +#include "asio/windows/basic_stream_handle.hpp" +#include "asio/windows/object_handle.hpp" +#include "asio/windows/overlapped_handle.hpp" +#include "asio/windows/overlapped_ptr.hpp" +#include "asio/windows/random_access_handle.hpp" +#include "asio/windows/stream_handle.hpp" +#include "asio/write.hpp" +#include "asio/write_at.hpp" + +#endif // ASIO_HPP diff --git a/include/asio/include/asio/any_io_executor.hpp b/include/asio/include/asio/any_io_executor.hpp new file mode 100644 index 0000000..3a4d13b --- /dev/null +++ b/include/asio/include/asio/any_io_executor.hpp @@ -0,0 +1,71 @@ +// +// any_io_executor.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ANY_IO_EXECUTOR_HPP +#define ASIO_ANY_IO_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) +# include "asio/executor.hpp" +#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) +# include "asio/execution.hpp" +# include "asio/execution_context.hpp" +#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) + +typedef executor any_io_executor; + +#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) + +/// Polymorphic executor type for use with I/O objects. +/** + * The @c any_io_executor type is a polymorphic executor that supports the set + * of properties required by I/O objects. It is defined as the + * execution::any_executor class template parameterised as follows: + * @code execution::any_executor< + * execution::context_as_t, + * execution::blocking_t::never_t, + * execution::prefer_only, + * execution::prefer_only, + * execution::prefer_only, + * execution::prefer_only, + * execution::prefer_only + * > @endcode + */ +#if defined(GENERATING_DOCUMENTATION) +typedef execution::any_executor<...> any_io_executor; +#else // defined(GENERATING_DOCUMENTATION) +typedef execution::any_executor< + execution::context_as_t, + execution::blocking_t::never_t, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only + > any_io_executor; +#endif // defined(GENERATING_DOCUMENTATION) + +#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ANY_IO_EXECUTOR_HPP diff --git a/include/asio/include/asio/associated_allocator.hpp b/include/asio/include/asio/associated_allocator.hpp new file mode 100644 index 0000000..14d76b6 --- /dev/null +++ b/include/asio/include/asio/associated_allocator.hpp @@ -0,0 +1,125 @@ +// +// associated_allocator.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASSOCIATED_ALLOCATOR_HPP +#define ASIO_ASSOCIATED_ALLOCATOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct associated_allocator_impl +{ + typedef E type; + + static type get(const T&, const E& e) ASIO_NOEXCEPT + { + return e; + } +}; + +template +struct associated_allocator_impl::type> +{ + typedef typename T::allocator_type type; + + static type get(const T& t, const E&) ASIO_NOEXCEPT + { + return t.get_allocator(); + } +}; + +} // namespace detail + +/// Traits type used to obtain the allocator associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * Allocator shall be a type meeting the Allocator requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c a is an object of type @c + * Allocator. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * Allocator requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,a) and with return type @c type. + */ +template > +struct associated_allocator +{ + /// If @c T has a nested type @c allocator_type, T::allocator_type. + /// Otherwise @c Allocator. +#if defined(GENERATING_DOCUMENTATION) + typedef see_below type; +#else // defined(GENERATING_DOCUMENTATION) + typedef typename detail::associated_allocator_impl::type type; +#endif // defined(GENERATING_DOCUMENTATION) + + /// If @c T has a nested type @c allocator_type, returns + /// t.get_allocator(). Otherwise returns @c a. + static type get(const T& t, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return detail::associated_allocator_impl::get(t, a); + } +}; + +/// Helper function to obtain an object's associated allocator. +/** + * @returns associated_allocator::get(t) + */ +template +inline typename associated_allocator::type +get_associated_allocator(const T& t) ASIO_NOEXCEPT +{ + return associated_allocator::get(t); +} + +/// Helper function to obtain an object's associated allocator. +/** + * @returns associated_allocator::get(t, a) + */ +template +inline typename associated_allocator::type +get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT +{ + return associated_allocator::get(t, a); +} + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template > +using associated_allocator_t + = typename associated_allocator::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASSOCIATED_ALLOCATOR_HPP diff --git a/include/asio/include/asio/associated_executor.hpp b/include/asio/include/asio/associated_executor.hpp new file mode 100644 index 0000000..e179246 --- /dev/null +++ b/include/asio/include/asio/associated_executor.hpp @@ -0,0 +1,166 @@ +// +// associated_executor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASSOCIATED_EXECUTOR_HPP +#define ASIO_ASSOCIATED_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/is_executor.hpp" +#include "asio/system_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct associated_executor_impl +{ + typedef void asio_associated_executor_is_unspecialised; + + typedef E type; + + static type get(const T&, const E& e = E()) ASIO_NOEXCEPT + { + return e; + } +}; + +template +struct associated_executor_impl::type> +{ + typedef typename T::executor_type type; + + static type get(const T& t, const E& = E()) ASIO_NOEXCEPT + { + return t.get_executor(); + } +}; + +} // namespace detail + +/// Traits type used to obtain the executor associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * Executor shall be a type meeting the Executor requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c e is an object of type @c + * Executor. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * Executor requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,e) and with return type @c type. + */ +template +struct associated_executor +#if !defined(GENERATING_DOCUMENTATION) + : detail::associated_executor_impl +#endif // !defined(GENERATING_DOCUMENTATION) +{ +#if defined(GENERATING_DOCUMENTATION) + /// If @c T has a nested type @c executor_type, T::executor_type. + /// Otherwise @c Executor. + typedef see_below type; + + /// If @c T has a nested type @c executor_type, returns + /// t.get_executor(). Otherwise returns @c ex. + static type get(const T& t, + const Executor& ex = Executor()) ASIO_NOEXCEPT; +#endif // defined(GENERATING_DOCUMENTATION) +}; + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t) ASIO_NOEXCEPT +{ + return associated_executor::get(t); +} + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t, ex) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t, const Executor& ex, + typename enable_if< + is_executor::value || execution::is_executor::value + >::type* = 0) ASIO_NOEXCEPT +{ + return associated_executor::get(t, ex); +} + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t, ctx.get_executor()) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t, ExecutionContext& ctx, + typename enable_if::value>::type* = 0) ASIO_NOEXCEPT +{ + return associated_executor::get(t, ctx.get_executor()); +} + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template +using associated_executor_t = typename associated_executor::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +namespace detail { + +template +struct associated_executor_forwarding_base +{ +}; + +template +struct associated_executor_forwarding_base::asio_associated_executor_is_unspecialised, + void + >::value + >::type> +{ + typedef void asio_associated_executor_is_unspecialised; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASSOCIATED_EXECUTOR_HPP diff --git a/include/asio/include/asio/async_result.hpp b/include/asio/include/asio/async_result.hpp new file mode 100644 index 0000000..9ccda6c --- /dev/null +++ b/include/asio/include/asio/async_result.hpp @@ -0,0 +1,582 @@ +// +// async_result.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASYNC_RESULT_HPP +#define ASIO_ASYNC_RESULT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/detail/variadic_templates.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(ASIO_HAS_CONCEPTS) \ + && defined(ASIO_HAS_VARIADIC_TEMPLATES) \ + && defined(ASIO_HAS_DECLTYPE) + +namespace detail { + +template +struct is_completion_signature : false_type +{ +}; + +template +struct is_completion_signature : true_type +{ +}; + +template +ASIO_CONCEPT callable_with = requires(T t, Args&&... args) +{ + t(static_cast(args)...); +}; + +template +struct is_completion_handler_for : false_type +{ +}; + +template +struct is_completion_handler_for + : integral_constant)> +{ +}; + +} // namespace detail + +template +ASIO_CONCEPT completion_signature = + detail::is_completion_signature::value; + +#define ASIO_COMPLETION_SIGNATURE \ + ::asio::completion_signature + +template +ASIO_CONCEPT completion_handler_for = + detail::is_completion_signature::value + && detail::is_completion_handler_for::value; + +#define ASIO_COMPLETION_HANDLER_FOR(s) \ + ::asio::completion_handler_for + +#else // defined(ASIO_HAS_CONCEPTS) + // && defined(ASIO_HAS_VARIADIC_TEMPLATES) + // && defined(ASIO_HAS_DECLTYPE) + +#define ASIO_COMPLETION_SIGNATURE typename +#define ASIO_COMPLETION_HANDLER_FOR(s) typename + +#endif // defined(ASIO_HAS_CONCEPTS) + // && defined(ASIO_HAS_VARIADIC_TEMPLATES) + // && defined(ASIO_HAS_DECLTYPE) + +/// An interface for customising the behaviour of an initiating function. +/** + * The async_result traits class is used for determining: + * + * @li the concrete completion handler type to be called at the end of the + * asynchronous operation; + * + * @li the initiating function return type; and + * + * @li how the return value of the initiating function is obtained. + * + * The trait allows the handler and return types to be determined at the point + * where the specific completion handler signature is known. + * + * This template may be specialised for user-defined completion token types. + * The primary template assumes that the CompletionToken is the completion + * handler. + */ +template +class async_result +{ +public: + /// The concrete completion handler type for the specific signature. + typedef CompletionToken completion_handler_type; + + /// The return type of the initiating function. + typedef void return_type; + + /// Construct an async result from a given handler. + /** + * When using a specalised async_result, the constructor has an opportunity + * to initialise some state associated with the completion handler, which is + * then returned from the initiating function. + */ + explicit async_result(completion_handler_type& h) + { + (void)h; + } + + /// Obtain the value to be returned from the initiating function. + return_type get() + { + } + +#if defined(GENERATING_DOCUMENTATION) + + /// Initiate the asynchronous operation that will produce the result, and + /// obtain the value to be returned from the initiating function. + template + static return_type initiate( + ASIO_MOVE_ARG(Initiation) initiation, + ASIO_MOVE_ARG(RawCompletionToken) token, + ASIO_MOVE_ARG(Args)... args); + +#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) + + template + static return_type initiate( + ASIO_MOVE_ARG(Initiation) initiation, + ASIO_MOVE_ARG(RawCompletionToken) token, + ASIO_MOVE_ARG(Args)... args) + { + ASIO_MOVE_CAST(Initiation)(initiation)( + ASIO_MOVE_CAST(RawCompletionToken)(token), + ASIO_MOVE_CAST(Args)(args)...); + } + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + + template + static return_type initiate( + ASIO_MOVE_ARG(Initiation) initiation, + ASIO_MOVE_ARG(RawCompletionToken) token) + { + ASIO_MOVE_CAST(Initiation)(initiation)( + ASIO_MOVE_CAST(RawCompletionToken)(token)); + } + +#define ASIO_PRIVATE_INITIATE_DEF(n) \ + template \ + static return_type initiate( \ + ASIO_MOVE_ARG(Initiation) initiation, \ + ASIO_MOVE_ARG(RawCompletionToken) token, \ + ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + ASIO_MOVE_CAST(Initiation)(initiation)( \ + ASIO_MOVE_CAST(RawCompletionToken)(token), \ + ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF) +#undef ASIO_PRIVATE_INITIATE_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +private: + async_result(const async_result&) ASIO_DELETED; + async_result& operator=(const async_result&) ASIO_DELETED; +}; + +#if !defined(GENERATING_DOCUMENTATION) + +template +class async_result +{ + // Empty. +}; + +#endif // !defined(GENERATING_DOCUMENTATION) + +/// Helper template to deduce the handler type from a CompletionToken, capture +/// a local copy of the handler, and then create an async_result for the +/// handler. +template +struct async_completion +{ + /// The real handler type to be used for the asynchronous operation. + typedef typename asio::async_result< + typename decay::type, + Signature>::completion_handler_type completion_handler_type; + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Constructor. + /** + * The constructor creates the concrete completion handler and makes the link + * between the handler and the asynchronous result. + */ + explicit async_completion(CompletionToken& token) + : completion_handler(static_cast::value, + completion_handler_type&, CompletionToken&&>::type>(token)), + result(completion_handler) + { + } +#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + explicit async_completion(typename decay::type& token) + : completion_handler(token), + result(completion_handler) + { + } + + explicit async_completion(const typename decay::type& token) + : completion_handler(token), + result(completion_handler) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// A copy of, or reference to, a real handler object. +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + typename conditional< + is_same::value, + completion_handler_type&, completion_handler_type>::type completion_handler; +#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + completion_handler_type completion_handler; +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// The result of the asynchronous operation's initiating function. + async_result::type, Signature> result; +}; + +namespace detail { + +template +struct async_result_helper + : async_result::type, Signature> +{ +}; + +struct async_result_memfns_base +{ + void initiate(); +}; + +template +struct async_result_memfns_derived + : T, async_result_memfns_base +{ +}; + +template +struct async_result_memfns_check +{ +}; + +template +char (&async_result_initiate_memfn_helper(...))[2]; + +template +char async_result_initiate_memfn_helper( + async_result_memfns_check< + void (async_result_memfns_base::*)(), + &async_result_memfns_derived::initiate>*); + +template +struct async_result_has_initiate_memfn + : integral_constant::type, Signature> + >(0)) != 1> +{ +}; + +} // namespace detail + +#if defined(GENERATING_DOCUMENTATION) +# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ + void_or_deduced +#elif defined(_MSC_VER) && (_MSC_VER < 1500) +# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ + typename ::asio::detail::async_result_helper< \ + ct, sig>::return_type +#define ASIO_HANDLER_TYPE(ct, sig) \ + typename ::asio::detail::async_result_helper< \ + ct, sig>::completion_handler_type +#else +# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ + typename ::asio::async_result< \ + typename ::asio::decay::type, sig>::return_type +#define ASIO_HANDLER_TYPE(ct, sig) \ + typename ::asio::async_result< \ + typename ::asio::decay::type, sig>::completion_handler_type +#endif + +#if defined(GENERATION_DOCUMENTATION) +# define ASIO_INITFN_AUTO_RESULT_TYPE(ct, sig) \ + auto +#elif defined(ASIO_HAS_RETURN_TYPE_DEDUCTION) +# define ASIO_INITFN_AUTO_RESULT_TYPE(ct, sig) \ + auto +#else +# define ASIO_INITFN_AUTO_RESULT_TYPE(ct, sig) \ + ASIO_INITFN_RESULT_TYPE(ct, sig) +#endif + +#if defined(GENERATION_DOCUMENTATION) +# define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \ + void_or_deduced +#elif defined(ASIO_HAS_DECLTYPE) +# define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \ + decltype expr +#else +# define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \ + ASIO_INITFN_RESULT_TYPE(ct, sig) +#endif + +#if defined(GENERATING_DOCUMENTATION) + +template +void_or_deduced async_initiate( + ASIO_MOVE_ARG(Initiation) initiation, + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken), + ASIO_MOVE_ARG(Args)... args); + +#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +inline typename enable_if< + detail::async_result_has_initiate_memfn::value, + ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, + (async_result::type, + Signature>::initiate(declval(), + declval(), + declval()...)))>::type +async_initiate(ASIO_MOVE_ARG(Initiation) initiation, + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, + ASIO_MOVE_ARG(Args)... args) +{ + return async_result::type, + Signature>::initiate(ASIO_MOVE_CAST(Initiation)(initiation), + ASIO_MOVE_CAST(CompletionToken)(token), + ASIO_MOVE_CAST(Args)(args)...); +} + +template +inline typename enable_if< + !detail::async_result_has_initiate_memfn::value, + ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type +async_initiate(ASIO_MOVE_ARG(Initiation) initiation, + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, + ASIO_MOVE_ARG(Args)... args) +{ + async_completion completion(token); + + ASIO_MOVE_CAST(Initiation)(initiation)( + ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken, + Signature))(completion.completion_handler), + ASIO_MOVE_CAST(Args)(args)...); + + return completion.result.get(); +} + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +inline typename enable_if< + detail::async_result_has_initiate_memfn::value, + ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, + (async_result::type, + Signature>::initiate(declval(), + declval())))>::type +async_initiate(ASIO_MOVE_ARG(Initiation) initiation, + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) +{ + return async_result::type, + Signature>::initiate(ASIO_MOVE_CAST(Initiation)(initiation), + ASIO_MOVE_CAST(CompletionToken)(token)); +} + +template +inline typename enable_if< + !detail::async_result_has_initiate_memfn::value, + ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type +async_initiate(ASIO_MOVE_ARG(Initiation) initiation, + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) +{ + async_completion completion(token); + + ASIO_MOVE_CAST(Initiation)(initiation)( + ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken, + Signature))(completion.completion_handler)); + + return completion.result.get(); +} + +#define ASIO_PRIVATE_INITIATE_DEF(n) \ + template \ + inline typename enable_if< \ + detail::async_result_has_initiate_memfn< \ + CompletionToken, Signature>::value, \ + ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, \ + (async_result::type, \ + Signature>::initiate(declval(), \ + declval(), \ + ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \ + async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ + ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + return async_result::type, \ + Signature>::initiate(ASIO_MOVE_CAST(Initiation)(initiation), \ + ASIO_MOVE_CAST(CompletionToken)(token), \ + ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + \ + template \ + inline typename enable_if< \ + !detail::async_result_has_initiate_memfn< \ + CompletionToken, Signature>::value, \ + ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type \ + async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ + ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + async_completion completion(token); \ + \ + ASIO_MOVE_CAST(Initiation)(initiation)( \ + ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken, \ + Signature))(completion.completion_handler), \ + ASIO_VARIADIC_MOVE_ARGS(n)); \ + \ + return completion.result.get(); \ + } \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF) +#undef ASIO_PRIVATE_INITIATE_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#if defined(ASIO_HAS_CONCEPTS) \ + && defined(ASIO_HAS_VARIADIC_TEMPLATES) \ + && defined(ASIO_HAS_DECLTYPE) + +namespace detail { + +template +struct initiation_archetype +{ + template CompletionHandler> + void operator()(CompletionHandler&&) const + { + } +}; + +} // namespace detail + +template +ASIO_CONCEPT completion_token_for = + detail::is_completion_signature::value + && + requires(T&& t) + { + async_initiate(detail::initiation_archetype{}, t); + }; + +#define ASIO_COMPLETION_TOKEN_FOR(s) \ + ::asio::completion_token_for + +#else // defined(ASIO_HAS_CONCEPTS) + // && defined(ASIO_HAS_VARIADIC_TEMPLATES) + // && defined(ASIO_HAS_DECLTYPE) + +#define ASIO_COMPLETION_TOKEN_FOR(s) typename + +#endif // defined(ASIO_HAS_CONCEPTS) + // && defined(ASIO_HAS_VARIADIC_TEMPLATES) + // && defined(ASIO_HAS_DECLTYPE) + +namespace detail { + +template +struct default_completion_token_impl +{ + typedef void type; +}; + +template +struct default_completion_token_impl::type> +{ + typedef typename T::default_completion_token_type type; +}; + +} // namespace detail + +#if defined(GENERATING_DOCUMENTATION) + +/// Traits type used to determine the default completion token type associated +/// with a type (such as an executor). +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. + * + * Specialisations of this trait may provide a nested typedef @c type, which is + * a default-constructible completion token type. + */ +template +struct default_completion_token +{ + /// If @c T has a nested type @c default_completion_token_type, + /// T::default_completion_token_type. Otherwise the typedef @c type + /// is not defined. + typedef see_below type; +}; +#else +template +struct default_completion_token + : detail::default_completion_token_impl +{ +}; +#endif + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template +using default_completion_token_t = typename default_completion_token::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +#if defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS) + +#define ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e) \ + = typename ::asio::default_completion_token::type +#define ASIO_DEFAULT_COMPLETION_TOKEN(e) \ + = typename ::asio::default_completion_token::type() + +#else // defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS) + +#define ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e) +#define ASIO_DEFAULT_COMPLETION_TOKEN(e) + +#endif // defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASYNC_RESULT_HPP diff --git a/include/asio/include/asio/awaitable.hpp b/include/asio/include/asio/awaitable.hpp new file mode 100644 index 0000000..e9c74c8 --- /dev/null +++ b/include/asio/include/asio/awaitable.hpp @@ -0,0 +1,133 @@ +// +// awaitable.hpp +// ~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_AWAITABLE_HPP +#define ASIO_AWAITABLE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) + +#if defined(ASIO_HAS_STD_COROUTINE) +# include +#else // defined(ASIO_HAS_STD_COROUTINE) +# include +#endif // defined(ASIO_HAS_STD_COROUTINE) + +#include "asio/any_io_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_STD_COROUTINE) +using std::coroutine_handle; +using std::suspend_always; +#else // defined(ASIO_HAS_STD_COROUTINE) +using std::experimental::coroutine_handle; +using std::experimental::suspend_always; +#endif // defined(ASIO_HAS_STD_COROUTINE) + +template class awaitable_thread; +template class awaitable_frame; + +} // namespace detail + +/// The return type of a coroutine or asynchronous operation. +template +class awaitable +{ +public: + /// The type of the awaited value. + typedef T value_type; + + /// The executor type that will be used for the coroutine. + typedef Executor executor_type; + + /// Default constructor. + constexpr awaitable() noexcept + : frame_(nullptr) + { + } + + /// Move constructor. + awaitable(awaitable&& other) noexcept + : frame_(std::exchange(other.frame_, nullptr)) + { + } + + /// Destructor + ~awaitable() + { + if (frame_) + frame_->destroy(); + } + + /// Checks if the awaitable refers to a future result. + bool valid() const noexcept + { + return !!frame_; + } + +#if !defined(GENERATING_DOCUMENTATION) + + // Support for co_await keyword. + bool await_ready() const noexcept + { + return false; + } + + // Support for co_await keyword. + template + void await_suspend( + detail::coroutine_handle> h) + { + frame_->push_frame(&h.promise()); + } + + // Support for co_await keyword. + T await_resume() + { + return awaitable(static_cast(*this)).frame_->get(); + } + +#endif // !defined(GENERATING_DOCUMENTATION) + +private: + template friend class detail::awaitable_thread; + template friend class detail::awaitable_frame; + + // Not copy constructible or copy assignable. + awaitable(const awaitable&) = delete; + awaitable& operator=(const awaitable&) = delete; + + // Construct the awaitable from a coroutine's frame object. + explicit awaitable(detail::awaitable_frame* a) + : frame_(a) + { + } + + detail::awaitable_frame* frame_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/awaitable.hpp" + +#endif // defined(ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) + +#endif // ASIO_AWAITABLE_HPP diff --git a/include/asio/include/asio/basic_datagram_socket.hpp b/include/asio/include/asio/basic_datagram_socket.hpp new file mode 100644 index 0000000..ce767ae --- /dev/null +++ b/include/asio/include/asio/basic_datagram_socket.hpp @@ -0,0 +1,1215 @@ +// +// basic_datagram_socket.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_DATAGRAM_SOCKET_HPP +#define ASIO_BASIC_DATAGRAM_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if !defined(ASIO_BASIC_DATAGRAM_SOCKET_FWD_DECL) +#define ASIO_BASIC_DATAGRAM_SOCKET_FWD_DECL + +// Forward declaration with defaulted arguments. +template +class basic_datagram_socket; + +#endif // !defined(ASIO_BASIC_DATAGRAM_SOCKET_FWD_DECL) + +/// Provides datagram-oriented socket functionality. +/** + * The basic_datagram_socket class template provides asynchronous and blocking + * datagram-oriented socket functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template +class basic_datagram_socket + : public basic_socket +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the socket type to another executor. + template + struct rebind_executor + { + /// The socket type when rebound to the specified executor. + typedef basic_datagram_socket other; + }; + + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct a basic_datagram_socket without opening it. + /** + * This constructor creates a datagram socket without opening it. The open() + * function must be called before data can be sent or received on the socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + */ + explicit basic_datagram_socket(const executor_type& ex) + : basic_socket(ex) + { + } + + /// Construct a basic_datagram_socket without opening it. + /** + * This constructor creates a datagram socket without opening it. The open() + * function must be called before data can be sent or received on the socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + */ + template + explicit basic_datagram_socket(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context) + { + } + + /// Construct and open a basic_datagram_socket. + /** + * This constructor creates and opens a datagram socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_datagram_socket(const executor_type& ex, const protocol_type& protocol) + : basic_socket(ex, protocol) + { + } + + /// Construct and open a basic_datagram_socket. + /** + * This constructor creates and opens a datagram socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_datagram_socket(ExecutionContext& context, + const protocol_type& protocol, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol) + { + } + + /// Construct a basic_datagram_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a datagram socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the datagram + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_datagram_socket(const executor_type& ex, const endpoint_type& endpoint) + : basic_socket(ex, endpoint) + { + } + + /// Construct a basic_datagram_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a datagram socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the datagram + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_datagram_socket(ExecutionContext& context, + const endpoint_type& endpoint, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, endpoint) + { + } + + /// Construct a basic_datagram_socket on an existing native socket. + /** + * This constructor creates a datagram socket object to hold an existing + * native socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + basic_datagram_socket(const executor_type& ex, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_socket(ex, protocol, native_socket) + { + } + + /// Construct a basic_datagram_socket on an existing native socket. + /** + * This constructor creates a datagram socket object to hold an existing + * native socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_datagram_socket(ExecutionContext& context, + const protocol_type& protocol, const native_handle_type& native_socket, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol, native_socket) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_datagram_socket from another. + /** + * This constructor moves a datagram socket from one object to another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. + */ + basic_datagram_socket(basic_datagram_socket&& other) ASIO_NOEXCEPT + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_datagram_socket from another. + /** + * This assignment operator moves a datagram socket from one object to + * another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. + */ + basic_datagram_socket& operator=(basic_datagram_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } + + /// Move-construct a basic_datagram_socket from a socket of another protocol + /// type. + /** + * This constructor moves a datagram socket from one object to another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. + */ + template + basic_datagram_socket(basic_datagram_socket&& other, + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_datagram_socket from a socket of another protocol + /// type. + /** + * This assignment operator moves a datagram socket from one object to + * another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. + */ + template + typename enable_if< + is_convertible::value + && is_convertible::value, + basic_datagram_socket& + >::type operator=(basic_datagram_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_datagram_socket() + { + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the datagram socket. The function + * call will block until the data has been sent successfully or an error + * occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected datagram socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code socket.send(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the datagram socket. The function + * call will block until the data has been sent successfully or an error + * occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected datagram socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the datagram socket. The function + * call will block until the data has been sent successfully or an error + * occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected datagram socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to asynchronously send data on the datagram socket. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected datagram + * socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, + buffers, socket_base::message_flags(0)); + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to asynchronously send data on the datagram socket. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected datagram + * socket. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, buffers, flags); + } + + /// Send a datagram to the specified endpoint. + /** + * This function is used to send a datagram to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.send_to(asio::buffer(data, size), destination); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send_to( + this->impl_.get_implementation(), buffers, destination, 0, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send a datagram to the specified endpoint. + /** + * This function is used to send a datagram to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send_to( + this->impl_.get_implementation(), buffers, destination, flags, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send a datagram to the specified endpoint. + /** + * This function is used to send a datagram to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->impl_.get_service().send_to(this->impl_.get_implementation(), + buffers, destination, flags, ec); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send a datagram to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.async_send_to( + * asio::buffer(data, size), destination, handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send_to(this), handler, buffers, + destination, socket_base::message_flags(0)); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send a datagram to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send_to(this), handler, buffers, destination, flags); + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the datagram socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected datagram + * socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.receive(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the datagram socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected datagram + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the datagram socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected datagram + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the datagram + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * datagram socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive(this), handler, + buffers, socket_base::message_flags(0)); + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the datagram + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * datagram socket. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive(this), handler, buffers, flags); + } + + /// Receive a datagram with the endpoint of the sender. + /** + * This function is used to receive a datagram. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * asio::ip::udp::endpoint sender_endpoint; + * socket.receive_from( + * asio::buffer(data, size), sender_endpoint); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, 0, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive a datagram with the endpoint of the sender. + /** + * This function is used to receive a datagram. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, flags, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive a datagram with the endpoint of the sender. + /** + * This function is used to receive a datagram. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, flags, ec); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive a datagram. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.async_receive_from( + * asio::buffer(data, size), sender_endpoint, handler); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive_from(this), handler, buffers, + &sender_endpoint, socket_base::message_flags(0)); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive a datagram. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive_from(this), handler, + buffers, &sender_endpoint, flags); + } + +private: + // Disallow copying and assignment. + basic_datagram_socket(const basic_datagram_socket&) ASIO_DELETED; + basic_datagram_socket& operator=( + const basic_datagram_socket&) ASIO_DELETED; + + class initiate_async_send + { + public: + typedef Executor executor_type; + + explicit initiate_async_send(basic_datagram_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WriteHandler) handler, + const ConstBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_send( + self_->impl_.get_implementation(), buffers, flags, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_datagram_socket* self_; + }; + + class initiate_async_send_to + { + public: + typedef Executor executor_type; + + explicit initiate_async_send_to(basic_datagram_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WriteHandler) handler, + const ConstBufferSequence& buffers, const endpoint_type& destination, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_send_to( + self_->impl_.get_implementation(), buffers, destination, + flags, handler2.value, self_->impl_.get_executor()); + } + + private: + basic_datagram_socket* self_; + }; + + class initiate_async_receive + { + public: + typedef Executor executor_type; + + explicit initiate_async_receive(basic_datagram_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ReadHandler) handler, + const MutableBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_receive( + self_->impl_.get_implementation(), buffers, flags, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_datagram_socket* self_; + }; + + class initiate_async_receive_from + { + public: + typedef Executor executor_type; + + explicit initiate_async_receive_from(basic_datagram_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ReadHandler) handler, + const MutableBufferSequence& buffers, endpoint_type* sender_endpoint, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_receive_from( + self_->impl_.get_implementation(), buffers, *sender_endpoint, + flags, handler2.value, self_->impl_.get_executor()); + } + + private: + basic_datagram_socket* self_; + }; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_DATAGRAM_SOCKET_HPP diff --git a/include/asio/include/asio/basic_deadline_timer.hpp b/include/asio/include/asio/basic_deadline_timer.hpp new file mode 100644 index 0000000..7e95f2b --- /dev/null +++ b/include/asio/include/asio/basic_deadline_timer.hpp @@ -0,0 +1,693 @@ +// +// basic_deadline_timer.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_DEADLINE_TIMER_HPP +#define ASIO_BASIC_DEADLINE_TIMER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + || defined(GENERATING_DOCUMENTATION) + +#include +#include "asio/any_io_executor.hpp" +#include "asio/detail/deadline_timer_service.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/io_object_impl.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/time_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides waitable timer functionality. +/** + * The basic_deadline_timer class template provides the ability to perform a + * blocking or asynchronous wait for a timer to expire. + * + * A deadline timer is always in one of two states: "expired" or "not expired". + * If the wait() or async_wait() function is called on an expired timer, the + * wait operation will complete immediately. + * + * Most applications will use the asio::deadline_timer typedef. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Examples + * Performing a blocking wait: + * @code + * // Construct a timer without setting an expiry time. + * asio::deadline_timer timer(my_context); + * + * // Set an expiry time relative to now. + * timer.expires_from_now(boost::posix_time::seconds(5)); + * + * // Wait for the timer to expire. + * timer.wait(); + * @endcode + * + * @par + * Performing an asynchronous wait: + * @code + * void handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Timer expired. + * } + * } + * + * ... + * + * // Construct a timer with an absolute expiry time. + * asio::deadline_timer timer(my_context, + * boost::posix_time::time_from_string("2005-12-07 23:59:59.000")); + * + * // Start an asynchronous wait. + * timer.async_wait(handler); + * @endcode + * + * @par Changing an active deadline_timer's expiry time + * + * Changing the expiry time of a timer while there are pending asynchronous + * waits causes those wait operations to be cancelled. To ensure that the action + * associated with the timer is performed only once, use something like this: + * used: + * + * @code + * void on_some_event() + * { + * if (my_timer.expires_from_now(seconds(5)) > 0) + * { + * // We managed to cancel the timer. Start new asynchronous wait. + * my_timer.async_wait(on_timeout); + * } + * else + * { + * // Too late, timer has already expired! + * } + * } + * + * void on_timeout(const asio::error_code& e) + * { + * if (e != asio::error::operation_aborted) + * { + * // Timer was not cancelled, take necessary action. + * } + * } + * @endcode + * + * @li The asio::basic_deadline_timer::expires_from_now() function + * cancels any pending asynchronous waits, and returns the number of + * asynchronous waits that were cancelled. If it returns 0 then you were too + * late and the wait handler has already been executed, or will soon be + * executed. If it returns 1 then the wait handler was successfully cancelled. + * + * @li If a wait handler is cancelled, the asio::error_code passed to + * it contains the value asio::error::operation_aborted. + */ +template , + typename Executor = any_io_executor> +class basic_deadline_timer +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the timer type to another executor. + template + struct rebind_executor + { + /// The timer type when rebound to the specified executor. + typedef basic_deadline_timer other; + }; + + /// The time traits type. + typedef TimeTraits traits_type; + + /// The time type. + typedef typename traits_type::time_type time_type; + + /// The duration type. + typedef typename traits_type::duration_type duration_type; + + /// Constructor. + /** + * This constructor creates a timer without setting an expiry time. The + * expires_at() or expires_from_now() functions must be called to set an + * expiry time before the timer can be waited on. + * + * @param ex The I/O executor that the timer will use, by default, to + * dispatch handlers for any asynchronous operations performed on the timer. + */ + explicit basic_deadline_timer(const executor_type& ex) + : impl_(ex) + { + } + + /// Constructor. + /** + * This constructor creates a timer without setting an expiry time. The + * expires_at() or expires_from_now() functions must be called to set an + * expiry time before the timer can be waited on. + * + * @param context An execution context which provides the I/O executor that + * the timer will use, by default, to dispatch handlers for any asynchronous + * operations performed on the timer. + */ + template + explicit basic_deadline_timer(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + } + + /// Constructor to set a particular expiry time as an absolute time. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param ex The I/O executor that the timer will use, by default, to + * dispatch handlers for any asynchronous operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, expressed + * as an absolute time. + */ + basic_deadline_timer(const executor_type& ex, const time_type& expiry_time) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().expires_at(impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + } + + /// Constructor to set a particular expiry time as an absolute time. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param context An execution context which provides the I/O executor that + * the timer will use, by default, to dispatch handlers for any asynchronous + * operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, expressed + * as an absolute time. + */ + template + basic_deadline_timer(ExecutionContext& context, const time_type& expiry_time, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().expires_at(impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + } + + /// Constructor to set a particular expiry time relative to now. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param ex The I/O executor that the timer will use, by default, to + * dispatch handlers for any asynchronous operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, relative to + * now. + */ + basic_deadline_timer(const executor_type& ex, + const duration_type& expiry_time) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().expires_from_now( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_from_now"); + } + + /// Constructor to set a particular expiry time relative to now. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param context An execution context which provides the I/O executor that + * the timer will use, by default, to dispatch handlers for any asynchronous + * operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, relative to + * now. + */ + template + basic_deadline_timer(ExecutionContext& context, + const duration_type& expiry_time, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().expires_from_now( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_from_now"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_deadline_timer from another. + /** + * This constructor moves a timer from one object to another. + * + * @param other The other basic_deadline_timer object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_deadline_timer(const executor_type&) + * constructor. + */ + basic_deadline_timer(basic_deadline_timer&& other) + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_deadline_timer from another. + /** + * This assignment operator moves a timer from one object to another. Cancels + * any outstanding asynchronous operations associated with the target object. + * + * @param other The other basic_deadline_timer object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_deadline_timer(const executor_type&) + * constructor. + */ + basic_deadline_timer& operator=(basic_deadline_timer&& other) + { + impl_ = std::move(other.impl_); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the timer. + /** + * This function destroys the timer, cancelling any outstanding asynchronous + * wait operations associated with the timer as if by calling @c cancel. + */ + ~basic_deadline_timer() + { + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return impl_.get_executor(); + } + + /// Cancel any asynchronous operations that are waiting on the timer. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the timer. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel() + { + asio::error_code ec; + std::size_t s = impl_.get_service().cancel(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + return s; + } + + /// Cancel any asynchronous operations that are waiting on the timer. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the timer. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel(asio::error_code& ec) + { + return impl_.get_service().cancel(impl_.get_implementation(), ec); + } + + /// Cancels one asynchronous operation that is waiting on the timer. + /** + * This function forces the completion of one pending asynchronous wait + * operation against the timer. Handlers are cancelled in FIFO order. The + * handler for the cancelled operation will be invoked with the + * asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @return The number of asynchronous operations that were cancelled. That is, + * either 0 or 1. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel_one() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel_one() + { + asio::error_code ec; + std::size_t s = impl_.get_service().cancel_one( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel_one"); + return s; + } + + /// Cancels one asynchronous operation that is waiting on the timer. + /** + * This function forces the completion of one pending asynchronous wait + * operation against the timer. Handlers are cancelled in FIFO order. The + * handler for the cancelled operation will be invoked with the + * asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. That is, + * either 0 or 1. + * + * @note If the timer has already expired when cancel_one() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel_one(asio::error_code& ec) + { + return impl_.get_service().cancel_one(impl_.get_implementation(), ec); + } + + /// Get the timer's expiry time as an absolute time. + /** + * This function may be used to obtain the timer's current expiry time. + * Whether the timer has expired or not does not affect this value. + */ + time_type expires_at() const + { + return impl_.get_service().expires_at(impl_.get_implementation()); + } + + /// Set the timer's expiry time as an absolute time. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_at(const time_type& expiry_time) + { + asio::error_code ec; + std::size_t s = impl_.get_service().expires_at( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + return s; + } + + /// Set the timer's expiry time as an absolute time. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_at(const time_type& expiry_time, + asio::error_code& ec) + { + return impl_.get_service().expires_at( + impl_.get_implementation(), expiry_time, ec); + } + + /// Get the timer's expiry time relative to now. + /** + * This function may be used to obtain the timer's current expiry time. + * Whether the timer has expired or not does not affect this value. + */ + duration_type expires_from_now() const + { + return impl_.get_service().expires_from_now(impl_.get_implementation()); + } + + /// Set the timer's expiry time relative to now. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_from_now(const duration_type& expiry_time) + { + asio::error_code ec; + std::size_t s = impl_.get_service().expires_from_now( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_from_now"); + return s; + } + + /// Set the timer's expiry time relative to now. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_from_now(const duration_type& expiry_time, + asio::error_code& ec) + { + return impl_.get_service().expires_from_now( + impl_.get_implementation(), expiry_time, ec); + } + + /// Perform a blocking wait on the timer. + /** + * This function is used to wait for the timer to expire. This function + * blocks and does not return until the timer has expired. + * + * @throws asio::system_error Thrown on failure. + */ + void wait() + { + asio::error_code ec; + impl_.get_service().wait(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "wait"); + } + + /// Perform a blocking wait on the timer. + /** + * This function is used to wait for the timer to expire. This function + * blocks and does not return until the timer has expired. + * + * @param ec Set to indicate what error occurred, if any. + */ + void wait(asio::error_code& ec) + { + impl_.get_service().wait(impl_.get_implementation(), ec); + } + + /// Start an asynchronous wait on the timer. + /** + * This function may be used to initiate an asynchronous wait against the + * timer. It always returns immediately. + * + * For each call to async_wait(), the supplied handler will be called exactly + * once. The handler will be called when: + * + * @li The timer has expired. + * + * @li The timer was cancelled, in which case the handler is passed the error + * code asio::error::operation_aborted. + * + * @param handler The handler to be called when the timer expires. Copies + * will be made of the handler as required. The function signature of the + * handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code)) + WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler, + void (asio::error_code)) + async_wait( + ASIO_MOVE_ARG(WaitHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_wait(this), handler); + } + +private: + // Disallow copying and assignment. + basic_deadline_timer(const basic_deadline_timer&) ASIO_DELETED; + basic_deadline_timer& operator=( + const basic_deadline_timer&) ASIO_DELETED; + + class initiate_async_wait + { + public: + typedef Executor executor_type; + + explicit initiate_async_wait(basic_deadline_timer* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WaitHandler) handler) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WaitHandler. + ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_wait( + self_->impl_.get_implementation(), + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_deadline_timer* self_; + }; + + detail::io_object_impl< + detail::deadline_timer_service, Executor> impl_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // || defined(GENERATING_DOCUMENTATION) + +#endif // ASIO_BASIC_DEADLINE_TIMER_HPP diff --git a/include/asio/include/asio/basic_io_object.hpp b/include/asio/include/asio/basic_io_object.hpp new file mode 100644 index 0000000..b6d5f46 --- /dev/null +++ b/include/asio/include/asio/basic_io_object.hpp @@ -0,0 +1,290 @@ +// +// basic_io_object.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_IO_OBJECT_HPP +#define ASIO_BASIC_IO_OBJECT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/io_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(ASIO_HAS_MOVE) +namespace detail +{ + // Type trait used to determine whether a service supports move. + template + class service_has_move + { + private: + typedef IoObjectService service_type; + typedef typename service_type::implementation_type implementation_type; + + template + static auto asio_service_has_move_eval(T* t, U* u) + -> decltype(t->move_construct(*u, *u), char()); + static char (&asio_service_has_move_eval(...))[2]; + + public: + static const bool value = + sizeof(asio_service_has_move_eval( + static_cast(0), + static_cast(0))) == 1; + }; +} +#endif // defined(ASIO_HAS_MOVE) + +/// Base class for all I/O objects. +/** + * @note All I/O objects are non-copyable. However, when using C++0x, certain + * I/O objects do support move construction and move assignment. + */ +#if !defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +template +#else +template ::value> +#endif +class basic_io_object +{ +public: + /// The type of the service that will be used to provide I/O operations. + typedef IoObjectService service_type; + + /// The underlying implementation type of I/O object. + typedef typename service_type::implementation_type implementation_type; + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_context() + { + return service_.get_io_context(); + } + + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_service() + { + return service_.get_io_context(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// The type of the executor associated with the object. + typedef asio::io_context::executor_type executor_type; + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return service_.get_io_context().get_executor(); + } + +protected: + /// Construct a basic_io_object. + /** + * Performs: + * @code get_service().construct(get_implementation()); @endcode + */ + explicit basic_io_object(asio::io_context& io_context) + : service_(asio::use_service(io_context)) + { + service_.construct(implementation_); + } + +#if defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_io_object. + /** + * Performs: + * @code get_service().move_construct( + * get_implementation(), other.get_implementation()); @endcode + * + * @note Available only for services that support movability, + */ + basic_io_object(basic_io_object&& other); + + /// Move-assign a basic_io_object. + /** + * Performs: + * @code get_service().move_assign(get_implementation(), + * other.get_service(), other.get_implementation()); @endcode + * + * @note Available only for services that support movability, + */ + basic_io_object& operator=(basic_io_object&& other); + + /// Perform a converting move-construction of a basic_io_object. + template + basic_io_object(IoObjectService1& other_service, + typename IoObjectService1::implementation_type& other_implementation); +#endif // defined(GENERATING_DOCUMENTATION) + + /// Protected destructor to prevent deletion through this type. + /** + * Performs: + * @code get_service().destroy(get_implementation()); @endcode + */ + ~basic_io_object() + { + service_.destroy(implementation_); + } + + /// Get the service associated with the I/O object. + service_type& get_service() + { + return service_; + } + + /// Get the service associated with the I/O object. + const service_type& get_service() const + { + return service_; + } + + /// Get the underlying implementation of the I/O object. + implementation_type& get_implementation() + { + return implementation_; + } + + /// Get the underlying implementation of the I/O object. + const implementation_type& get_implementation() const + { + return implementation_; + } + +private: + basic_io_object(const basic_io_object&); + basic_io_object& operator=(const basic_io_object&); + + // The service associated with the I/O object. + service_type& service_; + + /// The underlying implementation of the I/O object. + implementation_type implementation_; +}; + +#if defined(ASIO_HAS_MOVE) +// Specialisation for movable objects. +template +class basic_io_object +{ +public: + typedef IoObjectService service_type; + typedef typename service_type::implementation_type implementation_type; + +#if !defined(ASIO_NO_DEPRECATED) + asio::io_context& get_io_context() + { + return service_->get_io_context(); + } + + asio::io_context& get_io_service() + { + return service_->get_io_context(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + typedef asio::io_context::executor_type executor_type; + + executor_type get_executor() ASIO_NOEXCEPT + { + return service_->get_io_context().get_executor(); + } + +protected: + explicit basic_io_object(asio::io_context& io_context) + : service_(&asio::use_service(io_context)) + { + service_->construct(implementation_); + } + + basic_io_object(basic_io_object&& other) + : service_(&other.get_service()) + { + service_->move_construct(implementation_, other.implementation_); + } + + template + basic_io_object(IoObjectService1& other_service, + typename IoObjectService1::implementation_type& other_implementation) + : service_(&asio::use_service( + other_service.get_io_context())) + { + service_->converting_move_construct(implementation_, + other_service, other_implementation); + } + + ~basic_io_object() + { + service_->destroy(implementation_); + } + + basic_io_object& operator=(basic_io_object&& other) + { + service_->move_assign(implementation_, + *other.service_, other.implementation_); + service_ = other.service_; + return *this; + } + + service_type& get_service() + { + return *service_; + } + + const service_type& get_service() const + { + return *service_; + } + + implementation_type& get_implementation() + { + return implementation_; + } + + const implementation_type& get_implementation() const + { + return implementation_; + } + +private: + basic_io_object(const basic_io_object&); + void operator=(const basic_io_object&); + + IoObjectService* service_; + implementation_type implementation_; +}; +#endif // defined(ASIO_HAS_MOVE) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_IO_OBJECT_HPP diff --git a/include/asio/include/asio/basic_raw_socket.hpp b/include/asio/include/asio/basic_raw_socket.hpp new file mode 100644 index 0000000..5236870 --- /dev/null +++ b/include/asio/include/asio/basic_raw_socket.hpp @@ -0,0 +1,1206 @@ +// +// basic_raw_socket.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_RAW_SOCKET_HPP +#define ASIO_BASIC_RAW_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if !defined(ASIO_BASIC_RAW_SOCKET_FWD_DECL) +#define ASIO_BASIC_RAW_SOCKET_FWD_DECL + +// Forward declaration with defaulted arguments. +template +class basic_raw_socket; + +#endif // !defined(ASIO_BASIC_RAW_SOCKET_FWD_DECL) + +/// Provides raw-oriented socket functionality. +/** + * The basic_raw_socket class template provides asynchronous and blocking + * raw-oriented socket functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template +class basic_raw_socket + : public basic_socket +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the socket type to another executor. + template + struct rebind_executor + { + /// The socket type when rebound to the specified executor. + typedef basic_raw_socket other; + }; + + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct a basic_raw_socket without opening it. + /** + * This constructor creates a raw socket without opening it. The open() + * function must be called before data can be sent or received on the socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + */ + explicit basic_raw_socket(const executor_type& ex) + : basic_socket(ex) + { + } + + /// Construct a basic_raw_socket without opening it. + /** + * This constructor creates a raw socket without opening it. The open() + * function must be called before data can be sent or received on the socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + */ + template + explicit basic_raw_socket(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context) + { + } + + /// Construct and open a basic_raw_socket. + /** + * This constructor creates and opens a raw socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_raw_socket(const executor_type& ex, const protocol_type& protocol) + : basic_socket(ex, protocol) + { + } + + /// Construct and open a basic_raw_socket. + /** + * This constructor creates and opens a raw socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_raw_socket(ExecutionContext& context, const protocol_type& protocol, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol) + { + } + + /// Construct a basic_raw_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a raw socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the raw + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_raw_socket(const executor_type& ex, const endpoint_type& endpoint) + : basic_socket(ex, endpoint) + { + } + + /// Construct a basic_raw_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a raw socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the raw + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_raw_socket(ExecutionContext& context, const endpoint_type& endpoint, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, endpoint) + { + } + + /// Construct a basic_raw_socket on an existing native socket. + /** + * This constructor creates a raw socket object to hold an existing + * native socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + basic_raw_socket(const executor_type& ex, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_socket(ex, protocol, native_socket) + { + } + + /// Construct a basic_raw_socket on an existing native socket. + /** + * This constructor creates a raw socket object to hold an existing + * native socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_raw_socket(ExecutionContext& context, + const protocol_type& protocol, const native_handle_type& native_socket, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol, native_socket) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_raw_socket from another. + /** + * This constructor moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(const executor_type&) + * constructor. + */ + basic_raw_socket(basic_raw_socket&& other) ASIO_NOEXCEPT + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_raw_socket from another. + /** + * This assignment operator moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(const executor_type&) + * constructor. + */ + basic_raw_socket& operator=(basic_raw_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } + + /// Move-construct a basic_raw_socket from a socket of another protocol + /// type. + /** + * This constructor moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(const executor_type&) + * constructor. + */ + template + basic_raw_socket(basic_raw_socket&& other, + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_raw_socket from a socket of another protocol type. + /** + * This assignment operator moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(const executor_type&) + * constructor. + */ + template + typename enable_if< + is_convertible::value + && is_convertible::value, + basic_raw_socket& + >::type operator=(basic_raw_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_raw_socket() + { + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected raw socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code socket.send(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected raw socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected raw socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected raw + * socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, + buffers, socket_base::message_flags(0)); + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected raw + * socket. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, buffers, flags); + } + + /// Send raw data to the specified endpoint. + /** + * This function is used to send raw data to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.send_to(asio::buffer(data, size), destination); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send_to( + this->impl_.get_implementation(), buffers, destination, 0, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send raw data to the specified endpoint. + /** + * This function is used to send raw data to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send_to( + this->impl_.get_implementation(), buffers, destination, flags, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send raw data to the specified endpoint. + /** + * This function is used to send raw data to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->impl_.get_service().send_to(this->impl_.get_implementation(), + buffers, destination, flags, ec); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send raw data to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.async_send_to( + * asio::buffer(data, size), destination, handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send_to(this), handler, buffers, + destination, socket_base::message_flags(0)); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send raw data to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send_to(this), handler, buffers, destination, flags); + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the raw socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected raw + * socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.receive(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the raw socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected raw + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the raw socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected raw + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the raw + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * raw socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive(this), handler, + buffers, socket_base::message_flags(0)); + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the raw + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * raw socket. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive(this), handler, buffers, flags); + } + + /// Receive raw data with the endpoint of the sender. + /** + * This function is used to receive raw data. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * asio::ip::udp::endpoint sender_endpoint; + * socket.receive_from( + * asio::buffer(data, size), sender_endpoint); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, 0, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive raw data with the endpoint of the sender. + /** + * This function is used to receive raw data. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, flags, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive raw data with the endpoint of the sender. + /** + * This function is used to receive raw data. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, flags, ec); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive raw data. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.async_receive_from( + * asio::buffer(data, size), 0, sender_endpoint, handler); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive_from(this), handler, buffers, + &sender_endpoint, socket_base::message_flags(0)); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive raw data. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive_from(this), handler, + buffers, &sender_endpoint, flags); + } + +private: + // Disallow copying and assignment. + basic_raw_socket(const basic_raw_socket&) ASIO_DELETED; + basic_raw_socket& operator=(const basic_raw_socket&) ASIO_DELETED; + + class initiate_async_send + { + public: + typedef Executor executor_type; + + explicit initiate_async_send(basic_raw_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WriteHandler) handler, + const ConstBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_send( + self_->impl_.get_implementation(), buffers, flags, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_raw_socket* self_; + }; + + class initiate_async_send_to + { + public: + typedef Executor executor_type; + + explicit initiate_async_send_to(basic_raw_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WriteHandler) handler, + const ConstBufferSequence& buffers, const endpoint_type& destination, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_send_to( + self_->impl_.get_implementation(), buffers, destination, + flags, handler2.value, self_->impl_.get_executor()); + } + + private: + basic_raw_socket* self_; + }; + + class initiate_async_receive + { + public: + typedef Executor executor_type; + + explicit initiate_async_receive(basic_raw_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ReadHandler) handler, + const MutableBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_receive( + self_->impl_.get_implementation(), buffers, flags, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_raw_socket* self_; + }; + + class initiate_async_receive_from + { + public: + typedef Executor executor_type; + + explicit initiate_async_receive_from(basic_raw_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ReadHandler) handler, + const MutableBufferSequence& buffers, endpoint_type* sender_endpoint, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_receive_from( + self_->impl_.get_implementation(), buffers, *sender_endpoint, + flags, handler2.value, self_->impl_.get_executor()); + } + + private: + basic_raw_socket* self_; + }; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_RAW_SOCKET_HPP diff --git a/include/asio/include/asio/basic_seq_packet_socket.hpp b/include/asio/include/asio/basic_seq_packet_socket.hpp new file mode 100644 index 0000000..8106949 --- /dev/null +++ b/include/asio/include/asio/basic_seq_packet_socket.hpp @@ -0,0 +1,761 @@ +// +// basic_seq_packet_socket.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SEQ_PACKET_SOCKET_HPP +#define ASIO_BASIC_SEQ_PACKET_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if !defined(ASIO_BASIC_SEQ_PACKET_SOCKET_FWD_DECL) +#define ASIO_BASIC_SEQ_PACKET_SOCKET_FWD_DECL + +// Forward declaration with defaulted arguments. +template +class basic_seq_packet_socket; + +#endif // !defined(ASIO_BASIC_SEQ_PACKET_SOCKET_FWD_DECL) + +/// Provides sequenced packet socket functionality. +/** + * The basic_seq_packet_socket class template provides asynchronous and blocking + * sequenced packet socket functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template +class basic_seq_packet_socket + : public basic_socket +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the socket type to another executor. + template + struct rebind_executor + { + /// The socket type when rebound to the specified executor. + typedef basic_seq_packet_socket other; + }; + + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct a basic_seq_packet_socket without opening it. + /** + * This constructor creates a sequenced packet socket without opening it. The + * socket needs to be opened and then connected or accepted before data can + * be sent or received on it. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + */ + explicit basic_seq_packet_socket(const executor_type& ex) + : basic_socket(ex) + { + } + + /// Construct a basic_seq_packet_socket without opening it. + /** + * This constructor creates a sequenced packet socket without opening it. The + * socket needs to be opened and then connected or accepted before data can + * be sent or received on it. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + */ + template + explicit basic_seq_packet_socket(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context) + { + } + + /// Construct and open a basic_seq_packet_socket. + /** + * This constructor creates and opens a sequenced_packet socket. The socket + * needs to be connected or accepted before data can be sent or received on + * it. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_seq_packet_socket(const executor_type& ex, + const protocol_type& protocol) + : basic_socket(ex, protocol) + { + } + + /// Construct and open a basic_seq_packet_socket. + /** + * This constructor creates and opens a sequenced_packet socket. The socket + * needs to be connected or accepted before data can be sent or received on + * it. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_seq_packet_socket(ExecutionContext& context, + const protocol_type& protocol, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol) + { + } + + /// Construct a basic_seq_packet_socket, opening it and binding it to the + /// given local endpoint. + /** + * This constructor creates a sequenced packet socket and automatically opens + * it bound to the specified endpoint on the local machine. The protocol used + * is the protocol associated with the given endpoint. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the sequenced + * packet socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_seq_packet_socket(const executor_type& ex, + const endpoint_type& endpoint) + : basic_socket(ex, endpoint) + { + } + + /// Construct a basic_seq_packet_socket, opening it and binding it to the + /// given local endpoint. + /** + * This constructor creates a sequenced packet socket and automatically opens + * it bound to the specified endpoint on the local machine. The protocol used + * is the protocol associated with the given endpoint. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the sequenced + * packet socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_seq_packet_socket(ExecutionContext& context, + const endpoint_type& endpoint, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, endpoint) + { + } + + /// Construct a basic_seq_packet_socket on an existing native socket. + /** + * This constructor creates a sequenced packet socket object to hold an + * existing native socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + basic_seq_packet_socket(const executor_type& ex, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_socket(ex, protocol, native_socket) + { + } + + /// Construct a basic_seq_packet_socket on an existing native socket. + /** + * This constructor creates a sequenced packet socket object to hold an + * existing native socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_seq_packet_socket(ExecutionContext& context, + const protocol_type& protocol, const native_handle_type& native_socket, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol, native_socket) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_seq_packet_socket from another. + /** + * This constructor moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(const executor_type&) + * constructor. + */ + basic_seq_packet_socket(basic_seq_packet_socket&& other) ASIO_NOEXCEPT + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_seq_packet_socket from another. + /** + * This assignment operator moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(const executor_type&) + * constructor. + */ + basic_seq_packet_socket& operator=(basic_seq_packet_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } + + /// Move-construct a basic_seq_packet_socket from a socket of another protocol + /// type. + /** + * This constructor moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(const executor_type&) + * constructor. + */ + template + basic_seq_packet_socket(basic_seq_packet_socket&& other, + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_seq_packet_socket from a socket of another protocol + /// type. + /** + * This assignment operator moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(const executor_type&) + * constructor. + */ + template + typename enable_if< + is_convertible::value + && is_convertible::value, + basic_seq_packet_socket& + >::type operator=(basic_seq_packet_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_seq_packet_socket() + { + } + + /// Send some data on the socket. + /** + * This function is used to send data on the sequenced packet socket. The + * function call will block until the data has been sent successfully, or an + * until error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.send(asio::buffer(data, size), 0); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on the socket. + /** + * This function is used to send data on the sequenced packet socket. The + * function call will block the data has been sent successfully, or an until + * error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. Returns 0 if an error occurred. + * + * @note The send operation may not transmit all of the data to the peer. + * Consider using the @ref write function if you need to ensure that all data + * is written before the blocking operation completes. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send data on the sequenced packet + * socket. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), 0, handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, buffers, flags); + } + + /// Receive some data on the socket. + /** + * This function is used to receive data on the sequenced packet socket. The + * function call will block until data has been received successfully, or + * until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param out_flags After the receive call completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.receive(asio::buffer(data, size), out_flags); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags& out_flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive_with_flags( + this->impl_.get_implementation(), buffers, 0, out_flags, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on the socket. + /** + * This function is used to receive data on the sequenced packet socket. The + * function call will block until data has been received successfully, or + * until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param in_flags Flags specifying how the receive call is to be made. + * + * @param out_flags After the receive call completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that the + * requested amount of data is read before the blocking operation completes. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.receive(asio::buffer(data, size), 0, out_flags); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive_with_flags( + this->impl_.get_implementation(), buffers, in_flags, out_flags, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the sequenced packet socket. The + * function call will block until data has been received successfully, or + * until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param in_flags Flags specifying how the receive call is to be made. + * + * @param out_flags After the receive call completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. Returns 0 if an error occurred. + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that the + * requested amount of data is read before the blocking operation completes. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, asio::error_code& ec) + { + return this->impl_.get_service().receive_with_flags( + this->impl_.get_implementation(), buffers, in_flags, out_flags, ec); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive data from the sequenced + * packet socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param out_flags Once the asynchronous operation completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. The caller must guarantee that the referenced + * variable remains valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), out_flags, handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags& out_flags, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive_with_flags(this), handler, + buffers, socket_base::message_flags(0), &out_flags); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive data from the sequenced + * data socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param in_flags Flags specifying how the receive call is to be made. + * + * @param out_flags Once the asynchronous operation completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. The caller must guarantee that the referenced + * variable remains valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive( + * asio::buffer(data, size), + * 0, out_flags, handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive_with_flags(this), + handler, buffers, in_flags, &out_flags); + } + +private: + // Disallow copying and assignment. + basic_seq_packet_socket(const basic_seq_packet_socket&) ASIO_DELETED; + basic_seq_packet_socket& operator=( + const basic_seq_packet_socket&) ASIO_DELETED; + + class initiate_async_send + { + public: + typedef Executor executor_type; + + explicit initiate_async_send(basic_seq_packet_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WriteHandler) handler, + const ConstBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_send( + self_->impl_.get_implementation(), buffers, flags, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_seq_packet_socket* self_; + }; + + class initiate_async_receive_with_flags + { + public: + typedef Executor executor_type; + + explicit initiate_async_receive_with_flags(basic_seq_packet_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ReadHandler) handler, + const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags* out_flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_receive_with_flags( + self_->impl_.get_implementation(), buffers, in_flags, + *out_flags, handler2.value, self_->impl_.get_executor()); + } + + private: + basic_seq_packet_socket* self_; + }; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_SEQ_PACKET_SOCKET_HPP diff --git a/include/asio/include/asio/basic_serial_port.hpp b/include/asio/include/asio/basic_serial_port.hpp new file mode 100644 index 0000000..1d09c72 --- /dev/null +++ b/include/asio/include/asio/basic_serial_port.hpp @@ -0,0 +1,907 @@ +// +// basic_serial_port.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SERIAL_PORT_HPP +#define ASIO_BASIC_SERIAL_PORT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_SERIAL_PORT) \ + || defined(GENERATING_DOCUMENTATION) + +#include +#include "asio/any_io_executor.hpp" +#include "asio/async_result.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/io_object_impl.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/serial_port_base.hpp" +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_serial_port_service.hpp" +#else +# include "asio/detail/reactive_serial_port_service.hpp" +#endif + +#if defined(ASIO_HAS_MOVE) +# include +#endif // defined(ASIO_HAS_MOVE) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides serial port functionality. +/** + * The basic_serial_port class provides a wrapper over serial port + * functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template +class basic_serial_port + : public serial_port_base +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the serial port type to another executor. + template + struct rebind_executor + { + /// The serial port type when rebound to the specified executor. + typedef basic_serial_port other; + }; + + /// The native representation of a serial port. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#elif defined(ASIO_HAS_IOCP) + typedef detail::win_iocp_serial_port_service::native_handle_type + native_handle_type; +#else + typedef detail::reactive_serial_port_service::native_handle_type + native_handle_type; +#endif + + /// A basic_basic_serial_port is always the lowest layer. + typedef basic_serial_port lowest_layer_type; + + /// Construct a basic_serial_port without opening it. + /** + * This constructor creates a serial port without opening it. + * + * @param ex The I/O executor that the serial port will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * serial port. + */ + explicit basic_serial_port(const executor_type& ex) + : impl_(ex) + { + } + + /// Construct a basic_serial_port without opening it. + /** + * This constructor creates a serial port without opening it. + * + * @param context An execution context which provides the I/O executor that + * the serial port will use, by default, to dispatch handlers for any + * asynchronous operations performed on the serial port. + */ + template + explicit basic_serial_port(ExecutionContext& context, + typename enable_if< + is_convertible::value, + basic_serial_port + >::type* = 0) + : impl_(context) + { + } + + /// Construct and open a basic_serial_port. + /** + * This constructor creates and opens a serial port for the specified device + * name. + * + * @param ex The I/O executor that the serial port will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * serial port. + * + * @param device The platform-specific device name for this serial + * port. + */ + basic_serial_port(const executor_type& ex, const char* device) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct and open a basic_serial_port. + /** + * This constructor creates and opens a serial port for the specified device + * name. + * + * @param context An execution context which provides the I/O executor that + * the serial port will use, by default, to dispatch handlers for any + * asynchronous operations performed on the serial port. + * + * @param device The platform-specific device name for this serial + * port. + */ + template + basic_serial_port(ExecutionContext& context, const char* device, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct and open a basic_serial_port. + /** + * This constructor creates and opens a serial port for the specified device + * name. + * + * @param ex The I/O executor that the serial port will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * serial port. + * + * @param device The platform-specific device name for this serial + * port. + */ + basic_serial_port(const executor_type& ex, const std::string& device) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct and open a basic_serial_port. + /** + * This constructor creates and opens a serial port for the specified device + * name. + * + * @param context An execution context which provides the I/O executor that + * the serial port will use, by default, to dispatch handlers for any + * asynchronous operations performed on the serial port. + * + * @param device The platform-specific device name for this serial + * port. + */ + template + basic_serial_port(ExecutionContext& context, const std::string& device, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct a basic_serial_port on an existing native serial port. + /** + * This constructor creates a serial port object to hold an existing native + * serial port. + * + * @param ex The I/O executor that the serial port will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * serial port. + * + * @param native_serial_port A native serial port. + * + * @throws asio::system_error Thrown on failure. + */ + basic_serial_port(const executor_type& ex, + const native_handle_type& native_serial_port) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + native_serial_port, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Construct a basic_serial_port on an existing native serial port. + /** + * This constructor creates a serial port object to hold an existing native + * serial port. + * + * @param context An execution context which provides the I/O executor that + * the serial port will use, by default, to dispatch handlers for any + * asynchronous operations performed on the serial port. + * + * @param native_serial_port A native serial port. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_serial_port(ExecutionContext& context, + const native_handle_type& native_serial_port, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + native_serial_port, ec); + asio::detail::throw_error(ec, "assign"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_serial_port from another. + /** + * This constructor moves a serial port from one object to another. + * + * @param other The other basic_serial_port object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_serial_port(const executor_type&) + * constructor. + */ + basic_serial_port(basic_serial_port&& other) + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_serial_port from another. + /** + * This assignment operator moves a serial port from one object to another. + * + * @param other The other basic_serial_port object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_serial_port(const executor_type&) + * constructor. + */ + basic_serial_port& operator=(basic_serial_port&& other) + { + impl_ = std::move(other.impl_); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the serial port. + /** + * This function destroys the serial port, cancelling any outstanding + * asynchronous wait operations associated with the serial port as if by + * calling @c cancel. + */ + ~basic_serial_port() + { + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return impl_.get_executor(); + } + + /// Get a reference to the lowest layer. + /** + * This function returns a reference to the lowest layer in a stack of + * layers. Since a basic_serial_port cannot contain any further layers, it + * simply returns a reference to itself. + * + * @return A reference to the lowest layer in the stack of layers. Ownership + * is not transferred to the caller. + */ + lowest_layer_type& lowest_layer() + { + return *this; + } + + /// Get a const reference to the lowest layer. + /** + * This function returns a const reference to the lowest layer in a stack of + * layers. Since a basic_serial_port cannot contain any further layers, it + * simply returns a reference to itself. + * + * @return A const reference to the lowest layer in the stack of layers. + * Ownership is not transferred to the caller. + */ + const lowest_layer_type& lowest_layer() const + { + return *this; + } + + /// Open the serial port using the specified device name. + /** + * This function opens the serial port for the specified device name. + * + * @param device The platform-specific device name. + * + * @throws asio::system_error Thrown on failure. + */ + void open(const std::string& device) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Open the serial port using the specified device name. + /** + * This function opens the serial port using the given platform-specific + * device name. + * + * @param device The platform-specific device name. + * + * @param ec Set the indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID open(const std::string& device, + asio::error_code& ec) + { + impl_.get_service().open(impl_.get_implementation(), device, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Assign an existing native serial port to the serial port. + /* + * This function opens the serial port to hold an existing native serial port. + * + * @param native_serial_port A native serial port. + * + * @throws asio::system_error Thrown on failure. + */ + void assign(const native_handle_type& native_serial_port) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + native_serial_port, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Assign an existing native serial port to the serial port. + /* + * This function opens the serial port to hold an existing native serial port. + * + * @param native_serial_port A native serial port. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID assign(const native_handle_type& native_serial_port, + asio::error_code& ec) + { + impl_.get_service().assign(impl_.get_implementation(), + native_serial_port, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Determine whether the serial port is open. + bool is_open() const + { + return impl_.get_service().is_open(impl_.get_implementation()); + } + + /// Close the serial port. + /** + * This function is used to close the serial port. Any asynchronous read or + * write operations will be cancelled immediately, and will complete with the + * asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + */ + void close() + { + asio::error_code ec; + impl_.get_service().close(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "close"); + } + + /// Close the serial port. + /** + * This function is used to close the serial port. Any asynchronous read or + * write operations will be cancelled immediately, and will complete with the + * asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID close(asio::error_code& ec) + { + impl_.get_service().close(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Get the native serial port representation. + /** + * This function may be used to obtain the underlying representation of the + * serial port. This is intended to allow access to native serial port + * functionality that is not otherwise provided. + */ + native_handle_type native_handle() + { + return impl_.get_service().native_handle(impl_.get_implementation()); + } + + /// Cancel all asynchronous operations associated with the serial port. + /** + * This function causes all outstanding asynchronous read or write operations + * to finish immediately, and the handlers for cancelled operations will be + * passed the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + */ + void cancel() + { + asio::error_code ec; + impl_.get_service().cancel(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all asynchronous operations associated with the serial port. + /** + * This function causes all outstanding asynchronous read or write operations + * to finish immediately, and the handlers for cancelled operations will be + * passed the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) + { + impl_.get_service().cancel(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Send a break sequence to the serial port. + /** + * This function causes a break sequence of platform-specific duration to be + * sent out the serial port. + * + * @throws asio::system_error Thrown on failure. + */ + void send_break() + { + asio::error_code ec; + impl_.get_service().send_break(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "send_break"); + } + + /// Send a break sequence to the serial port. + /** + * This function causes a break sequence of platform-specific duration to be + * sent out the serial port. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID send_break(asio::error_code& ec) + { + impl_.get_service().send_break(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Set an option on the serial port. + /** + * This function is used to set an option on the serial port. + * + * @param option The option value to be set on the serial port. + * + * @throws asio::system_error Thrown on failure. + * + * @sa SettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + void set_option(const SettableSerialPortOption& option) + { + asio::error_code ec; + impl_.get_service().set_option(impl_.get_implementation(), option, ec); + asio::detail::throw_error(ec, "set_option"); + } + + /// Set an option on the serial port. + /** + * This function is used to set an option on the serial port. + * + * @param option The option value to be set on the serial port. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa SettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + ASIO_SYNC_OP_VOID set_option(const SettableSerialPortOption& option, + asio::error_code& ec) + { + impl_.get_service().set_option(impl_.get_implementation(), option, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Get an option from the serial port. + /** + * This function is used to get the current value of an option on the serial + * port. + * + * @param option The option value to be obtained from the serial port. + * + * @throws asio::system_error Thrown on failure. + * + * @sa GettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + void get_option(GettableSerialPortOption& option) const + { + asio::error_code ec; + impl_.get_service().get_option(impl_.get_implementation(), option, ec); + asio::detail::throw_error(ec, "get_option"); + } + + /// Get an option from the serial port. + /** + * This function is used to get the current value of an option on the serial + * port. + * + * @param option The option value to be obtained from the serial port. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa GettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + ASIO_SYNC_OP_VOID get_option(GettableSerialPortOption& option, + asio::error_code& ec) const + { + impl_.get_service().get_option(impl_.get_implementation(), option, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Write some data to the serial port. + /** + * This function is used to write data to the serial port. The function call + * will block until one or more bytes of the data has been written + * successfully, or until an error occurs. + * + * @param buffers One or more data buffers to be written to the serial port. + * + * @returns The number of bytes written. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The write_some operation may not transmit all of the data to the + * peer. Consider using the @ref write function if you need to ensure that + * all data is written before the blocking operation completes. + * + * @par Example + * To write a single data buffer use the @ref buffer function as follows: + * @code + * basic_serial_port.write_some(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on writing multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t write_some(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = impl_.get_service().write_some( + impl_.get_implementation(), buffers, ec); + asio::detail::throw_error(ec, "write_some"); + return s; + } + + /// Write some data to the serial port. + /** + * This function is used to write data to the serial port. The function call + * will block until one or more bytes of the data has been written + * successfully, or until an error occurs. + * + * @param buffers One or more data buffers to be written to the serial port. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes written. Returns 0 if an error occurred. + * + * @note The write_some operation may not transmit all of the data to the + * peer. Consider using the @ref write function if you need to ensure that + * all data is written before the blocking operation completes. + */ + template + std::size_t write_some(const ConstBufferSequence& buffers, + asio::error_code& ec) + { + return impl_.get_service().write_some( + impl_.get_implementation(), buffers, ec); + } + + /// Start an asynchronous write. + /** + * This function is used to asynchronously write data to the serial port. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be written to the serial port. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the write operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes written. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The write operation may not transmit all of the data to the peer. + * Consider using the @ref async_write function if you need to ensure that all + * data is written before the asynchronous operation completes. + * + * @par Example + * To write a single data buffer use the @ref buffer function as follows: + * @code + * basic_serial_port.async_write_some( + * asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on writing multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_write_some(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_write_some(this), handler, buffers); + } + + /// Read some data from the serial port. + /** + * This function is used to read data from the serial port. The function + * call will block until one or more bytes of data has been read successfully, + * or until an error occurs. + * + * @param buffers One or more buffers into which the data will be read. + * + * @returns The number of bytes read. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The read_some operation may not read all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that + * the requested amount of data is read before the blocking operation + * completes. + * + * @par Example + * To read into a single data buffer use the @ref buffer function as follows: + * @code + * basic_serial_port.read_some(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on reading into multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t read_some(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = impl_.get_service().read_some( + impl_.get_implementation(), buffers, ec); + asio::detail::throw_error(ec, "read_some"); + return s; + } + + /// Read some data from the serial port. + /** + * This function is used to read data from the serial port. The function + * call will block until one or more bytes of data has been read successfully, + * or until an error occurs. + * + * @param buffers One or more buffers into which the data will be read. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes read. Returns 0 if an error occurred. + * + * @note The read_some operation may not read all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that + * the requested amount of data is read before the blocking operation + * completes. + */ + template + std::size_t read_some(const MutableBufferSequence& buffers, + asio::error_code& ec) + { + return impl_.get_service().read_some( + impl_.get_implementation(), buffers, ec); + } + + /// Start an asynchronous read. + /** + * This function is used to asynchronously read data from the serial port. + * The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be read. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the read operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes read. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The read operation may not read all of the requested number of bytes. + * Consider using the @ref async_read function if you need to ensure that the + * requested amount of data is read before the asynchronous operation + * completes. + * + * @par Example + * To read into a single data buffer use the @ref buffer function as follows: + * @code + * basic_serial_port.async_read_some( + * asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on reading into multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_read_some(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_read_some(this), handler, buffers); + } + +private: + // Disallow copying and assignment. + basic_serial_port(const basic_serial_port&) ASIO_DELETED; + basic_serial_port& operator=(const basic_serial_port&) ASIO_DELETED; + + class initiate_async_write_some + { + public: + typedef Executor executor_type; + + explicit initiate_async_write_some(basic_serial_port* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WriteHandler) handler, + const ConstBufferSequence& buffers) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_write_some( + self_->impl_.get_implementation(), buffers, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_serial_port* self_; + }; + + class initiate_async_read_some + { + public: + typedef Executor executor_type; + + explicit initiate_async_read_some(basic_serial_port* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ReadHandler) handler, + const MutableBufferSequence& buffers) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_read_some( + self_->impl_.get_implementation(), buffers, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_serial_port* self_; + }; + +#if defined(ASIO_HAS_IOCP) + detail::io_object_impl impl_; +#else + detail::io_object_impl impl_; +#endif +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_SERIAL_PORT) + // || defined(GENERATING_DOCUMENTATION) + +#endif // ASIO_BASIC_SERIAL_PORT_HPP diff --git a/include/asio/include/asio/basic_signal_set.hpp b/include/asio/include/asio/basic_signal_set.hpp new file mode 100644 index 0000000..b72dcf2 --- /dev/null +++ b/include/asio/include/asio/basic_signal_set.hpp @@ -0,0 +1,568 @@ +// +// basic_signal_set.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SIGNAL_SET_HPP +#define ASIO_BASIC_SIGNAL_SET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/any_io_executor.hpp" +#include "asio/async_result.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/io_object_impl.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/signal_set_service.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" + +namespace asio { + +/// Provides signal functionality. +/** + * The basic_signal_set class provides the ability to perform an asynchronous + * wait for one or more signals to occur. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Example + * Performing an asynchronous wait: + * @code + * void handler( + * const asio::error_code& error, + * int signal_number) + * { + * if (!error) + * { + * // A signal occurred. + * } + * } + * + * ... + * + * // Construct a signal set registered for process termination. + * asio::signal_set signals(my_context, SIGINT, SIGTERM); + * + * // Start an asynchronous wait for one of the signals to occur. + * signals.async_wait(handler); + * @endcode + * + * @par Queueing of signal notifications + * + * If a signal is registered with a signal_set, and the signal occurs when + * there are no waiting handlers, then the signal notification is queued. The + * next async_wait operation on that signal_set will dequeue the notification. + * If multiple notifications are queued, subsequent async_wait operations + * dequeue them one at a time. Signal notifications are dequeued in order of + * ascending signal number. + * + * If a signal number is removed from a signal_set (using the @c remove or @c + * erase member functions) then any queued notifications for that signal are + * discarded. + * + * @par Multiple registration of signals + * + * The same signal number may be registered with different signal_set objects. + * When the signal occurs, one handler is called for each signal_set object. + * + * Note that multiple registration only works for signals that are registered + * using Asio. The application must not also register a signal handler using + * functions such as @c signal() or @c sigaction(). + * + * @par Signal masking on POSIX platforms + * + * POSIX allows signals to be blocked using functions such as @c sigprocmask() + * and @c pthread_sigmask(). For signals to be delivered, programs must ensure + * that any signals registered using signal_set objects are unblocked in at + * least one thread. + */ +template +class basic_signal_set +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the signal set type to another executor. + template + struct rebind_executor + { + /// The signal set type when rebound to the specified executor. + typedef basic_signal_set other; + }; + + /// Construct a signal set without adding any signals. + /** + * This constructor creates a signal set without registering for any signals. + * + * @param ex The I/O executor that the signal set will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * signal set. + */ + explicit basic_signal_set(const executor_type& ex) + : impl_(ex) + { + } + + /// Construct a signal set without adding any signals. + /** + * This constructor creates a signal set without registering for any signals. + * + * @param context An execution context which provides the I/O executor that + * the signal set will use, by default, to dispatch handlers for any + * asynchronous operations performed on the signal set. + */ + template + explicit basic_signal_set(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + } + + /// Construct a signal set and add one signal. + /** + * This constructor creates a signal set and registers for one signal. + * + * @param ex The I/O executor that the signal set will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * signal set. + * + * @param signal_number_1 The signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(ex); + * signals.add(signal_number_1); @endcode + */ + basic_signal_set(const executor_type& ex, int signal_number_1) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Construct a signal set and add one signal. + /** + * This constructor creates a signal set and registers for one signal. + * + * @param context An execution context which provides the I/O executor that + * the signal set will use, by default, to dispatch handlers for any + * asynchronous operations performed on the signal set. + * + * @param signal_number_1 The signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(context); + * signals.add(signal_number_1); @endcode + */ + template + basic_signal_set(ExecutionContext& context, int signal_number_1, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Construct a signal set and add two signals. + /** + * This constructor creates a signal set and registers for two signals. + * + * @param ex The I/O executor that the signal set will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * signal set. + * + * @param signal_number_1 The first signal number to be added. + * + * @param signal_number_2 The second signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(ex); + * signals.add(signal_number_1); + * signals.add(signal_number_2); @endcode + */ + basic_signal_set(const executor_type& ex, int signal_number_1, + int signal_number_2) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + impl_.get_service().add(impl_.get_implementation(), signal_number_2, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Construct a signal set and add two signals. + /** + * This constructor creates a signal set and registers for two signals. + * + * @param context An execution context which provides the I/O executor that + * the signal set will use, by default, to dispatch handlers for any + * asynchronous operations performed on the signal set. + * + * @param signal_number_1 The first signal number to be added. + * + * @param signal_number_2 The second signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(context); + * signals.add(signal_number_1); + * signals.add(signal_number_2); @endcode + */ + template + basic_signal_set(ExecutionContext& context, int signal_number_1, + int signal_number_2, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + impl_.get_service().add(impl_.get_implementation(), signal_number_2, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Construct a signal set and add three signals. + /** + * This constructor creates a signal set and registers for three signals. + * + * @param ex The I/O executor that the signal set will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * signal set. + * + * @param signal_number_1 The first signal number to be added. + * + * @param signal_number_2 The second signal number to be added. + * + * @param signal_number_3 The third signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(ex); + * signals.add(signal_number_1); + * signals.add(signal_number_2); + * signals.add(signal_number_3); @endcode + */ + basic_signal_set(const executor_type& ex, int signal_number_1, + int signal_number_2, int signal_number_3) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + impl_.get_service().add(impl_.get_implementation(), signal_number_2, ec); + asio::detail::throw_error(ec, "add"); + impl_.get_service().add(impl_.get_implementation(), signal_number_3, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Construct a signal set and add three signals. + /** + * This constructor creates a signal set and registers for three signals. + * + * @param context An execution context which provides the I/O executor that + * the signal set will use, by default, to dispatch handlers for any + * asynchronous operations performed on the signal set. + * + * @param signal_number_1 The first signal number to be added. + * + * @param signal_number_2 The second signal number to be added. + * + * @param signal_number_3 The third signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(context); + * signals.add(signal_number_1); + * signals.add(signal_number_2); + * signals.add(signal_number_3); @endcode + */ + template + basic_signal_set(ExecutionContext& context, int signal_number_1, + int signal_number_2, int signal_number_3, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + impl_.get_service().add(impl_.get_implementation(), signal_number_2, ec); + asio::detail::throw_error(ec, "add"); + impl_.get_service().add(impl_.get_implementation(), signal_number_3, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Destroys the signal set. + /** + * This function destroys the signal set, cancelling any outstanding + * asynchronous wait operations associated with the signal set as if by + * calling @c cancel. + */ + ~basic_signal_set() + { + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return impl_.get_executor(); + } + + /// Add a signal to a signal_set. + /** + * This function adds the specified signal to the set. It has no effect if the + * signal is already in the set. + * + * @param signal_number The signal to be added to the set. + * + * @throws asio::system_error Thrown on failure. + */ + void add(int signal_number) + { + asio::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Add a signal to a signal_set. + /** + * This function adds the specified signal to the set. It has no effect if the + * signal is already in the set. + * + * @param signal_number The signal to be added to the set. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID add(int signal_number, + asio::error_code& ec) + { + impl_.get_service().add(impl_.get_implementation(), signal_number, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Remove a signal from a signal_set. + /** + * This function removes the specified signal from the set. It has no effect + * if the signal is not in the set. + * + * @param signal_number The signal to be removed from the set. + * + * @throws asio::system_error Thrown on failure. + * + * @note Removes any notifications that have been queued for the specified + * signal number. + */ + void remove(int signal_number) + { + asio::error_code ec; + impl_.get_service().remove(impl_.get_implementation(), signal_number, ec); + asio::detail::throw_error(ec, "remove"); + } + + /// Remove a signal from a signal_set. + /** + * This function removes the specified signal from the set. It has no effect + * if the signal is not in the set. + * + * @param signal_number The signal to be removed from the set. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note Removes any notifications that have been queued for the specified + * signal number. + */ + ASIO_SYNC_OP_VOID remove(int signal_number, + asio::error_code& ec) + { + impl_.get_service().remove(impl_.get_implementation(), signal_number, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Remove all signals from a signal_set. + /** + * This function removes all signals from the set. It has no effect if the set + * is already empty. + * + * @throws asio::system_error Thrown on failure. + * + * @note Removes all queued notifications. + */ + void clear() + { + asio::error_code ec; + impl_.get_service().clear(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "clear"); + } + + /// Remove all signals from a signal_set. + /** + * This function removes all signals from the set. It has no effect if the set + * is already empty. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note Removes all queued notifications. + */ + ASIO_SYNC_OP_VOID clear(asio::error_code& ec) + { + impl_.get_service().clear(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Cancel all operations associated with the signal set. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the signal set. The handler for each cancelled + * operation will be invoked with the asio::error::operation_aborted + * error code. + * + * Cancellation does not alter the set of registered signals. + * + * @throws asio::system_error Thrown on failure. + * + * @note If a registered signal occurred before cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + void cancel() + { + asio::error_code ec; + impl_.get_service().cancel(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all operations associated with the signal set. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the signal set. The handler for each cancelled + * operation will be invoked with the asio::error::operation_aborted + * error code. + * + * Cancellation does not alter the set of registered signals. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note If a registered signal occurred before cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) + { + impl_.get_service().cancel(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Start an asynchronous operation to wait for a signal to be delivered. + /** + * This function may be used to initiate an asynchronous wait against the + * signal set. It always returns immediately. + * + * For each call to async_wait(), the supplied handler will be called exactly + * once. The handler will be called when: + * + * @li One of the registered signals in the signal set occurs; or + * + * @li The signal set was cancelled, in which case the handler is passed the + * error code asio::error::operation_aborted. + * + * @param handler The handler to be called when the signal occurs. Copies + * will be made of the handler as required. The function signature of the + * handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * int signal_number // Indicates which signal occurred. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, int)) + SignalHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(SignalHandler, + void (asio::error_code, int)) + async_wait( + ASIO_MOVE_ARG(SignalHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_wait(this), handler); + } + +private: + // Disallow copying and assignment. + basic_signal_set(const basic_signal_set&) ASIO_DELETED; + basic_signal_set& operator=(const basic_signal_set&) ASIO_DELETED; + + class initiate_async_wait + { + public: + typedef Executor executor_type; + + explicit initiate_async_wait(basic_signal_set* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(SignalHandler) handler) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a SignalHandler. + ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_wait( + self_->impl_.get_implementation(), + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_signal_set* self_; + }; + + detail::io_object_impl impl_; +}; + +} // namespace asio + +#endif // ASIO_BASIC_SIGNAL_SET_HPP diff --git a/include/asio/include/asio/basic_socket.hpp b/include/asio/include/asio/basic_socket.hpp new file mode 100644 index 0000000..2504cec --- /dev/null +++ b/include/asio/include/asio/basic_socket.hpp @@ -0,0 +1,1894 @@ +// +// basic_socket.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SOCKET_HPP +#define ASIO_BASIC_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/any_io_executor.hpp" +#include "asio/detail/config.hpp" +#include "asio/async_result.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/io_object_impl.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/post.hpp" +#include "asio/socket_base.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) +# include "asio/detail/null_socket_service.hpp" +#elif defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_socket_service.hpp" +#else +# include "asio/detail/reactive_socket_service.hpp" +#endif + +#if defined(ASIO_HAS_MOVE) +# include +#endif // defined(ASIO_HAS_MOVE) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if !defined(ASIO_BASIC_SOCKET_FWD_DECL) +#define ASIO_BASIC_SOCKET_FWD_DECL + +// Forward declaration with defaulted arguments. +template +class basic_socket; + +#endif // !defined(ASIO_BASIC_SOCKET_FWD_DECL) + +/// Provides socket functionality. +/** + * The basic_socket class template provides functionality that is common to both + * stream-oriented and datagram-oriented sockets. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template +class basic_socket + : public socket_base +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the socket type to another executor. + template + struct rebind_executor + { + /// The socket type when rebound to the specified executor. + typedef basic_socket other; + }; + + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#elif defined(ASIO_WINDOWS_RUNTIME) + typedef typename detail::null_socket_service< + Protocol>::native_handle_type native_handle_type; +#elif defined(ASIO_HAS_IOCP) + typedef typename detail::win_iocp_socket_service< + Protocol>::native_handle_type native_handle_type; +#else + typedef typename detail::reactive_socket_service< + Protocol>::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + +#if !defined(ASIO_NO_EXTENSIONS) + /// A basic_socket is always the lowest layer. + typedef basic_socket lowest_layer_type; +#endif // !defined(ASIO_NO_EXTENSIONS) + + /// Construct a basic_socket without opening it. + /** + * This constructor creates a socket without opening it. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + */ + explicit basic_socket(const executor_type& ex) + : impl_(ex) + { + } + + /// Construct a basic_socket without opening it. + /** + * This constructor creates a socket without opening it. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + */ + template + explicit basic_socket(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + } + + /// Construct and open a basic_socket. + /** + * This constructor creates and opens a socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket(const executor_type& ex, const protocol_type& protocol) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct and open a basic_socket. + /** + * This constructor creates and opens a socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_socket(ExecutionContext& context, const protocol_type& protocol, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct a basic_socket, opening it and binding it to the given local + /// endpoint. + /** + * This constructor creates a socket and automatically opens it bound to the + * specified endpoint on the local machine. The protocol used is the protocol + * associated with the given endpoint. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the socket will + * be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket(const executor_type& ex, const endpoint_type& endpoint) + : impl_(ex) + { + asio::error_code ec; + const protocol_type protocol = endpoint.protocol(); + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + } + + /// Construct a basic_socket, opening it and binding it to the given local + /// endpoint. + /** + * This constructor creates a socket and automatically opens it bound to the + * specified endpoint on the local machine. The protocol used is the protocol + * associated with the given endpoint. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the socket will + * be bound. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_socket(ExecutionContext& context, const endpoint_type& endpoint, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + const protocol_type protocol = endpoint.protocol(); + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + } + + /// Construct a basic_socket on an existing native socket. + /** + * This constructor creates a socket object to hold an existing native socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket A native socket. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket(const executor_type& ex, const protocol_type& protocol, + const native_handle_type& native_socket) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_socket, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Construct a basic_socket on an existing native socket. + /** + * This constructor creates a socket object to hold an existing native socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket A native socket. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_socket(ExecutionContext& context, const protocol_type& protocol, + const native_handle_type& native_socket, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_socket, ec); + asio::detail::throw_error(ec, "assign"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_socket from another. + /** + * This constructor moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(const executor_type&) constructor. + */ + basic_socket(basic_socket&& other) ASIO_NOEXCEPT + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_socket from another. + /** + * This assignment operator moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(const executor_type&) constructor. + */ + basic_socket& operator=(basic_socket&& other) + { + impl_ = std::move(other.impl_); + return *this; + } + + // All sockets have access to each other's implementations. + template + friend class basic_socket; + + /// Move-construct a basic_socket from a socket of another protocol type. + /** + * This constructor moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(const executor_type&) constructor. + */ + template + basic_socket(basic_socket&& other, + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0) + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_socket from a socket of another protocol type. + /** + * This assignment operator moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(const executor_type&) constructor. + */ + template + typename enable_if< + is_convertible::value + && is_convertible::value, + basic_socket& + >::type operator=(basic_socket && other) + { + basic_socket tmp(std::move(other)); + impl_ = std::move(tmp.impl_); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return impl_.get_executor(); + } + +#if !defined(ASIO_NO_EXTENSIONS) + /// Get a reference to the lowest layer. + /** + * This function returns a reference to the lowest layer in a stack of + * layers. Since a basic_socket cannot contain any further layers, it simply + * returns a reference to itself. + * + * @return A reference to the lowest layer in the stack of layers. Ownership + * is not transferred to the caller. + */ + lowest_layer_type& lowest_layer() + { + return *this; + } + + /// Get a const reference to the lowest layer. + /** + * This function returns a const reference to the lowest layer in a stack of + * layers. Since a basic_socket cannot contain any further layers, it simply + * returns a reference to itself. + * + * @return A const reference to the lowest layer in the stack of layers. + * Ownership is not transferred to the caller. + */ + const lowest_layer_type& lowest_layer() const + { + return *this; + } +#endif // !defined(ASIO_NO_EXTENSIONS) + + /// Open the socket using the specified protocol. + /** + * This function opens the socket so that it will use the specified protocol. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * socket.open(asio::ip::tcp::v4()); + * @endcode + */ + void open(const protocol_type& protocol = protocol_type()) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Open the socket using the specified protocol. + /** + * This function opens the socket so that it will use the specified protocol. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * asio::error_code ec; + * socket.open(asio::ip::tcp::v4(), ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID open(const protocol_type& protocol, + asio::error_code& ec) + { + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Assign an existing native socket to the socket. + /* + * This function opens the socket to hold an existing native socket. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_socket A native socket. + * + * @throws asio::system_error Thrown on failure. + */ + void assign(const protocol_type& protocol, + const native_handle_type& native_socket) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_socket, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Assign an existing native socket to the socket. + /* + * This function opens the socket to hold an existing native socket. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_socket A native socket. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID assign(const protocol_type& protocol, + const native_handle_type& native_socket, asio::error_code& ec) + { + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_socket, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Determine whether the socket is open. + bool is_open() const + { + return impl_.get_service().is_open(impl_.get_implementation()); + } + + /// Close the socket. + /** + * This function is used to close the socket. Any asynchronous send, receive + * or connect operations will be cancelled immediately, and will complete + * with the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. Note that, even if + * the function indicates an error, the underlying descriptor is closed. + * + * @note For portable behaviour with respect to graceful closure of a + * connected socket, call shutdown() before closing the socket. + */ + void close() + { + asio::error_code ec; + impl_.get_service().close(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "close"); + } + + /// Close the socket. + /** + * This function is used to close the socket. Any asynchronous send, receive + * or connect operations will be cancelled immediately, and will complete + * with the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. Note that, even if + * the function indicates an error, the underlying descriptor is closed. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::error_code ec; + * socket.close(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + * + * @note For portable behaviour with respect to graceful closure of a + * connected socket, call shutdown() before closing the socket. + */ + ASIO_SYNC_OP_VOID close(asio::error_code& ec) + { + impl_.get_service().close(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Release ownership of the underlying native socket. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. Ownership + * of the native socket is then transferred to the caller. + * + * @throws asio::system_error Thrown on failure. + * + * @note This function is unsupported on Windows versions prior to Windows + * 8.1, and will fail with asio::error::operation_not_supported on + * these platforms. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) + __declspec(deprecated("This function always fails with " + "operation_not_supported when used on Windows versions " + "prior to Windows 8.1.")) +#endif + native_handle_type release() + { + asio::error_code ec; + native_handle_type s = impl_.get_service().release( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "release"); + return s; + } + + /// Release ownership of the underlying native socket. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. Ownership + * of the native socket is then transferred to the caller. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note This function is unsupported on Windows versions prior to Windows + * 8.1, and will fail with asio::error::operation_not_supported on + * these platforms. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) + __declspec(deprecated("This function always fails with " + "operation_not_supported when used on Windows versions " + "prior to Windows 8.1.")) +#endif + native_handle_type release(asio::error_code& ec) + { + return impl_.get_service().release(impl_.get_implementation(), ec); + } + + /// Get the native socket representation. + /** + * This function may be used to obtain the underlying representation of the + * socket. This is intended to allow access to native socket functionality + * that is not otherwise provided. + */ + native_handle_type native_handle() + { + return impl_.get_service().native_handle(impl_.get_implementation()); + } + + /// Cancel all asynchronous operations associated with the socket. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + * + * @note Calls to cancel() will always fail with + * asio::error::operation_not_supported when run on Windows XP, Windows + * Server 2003, and earlier versions of Windows, unless + * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has + * two issues that should be considered before enabling its use: + * + * @li It will only cancel asynchronous operations that were initiated in the + * current thread. + * + * @li It can appear to complete without error, but the request to cancel the + * unfinished operations may be silently ignored by the operating system. + * Whether it works or not seems to depend on the drivers that are installed. + * + * For portable cancellation, consider using one of the following + * alternatives: + * + * @li Disable asio's I/O completion port backend by defining + * ASIO_DISABLE_IOCP. + * + * @li Use the close() function to simultaneously cancel the outstanding + * operations and close the socket. + * + * When running on Windows Vista, Windows Server 2008, and later, the + * CancelIoEx function is always used. This function does not have the + * problems described above. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ + && !defined(ASIO_ENABLE_CANCELIO) + __declspec(deprecated("By default, this function always fails with " + "operation_not_supported when used on Windows XP, Windows Server 2003, " + "or earlier. Consult documentation for details.")) +#endif + void cancel() + { + asio::error_code ec; + impl_.get_service().cancel(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all asynchronous operations associated with the socket. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note Calls to cancel() will always fail with + * asio::error::operation_not_supported when run on Windows XP, Windows + * Server 2003, and earlier versions of Windows, unless + * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has + * two issues that should be considered before enabling its use: + * + * @li It will only cancel asynchronous operations that were initiated in the + * current thread. + * + * @li It can appear to complete without error, but the request to cancel the + * unfinished operations may be silently ignored by the operating system. + * Whether it works or not seems to depend on the drivers that are installed. + * + * For portable cancellation, consider using one of the following + * alternatives: + * + * @li Disable asio's I/O completion port backend by defining + * ASIO_DISABLE_IOCP. + * + * @li Use the close() function to simultaneously cancel the outstanding + * operations and close the socket. + * + * When running on Windows Vista, Windows Server 2008, and later, the + * CancelIoEx function is always used. This function does not have the + * problems described above. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ + && !defined(ASIO_ENABLE_CANCELIO) + __declspec(deprecated("By default, this function always fails with " + "operation_not_supported when used on Windows XP, Windows Server 2003, " + "or earlier. Consult documentation for details.")) +#endif + ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) + { + impl_.get_service().cancel(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Determine whether the socket is at the out-of-band data mark. + /** + * This function is used to check whether the socket input is currently + * positioned at the out-of-band data mark. + * + * @return A bool indicating whether the socket is at the out-of-band data + * mark. + * + * @throws asio::system_error Thrown on failure. + */ + bool at_mark() const + { + asio::error_code ec; + bool b = impl_.get_service().at_mark(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "at_mark"); + return b; + } + + /// Determine whether the socket is at the out-of-band data mark. + /** + * This function is used to check whether the socket input is currently + * positioned at the out-of-band data mark. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return A bool indicating whether the socket is at the out-of-band data + * mark. + */ + bool at_mark(asio::error_code& ec) const + { + return impl_.get_service().at_mark(impl_.get_implementation(), ec); + } + + /// Determine the number of bytes available for reading. + /** + * This function is used to determine the number of bytes that may be read + * without blocking. + * + * @return The number of bytes that may be read without blocking, or 0 if an + * error occurs. + * + * @throws asio::system_error Thrown on failure. + */ + std::size_t available() const + { + asio::error_code ec; + std::size_t s = impl_.get_service().available( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "available"); + return s; + } + + /// Determine the number of bytes available for reading. + /** + * This function is used to determine the number of bytes that may be read + * without blocking. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of bytes that may be read without blocking, or 0 if an + * error occurs. + */ + std::size_t available(asio::error_code& ec) const + { + return impl_.get_service().available(impl_.get_implementation(), ec); + } + + /// Bind the socket to the given local endpoint. + /** + * This function binds the socket to the specified endpoint on the local + * machine. + * + * @param endpoint An endpoint on the local machine to which the socket will + * be bound. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * socket.open(asio::ip::tcp::v4()); + * socket.bind(asio::ip::tcp::endpoint( + * asio::ip::tcp::v4(), 12345)); + * @endcode + */ + void bind(const endpoint_type& endpoint) + { + asio::error_code ec; + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + } + + /// Bind the socket to the given local endpoint. + /** + * This function binds the socket to the specified endpoint on the local + * machine. + * + * @param endpoint An endpoint on the local machine to which the socket will + * be bound. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * socket.open(asio::ip::tcp::v4()); + * asio::error_code ec; + * socket.bind(asio::ip::tcp::endpoint( + * asio::ip::tcp::v4(), 12345), ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID bind(const endpoint_type& endpoint, + asio::error_code& ec) + { + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Connect the socket to the specified endpoint. + /** + * This function is used to connect a socket to the specified remote endpoint. + * The function call will block until the connection is successfully made or + * an error occurs. + * + * The socket is automatically opened if it is not already open. If the + * connect fails, and the socket was automatically opened, the socket is + * not returned to the closed state. + * + * @param peer_endpoint The remote endpoint to which the socket will be + * connected. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * asio::ip::tcp::endpoint endpoint( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.connect(endpoint); + * @endcode + */ + void connect(const endpoint_type& peer_endpoint) + { + asio::error_code ec; + if (!is_open()) + { + impl_.get_service().open(impl_.get_implementation(), + peer_endpoint.protocol(), ec); + asio::detail::throw_error(ec, "connect"); + } + impl_.get_service().connect(impl_.get_implementation(), peer_endpoint, ec); + asio::detail::throw_error(ec, "connect"); + } + + /// Connect the socket to the specified endpoint. + /** + * This function is used to connect a socket to the specified remote endpoint. + * The function call will block until the connection is successfully made or + * an error occurs. + * + * The socket is automatically opened if it is not already open. If the + * connect fails, and the socket was automatically opened, the socket is + * not returned to the closed state. + * + * @param peer_endpoint The remote endpoint to which the socket will be + * connected. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * asio::ip::tcp::endpoint endpoint( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * asio::error_code ec; + * socket.connect(endpoint, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID connect(const endpoint_type& peer_endpoint, + asio::error_code& ec) + { + if (!is_open()) + { + impl_.get_service().open(impl_.get_implementation(), + peer_endpoint.protocol(), ec); + if (ec) + { + ASIO_SYNC_OP_VOID_RETURN(ec); + } + } + + impl_.get_service().connect(impl_.get_implementation(), peer_endpoint, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Start an asynchronous connect. + /** + * This function is used to asynchronously connect a socket to the specified + * remote endpoint. The function call always returns immediately. + * + * The socket is automatically opened if it is not already open. If the + * connect fails, and the socket was automatically opened, the socket is + * not returned to the closed state. + * + * @param peer_endpoint The remote endpoint to which the socket will be + * connected. Copies will be made of the endpoint object as required. + * + * @param handler The handler to be called when the connection operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void connect_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Connect succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::socket socket(my_context); + * asio::ip::tcp::endpoint endpoint( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.async_connect(endpoint, connect_handler); + * @endcode + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code)) + ConnectHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(ConnectHandler, + void (asio::error_code)) + async_connect(const endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(ConnectHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + asio::error_code open_ec; + if (!is_open()) + { + const protocol_type protocol = peer_endpoint.protocol(); + impl_.get_service().open(impl_.get_implementation(), protocol, open_ec); + } + + return async_initiate( + initiate_async_connect(this), handler, peer_endpoint, open_ec); + } + + /// Set an option on the socket. + /** + * This function is used to set an option on the socket. + * + * @param option The new option value to be set on the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @sa SettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Setting the IPPROTO_TCP/TCP_NODELAY option: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::no_delay option(true); + * socket.set_option(option); + * @endcode + */ + template + void set_option(const SettableSocketOption& option) + { + asio::error_code ec; + impl_.get_service().set_option(impl_.get_implementation(), option, ec); + asio::detail::throw_error(ec, "set_option"); + } + + /// Set an option on the socket. + /** + * This function is used to set an option on the socket. + * + * @param option The new option value to be set on the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa SettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Setting the IPPROTO_TCP/TCP_NODELAY option: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::no_delay option(true); + * asio::error_code ec; + * socket.set_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + ASIO_SYNC_OP_VOID set_option(const SettableSocketOption& option, + asio::error_code& ec) + { + impl_.get_service().set_option(impl_.get_implementation(), option, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Get an option from the socket. + /** + * This function is used to get the current value of an option on the socket. + * + * @param option The option value to be obtained from the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @sa GettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::socket::keep_alive option; + * socket.get_option(option); + * bool is_set = option.value(); + * @endcode + */ + template + void get_option(GettableSocketOption& option) const + { + asio::error_code ec; + impl_.get_service().get_option(impl_.get_implementation(), option, ec); + asio::detail::throw_error(ec, "get_option"); + } + + /// Get an option from the socket. + /** + * This function is used to get the current value of an option on the socket. + * + * @param option The option value to be obtained from the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa GettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::socket::keep_alive option; + * asio::error_code ec; + * socket.get_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * bool is_set = option.value(); + * @endcode + */ + template + ASIO_SYNC_OP_VOID get_option(GettableSocketOption& option, + asio::error_code& ec) const + { + impl_.get_service().get_option(impl_.get_implementation(), option, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Perform an IO control command on the socket. + /** + * This function is used to execute an IO control command on the socket. + * + * @param command The IO control command to be performed on the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @sa IoControlCommand @n + * asio::socket_base::bytes_readable @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::socket::bytes_readable command; + * socket.io_control(command); + * std::size_t bytes_readable = command.get(); + * @endcode + */ + template + void io_control(IoControlCommand& command) + { + asio::error_code ec; + impl_.get_service().io_control(impl_.get_implementation(), command, ec); + asio::detail::throw_error(ec, "io_control"); + } + + /// Perform an IO control command on the socket. + /** + * This function is used to execute an IO control command on the socket. + * + * @param command The IO control command to be performed on the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa IoControlCommand @n + * asio::socket_base::bytes_readable @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::socket::bytes_readable command; + * asio::error_code ec; + * socket.io_control(command, ec); + * if (ec) + * { + * // An error occurred. + * } + * std::size_t bytes_readable = command.get(); + * @endcode + */ + template + ASIO_SYNC_OP_VOID io_control(IoControlCommand& command, + asio::error_code& ec) + { + impl_.get_service().io_control(impl_.get_implementation(), command, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Gets the non-blocking mode of the socket. + /** + * @returns @c true if the socket's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + bool non_blocking() const + { + return impl_.get_service().non_blocking(impl_.get_implementation()); + } + + /// Sets the non-blocking mode of the socket. + /** + * @param mode If @c true, the socket's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @throws asio::system_error Thrown on failure. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + void non_blocking(bool mode) + { + asio::error_code ec; + impl_.get_service().non_blocking(impl_.get_implementation(), mode, ec); + asio::detail::throw_error(ec, "non_blocking"); + } + + /// Sets the non-blocking mode of the socket. + /** + * @param mode If @c true, the socket's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + ASIO_SYNC_OP_VOID non_blocking( + bool mode, asio::error_code& ec) + { + impl_.get_service().non_blocking(impl_.get_implementation(), mode, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Gets the non-blocking mode of the native socket implementation. + /** + * This function is used to retrieve the non-blocking mode of the underlying + * native socket. This mode has no effect on the behaviour of the socket + * object's synchronous operations. + * + * @returns @c true if the underlying socket is in non-blocking mode and + * direct system calls may fail with asio::error::would_block (or the + * equivalent system error). + * + * @note The current non-blocking mode is cached by the socket object. + * Consequently, the return value may be incorrect if the non-blocking mode + * was set directly on the native socket. + * + * @par Example + * This function is intended to allow the encapsulation of arbitrary + * non-blocking system calls as asynchronous operations, in a way that is + * transparent to the user of the socket object. The following example + * illustrates how Linux's @c sendfile system call might be encapsulated: + * @code template + * struct sendfile_op + * { + * tcp::socket& sock_; + * int fd_; + * Handler handler_; + * off_t offset_; + * std::size_t total_bytes_transferred_; + * + * // Function call operator meeting WriteHandler requirements. + * // Used as the handler for the async_write_some operation. + * void operator()(asio::error_code ec, std::size_t) + * { + * // Put the underlying socket into non-blocking mode. + * if (!ec) + * if (!sock_.native_non_blocking()) + * sock_.native_non_blocking(true, ec); + * + * if (!ec) + * { + * for (;;) + * { + * // Try the system call. + * errno = 0; + * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); + * ec = asio::error_code(n < 0 ? errno : 0, + * asio::error::get_system_category()); + * total_bytes_transferred_ += ec ? 0 : n; + * + * // Retry operation immediately if interrupted by signal. + * if (ec == asio::error::interrupted) + * continue; + * + * // Check if we need to run the operation again. + * if (ec == asio::error::would_block + * || ec == asio::error::try_again) + * { + * // We have to wait for the socket to become ready again. + * sock_.async_wait(tcp::socket::wait_write, *this); + * return; + * } + * + * if (ec || n == 0) + * { + * // An error occurred, or we have reached the end of the file. + * // Either way we must exit the loop so we can call the handler. + * break; + * } + * + * // Loop around to try calling sendfile again. + * } + * } + * + * // Pass result back to user's handler. + * handler_(ec, total_bytes_transferred_); + * } + * }; + * + * template + * void async_sendfile(tcp::socket& sock, int fd, Handler h) + * { + * sendfile_op op = { sock, fd, h, 0, 0 }; + * sock.async_wait(tcp::socket::wait_write, op); + * } @endcode + */ + bool native_non_blocking() const + { + return impl_.get_service().native_non_blocking(impl_.get_implementation()); + } + + /// Sets the non-blocking mode of the native socket implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native socket. It has no effect on the behaviour of the socket object's + * synchronous operations. + * + * @param mode If @c true, the underlying socket is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @throws asio::system_error Thrown on failure. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + * + * @par Example + * This function is intended to allow the encapsulation of arbitrary + * non-blocking system calls as asynchronous operations, in a way that is + * transparent to the user of the socket object. The following example + * illustrates how Linux's @c sendfile system call might be encapsulated: + * @code template + * struct sendfile_op + * { + * tcp::socket& sock_; + * int fd_; + * Handler handler_; + * off_t offset_; + * std::size_t total_bytes_transferred_; + * + * // Function call operator meeting WriteHandler requirements. + * // Used as the handler for the async_write_some operation. + * void operator()(asio::error_code ec, std::size_t) + * { + * // Put the underlying socket into non-blocking mode. + * if (!ec) + * if (!sock_.native_non_blocking()) + * sock_.native_non_blocking(true, ec); + * + * if (!ec) + * { + * for (;;) + * { + * // Try the system call. + * errno = 0; + * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); + * ec = asio::error_code(n < 0 ? errno : 0, + * asio::error::get_system_category()); + * total_bytes_transferred_ += ec ? 0 : n; + * + * // Retry operation immediately if interrupted by signal. + * if (ec == asio::error::interrupted) + * continue; + * + * // Check if we need to run the operation again. + * if (ec == asio::error::would_block + * || ec == asio::error::try_again) + * { + * // We have to wait for the socket to become ready again. + * sock_.async_wait(tcp::socket::wait_write, *this); + * return; + * } + * + * if (ec || n == 0) + * { + * // An error occurred, or we have reached the end of the file. + * // Either way we must exit the loop so we can call the handler. + * break; + * } + * + * // Loop around to try calling sendfile again. + * } + * } + * + * // Pass result back to user's handler. + * handler_(ec, total_bytes_transferred_); + * } + * }; + * + * template + * void async_sendfile(tcp::socket& sock, int fd, Handler h) + * { + * sendfile_op op = { sock, fd, h, 0, 0 }; + * sock.async_wait(tcp::socket::wait_write, op); + * } @endcode + */ + void native_non_blocking(bool mode) + { + asio::error_code ec; + impl_.get_service().native_non_blocking( + impl_.get_implementation(), mode, ec); + asio::detail::throw_error(ec, "native_non_blocking"); + } + + /// Sets the non-blocking mode of the native socket implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native socket. It has no effect on the behaviour of the socket object's + * synchronous operations. + * + * @param mode If @c true, the underlying socket is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @param ec Set to indicate what error occurred, if any. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + * + * @par Example + * This function is intended to allow the encapsulation of arbitrary + * non-blocking system calls as asynchronous operations, in a way that is + * transparent to the user of the socket object. The following example + * illustrates how Linux's @c sendfile system call might be encapsulated: + * @code template + * struct sendfile_op + * { + * tcp::socket& sock_; + * int fd_; + * Handler handler_; + * off_t offset_; + * std::size_t total_bytes_transferred_; + * + * // Function call operator meeting WriteHandler requirements. + * // Used as the handler for the async_write_some operation. + * void operator()(asio::error_code ec, std::size_t) + * { + * // Put the underlying socket into non-blocking mode. + * if (!ec) + * if (!sock_.native_non_blocking()) + * sock_.native_non_blocking(true, ec); + * + * if (!ec) + * { + * for (;;) + * { + * // Try the system call. + * errno = 0; + * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); + * ec = asio::error_code(n < 0 ? errno : 0, + * asio::error::get_system_category()); + * total_bytes_transferred_ += ec ? 0 : n; + * + * // Retry operation immediately if interrupted by signal. + * if (ec == asio::error::interrupted) + * continue; + * + * // Check if we need to run the operation again. + * if (ec == asio::error::would_block + * || ec == asio::error::try_again) + * { + * // We have to wait for the socket to become ready again. + * sock_.async_wait(tcp::socket::wait_write, *this); + * return; + * } + * + * if (ec || n == 0) + * { + * // An error occurred, or we have reached the end of the file. + * // Either way we must exit the loop so we can call the handler. + * break; + * } + * + * // Loop around to try calling sendfile again. + * } + * } + * + * // Pass result back to user's handler. + * handler_(ec, total_bytes_transferred_); + * } + * }; + * + * template + * void async_sendfile(tcp::socket& sock, int fd, Handler h) + * { + * sendfile_op op = { sock, fd, h, 0, 0 }; + * sock.async_wait(tcp::socket::wait_write, op); + * } @endcode + */ + ASIO_SYNC_OP_VOID native_non_blocking( + bool mode, asio::error_code& ec) + { + impl_.get_service().native_non_blocking( + impl_.get_implementation(), mode, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Get the local endpoint of the socket. + /** + * This function is used to obtain the locally bound endpoint of the socket. + * + * @returns An object that represents the local endpoint of the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); + * @endcode + */ + endpoint_type local_endpoint() const + { + asio::error_code ec; + endpoint_type ep = impl_.get_service().local_endpoint( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "local_endpoint"); + return ep; + } + + /// Get the local endpoint of the socket. + /** + * This function is used to obtain the locally bound endpoint of the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns An object that represents the local endpoint of the socket. + * Returns a default-constructed endpoint object if an error occurred. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::error_code ec; + * asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + endpoint_type local_endpoint(asio::error_code& ec) const + { + return impl_.get_service().local_endpoint(impl_.get_implementation(), ec); + } + + /// Get the remote endpoint of the socket. + /** + * This function is used to obtain the remote endpoint of the socket. + * + * @returns An object that represents the remote endpoint of the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); + * @endcode + */ + endpoint_type remote_endpoint() const + { + asio::error_code ec; + endpoint_type ep = impl_.get_service().remote_endpoint( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "remote_endpoint"); + return ep; + } + + /// Get the remote endpoint of the socket. + /** + * This function is used to obtain the remote endpoint of the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns An object that represents the remote endpoint of the socket. + * Returns a default-constructed endpoint object if an error occurred. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::error_code ec; + * asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + endpoint_type remote_endpoint(asio::error_code& ec) const + { + return impl_.get_service().remote_endpoint(impl_.get_implementation(), ec); + } + + /// Disable sends or receives on the socket. + /** + * This function is used to disable send operations, receive operations, or + * both. + * + * @param what Determines what types of operation will no longer be allowed. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * Shutting down the send side of the socket: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * socket.shutdown(asio::ip::tcp::socket::shutdown_send); + * @endcode + */ + void shutdown(shutdown_type what) + { + asio::error_code ec; + impl_.get_service().shutdown(impl_.get_implementation(), what, ec); + asio::detail::throw_error(ec, "shutdown"); + } + + /// Disable sends or receives on the socket. + /** + * This function is used to disable send operations, receive operations, or + * both. + * + * @param what Determines what types of operation will no longer be allowed. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * Shutting down the send side of the socket: + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::error_code ec; + * socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID shutdown(shutdown_type what, + asio::error_code& ec) + { + impl_.get_service().shutdown(impl_.get_implementation(), what, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Wait for the socket to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for a socket to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired socket state. + * + * @par Example + * Waiting for a socket to become readable. + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * socket.wait(asio::ip::tcp::socket::wait_read); + * @endcode + */ + void wait(wait_type w) + { + asio::error_code ec; + impl_.get_service().wait(impl_.get_implementation(), w, ec); + asio::detail::throw_error(ec, "wait"); + } + + /// Wait for the socket to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for a socket to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired socket state. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * Waiting for a socket to become readable. + * @code + * asio::ip::tcp::socket socket(my_context); + * ... + * asio::error_code ec; + * socket.wait(asio::ip::tcp::socket::wait_read, ec); + * @endcode + */ + ASIO_SYNC_OP_VOID wait(wait_type w, asio::error_code& ec) + { + impl_.get_service().wait(impl_.get_implementation(), w, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Asynchronously wait for the socket to become ready to read, ready to + /// write, or to have pending error conditions. + /** + * This function is used to perform an asynchronous wait for a socket to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired socket state. + * + * @param handler The handler to be called when the wait operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void wait_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Wait succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::socket socket(my_context); + * ... + * socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + * @endcode + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code)) + WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler, + void (asio::error_code)) + async_wait(wait_type w, + ASIO_MOVE_ARG(WaitHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_wait(this), handler, w); + } + +protected: + /// Protected destructor to prevent deletion through this type. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_socket() + { + } + +#if defined(ASIO_WINDOWS_RUNTIME) + detail::io_object_impl< + detail::null_socket_service, Executor> impl_; +#elif defined(ASIO_HAS_IOCP) + detail::io_object_impl< + detail::win_iocp_socket_service, Executor> impl_; +#else + detail::io_object_impl< + detail::reactive_socket_service, Executor> impl_; +#endif + +private: + // Disallow copying and assignment. + basic_socket(const basic_socket&) ASIO_DELETED; + basic_socket& operator=(const basic_socket&) ASIO_DELETED; + + class initiate_async_connect + { + public: + typedef Executor executor_type; + + explicit initiate_async_connect(basic_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ConnectHandler) handler, + const endpoint_type& peer_endpoint, + const asio::error_code& open_ec) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ConnectHandler. + ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check; + + if (open_ec) + { + asio::post(self_->impl_.get_executor(), + asio::detail::bind_handler( + ASIO_MOVE_CAST(ConnectHandler)(handler), open_ec)); + } + else + { + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_connect( + self_->impl_.get_implementation(), peer_endpoint, + handler2.value, self_->impl_.get_executor()); + } + } + + private: + basic_socket* self_; + }; + + class initiate_async_wait + { + public: + typedef Executor executor_type; + + explicit initiate_async_wait(basic_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WaitHandler) handler, wait_type w) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WaitHandler. + ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_wait( + self_->impl_.get_implementation(), w, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_socket* self_; + }; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_SOCKET_HPP diff --git a/include/asio/include/asio/basic_socket_acceptor.hpp b/include/asio/include/asio/basic_socket_acceptor.hpp new file mode 100644 index 0000000..89a83f3 --- /dev/null +++ b/include/asio/include/asio/basic_socket_acceptor.hpp @@ -0,0 +1,2501 @@ +// +// basic_socket_acceptor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SOCKET_ACCEPTOR_HPP +#define ASIO_BASIC_SOCKET_ACCEPTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/any_io_executor.hpp" +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/io_object_impl.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/socket_base.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) +# include "asio/detail/null_socket_service.hpp" +#elif defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_socket_service.hpp" +#else +# include "asio/detail/reactive_socket_service.hpp" +#endif + +#if defined(ASIO_HAS_MOVE) +# include +#endif // defined(ASIO_HAS_MOVE) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if !defined(ASIO_BASIC_SOCKET_ACCEPTOR_FWD_DECL) +#define ASIO_BASIC_SOCKET_ACCEPTOR_FWD_DECL + +// Forward declaration with defaulted arguments. +template +class basic_socket_acceptor; + +#endif // !defined(ASIO_BASIC_SOCKET_ACCEPTOR_FWD_DECL) + +/// Provides the ability to accept new connections. +/** + * The basic_socket_acceptor class template is used for accepting new socket + * connections. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Example + * Opening a socket acceptor with the SO_REUSEADDR option enabled: + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port); + * acceptor.open(endpoint.protocol()); + * acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true)); + * acceptor.bind(endpoint); + * acceptor.listen(); + * @endcode + */ +template +class basic_socket_acceptor + : public socket_base +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the acceptor type to another executor. + template + struct rebind_executor + { + /// The socket type when rebound to the specified executor. + typedef basic_socket_acceptor other; + }; + + /// The native representation of an acceptor. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#elif defined(ASIO_WINDOWS_RUNTIME) + typedef typename detail::null_socket_service< + Protocol>::native_handle_type native_handle_type; +#elif defined(ASIO_HAS_IOCP) + typedef typename detail::win_iocp_socket_service< + Protocol>::native_handle_type native_handle_type; +#else + typedef typename detail::reactive_socket_service< + Protocol>::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct an acceptor without opening it. + /** + * This constructor creates an acceptor without opening it to listen for new + * connections. The open() function must be called before the acceptor can + * accept new socket connections. + * + * @param ex The I/O executor that the acceptor will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + */ + explicit basic_socket_acceptor(const executor_type& ex) + : impl_(ex) + { + } + + /// Construct an acceptor without opening it. + /** + * This constructor creates an acceptor without opening it to listen for new + * connections. The open() function must be called before the acceptor can + * accept new socket connections. + * + * @param context An execution context which provides the I/O executor that + * the acceptor will use, by default, to dispatch handlers for any + * asynchronous operations performed on the acceptor. + */ + template + explicit basic_socket_acceptor(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + } + + /// Construct an open acceptor. + /** + * This constructor creates an acceptor and automatically opens it. + * + * @param ex The I/O executor that the acceptor will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket_acceptor(const executor_type& ex, const protocol_type& protocol) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct an open acceptor. + /** + * This constructor creates an acceptor and automatically opens it. + * + * @param context An execution context which provides the I/O executor that + * the acceptor will use, by default, to dispatch handlers for any + * asynchronous operations performed on the acceptor. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_socket_acceptor(ExecutionContext& context, + const protocol_type& protocol, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct an acceptor opened on the given endpoint. + /** + * This constructor creates an acceptor and automatically opens it to listen + * for new connections on the specified endpoint. + * + * @param ex The I/O executor that the acceptor will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + * + * @param endpoint An endpoint on the local machine on which the acceptor + * will listen for new connections. + * + * @param reuse_addr Whether the constructor should set the socket option + * socket_base::reuse_address. + * + * @throws asio::system_error Thrown on failure. + * + * @note This constructor is equivalent to the following code: + * @code + * basic_socket_acceptor acceptor(my_context); + * acceptor.open(endpoint.protocol()); + * if (reuse_addr) + * acceptor.set_option(socket_base::reuse_address(true)); + * acceptor.bind(endpoint); + * acceptor.listen(); + * @endcode + */ + basic_socket_acceptor(const executor_type& ex, + const endpoint_type& endpoint, bool reuse_addr = true) + : impl_(ex) + { + asio::error_code ec; + const protocol_type protocol = endpoint.protocol(); + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + if (reuse_addr) + { + impl_.get_service().set_option(impl_.get_implementation(), + socket_base::reuse_address(true), ec); + asio::detail::throw_error(ec, "set_option"); + } + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + impl_.get_service().listen(impl_.get_implementation(), + socket_base::max_listen_connections, ec); + asio::detail::throw_error(ec, "listen"); + } + + /// Construct an acceptor opened on the given endpoint. + /** + * This constructor creates an acceptor and automatically opens it to listen + * for new connections on the specified endpoint. + * + * @param context An execution context which provides the I/O executor that + * the acceptor will use, by default, to dispatch handlers for any + * asynchronous operations performed on the acceptor. + * + * @param endpoint An endpoint on the local machine on which the acceptor + * will listen for new connections. + * + * @param reuse_addr Whether the constructor should set the socket option + * socket_base::reuse_address. + * + * @throws asio::system_error Thrown on failure. + * + * @note This constructor is equivalent to the following code: + * @code + * basic_socket_acceptor acceptor(my_context); + * acceptor.open(endpoint.protocol()); + * if (reuse_addr) + * acceptor.set_option(socket_base::reuse_address(true)); + * acceptor.bind(endpoint); + * acceptor.listen(); + * @endcode + */ + template + basic_socket_acceptor(ExecutionContext& context, + const endpoint_type& endpoint, bool reuse_addr = true, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + const protocol_type protocol = endpoint.protocol(); + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + if (reuse_addr) + { + impl_.get_service().set_option(impl_.get_implementation(), + socket_base::reuse_address(true), ec); + asio::detail::throw_error(ec, "set_option"); + } + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + impl_.get_service().listen(impl_.get_implementation(), + socket_base::max_listen_connections, ec); + asio::detail::throw_error(ec, "listen"); + } + + /// Construct a basic_socket_acceptor on an existing native acceptor. + /** + * This constructor creates an acceptor object to hold an existing native + * acceptor. + * + * @param ex The I/O executor that the acceptor will use, by default, to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_acceptor A native acceptor. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket_acceptor(const executor_type& ex, + const protocol_type& protocol, const native_handle_type& native_acceptor) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_acceptor, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Construct a basic_socket_acceptor on an existing native acceptor. + /** + * This constructor creates an acceptor object to hold an existing native + * acceptor. + * + * @param context An execution context which provides the I/O executor that + * the acceptor will use, by default, to dispatch handlers for any + * asynchronous operations performed on the acceptor. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_acceptor A native acceptor. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_socket_acceptor(ExecutionContext& context, + const protocol_type& protocol, const native_handle_type& native_acceptor, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_acceptor, ec); + asio::detail::throw_error(ec, "assign"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_socket_acceptor from another. + /** + * This constructor moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket_acceptor(const executor_type&) + * constructor. + */ + basic_socket_acceptor(basic_socket_acceptor&& other) ASIO_NOEXCEPT + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_socket_acceptor from another. + /** + * This assignment operator moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket_acceptor(const executor_type&) + * constructor. + */ + basic_socket_acceptor& operator=(basic_socket_acceptor&& other) + { + impl_ = std::move(other.impl_); + return *this; + } + + // All socket acceptors have access to each other's implementations. + template + friend class basic_socket_acceptor; + + /// Move-construct a basic_socket_acceptor from an acceptor of another + /// protocol type. + /** + * This constructor moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket_acceptor(const executor_type&) + * constructor. + */ + template + basic_socket_acceptor(basic_socket_acceptor&& other, + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0) + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_socket_acceptor from an acceptor of another protocol + /// type. + /** + * This assignment operator moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket_acceptor(const executor_type&) + * constructor. + */ + template + typename enable_if< + is_convertible::value + && is_convertible::value, + basic_socket_acceptor& + >::type operator=(basic_socket_acceptor&& other) + { + basic_socket_acceptor tmp(std::move(other)); + impl_ = std::move(tmp.impl_); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the acceptor. + /** + * This function destroys the acceptor, cancelling any outstanding + * asynchronous operations associated with the acceptor as if by calling + * @c cancel. + */ + ~basic_socket_acceptor() + { + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return impl_.get_executor(); + } + + /// Open the acceptor using the specified protocol. + /** + * This function opens the socket acceptor so that it will use the specified + * protocol. + * + * @param protocol An object specifying which protocol is to be used. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * acceptor.open(asio::ip::tcp::v4()); + * @endcode + */ + void open(const protocol_type& protocol = protocol_type()) + { + asio::error_code ec; + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Open the acceptor using the specified protocol. + /** + * This function opens the socket acceptor so that it will use the specified + * protocol. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * asio::error_code ec; + * acceptor.open(asio::ip::tcp::v4(), ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID open(const protocol_type& protocol, + asio::error_code& ec) + { + impl_.get_service().open(impl_.get_implementation(), protocol, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Assigns an existing native acceptor to the acceptor. + /* + * This function opens the acceptor to hold an existing native acceptor. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_acceptor A native acceptor. + * + * @throws asio::system_error Thrown on failure. + */ + void assign(const protocol_type& protocol, + const native_handle_type& native_acceptor) + { + asio::error_code ec; + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_acceptor, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Assigns an existing native acceptor to the acceptor. + /* + * This function opens the acceptor to hold an existing native acceptor. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_acceptor A native acceptor. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID assign(const protocol_type& protocol, + const native_handle_type& native_acceptor, asio::error_code& ec) + { + impl_.get_service().assign(impl_.get_implementation(), + protocol, native_acceptor, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Determine whether the acceptor is open. + bool is_open() const + { + return impl_.get_service().is_open(impl_.get_implementation()); + } + + /// Bind the acceptor to the given local endpoint. + /** + * This function binds the socket acceptor to the specified endpoint on the + * local machine. + * + * @param endpoint An endpoint on the local machine to which the socket + * acceptor will be bound. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); + * acceptor.open(endpoint.protocol()); + * acceptor.bind(endpoint); + * @endcode + */ + void bind(const endpoint_type& endpoint) + { + asio::error_code ec; + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + } + + /// Bind the acceptor to the given local endpoint. + /** + * This function binds the socket acceptor to the specified endpoint on the + * local machine. + * + * @param endpoint An endpoint on the local machine to which the socket + * acceptor will be bound. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); + * acceptor.open(endpoint.protocol()); + * asio::error_code ec; + * acceptor.bind(endpoint, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID bind(const endpoint_type& endpoint, + asio::error_code& ec) + { + impl_.get_service().bind(impl_.get_implementation(), endpoint, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Place the acceptor into the state where it will listen for new + /// connections. + /** + * This function puts the socket acceptor into the state where it may accept + * new connections. + * + * @param backlog The maximum length of the queue of pending connections. + * + * @throws asio::system_error Thrown on failure. + */ + void listen(int backlog = socket_base::max_listen_connections) + { + asio::error_code ec; + impl_.get_service().listen(impl_.get_implementation(), backlog, ec); + asio::detail::throw_error(ec, "listen"); + } + + /// Place the acceptor into the state where it will listen for new + /// connections. + /** + * This function puts the socket acceptor into the state where it may accept + * new connections. + * + * @param backlog The maximum length of the queue of pending connections. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::error_code ec; + * acceptor.listen(asio::socket_base::max_listen_connections, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID listen(int backlog, asio::error_code& ec) + { + impl_.get_service().listen(impl_.get_implementation(), backlog, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Close the acceptor. + /** + * This function is used to close the acceptor. Any asynchronous accept + * operations will be cancelled immediately. + * + * A subsequent call to open() is required before the acceptor can again be + * used to again perform socket accept operations. + * + * @throws asio::system_error Thrown on failure. + */ + void close() + { + asio::error_code ec; + impl_.get_service().close(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "close"); + } + + /// Close the acceptor. + /** + * This function is used to close the acceptor. Any asynchronous accept + * operations will be cancelled immediately. + * + * A subsequent call to open() is required before the acceptor can again be + * used to again perform socket accept operations. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::error_code ec; + * acceptor.close(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + ASIO_SYNC_OP_VOID close(asio::error_code& ec) + { + impl_.get_service().close(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Release ownership of the underlying native acceptor. + /** + * This function causes all outstanding asynchronous accept operations to + * finish immediately, and the handlers for cancelled operations will be + * passed the asio::error::operation_aborted error. Ownership of the + * native acceptor is then transferred to the caller. + * + * @throws asio::system_error Thrown on failure. + * + * @note This function is unsupported on Windows versions prior to Windows + * 8.1, and will fail with asio::error::operation_not_supported on + * these platforms. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) + __declspec(deprecated("This function always fails with " + "operation_not_supported when used on Windows versions " + "prior to Windows 8.1.")) +#endif + native_handle_type release() + { + asio::error_code ec; + native_handle_type s = impl_.get_service().release( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "release"); + return s; + } + + /// Release ownership of the underlying native acceptor. + /** + * This function causes all outstanding asynchronous accept operations to + * finish immediately, and the handlers for cancelled operations will be + * passed the asio::error::operation_aborted error. Ownership of the + * native acceptor is then transferred to the caller. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note This function is unsupported on Windows versions prior to Windows + * 8.1, and will fail with asio::error::operation_not_supported on + * these platforms. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603) + __declspec(deprecated("This function always fails with " + "operation_not_supported when used on Windows versions " + "prior to Windows 8.1.")) +#endif + native_handle_type release(asio::error_code& ec) + { + return impl_.get_service().release(impl_.get_implementation(), ec); + } + + /// Get the native acceptor representation. + /** + * This function may be used to obtain the underlying representation of the + * acceptor. This is intended to allow access to native acceptor functionality + * that is not otherwise provided. + */ + native_handle_type native_handle() + { + return impl_.get_service().native_handle(impl_.get_implementation()); + } + + /// Cancel all asynchronous operations associated with the acceptor. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + */ + void cancel() + { + asio::error_code ec; + impl_.get_service().cancel(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all asynchronous operations associated with the acceptor. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + */ + ASIO_SYNC_OP_VOID cancel(asio::error_code& ec) + { + impl_.get_service().cancel(impl_.get_implementation(), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Set an option on the acceptor. + /** + * This function is used to set an option on the acceptor. + * + * @param option The new option value to be set on the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @sa SettableSocketOption @n + * asio::socket_base::reuse_address + * asio::socket_base::enable_connection_aborted + * + * @par Example + * Setting the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option(true); + * acceptor.set_option(option); + * @endcode + */ + template + void set_option(const SettableSocketOption& option) + { + asio::error_code ec; + impl_.get_service().set_option(impl_.get_implementation(), option, ec); + asio::detail::throw_error(ec, "set_option"); + } + + /// Set an option on the acceptor. + /** + * This function is used to set an option on the acceptor. + * + * @param option The new option value to be set on the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa SettableSocketOption @n + * asio::socket_base::reuse_address + * asio::socket_base::enable_connection_aborted + * + * @par Example + * Setting the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option(true); + * asio::error_code ec; + * acceptor.set_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + ASIO_SYNC_OP_VOID set_option(const SettableSocketOption& option, + asio::error_code& ec) + { + impl_.get_service().set_option(impl_.get_implementation(), option, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Get an option from the acceptor. + /** + * This function is used to get the current value of an option on the + * acceptor. + * + * @param option The option value to be obtained from the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @sa GettableSocketOption @n + * asio::socket_base::reuse_address + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option; + * acceptor.get_option(option); + * bool is_set = option.get(); + * @endcode + */ + template + void get_option(GettableSocketOption& option) const + { + asio::error_code ec; + impl_.get_service().get_option(impl_.get_implementation(), option, ec); + asio::detail::throw_error(ec, "get_option"); + } + + /// Get an option from the acceptor. + /** + * This function is used to get the current value of an option on the + * acceptor. + * + * @param option The option value to be obtained from the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa GettableSocketOption @n + * asio::socket_base::reuse_address + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option; + * asio::error_code ec; + * acceptor.get_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * bool is_set = option.get(); + * @endcode + */ + template + ASIO_SYNC_OP_VOID get_option(GettableSocketOption& option, + asio::error_code& ec) const + { + impl_.get_service().get_option(impl_.get_implementation(), option, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Perform an IO control command on the acceptor. + /** + * This function is used to execute an IO control command on the acceptor. + * + * @param command The IO control command to be performed on the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @sa IoControlCommand @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::acceptor::non_blocking_io command(true); + * socket.io_control(command); + * @endcode + */ + template + void io_control(IoControlCommand& command) + { + asio::error_code ec; + impl_.get_service().io_control(impl_.get_implementation(), command, ec); + asio::detail::throw_error(ec, "io_control"); + } + + /// Perform an IO control command on the acceptor. + /** + * This function is used to execute an IO control command on the acceptor. + * + * @param command The IO control command to be performed on the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa IoControlCommand @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::acceptor::non_blocking_io command(true); + * asio::error_code ec; + * socket.io_control(command, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + ASIO_SYNC_OP_VOID io_control(IoControlCommand& command, + asio::error_code& ec) + { + impl_.get_service().io_control(impl_.get_implementation(), command, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Gets the non-blocking mode of the acceptor. + /** + * @returns @c true if the acceptor's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + bool non_blocking() const + { + return impl_.get_service().non_blocking(impl_.get_implementation()); + } + + /// Sets the non-blocking mode of the acceptor. + /** + * @param mode If @c true, the acceptor's synchronous operations will fail + * with asio::error::would_block if they are unable to perform the + * requested operation immediately. If @c false, synchronous operations will + * block until complete. + * + * @throws asio::system_error Thrown on failure. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + void non_blocking(bool mode) + { + asio::error_code ec; + impl_.get_service().non_blocking(impl_.get_implementation(), mode, ec); + asio::detail::throw_error(ec, "non_blocking"); + } + + /// Sets the non-blocking mode of the acceptor. + /** + * @param mode If @c true, the acceptor's synchronous operations will fail + * with asio::error::would_block if they are unable to perform the + * requested operation immediately. If @c false, synchronous operations will + * block until complete. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + ASIO_SYNC_OP_VOID non_blocking( + bool mode, asio::error_code& ec) + { + impl_.get_service().non_blocking(impl_.get_implementation(), mode, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Gets the non-blocking mode of the native acceptor implementation. + /** + * This function is used to retrieve the non-blocking mode of the underlying + * native acceptor. This mode has no effect on the behaviour of the acceptor + * object's synchronous operations. + * + * @returns @c true if the underlying acceptor is in non-blocking mode and + * direct system calls may fail with asio::error::would_block (or the + * equivalent system error). + * + * @note The current non-blocking mode is cached by the acceptor object. + * Consequently, the return value may be incorrect if the non-blocking mode + * was set directly on the native acceptor. + */ + bool native_non_blocking() const + { + return impl_.get_service().native_non_blocking(impl_.get_implementation()); + } + + /// Sets the non-blocking mode of the native acceptor implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native acceptor. It has no effect on the behaviour of the acceptor object's + * synchronous operations. + * + * @param mode If @c true, the underlying acceptor is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @throws asio::system_error Thrown on failure. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + */ + void native_non_blocking(bool mode) + { + asio::error_code ec; + impl_.get_service().native_non_blocking( + impl_.get_implementation(), mode, ec); + asio::detail::throw_error(ec, "native_non_blocking"); + } + + /// Sets the non-blocking mode of the native acceptor implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native acceptor. It has no effect on the behaviour of the acceptor object's + * synchronous operations. + * + * @param mode If @c true, the underlying acceptor is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @param ec Set to indicate what error occurred, if any. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + */ + ASIO_SYNC_OP_VOID native_non_blocking( + bool mode, asio::error_code& ec) + { + impl_.get_service().native_non_blocking( + impl_.get_implementation(), mode, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Get the local endpoint of the acceptor. + /** + * This function is used to obtain the locally bound endpoint of the acceptor. + * + * @returns An object that represents the local endpoint of the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(); + * @endcode + */ + endpoint_type local_endpoint() const + { + asio::error_code ec; + endpoint_type ep = impl_.get_service().local_endpoint( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "local_endpoint"); + return ep; + } + + /// Get the local endpoint of the acceptor. + /** + * This function is used to obtain the locally bound endpoint of the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns An object that represents the local endpoint of the acceptor. + * Returns a default-constructed endpoint object if an error occurred and the + * error handler did not throw an exception. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::error_code ec; + * asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + endpoint_type local_endpoint(asio::error_code& ec) const + { + return impl_.get_service().local_endpoint(impl_.get_implementation(), ec); + } + + /// Wait for the acceptor to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for an acceptor to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired acceptor state. + * + * @par Example + * Waiting for an acceptor to become readable. + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * acceptor.wait(asio::ip::tcp::acceptor::wait_read); + * @endcode + */ + void wait(wait_type w) + { + asio::error_code ec; + impl_.get_service().wait(impl_.get_implementation(), w, ec); + asio::detail::throw_error(ec, "wait"); + } + + /// Wait for the acceptor to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for an acceptor to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired acceptor state. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * Waiting for an acceptor to become readable. + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::error_code ec; + * acceptor.wait(asio::ip::tcp::acceptor::wait_read, ec); + * @endcode + */ + ASIO_SYNC_OP_VOID wait(wait_type w, asio::error_code& ec) + { + impl_.get_service().wait(impl_.get_implementation(), w, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Asynchronously wait for the acceptor to become ready to read, ready to + /// write, or to have pending error conditions. + /** + * This function is used to perform an asynchronous wait for an acceptor to + * enter a ready to read, write or error condition state. + * + * @param w Specifies the desired acceptor state. + * + * @param handler The handler to be called when the wait operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void wait_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Wait succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * acceptor.async_wait( + * asio::ip::tcp::acceptor::wait_read, + * wait_handler); + * @endcode + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code)) + WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler, + void (asio::error_code)) + async_wait(wait_type w, + ASIO_MOVE_ARG(WaitHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_wait(this), handler, w); + } + +#if !defined(ASIO_NO_EXTENSIONS) + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer into the + * given socket. The function call will block until a new connection has been + * accepted successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(my_context); + * acceptor.accept(socket); + * @endcode + */ + template + void accept(basic_socket& peer, + typename enable_if< + is_convertible::value + >::type* = 0) + { + asio::error_code ec; + impl_.get_service().accept(impl_.get_implementation(), + peer, static_cast(0), ec); + asio::detail::throw_error(ec, "accept"); + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer into the + * given socket. The function call will block until a new connection has been + * accepted successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(my_context); + * asio::error_code ec; + * acceptor.accept(socket, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + ASIO_SYNC_OP_VOID accept( + basic_socket& peer, asio::error_code& ec, + typename enable_if< + is_convertible::value + >::type* = 0) + { + impl_.get_service().accept(impl_.get_implementation(), + peer, static_cast(0), ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection into a + * socket. The function call always returns immediately. + * + * @param peer The socket into which the new connection will be accepted. + * Ownership of the peer object is retained by the caller, which must + * guarantee that it is valid until the handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(my_context); + * acceptor.async_accept(socket, accept_handler); + * @endcode + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(AcceptHandler, + void (asio::error_code)) + async_accept(basic_socket& peer, + ASIO_MOVE_ARG(AcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), + typename enable_if< + is_convertible::value + >::type* = 0) + { + return async_initiate( + initiate_async_accept(this), handler, + &peer, static_cast(0)); + } + + /// Accept a new connection and obtain the endpoint of the peer + /** + * This function is used to accept a new connection from a peer into the + * given socket, and additionally provide the endpoint of the remote peer. + * The function call will block until a new connection has been accepted + * successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @param peer_endpoint An endpoint object which will receive the endpoint of + * the remote peer. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(my_context); + * asio::ip::tcp::endpoint endpoint; + * acceptor.accept(socket, endpoint); + * @endcode + */ + template + void accept(basic_socket& peer, + endpoint_type& peer_endpoint) + { + asio::error_code ec; + impl_.get_service().accept(impl_.get_implementation(), + peer, &peer_endpoint, ec); + asio::detail::throw_error(ec, "accept"); + } + + /// Accept a new connection and obtain the endpoint of the peer + /** + * This function is used to accept a new connection from a peer into the + * given socket, and additionally provide the endpoint of the remote peer. + * The function call will block until a new connection has been accepted + * successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @param peer_endpoint An endpoint object which will receive the endpoint of + * the remote peer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(my_context); + * asio::ip::tcp::endpoint endpoint; + * asio::error_code ec; + * acceptor.accept(socket, endpoint, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + ASIO_SYNC_OP_VOID accept(basic_socket& peer, + endpoint_type& peer_endpoint, asio::error_code& ec) + { + impl_.get_service().accept( + impl_.get_implementation(), peer, &peer_endpoint, ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection into a + * socket, and additionally obtain the endpoint of the remote peer. The + * function call always returns immediately. + * + * @param peer The socket into which the new connection will be accepted. + * Ownership of the peer object is retained by the caller, which must + * guarantee that it is valid until the handler is called. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. Ownership of the peer_endpoint object is + * retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(AcceptHandler, + void (asio::error_code)) + async_accept(basic_socket& peer, + endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(AcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_accept(this), handler, &peer, &peer_endpoint); + } +#endif // !defined(ASIO_NO_EXTENSIONS) + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept()); + * @endcode + */ + typename Protocol::socket::template rebind_executor::other + accept() + { + asio::error_code ec; + typename Protocol::socket::template rebind_executor< + executor_type>::other peer(impl_.get_executor()); + impl_.get_service().accept(impl_.get_implementation(), peer, 0, ec); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept(ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + typename Protocol::socket::template rebind_executor::other + accept(asio::error_code& ec) + { + typename Protocol::socket::template rebind_executor< + executor_type>::other peer(impl_.get_executor()); + impl_.get_service().accept(impl_.get_implementation(), peer, 0, ec); + return peer; + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. + * const asio::error_code& error, + * // On success, the newly accepted socket. + * typename Protocol::socket::template + * rebind_executor::other peer + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * acceptor.async_accept(accept_handler); + * @endcode + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + typename Protocol::socket::template rebind_executor< + executor_type>::other)) MoveAcceptHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, + typename Protocol::socket::template + rebind_executor::other)) + async_accept( + ASIO_MOVE_ARG(MoveAcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate::other)>( + initiate_async_move_accept(this), handler, + impl_.get_executor(), static_cast(0), + static_cast::other*>(0)); + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ex The I/O executor object to be used for the newly + * accepted socket. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept()); + * @endcode + */ + template + typename Protocol::socket::template rebind_executor::other + accept(const Executor1& ex, + typename enable_if< + is_executor::value + || execution::is_executor::value + >::type* = 0) + { + asio::error_code ec; + typename Protocol::socket::template + rebind_executor::other peer(ex); + impl_.get_service().accept(impl_.get_implementation(), peer, 0, ec); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param context The I/O execution context object to be used for the newly + * accepted socket. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept()); + * @endcode + */ + template + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other + accept(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + { + asio::error_code ec; + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other peer(context); + impl_.get_service().accept(impl_.get_implementation(), peer, 0, ec); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ex The I/O executor object to be used for the newly accepted + * socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + typename Protocol::socket::template rebind_executor::other + accept(const Executor1& ex, asio::error_code& ec, + typename enable_if< + is_executor::value + || execution::is_executor::value + >::type* = 0) + { + typename Protocol::socket::template + rebind_executor::other peer(ex); + impl_.get_service().accept(impl_.get_implementation(), peer, 0, ec); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param context The I/O execution context object to be used for the newly + * accepted socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept(my_context2, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other + accept(ExecutionContext& context, asio::error_code& ec, + typename enable_if< + is_convertible::value + >::type* = 0) + { + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other peer(context); + impl_.get_service().accept(impl_.get_implementation(), peer, 0, ec); + return peer; + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ex The I/O executor object to be used for the newly accepted + * socket. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket::template rebind_executor< + * Executor1>::other peer // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * acceptor.async_accept(my_context2, accept_handler); + * @endcode + */ + template ::other)) MoveAcceptHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, + typename Protocol::socket::template rebind_executor< + Executor1>::other)) + async_accept(const Executor1& ex, + ASIO_MOVE_ARG(MoveAcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), + typename enable_if< + is_executor::value + || execution::is_executor::value + >::type* = 0) + { + typedef typename Protocol::socket::template rebind_executor< + Executor1>::other other_socket_type; + + return async_initiate( + initiate_async_move_accept(this), handler, + ex, static_cast(0), + static_cast(0)); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param context The I/O execution context object to be used for the newly + * accepted socket. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket::template rebind_executor< + * typename ExecutionContext::executor_type>::other peer + * // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * acceptor.async_accept(my_context2, accept_handler); + * @endcode + */ + template ::other)) MoveAcceptHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other)) + async_accept(ExecutionContext& context, + ASIO_MOVE_ARG(MoveAcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), + typename enable_if< + is_convertible::value + >::type* = 0) + { + typedef typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other other_socket_type; + + return async_initiate( + initiate_async_move_accept(this), handler, + context.get_executor(), static_cast(0), + static_cast(0)); + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket(acceptor.accept(endpoint)); + * @endcode + */ + typename Protocol::socket::template rebind_executor::other + accept(endpoint_type& peer_endpoint) + { + asio::error_code ec; + typename Protocol::socket::template rebind_executor< + executor_type>::other peer(impl_.get_executor()); + impl_.get_service().accept(impl_.get_implementation(), + peer, &peer_endpoint, ec); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket(acceptor.accept(endpoint, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + typename Protocol::socket::template rebind_executor::other + accept(endpoint_type& peer_endpoint, asio::error_code& ec) + { + typename Protocol::socket::template rebind_executor< + executor_type>::other peer(impl_.get_executor()); + impl_.get_service().accept(impl_.get_implementation(), + peer, &peer_endpoint, ec); + return peer; + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. Ownership of the peer_endpoint object is + * retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. + * const asio::error_code& error, + * // On success, the newly accepted socket. + * typename Protocol::socket::template + * rebind_executor::other peer + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * acceptor.async_accept(endpoint, accept_handler); + * @endcode + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + typename Protocol::socket::template rebind_executor< + executor_type>::other)) MoveAcceptHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, + typename Protocol::socket::template + rebind_executor::other)) + async_accept(endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(MoveAcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate::other)>( + initiate_async_move_accept(this), handler, + impl_.get_executor(), &peer_endpoint, + static_cast::other*>(0)); + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ex The I/O executor object to be used for the newly accepted + * socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket( + * acceptor.accept(my_context2, endpoint)); + * @endcode + */ + template + typename Protocol::socket::template rebind_executor::other + accept(const Executor1& ex, endpoint_type& peer_endpoint, + typename enable_if< + is_executor::value + || execution::is_executor::value + >::type* = 0) + { + asio::error_code ec; + typename Protocol::socket::template + rebind_executor::other peer(ex); + impl_.get_service().accept(impl_.get_implementation(), + peer, &peer_endpoint, ec); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param context The I/O execution context object to be used for the newly + * accepted socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket( + * acceptor.accept(my_context2, endpoint)); + * @endcode + */ + template + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other + accept(ExecutionContext& context, endpoint_type& peer_endpoint, + typename enable_if< + is_convertible::value + >::type* = 0) + { + asio::error_code ec; + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other peer(context); + impl_.get_service().accept(impl_.get_implementation(), + peer, &peer_endpoint, ec); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ex The I/O executor object to be used for the newly accepted + * socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket( + * acceptor.accept(my_context2, endpoint, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + typename Protocol::socket::template rebind_executor::other + accept(const executor_type& ex, + endpoint_type& peer_endpoint, asio::error_code& ec, + typename enable_if< + is_executor::value + || execution::is_executor::value + >::type* = 0) + { + typename Protocol::socket::template + rebind_executor::other peer(ex); + impl_.get_service().accept(impl_.get_implementation(), + peer, &peer_endpoint, ec); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param context The I/O execution context object to be used for the newly + * accepted socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket( + * acceptor.accept(my_context2, endpoint, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other + accept(ExecutionContext& context, + endpoint_type& peer_endpoint, asio::error_code& ec, + typename enable_if< + is_convertible::value + >::type* = 0) + { + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other peer(context); + impl_.get_service().accept(impl_.get_implementation(), + peer, &peer_endpoint, ec); + return peer; + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ex The I/O executor object to be used for the newly accepted + * socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. Ownership of the peer_endpoint object is + * retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket::template rebind_executor< + * Executor1>::other peer // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * acceptor.async_accept(my_context2, endpoint, accept_handler); + * @endcode + */ + template ::other)) MoveAcceptHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, + typename Protocol::socket::template rebind_executor< + Executor1>::other)) + async_accept(const Executor1& ex, endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(MoveAcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), + typename enable_if< + is_executor::value + || execution::is_executor::value + >::type* = 0) + { + typedef typename Protocol::socket::template rebind_executor< + Executor1>::other other_socket_type; + + return async_initiate( + initiate_async_move_accept(this), handler, + ex, &peer_endpoint, + static_cast(0)); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param context The I/O execution context object to be used for the newly + * accepted socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. Ownership of the peer_endpoint object is + * retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket::template rebind_executor< + * typename ExecutionContext::executor_type>::other peer + * // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(my_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * acceptor.async_accept(my_context2, endpoint, accept_handler); + * @endcode + */ + template ::other)) MoveAcceptHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other)) + async_accept(ExecutionContext& context, + endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(MoveAcceptHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), + typename enable_if< + is_convertible::value + >::type* = 0) + { + typedef typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other other_socket_type; + + return async_initiate( + initiate_async_move_accept(this), handler, + context.get_executor(), &peer_endpoint, + static_cast(0)); + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + +private: + // Disallow copying and assignment. + basic_socket_acceptor(const basic_socket_acceptor&) ASIO_DELETED; + basic_socket_acceptor& operator=( + const basic_socket_acceptor&) ASIO_DELETED; + + class initiate_async_wait + { + public: + typedef Executor executor_type; + + explicit initiate_async_wait(basic_socket_acceptor* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WaitHandler) handler, wait_type w) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WaitHandler. + ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_wait( + self_->impl_.get_implementation(), w, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_socket_acceptor* self_; + }; + + class initiate_async_accept + { + public: + typedef Executor executor_type; + + explicit initiate_async_accept(basic_socket_acceptor* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(AcceptHandler) handler, + basic_socket* peer, + endpoint_type* peer_endpoint) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a AcceptHandler. + ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_accept( + self_->impl_.get_implementation(), *peer, peer_endpoint, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_socket_acceptor* self_; + }; + + class initiate_async_move_accept + { + public: + typedef Executor executor_type; + + explicit initiate_async_move_accept(basic_socket_acceptor* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(MoveAcceptHandler) handler, + const Executor1& peer_ex, endpoint_type* peer_endpoint, Socket*) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a MoveAcceptHandler. + ASIO_MOVE_ACCEPT_HANDLER_CHECK( + MoveAcceptHandler, handler, Socket) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_move_accept( + self_->impl_.get_implementation(), peer_ex, peer_endpoint, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_socket_acceptor* self_; + }; + +#if defined(ASIO_WINDOWS_RUNTIME) + detail::io_object_impl< + detail::null_socket_service, Executor> impl_; +#elif defined(ASIO_HAS_IOCP) + detail::io_object_impl< + detail::win_iocp_socket_service, Executor> impl_; +#else + detail::io_object_impl< + detail::reactive_socket_service, Executor> impl_; +#endif +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_SOCKET_ACCEPTOR_HPP diff --git a/include/asio/include/asio/basic_socket_iostream.hpp b/include/asio/include/asio/basic_socket_iostream.hpp new file mode 100644 index 0000000..abd35a6 --- /dev/null +++ b/include/asio/include/asio/basic_socket_iostream.hpp @@ -0,0 +1,407 @@ +// +// basic_socket_iostream.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SOCKET_IOSTREAM_HPP +#define ASIO_BASIC_SOCKET_IOSTREAM_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_NO_IOSTREAM) + +#include +#include +#include "asio/basic_socket_streambuf.hpp" + +#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +# include "asio/detail/variadic_templates.hpp" + +// A macro that should expand to: +// template +// explicit basic_socket_iostream(T1 x1, ..., Tn xn) +// : std::basic_iostream( +// &this->detail::socket_iostream_base< +// Protocol, Clock, WaitTraits>::streambuf_) +// { +// if (rdbuf()->connect(x1, ..., xn) == 0) +// this->setstate(std::ios_base::failbit); +// } +// This macro should only persist within this file. + +# define ASIO_PRIVATE_CTR_DEF(n) \ + template \ + explicit basic_socket_iostream(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ + : std::basic_iostream( \ + &this->detail::socket_iostream_base< \ + Protocol, Clock, WaitTraits>::streambuf_) \ + { \ + this->setf(std::ios_base::unitbuf); \ + if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \ + this->setstate(std::ios_base::failbit); \ + } \ + /**/ + +// A macro that should expand to: +// template +// void connect(T1 x1, ..., Tn xn) +// { +// if (rdbuf()->connect(x1, ..., xn) == 0) +// this->setstate(std::ios_base::failbit); +// } +// This macro should only persist within this file. + +# define ASIO_PRIVATE_CONNECT_DEF(n) \ + template \ + void connect(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ + { \ + if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \ + this->setstate(std::ios_base::failbit); \ + } \ + /**/ + +#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// A separate base class is used to ensure that the streambuf is initialised +// prior to the basic_socket_iostream's basic_iostream base class. +template +class socket_iostream_base +{ +protected: + socket_iostream_base() + { + } + +#if defined(ASIO_HAS_MOVE) + socket_iostream_base(socket_iostream_base&& other) + : streambuf_(std::move(other.streambuf_)) + { + } + + socket_iostream_base(basic_stream_socket s) + : streambuf_(std::move(s)) + { + } + + socket_iostream_base& operator=(socket_iostream_base&& other) + { + streambuf_ = std::move(other.streambuf_); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) + + basic_socket_streambuf streambuf_; +}; + +} // namespace detail + +#if !defined(ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL) +#define ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL + +// Forward declaration with defaulted arguments. +template > +#else // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + typename Clock = chrono::steady_clock, + typename WaitTraits = wait_traits > +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) +class basic_socket_iostream; + +#endif // !defined(ASIO_BASIC_SOCKET_IOSTREAM_FWD_DECL) + +/// Iostream interface for a socket. +#if defined(GENERATING_DOCUMENTATION) +template > +#else // defined(GENERATING_DOCUMENTATION) +template +#endif // defined(GENERATING_DOCUMENTATION) +class basic_socket_iostream + : private detail::socket_iostream_base, + public std::basic_iostream +{ +private: + // These typedefs are intended keep this class's implementation independent + // of whether it's using Boost.DateClock, Boost.Chrono or std::chrono. +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + typedef WaitTraits traits_helper; +#else // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + typedef detail::chrono_time_traits traits_helper; +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + +public: + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// The clock type. + typedef Clock clock_type; + +#if defined(GENERATING_DOCUMENTATION) + /// (Deprecated: Use time_point.) The time type. + typedef typename WaitTraits::time_type time_type; + + /// The time type. + typedef typename WaitTraits::time_point time_point; + + /// (Deprecated: Use duration.) The duration type. + typedef typename WaitTraits::duration_type duration_type; + + /// The duration type. + typedef typename WaitTraits::duration duration; +#else +# if !defined(ASIO_NO_DEPRECATED) + typedef typename traits_helper::time_type time_type; + typedef typename traits_helper::duration_type duration_type; +# endif // !defined(ASIO_NO_DEPRECATED) + typedef typename traits_helper::time_type time_point; + typedef typename traits_helper::duration_type duration; +#endif + + /// Construct a basic_socket_iostream without establishing a connection. + basic_socket_iostream() + : std::basic_iostream( + &this->detail::socket_iostream_base< + Protocol, Clock, WaitTraits>::streambuf_) + { + this->setf(std::ios_base::unitbuf); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Construct a basic_socket_iostream from the supplied socket. + explicit basic_socket_iostream(basic_stream_socket s) + : detail::socket_iostream_base< + Protocol, Clock, WaitTraits>(std::move(s)), + std::basic_iostream( + &this->detail::socket_iostream_base< + Protocol, Clock, WaitTraits>::streambuf_) + { + this->setf(std::ios_base::unitbuf); + } + +#if defined(ASIO_HAS_STD_IOSTREAM_MOVE) \ + || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_socket_iostream from another. + basic_socket_iostream(basic_socket_iostream&& other) + : detail::socket_iostream_base< + Protocol, Clock, WaitTraits>(std::move(other)), + std::basic_iostream(std::move(other)) + { + this->set_rdbuf(&this->detail::socket_iostream_base< + Protocol, Clock, WaitTraits>::streambuf_); + } + + /// Move-assign a basic_socket_iostream from another. + basic_socket_iostream& operator=(basic_socket_iostream&& other) + { + std::basic_iostream::operator=(std::move(other)); + detail::socket_iostream_base< + Protocol, Clock, WaitTraits>::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_STD_IOSTREAM_MOVE) + // || defined(GENERATING_DOCUMENTATION) +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + +#if defined(GENERATING_DOCUMENTATION) + /// Establish a connection to an endpoint corresponding to a resolver query. + /** + * This constructor automatically establishes a connection based on the + * supplied resolver query parameters. The arguments are used to construct + * a resolver query object. + */ + template + explicit basic_socket_iostream(T1 t1, ..., TN tn); +#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) + template + explicit basic_socket_iostream(T... x) + : std::basic_iostream( + &this->detail::socket_iostream_base< + Protocol, Clock, WaitTraits>::streambuf_) + { + this->setf(std::ios_base::unitbuf); + if (rdbuf()->connect(x...) == 0) + this->setstate(std::ios_base::failbit); + } +#else + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CTR_DEF) +#endif + +#if defined(GENERATING_DOCUMENTATION) + /// Establish a connection to an endpoint corresponding to a resolver query. + /** + * This function automatically establishes a connection based on the supplied + * resolver query parameters. The arguments are used to construct a resolver + * query object. + */ + template + void connect(T1 t1, ..., TN tn); +#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) + template + void connect(T... x) + { + if (rdbuf()->connect(x...) == 0) + this->setstate(std::ios_base::failbit); + } +#else + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CONNECT_DEF) +#endif + + /// Close the connection. + void close() + { + if (rdbuf()->close() == 0) + this->setstate(std::ios_base::failbit); + } + + /// Return a pointer to the underlying streambuf. + basic_socket_streambuf* rdbuf() const + { + return const_cast*>( + &this->detail::socket_iostream_base< + Protocol, Clock, WaitTraits>::streambuf_); + } + + /// Get a reference to the underlying socket. + basic_socket& socket() + { + return rdbuf()->socket(); + } + + /// Get the last error associated with the stream. + /** + * @return An \c error_code corresponding to the last error from the stream. + * + * @par Example + * To print the error associated with a failure to establish a connection: + * @code tcp::iostream s("www.boost.org", "http"); + * if (!s) + * { + * std::cout << "Error: " << s.error().message() << std::endl; + * } @endcode + */ + const asio::error_code& error() const + { + return rdbuf()->error(); + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use expiry().) Get the stream's expiry time as an absolute + /// time. + /** + * @return An absolute time value representing the stream's expiry time. + */ + time_point expires_at() const + { + return rdbuf()->expires_at(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Get the stream's expiry time as an absolute time. + /** + * @return An absolute time value representing the stream's expiry time. + */ + time_point expiry() const + { + return rdbuf()->expiry(); + } + + /// Set the stream's expiry time as an absolute time. + /** + * This function sets the expiry time associated with the stream. Stream + * operations performed after this time (where the operations cannot be + * completed using the internal buffers) will fail with the error + * asio::error::operation_aborted. + * + * @param expiry_time The expiry time to be used for the stream. + */ + void expires_at(const time_point& expiry_time) + { + rdbuf()->expires_at(expiry_time); + } + + /// Set the stream's expiry time relative to now. + /** + * This function sets the expiry time associated with the stream. Stream + * operations performed after this time (where the operations cannot be + * completed using the internal buffers) will fail with the error + * asio::error::operation_aborted. + * + * @param expiry_time The expiry time to be used for the timer. + */ + void expires_after(const duration& expiry_time) + { + rdbuf()->expires_after(expiry_time); + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use expiry().) Get the stream's expiry time relative to now. + /** + * @return A relative time value representing the stream's expiry time. + */ + duration expires_from_now() const + { + return rdbuf()->expires_from_now(); + } + + /// (Deprecated: Use expires_after().) Set the stream's expiry time relative + /// to now. + /** + * This function sets the expiry time associated with the stream. Stream + * operations performed after this time (where the operations cannot be + * completed using the internal buffers) will fail with the error + * asio::error::operation_aborted. + * + * @param expiry_time The expiry time to be used for the timer. + */ + void expires_from_now(const duration& expiry_time) + { + rdbuf()->expires_from_now(expiry_time); + } +#endif // !defined(ASIO_NO_DEPRECATED) + +private: + // Disallow copying and assignment. + basic_socket_iostream(const basic_socket_iostream&) ASIO_DELETED; + basic_socket_iostream& operator=( + const basic_socket_iostream&) ASIO_DELETED; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) +# undef ASIO_PRIVATE_CTR_DEF +# undef ASIO_PRIVATE_CONNECT_DEF +#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#endif // !defined(ASIO_NO_IOSTREAM) + +#endif // ASIO_BASIC_SOCKET_IOSTREAM_HPP diff --git a/include/asio/include/asio/basic_socket_streambuf.hpp b/include/asio/include/asio/basic_socket_streambuf.hpp new file mode 100644 index 0000000..2b5aad9 --- /dev/null +++ b/include/asio/include/asio/basic_socket_streambuf.hpp @@ -0,0 +1,687 @@ +// +// basic_socket_streambuf.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SOCKET_STREAMBUF_HPP +#define ASIO_BASIC_SOCKET_STREAMBUF_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_NO_IOSTREAM) + +#include +#include +#include "asio/basic_socket.hpp" +#include "asio/basic_stream_socket.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/io_context.hpp" + +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) +# include "asio/detail/deadline_timer_service.hpp" +#else // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) +# include "asio/steady_timer.hpp" +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + +#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +# include "asio/detail/variadic_templates.hpp" + +// A macro that should expand to: +// template +// basic_socket_streambuf* connect(T1 x1, ..., Tn xn) +// { +// init_buffers(); +// typedef typename Protocol::resolver resolver_type; +// resolver_type resolver(socket().get_executor()); +// connect_to_endpoints( +// resolver.resolve(x1, ..., xn, ec_)); +// return !ec_ ? this : 0; +// } +// This macro should only persist within this file. + +# define ASIO_PRIVATE_CONNECT_DEF(n) \ + template \ + basic_socket_streambuf* connect(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ + { \ + init_buffers(); \ + typedef typename Protocol::resolver resolver_type; \ + resolver_type resolver(socket().get_executor()); \ + connect_to_endpoints( \ + resolver.resolve(ASIO_VARIADIC_BYVAL_ARGS(n), ec_)); \ + return !ec_ ? this : 0; \ + } \ + /**/ + +#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// A separate base class is used to ensure that the io_context member is +// initialised prior to the basic_socket_streambuf's basic_socket base class. +class socket_streambuf_io_context +{ +protected: + socket_streambuf_io_context(io_context* ctx) + : default_io_context_(ctx) + { + } + + shared_ptr default_io_context_; +}; + +// A separate base class is used to ensure that the dynamically allocated +// buffers are constructed prior to the basic_socket_streambuf's basic_socket +// base class. This makes moving the socket is the last potentially throwing +// step in the streambuf's move constructor, giving the constructor a strong +// exception safety guarantee. +class socket_streambuf_buffers +{ +protected: + socket_streambuf_buffers() + : get_buffer_(buffer_size), + put_buffer_(buffer_size) + { + } + + enum { buffer_size = 512 }; + std::vector get_buffer_; + std::vector put_buffer_; +}; + +} // namespace detail + +#if !defined(ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL) +#define ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL + +// Forward declaration with defaulted arguments. +template > +#else // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + typename Clock = chrono::steady_clock, + typename WaitTraits = wait_traits > +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) +class basic_socket_streambuf; + +#endif // !defined(ASIO_BASIC_SOCKET_STREAMBUF_FWD_DECL) + +/// Iostream streambuf for a socket. +#if defined(GENERATING_DOCUMENTATION) +template > +#else // defined(GENERATING_DOCUMENTATION) +template +#endif // defined(GENERATING_DOCUMENTATION) +class basic_socket_streambuf + : public std::streambuf, + private detail::socket_streambuf_io_context, + private detail::socket_streambuf_buffers, +#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + private basic_socket +#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + public basic_socket +#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) +{ +private: + // These typedefs are intended keep this class's implementation independent + // of whether it's using Boost.DateClock, Boost.Chrono or std::chrono. +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + typedef WaitTraits traits_helper; +#else // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + typedef detail::chrono_time_traits traits_helper; +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + +public: + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// The clock type. + typedef Clock clock_type; + +#if defined(GENERATING_DOCUMENTATION) + /// (Deprecated: Use time_point.) The time type. + typedef typename WaitTraits::time_type time_type; + + /// The time type. + typedef typename WaitTraits::time_point time_point; + + /// (Deprecated: Use duration.) The duration type. + typedef typename WaitTraits::duration_type duration_type; + + /// The duration type. + typedef typename WaitTraits::duration duration; +#else +# if !defined(ASIO_NO_DEPRECATED) + typedef typename traits_helper::time_type time_type; + typedef typename traits_helper::duration_type duration_type; +# endif // !defined(ASIO_NO_DEPRECATED) + typedef typename traits_helper::time_type time_point; + typedef typename traits_helper::duration_type duration; +#endif + + /// Construct a basic_socket_streambuf without establishing a connection. + basic_socket_streambuf() + : detail::socket_streambuf_io_context(new io_context), + basic_socket(*default_io_context_), + expiry_time_(max_expiry_time()) + { + init_buffers(); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Construct a basic_socket_streambuf from the supplied socket. + explicit basic_socket_streambuf(basic_stream_socket s) + : detail::socket_streambuf_io_context(0), + basic_socket(std::move(s)), + expiry_time_(max_expiry_time()) + { + init_buffers(); + } + + /// Move-construct a basic_socket_streambuf from another. + basic_socket_streambuf(basic_socket_streambuf&& other) + : detail::socket_streambuf_io_context(other), + basic_socket(std::move(other.socket())), + ec_(other.ec_), + expiry_time_(other.expiry_time_) + { + get_buffer_.swap(other.get_buffer_); + put_buffer_.swap(other.put_buffer_); + setg(other.eback(), other.gptr(), other.egptr()); + setp(other.pptr(), other.epptr()); + other.ec_ = asio::error_code(); + other.expiry_time_ = max_expiry_time(); + other.init_buffers(); + } + + /// Move-assign a basic_socket_streambuf from another. + basic_socket_streambuf& operator=(basic_socket_streambuf&& other) + { + this->close(); + socket() = std::move(other.socket()); + detail::socket_streambuf_io_context::operator=(other); + ec_ = other.ec_; + expiry_time_ = other.expiry_time_; + get_buffer_.swap(other.get_buffer_); + put_buffer_.swap(other.put_buffer_); + setg(other.eback(), other.gptr(), other.egptr()); + setp(other.pptr(), other.epptr()); + other.ec_ = asio::error_code(); + other.expiry_time_ = max_expiry_time(); + other.put_buffer_.resize(buffer_size); + other.init_buffers(); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destructor flushes buffered data. + virtual ~basic_socket_streambuf() + { + if (pptr() != pbase()) + overflow(traits_type::eof()); + } + + /// Establish a connection. + /** + * This function establishes a connection to the specified endpoint. + * + * @return \c this if a connection was successfully established, a null + * pointer otherwise. + */ + basic_socket_streambuf* connect(const endpoint_type& endpoint) + { + init_buffers(); + ec_ = asio::error_code(); + this->connect_to_endpoints(&endpoint, &endpoint + 1); + return !ec_ ? this : 0; + } + +#if defined(GENERATING_DOCUMENTATION) + /// Establish a connection. + /** + * This function automatically establishes a connection based on the supplied + * resolver query parameters. The arguments are used to construct a resolver + * query object. + * + * @return \c this if a connection was successfully established, a null + * pointer otherwise. + */ + template + basic_socket_streambuf* connect(T1 t1, ..., TN tn); +#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) + template + basic_socket_streambuf* connect(T... x) + { + init_buffers(); + typedef typename Protocol::resolver resolver_type; + resolver_type resolver(socket().get_executor()); + connect_to_endpoints(resolver.resolve(x..., ec_)); + return !ec_ ? this : 0; + } +#else + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CONNECT_DEF) +#endif + + /// Close the connection. + /** + * @return \c this if a connection was successfully established, a null + * pointer otherwise. + */ + basic_socket_streambuf* close() + { + sync(); + socket().close(ec_); + if (!ec_) + init_buffers(); + return !ec_ ? this : 0; + } + + /// Get a reference to the underlying socket. + basic_socket& socket() + { + return *this; + } + + /// Get the last error associated with the stream buffer. + /** + * @return An \c error_code corresponding to the last error from the stream + * buffer. + */ + const asio::error_code& error() const + { + return ec_; + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use error().) Get the last error associated with the stream + /// buffer. + /** + * @return An \c error_code corresponding to the last error from the stream + * buffer. + */ + const asio::error_code& puberror() const + { + return error(); + } + + /// (Deprecated: Use expiry().) Get the stream buffer's expiry time as an + /// absolute time. + /** + * @return An absolute time value representing the stream buffer's expiry + * time. + */ + time_point expires_at() const + { + return expiry_time_; + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Get the stream buffer's expiry time as an absolute time. + /** + * @return An absolute time value representing the stream buffer's expiry + * time. + */ + time_point expiry() const + { + return expiry_time_; + } + + /// Set the stream buffer's expiry time as an absolute time. + /** + * This function sets the expiry time associated with the stream. Stream + * operations performed after this time (where the operations cannot be + * completed using the internal buffers) will fail with the error + * asio::error::operation_aborted. + * + * @param expiry_time The expiry time to be used for the stream. + */ + void expires_at(const time_point& expiry_time) + { + expiry_time_ = expiry_time; + } + + /// Set the stream buffer's expiry time relative to now. + /** + * This function sets the expiry time associated with the stream. Stream + * operations performed after this time (where the operations cannot be + * completed using the internal buffers) will fail with the error + * asio::error::operation_aborted. + * + * @param expiry_time The expiry time to be used for the timer. + */ + void expires_after(const duration& expiry_time) + { + expiry_time_ = traits_helper::add(traits_helper::now(), expiry_time); + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use expiry().) Get the stream buffer's expiry time relative + /// to now. + /** + * @return A relative time value representing the stream buffer's expiry time. + */ + duration expires_from_now() const + { + return traits_helper::subtract(expires_at(), traits_helper::now()); + } + + /// (Deprecated: Use expires_after().) Set the stream buffer's expiry time + /// relative to now. + /** + * This function sets the expiry time associated with the stream. Stream + * operations performed after this time (where the operations cannot be + * completed using the internal buffers) will fail with the error + * asio::error::operation_aborted. + * + * @param expiry_time The expiry time to be used for the timer. + */ + void expires_from_now(const duration& expiry_time) + { + expiry_time_ = traits_helper::add(traits_helper::now(), expiry_time); + } +#endif // !defined(ASIO_NO_DEPRECATED) + +protected: + int_type underflow() + { +#if defined(ASIO_WINDOWS_RUNTIME) + ec_ = asio::error::operation_not_supported; + return traits_type::eof(); +#else // defined(ASIO_WINDOWS_RUNTIME) + if (gptr() != egptr()) + return traits_type::eof(); + + for (;;) + { + // Check if we are past the expiry time. + if (traits_helper::less_than(expiry_time_, traits_helper::now())) + { + ec_ = asio::error::timed_out; + return traits_type::eof(); + } + + // Try to complete the operation without blocking. + if (!socket().native_non_blocking()) + socket().native_non_blocking(true, ec_); + detail::buffer_sequence_adapter + bufs(asio::buffer(get_buffer_) + putback_max); + detail::signed_size_type bytes = detail::socket_ops::recv( + socket().native_handle(), bufs.buffers(), bufs.count(), 0, ec_); + + // Check if operation succeeded. + if (bytes > 0) + { + setg(&get_buffer_[0], &get_buffer_[0] + putback_max, + &get_buffer_[0] + putback_max + bytes); + return traits_type::to_int_type(*gptr()); + } + + // Check for EOF. + if (bytes == 0) + { + ec_ = asio::error::eof; + return traits_type::eof(); + } + + // Operation failed. + if (ec_ != asio::error::would_block + && ec_ != asio::error::try_again) + return traits_type::eof(); + + // Wait for socket to become ready. + if (detail::socket_ops::poll_read( + socket().native_handle(), 0, timeout(), ec_) < 0) + return traits_type::eof(); + } +#endif // defined(ASIO_WINDOWS_RUNTIME) + } + + int_type overflow(int_type c) + { +#if defined(ASIO_WINDOWS_RUNTIME) + ec_ = asio::error::operation_not_supported; + return traits_type::eof(); +#else // defined(ASIO_WINDOWS_RUNTIME) + char_type ch = traits_type::to_char_type(c); + + // Determine what needs to be sent. + const_buffer output_buffer; + if (put_buffer_.empty()) + { + if (traits_type::eq_int_type(c, traits_type::eof())) + return traits_type::not_eof(c); // Nothing to do. + output_buffer = asio::buffer(&ch, sizeof(char_type)); + } + else + { + output_buffer = asio::buffer(pbase(), + (pptr() - pbase()) * sizeof(char_type)); + } + + while (output_buffer.size() > 0) + { + // Check if we are past the expiry time. + if (traits_helper::less_than(expiry_time_, traits_helper::now())) + { + ec_ = asio::error::timed_out; + return traits_type::eof(); + } + + // Try to complete the operation without blocking. + if (!socket().native_non_blocking()) + socket().native_non_blocking(true, ec_); + detail::buffer_sequence_adapter< + const_buffer, const_buffer> bufs(output_buffer); + detail::signed_size_type bytes = detail::socket_ops::send( + socket().native_handle(), bufs.buffers(), bufs.count(), 0, ec_); + + // Check if operation succeeded. + if (bytes > 0) + { + output_buffer += static_cast(bytes); + continue; + } + + // Operation failed. + if (ec_ != asio::error::would_block + && ec_ != asio::error::try_again) + return traits_type::eof(); + + // Wait for socket to become ready. + if (detail::socket_ops::poll_write( + socket().native_handle(), 0, timeout(), ec_) < 0) + return traits_type::eof(); + } + + if (!put_buffer_.empty()) + { + setp(&put_buffer_[0], &put_buffer_[0] + put_buffer_.size()); + + // If the new character is eof then our work here is done. + if (traits_type::eq_int_type(c, traits_type::eof())) + return traits_type::not_eof(c); + + // Add the new character to the output buffer. + *pptr() = ch; + pbump(1); + } + + return c; +#endif // defined(ASIO_WINDOWS_RUNTIME) + } + + int sync() + { + return overflow(traits_type::eof()); + } + + std::streambuf* setbuf(char_type* s, std::streamsize n) + { + if (pptr() == pbase() && s == 0 && n == 0) + { + put_buffer_.clear(); + setp(0, 0); + sync(); + return this; + } + + return 0; + } + +private: + // Disallow copying and assignment. + basic_socket_streambuf(const basic_socket_streambuf&) ASIO_DELETED; + basic_socket_streambuf& operator=( + const basic_socket_streambuf&) ASIO_DELETED; + + void init_buffers() + { + setg(&get_buffer_[0], + &get_buffer_[0] + putback_max, + &get_buffer_[0] + putback_max); + + if (put_buffer_.empty()) + setp(0, 0); + else + setp(&put_buffer_[0], &put_buffer_[0] + put_buffer_.size()); + } + + int timeout() const + { + int64_t msec = traits_helper::to_posix_duration( + traits_helper::subtract(expiry_time_, + traits_helper::now())).total_milliseconds(); + if (msec > (std::numeric_limits::max)()) + msec = (std::numeric_limits::max)(); + else if (msec < 0) + msec = 0; + return static_cast(msec); + } + + template + void connect_to_endpoints(const EndpointSequence& endpoints) + { + this->connect_to_endpoints(endpoints.begin(), endpoints.end()); + } + + template + void connect_to_endpoints(EndpointIterator begin, EndpointIterator end) + { +#if defined(ASIO_WINDOWS_RUNTIME) + ec_ = asio::error::operation_not_supported; +#else // defined(ASIO_WINDOWS_RUNTIME) + if (ec_) + return; + + ec_ = asio::error::not_found; + for (EndpointIterator i = begin; i != end; ++i) + { + // Check if we are past the expiry time. + if (traits_helper::less_than(expiry_time_, traits_helper::now())) + { + ec_ = asio::error::timed_out; + return; + } + + // Close and reopen the socket. + typename Protocol::endpoint ep(*i); + socket().close(ec_); + socket().open(ep.protocol(), ec_); + if (ec_) + continue; + + // Try to complete the operation without blocking. + if (!socket().native_non_blocking()) + socket().native_non_blocking(true, ec_); + detail::socket_ops::connect(socket().native_handle(), + ep.data(), ep.size(), ec_); + + // Check if operation succeeded. + if (!ec_) + return; + + // Operation failed. + if (ec_ != asio::error::in_progress + && ec_ != asio::error::would_block) + continue; + + // Wait for socket to become ready. + if (detail::socket_ops::poll_connect( + socket().native_handle(), timeout(), ec_) < 0) + continue; + + // Get the error code from the connect operation. + int connect_error = 0; + size_t connect_error_len = sizeof(connect_error); + if (detail::socket_ops::getsockopt(socket().native_handle(), 0, + SOL_SOCKET, SO_ERROR, &connect_error, &connect_error_len, ec_) + == detail::socket_error_retval) + return; + + // Check the result of the connect operation. + ec_ = asio::error_code(connect_error, + asio::error::get_system_category()); + if (!ec_) + return; + } +#endif // defined(ASIO_WINDOWS_RUNTIME) + } + + // Helper function to get the maximum expiry time. + static time_point max_expiry_time() + { +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + return boost::posix_time::pos_infin; +#else // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + return (time_point::max)(); +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM) + } + + enum { putback_max = 8 }; + asio::error_code ec_; + time_point expiry_time_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) +# undef ASIO_PRIVATE_CONNECT_DEF +#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#endif // !defined(ASIO_NO_IOSTREAM) + +#endif // ASIO_BASIC_SOCKET_STREAMBUF_HPP diff --git a/include/asio/include/asio/basic_stream_socket.hpp b/include/asio/include/asio/basic_stream_socket.hpp new file mode 100644 index 0000000..c31655a --- /dev/null +++ b/include/asio/include/asio/basic_stream_socket.hpp @@ -0,0 +1,1053 @@ +// +// basic_stream_socket.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_STREAM_SOCKET_HPP +#define ASIO_BASIC_STREAM_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/async_result.hpp" +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if !defined(ASIO_BASIC_STREAM_SOCKET_FWD_DECL) +#define ASIO_BASIC_STREAM_SOCKET_FWD_DECL + +// Forward declaration with defaulted arguments. +template +class basic_stream_socket; + +#endif // !defined(ASIO_BASIC_STREAM_SOCKET_FWD_DECL) + +/// Provides stream-oriented socket functionality. +/** + * The basic_stream_socket class template provides asynchronous and blocking + * stream-oriented socket functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Concepts: + * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. + */ +template +class basic_stream_socket + : public basic_socket +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the socket type to another executor. + template + struct rebind_executor + { + /// The socket type when rebound to the specified executor. + typedef basic_stream_socket other; + }; + + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct a basic_stream_socket without opening it. + /** + * This constructor creates a stream socket without opening it. The socket + * needs to be opened and then connected or accepted before data can be sent + * or received on it. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + */ + explicit basic_stream_socket(const executor_type& ex) + : basic_socket(ex) + { + } + + /// Construct a basic_stream_socket without opening it. + /** + * This constructor creates a stream socket without opening it. The socket + * needs to be opened and then connected or accepted before data can be sent + * or received on it. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + */ + template + explicit basic_stream_socket(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context) + { + } + + /// Construct and open a basic_stream_socket. + /** + * This constructor creates and opens a stream socket. The socket needs to be + * connected or accepted before data can be sent or received on it. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_stream_socket(const executor_type& ex, const protocol_type& protocol) + : basic_socket(ex, protocol) + { + } + + /// Construct and open a basic_stream_socket. + /** + * This constructor creates and opens a stream socket. The socket needs to be + * connected or accepted before data can be sent or received on it. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_stream_socket(ExecutionContext& context, const protocol_type& protocol, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol) + { + } + + /// Construct a basic_stream_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a stream socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the stream + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_stream_socket(const executor_type& ex, const endpoint_type& endpoint) + : basic_socket(ex, endpoint) + { + } + + /// Construct a basic_stream_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a stream socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the stream + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_stream_socket(ExecutionContext& context, const endpoint_type& endpoint, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, endpoint) + { + } + + /// Construct a basic_stream_socket on an existing native socket. + /** + * This constructor creates a stream socket object to hold an existing native + * socket. + * + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + basic_stream_socket(const executor_type& ex, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_socket(ex, protocol, native_socket) + { + } + + /// Construct a basic_stream_socket on an existing native socket. + /** + * This constructor creates a stream socket object to hold an existing native + * socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + template + basic_stream_socket(ExecutionContext& context, + const protocol_type& protocol, const native_handle_type& native_socket, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol, native_socket) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_stream_socket from another. + /** + * This constructor moves a stream socket from one object to another. + * + * @param other The other basic_stream_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_stream_socket(const executor_type&) + * constructor. + */ + basic_stream_socket(basic_stream_socket&& other) ASIO_NOEXCEPT + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_stream_socket from another. + /** + * This assignment operator moves a stream socket from one object to another. + * + * @param other The other basic_stream_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_stream_socket(const executor_type&) + * constructor. + */ + basic_stream_socket& operator=(basic_stream_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } + + /// Move-construct a basic_stream_socket from a socket of another protocol + /// type. + /** + * This constructor moves a stream socket from one object to another. + * + * @param other The other basic_stream_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_stream_socket(const executor_type&) + * constructor. + */ + template + basic_stream_socket(basic_stream_socket&& other, + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_stream_socket from a socket of another protocol type. + /** + * This assignment operator moves a stream socket from one object to another. + * + * @param other The other basic_stream_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_stream_socket(const executor_type&) + * constructor. + */ + template + typename enable_if< + is_convertible::value + && is_convertible::value, + basic_stream_socket& + >::type operator=(basic_stream_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_stream_socket() + { + } + + /// Send some data on the socket. + /** + * This function is used to send data on the stream socket. The function + * call will block until one or more bytes of the data has been sent + * successfully, or an until error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation may not transmit all of the data to the peer. + * Consider using the @ref write function if you need to ensure that all data + * is written before the blocking operation completes. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.send(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on the socket. + /** + * This function is used to send data on the stream socket. The function + * call will block until one or more bytes of the data has been sent + * successfully, or an until error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation may not transmit all of the data to the peer. + * Consider using the @ref write function if you need to ensure that all data + * is written before the blocking operation completes. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.send(asio::buffer(data, size), 0); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on the socket. + /** + * This function is used to send data on the stream socket. The function + * call will block until one or more bytes of the data has been sent + * successfully, or an until error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. Returns 0 if an error occurred. + * + * @note The send operation may not transmit all of the data to the peer. + * Consider using the @ref write function if you need to ensure that all data + * is written before the blocking operation completes. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send data on the stream socket. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The send operation may not transmit all of the data to the peer. + * Consider using the @ref async_write function if you need to ensure that all + * data is written before the asynchronous operation completes. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, + buffers, socket_base::message_flags(0)); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send data on the stream socket. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The send operation may not transmit all of the data to the peer. + * Consider using the @ref async_write function if you need to ensure that all + * data is written before the asynchronous operation completes. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), 0, handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, buffers, flags); + } + + /// Receive some data on the socket. + /** + * This function is used to receive data on the stream socket. The function + * call will block until one or more bytes of data has been received + * successfully, or until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that the + * requested amount of data is read before the blocking operation completes. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.receive(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on the socket. + /** + * This function is used to receive data on the stream socket. The function + * call will block until one or more bytes of data has been received + * successfully, or until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that the + * requested amount of data is read before the blocking operation completes. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.receive(asio::buffer(data, size), 0); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the stream socket. The function + * call will block until one or more bytes of data has been received + * successfully, or until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. Returns 0 if an error occurred. + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that the + * requested amount of data is read before the blocking operation completes. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive data from the stream + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref async_read function if you need to ensure + * that the requested amount of data is received before the asynchronous + * operation completes. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive(this), handler, + buffers, socket_base::message_flags(0)); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive data from the stream + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref async_read function if you need to ensure + * that the requested amount of data is received before the asynchronous + * operation completes. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), 0, handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive(this), handler, buffers, flags); + } + + /// Write some data to the socket. + /** + * This function is used to write data to the stream socket. The function call + * will block until one or more bytes of the data has been written + * successfully, or until an error occurs. + * + * @param buffers One or more data buffers to be written to the socket. + * + * @returns The number of bytes written. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The write_some operation may not transmit all of the data to the + * peer. Consider using the @ref write function if you need to ensure that + * all data is written before the blocking operation completes. + * + * @par Example + * To write a single data buffer use the @ref buffer function as follows: + * @code + * socket.write_some(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on writing multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t write_some(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "write_some"); + return s; + } + + /// Write some data to the socket. + /** + * This function is used to write data to the stream socket. The function call + * will block until one or more bytes of the data has been written + * successfully, or until an error occurs. + * + * @param buffers One or more data buffers to be written to the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes written. Returns 0 if an error occurred. + * + * @note The write_some operation may not transmit all of the data to the + * peer. Consider using the @ref write function if you need to ensure that + * all data is written before the blocking operation completes. + */ + template + std::size_t write_some(const ConstBufferSequence& buffers, + asio::error_code& ec) + { + return this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, 0, ec); + } + + /// Start an asynchronous write. + /** + * This function is used to asynchronously write data to the stream socket. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be written to the socket. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the write operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes written. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The write operation may not transmit all of the data to the peer. + * Consider using the @ref async_write function if you need to ensure that all + * data is written before the asynchronous operation completes. + * + * @par Example + * To write a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_write_some(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on writing multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_write_some(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_send(this), handler, + buffers, socket_base::message_flags(0)); + } + + /// Read some data from the socket. + /** + * This function is used to read data from the stream socket. The function + * call will block until one or more bytes of data has been read successfully, + * or until an error occurs. + * + * @param buffers One or more buffers into which the data will be read. + * + * @returns The number of bytes read. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The read_some operation may not read all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that + * the requested amount of data is read before the blocking operation + * completes. + * + * @par Example + * To read into a single data buffer use the @ref buffer function as follows: + * @code + * socket.read_some(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on reading into multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t read_some(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "read_some"); + return s; + } + + /// Read some data from the socket. + /** + * This function is used to read data from the stream socket. The function + * call will block until one or more bytes of data has been read successfully, + * or until an error occurs. + * + * @param buffers One or more buffers into which the data will be read. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes read. Returns 0 if an error occurred. + * + * @note The read_some operation may not read all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that + * the requested amount of data is read before the blocking operation + * completes. + */ + template + std::size_t read_some(const MutableBufferSequence& buffers, + asio::error_code& ec) + { + return this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, 0, ec); + } + + /// Start an asynchronous read. + /** + * This function is used to asynchronously read data from the stream socket. + * The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be read. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the read operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes read. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note The read operation may not read all of the requested number of bytes. + * Consider using the @ref async_read function if you need to ensure that the + * requested amount of data is read before the asynchronous operation + * completes. + * + * @par Example + * To read into a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_read_some(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on reading into multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_read_some(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_receive(this), handler, + buffers, socket_base::message_flags(0)); + } + +private: + // Disallow copying and assignment. + basic_stream_socket(const basic_stream_socket&) ASIO_DELETED; + basic_stream_socket& operator=(const basic_stream_socket&) ASIO_DELETED; + + class initiate_async_send + { + public: + typedef Executor executor_type; + + explicit initiate_async_send(basic_stream_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WriteHandler) handler, + const ConstBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_send( + self_->impl_.get_implementation(), buffers, flags, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_stream_socket* self_; + }; + + class initiate_async_receive + { + public: + typedef Executor executor_type; + + explicit initiate_async_receive(basic_stream_socket* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(ReadHandler) handler, + const MutableBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_receive( + self_->impl_.get_implementation(), buffers, flags, + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_stream_socket* self_; + }; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_STREAM_SOCKET_HPP diff --git a/include/asio/include/asio/basic_streambuf.hpp b/include/asio/include/asio/basic_streambuf.hpp new file mode 100644 index 0000000..5b22070 --- /dev/null +++ b/include/asio/include/asio/basic_streambuf.hpp @@ -0,0 +1,452 @@ +// +// basic_streambuf.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_STREAMBUF_HPP +#define ASIO_BASIC_STREAMBUF_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_NO_IOSTREAM) + +#include +#include +#include +#include +#include +#include "asio/basic_streambuf_fwd.hpp" +#include "asio/buffer.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/throw_exception.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Automatically resizable buffer class based on std::streambuf. +/** + * The @c basic_streambuf class is derived from @c std::streambuf to associate + * the streambuf's input and output sequences with one or more character + * arrays. These character arrays are internal to the @c basic_streambuf + * object, but direct access to the array elements is provided to permit them + * to be used efficiently with I/O operations. Characters written to the output + * sequence of a @c basic_streambuf object are appended to the input sequence + * of the same object. + * + * The @c basic_streambuf class's public interface is intended to permit the + * following implementation strategies: + * + * @li A single contiguous character array, which is reallocated as necessary + * to accommodate changes in the size of the character sequence. This is the + * implementation approach currently used in Asio. + * + * @li A sequence of one or more character arrays, where each array is of the + * same size. Additional character array objects are appended to the sequence + * to accommodate changes in the size of the character sequence. + * + * @li A sequence of one or more character arrays of varying sizes. Additional + * character array objects are appended to the sequence to accommodate changes + * in the size of the character sequence. + * + * The constructor for basic_streambuf accepts a @c size_t argument specifying + * the maximum of the sum of the sizes of the input sequence and output + * sequence. During the lifetime of the @c basic_streambuf object, the following + * invariant holds: + * @code size() <= max_size()@endcode + * Any member function that would, if successful, cause the invariant to be + * violated shall throw an exception of class @c std::length_error. + * + * The constructor for @c basic_streambuf takes an Allocator argument. A copy + * of this argument is used for any memory allocation performed, by the + * constructor and by all member functions, during the lifetime of each @c + * basic_streambuf object. + * + * @par Examples + * Writing directly from an streambuf to a socket: + * @code + * asio::streambuf b; + * std::ostream os(&b); + * os << "Hello, World!\n"; + * + * // try sending some data in input sequence + * size_t n = sock.send(b.data()); + * + * b.consume(n); // sent data is removed from input sequence + * @endcode + * + * Reading from a socket directly into a streambuf: + * @code + * asio::streambuf b; + * + * // reserve 512 bytes in output sequence + * asio::streambuf::mutable_buffers_type bufs = b.prepare(512); + * + * size_t n = sock.receive(bufs); + * + * // received data is "committed" from output sequence to input sequence + * b.commit(n); + * + * std::istream is(&b); + * std::string s; + * is >> s; + * @endcode + */ +#if defined(GENERATING_DOCUMENTATION) +template > +#else +template +#endif +class basic_streambuf + : public std::streambuf, + private noncopyable +{ +public: +#if defined(GENERATING_DOCUMENTATION) + /// The type used to represent the input sequence as a list of buffers. + typedef implementation_defined const_buffers_type; + + /// The type used to represent the output sequence as a list of buffers. + typedef implementation_defined mutable_buffers_type; +#else + typedef ASIO_CONST_BUFFER const_buffers_type; + typedef ASIO_MUTABLE_BUFFER mutable_buffers_type; +#endif + + /// Construct a basic_streambuf object. + /** + * Constructs a streambuf with the specified maximum size. The initial size + * of the streambuf's input sequence is 0. + */ + explicit basic_streambuf( + std::size_t maximum_size = (std::numeric_limits::max)(), + const Allocator& allocator = Allocator()) + : max_size_(maximum_size), + buffer_(allocator) + { + std::size_t pend = (std::min)(max_size_, buffer_delta); + buffer_.resize((std::max)(pend, 1)); + setg(&buffer_[0], &buffer_[0], &buffer_[0]); + setp(&buffer_[0], &buffer_[0] + pend); + } + + /// Get the size of the input sequence. + /** + * @returns The size of the input sequence. The value is equal to that + * calculated for @c s in the following code: + * @code + * size_t s = 0; + * const_buffers_type bufs = data(); + * const_buffers_type::const_iterator i = bufs.begin(); + * while (i != bufs.end()) + * { + * const_buffer buf(*i++); + * s += buf.size(); + * } + * @endcode + */ + std::size_t size() const ASIO_NOEXCEPT + { + return pptr() - gptr(); + } + + /// Get the maximum size of the basic_streambuf. + /** + * @returns The allowed maximum of the sum of the sizes of the input sequence + * and output sequence. + */ + std::size_t max_size() const ASIO_NOEXCEPT + { + return max_size_; + } + + /// Get the current capacity of the basic_streambuf. + /** + * @returns The current total capacity of the streambuf, i.e. for both the + * input sequence and output sequence. + */ + std::size_t capacity() const ASIO_NOEXCEPT + { + return buffer_.capacity(); + } + + /// Get a list of buffers that represents the input sequence. + /** + * @returns An object of type @c const_buffers_type that satisfies + * ConstBufferSequence requirements, representing all character arrays in the + * input sequence. + * + * @note The returned object is invalidated by any @c basic_streambuf member + * function that modifies the input sequence or output sequence. + */ + const_buffers_type data() const ASIO_NOEXCEPT + { + return asio::buffer(asio::const_buffer(gptr(), + (pptr() - gptr()) * sizeof(char_type))); + } + + /// Get a list of buffers that represents the output sequence, with the given + /// size. + /** + * Ensures that the output sequence can accommodate @c n characters, + * reallocating character array objects as necessary. + * + * @returns An object of type @c mutable_buffers_type that satisfies + * MutableBufferSequence requirements, representing character array objects + * at the start of the output sequence such that the sum of the buffer sizes + * is @c n. + * + * @throws std::length_error If size() + n > max_size(). + * + * @note The returned object is invalidated by any @c basic_streambuf member + * function that modifies the input sequence or output sequence. + */ + mutable_buffers_type prepare(std::size_t n) + { + reserve(n); + return asio::buffer(asio::mutable_buffer( + pptr(), n * sizeof(char_type))); + } + + /// Move characters from the output sequence to the input sequence. + /** + * Appends @c n characters from the start of the output sequence to the input + * sequence. The beginning of the output sequence is advanced by @c n + * characters. + * + * Requires a preceding call prepare(x) where x >= n, and + * no intervening operations that modify the input or output sequence. + * + * @note If @c n is greater than the size of the output sequence, the entire + * output sequence is moved to the input sequence and no error is issued. + */ + void commit(std::size_t n) + { + n = std::min(n, epptr() - pptr()); + pbump(static_cast(n)); + setg(eback(), gptr(), pptr()); + } + + /// Remove characters from the input sequence. + /** + * Removes @c n characters from the beginning of the input sequence. + * + * @note If @c n is greater than the size of the input sequence, the entire + * input sequence is consumed and no error is issued. + */ + void consume(std::size_t n) + { + if (egptr() < pptr()) + setg(&buffer_[0], gptr(), pptr()); + if (gptr() + n > pptr()) + n = pptr() - gptr(); + gbump(static_cast(n)); + } + +protected: + enum { buffer_delta = 128 }; + + /// Override std::streambuf behaviour. + /** + * Behaves according to the specification of @c std::streambuf::underflow(). + */ + int_type underflow() + { + if (gptr() < pptr()) + { + setg(&buffer_[0], gptr(), pptr()); + return traits_type::to_int_type(*gptr()); + } + else + { + return traits_type::eof(); + } + } + + /// Override std::streambuf behaviour. + /** + * Behaves according to the specification of @c std::streambuf::overflow(), + * with the specialisation that @c std::length_error is thrown if appending + * the character to the input sequence would require the condition + * size() > max_size() to be true. + */ + int_type overflow(int_type c) + { + if (!traits_type::eq_int_type(c, traits_type::eof())) + { + if (pptr() == epptr()) + { + std::size_t buffer_size = pptr() - gptr(); + if (buffer_size < max_size_ && max_size_ - buffer_size < buffer_delta) + { + reserve(max_size_ - buffer_size); + } + else + { + reserve(buffer_delta); + } + } + + *pptr() = traits_type::to_char_type(c); + pbump(1); + return c; + } + + return traits_type::not_eof(c); + } + + void reserve(std::size_t n) + { + // Get current stream positions as offsets. + std::size_t gnext = gptr() - &buffer_[0]; + std::size_t pnext = pptr() - &buffer_[0]; + std::size_t pend = epptr() - &buffer_[0]; + + // Check if there is already enough space in the put area. + if (n <= pend - pnext) + { + return; + } + + // Shift existing contents of get area to start of buffer. + if (gnext > 0) + { + pnext -= gnext; + std::memmove(&buffer_[0], &buffer_[0] + gnext, pnext); + } + + // Ensure buffer is large enough to hold at least the specified size. + if (n > pend - pnext) + { + if (n <= max_size_ && pnext <= max_size_ - n) + { + pend = pnext + n; + buffer_.resize((std::max)(pend, 1)); + } + else + { + std::length_error ex("asio::streambuf too long"); + asio::detail::throw_exception(ex); + } + } + + // Update stream positions. + setg(&buffer_[0], &buffer_[0], &buffer_[0] + pnext); + setp(&buffer_[0] + pnext, &buffer_[0] + pend); + } + +private: + std::size_t max_size_; + std::vector buffer_; + + // Helper function to get the preferred size for reading data. + friend std::size_t read_size_helper( + basic_streambuf& sb, std::size_t max_size) + { + return std::min( + std::max(512, sb.buffer_.capacity() - sb.size()), + std::min(max_size, sb.max_size() - sb.size())); + } +}; + +/// Adapts basic_streambuf to the dynamic buffer sequence type requirements. +#if defined(GENERATING_DOCUMENTATION) +template > +#else +template +#endif +class basic_streambuf_ref +{ +public: + /// The type used to represent the input sequence as a list of buffers. + typedef typename basic_streambuf::const_buffers_type + const_buffers_type; + + /// The type used to represent the output sequence as a list of buffers. + typedef typename basic_streambuf::mutable_buffers_type + mutable_buffers_type; + + /// Construct a basic_streambuf_ref for the given basic_streambuf object. + explicit basic_streambuf_ref(basic_streambuf& sb) + : sb_(sb) + { + } + + /// Copy construct a basic_streambuf_ref. + basic_streambuf_ref(const basic_streambuf_ref& other) ASIO_NOEXCEPT + : sb_(other.sb_) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move construct a basic_streambuf_ref. + basic_streambuf_ref(basic_streambuf_ref&& other) ASIO_NOEXCEPT + : sb_(other.sb_) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Get the size of the input sequence. + std::size_t size() const ASIO_NOEXCEPT + { + return sb_.size(); + } + + /// Get the maximum size of the dynamic buffer. + std::size_t max_size() const ASIO_NOEXCEPT + { + return sb_.max_size(); + } + + /// Get the current capacity of the dynamic buffer. + std::size_t capacity() const ASIO_NOEXCEPT + { + return sb_.capacity(); + } + + /// Get a list of buffers that represents the input sequence. + const_buffers_type data() const ASIO_NOEXCEPT + { + return sb_.data(); + } + + /// Get a list of buffers that represents the output sequence, with the given + /// size. + mutable_buffers_type prepare(std::size_t n) + { + return sb_.prepare(n); + } + + /// Move bytes from the output sequence to the input sequence. + void commit(std::size_t n) + { + return sb_.commit(n); + } + + /// Remove characters from the input sequence. + void consume(std::size_t n) + { + return sb_.consume(n); + } + +private: + basic_streambuf& sb_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_NO_IOSTREAM) + +#endif // ASIO_BASIC_STREAMBUF_HPP diff --git a/include/asio/include/asio/basic_streambuf_fwd.hpp b/include/asio/include/asio/basic_streambuf_fwd.hpp new file mode 100644 index 0000000..df9961d --- /dev/null +++ b/include/asio/include/asio/basic_streambuf_fwd.hpp @@ -0,0 +1,36 @@ +// +// basic_streambuf_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_STREAMBUF_FWD_HPP +#define ASIO_BASIC_STREAMBUF_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_NO_IOSTREAM) + +#include + +namespace asio { + +template > +class basic_streambuf; + +template > +class basic_streambuf_ref; + +} // namespace asio + +#endif // !defined(ASIO_NO_IOSTREAM) + +#endif // ASIO_BASIC_STREAMBUF_FWD_HPP diff --git a/include/asio/include/asio/basic_waitable_timer.hpp b/include/asio/include/asio/basic_waitable_timer.hpp new file mode 100644 index 0000000..28452ef --- /dev/null +++ b/include/asio/include/asio/basic_waitable_timer.hpp @@ -0,0 +1,811 @@ +// +// basic_waitable_timer.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_WAITABLE_TIMER_HPP +#define ASIO_BASIC_WAITABLE_TIMER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/any_io_executor.hpp" +#include "asio/detail/chrono_time_traits.hpp" +#include "asio/detail/deadline_timer_service.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/io_object_impl.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" +#include "asio/wait_traits.hpp" + +#if defined(ASIO_HAS_MOVE) +# include +#endif // defined(ASIO_HAS_MOVE) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if !defined(ASIO_BASIC_WAITABLE_TIMER_FWD_DECL) +#define ASIO_BASIC_WAITABLE_TIMER_FWD_DECL + +// Forward declaration with defaulted arguments. +template , + typename Executor = any_io_executor> +class basic_waitable_timer; + +#endif // !defined(ASIO_BASIC_WAITABLE_TIMER_FWD_DECL) + +/// Provides waitable timer functionality. +/** + * The basic_waitable_timer class template provides the ability to perform a + * blocking or asynchronous wait for a timer to expire. + * + * A waitable timer is always in one of two states: "expired" or "not expired". + * If the wait() or async_wait() function is called on an expired timer, the + * wait operation will complete immediately. + * + * Most applications will use one of the asio::steady_timer, + * asio::system_timer or asio::high_resolution_timer typedefs. + * + * @note This waitable timer functionality is for use with the C++11 standard + * library's @c <chrono> facility, or with the Boost.Chrono library. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Examples + * Performing a blocking wait (C++11): + * @code + * // Construct a timer without setting an expiry time. + * asio::steady_timer timer(my_context); + * + * // Set an expiry time relative to now. + * timer.expires_after(std::chrono::seconds(5)); + * + * // Wait for the timer to expire. + * timer.wait(); + * @endcode + * + * @par + * Performing an asynchronous wait (C++11): + * @code + * void handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Timer expired. + * } + * } + * + * ... + * + * // Construct a timer with an absolute expiry time. + * asio::steady_timer timer(my_context, + * std::chrono::steady_clock::now() + std::chrono::seconds(60)); + * + * // Start an asynchronous wait. + * timer.async_wait(handler); + * @endcode + * + * @par Changing an active waitable timer's expiry time + * + * Changing the expiry time of a timer while there are pending asynchronous + * waits causes those wait operations to be cancelled. To ensure that the action + * associated with the timer is performed only once, use something like this: + * used: + * + * @code + * void on_some_event() + * { + * if (my_timer.expires_after(seconds(5)) > 0) + * { + * // We managed to cancel the timer. Start new asynchronous wait. + * my_timer.async_wait(on_timeout); + * } + * else + * { + * // Too late, timer has already expired! + * } + * } + * + * void on_timeout(const asio::error_code& e) + * { + * if (e != asio::error::operation_aborted) + * { + * // Timer was not cancelled, take necessary action. + * } + * } + * @endcode + * + * @li The asio::basic_waitable_timer::expires_after() function + * cancels any pending asynchronous waits, and returns the number of + * asynchronous waits that were cancelled. If it returns 0 then you were too + * late and the wait handler has already been executed, or will soon be + * executed. If it returns 1 then the wait handler was successfully cancelled. + * + * @li If a wait handler is cancelled, the asio::error_code passed to + * it contains the value asio::error::operation_aborted. + */ +template +class basic_waitable_timer +{ +public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the timer type to another executor. + template + struct rebind_executor + { + /// The timer type when rebound to the specified executor. + typedef basic_waitable_timer other; + }; + + /// The clock type. + typedef Clock clock_type; + + /// The duration type of the clock. + typedef typename clock_type::duration duration; + + /// The time point type of the clock. + typedef typename clock_type::time_point time_point; + + /// The wait traits type. + typedef WaitTraits traits_type; + + /// Constructor. + /** + * This constructor creates a timer without setting an expiry time. The + * expires_at() or expires_after() functions must be called to set an expiry + * time before the timer can be waited on. + * + * @param ex The I/O executor that the timer will use, by default, to + * dispatch handlers for any asynchronous operations performed on the timer. + */ + explicit basic_waitable_timer(const executor_type& ex) + : impl_(ex) + { + } + + /// Constructor. + /** + * This constructor creates a timer without setting an expiry time. The + * expires_at() or expires_after() functions must be called to set an expiry + * time before the timer can be waited on. + * + * @param context An execution context which provides the I/O executor that + * the timer will use, by default, to dispatch handlers for any asynchronous + * operations performed on the timer. + */ + template + explicit basic_waitable_timer(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + } + + /// Constructor to set a particular expiry time as an absolute time. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param ex The I/O executor object that the timer will use, by default, to + * dispatch handlers for any asynchronous operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, expressed + * as an absolute time. + */ + basic_waitable_timer(const executor_type& ex, const time_point& expiry_time) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().expires_at(impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + } + + /// Constructor to set a particular expiry time as an absolute time. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param context An execution context which provides the I/O executor that + * the timer will use, by default, to dispatch handlers for any asynchronous + * operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, expressed + * as an absolute time. + */ + template + explicit basic_waitable_timer(ExecutionContext& context, + const time_point& expiry_time, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().expires_at(impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + } + + /// Constructor to set a particular expiry time relative to now. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param ex The I/O executor that the timer will use, by default, to + * dispatch handlers for any asynchronous operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, relative to + * now. + */ + basic_waitable_timer(const executor_type& ex, const duration& expiry_time) + : impl_(ex) + { + asio::error_code ec; + impl_.get_service().expires_after( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_after"); + } + + /// Constructor to set a particular expiry time relative to now. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param context An execution context which provides the I/O executor that + * the timer will use, by default, to dispatch handlers for any asynchronous + * operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, relative to + * now. + */ + template + explicit basic_waitable_timer(ExecutionContext& context, + const duration& expiry_time, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(context) + { + asio::error_code ec; + impl_.get_service().expires_after( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_after"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_waitable_timer from another. + /** + * This constructor moves a timer from one object to another. + * + * @param other The other basic_waitable_timer object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_waitable_timer(const executor_type&) + * constructor. + */ + basic_waitable_timer(basic_waitable_timer&& other) + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_waitable_timer from another. + /** + * This assignment operator moves a timer from one object to another. Cancels + * any outstanding asynchronous operations associated with the target object. + * + * @param other The other basic_waitable_timer object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_waitable_timer(const executor_type&) + * constructor. + */ + basic_waitable_timer& operator=(basic_waitable_timer&& other) + { + impl_ = std::move(other.impl_); + return *this; + } + + // All timers have access to each other's implementations. + template + friend class basic_waitable_timer; + + /// Move-construct a basic_waitable_timer from another. + /** + * This constructor moves a timer from one object to another. + * + * @param other The other basic_waitable_timer object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_waitable_timer(const executor_type&) + * constructor. + */ + template + basic_waitable_timer( + basic_waitable_timer&& other, + typename enable_if< + is_convertible::value + >::type* = 0) + : impl_(std::move(other.impl_)) + { + } + + /// Move-assign a basic_waitable_timer from another. + /** + * This assignment operator moves a timer from one object to another. Cancels + * any outstanding asynchronous operations associated with the target object. + * + * @param other The other basic_waitable_timer object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_waitable_timer(const executor_type&) + * constructor. + */ + template + typename enable_if< + is_convertible::value, + basic_waitable_timer& + >::type operator=(basic_waitable_timer&& other) + { + basic_waitable_timer tmp(std::move(other)); + impl_ = std::move(tmp.impl_); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the timer. + /** + * This function destroys the timer, cancelling any outstanding asynchronous + * wait operations associated with the timer as if by calling @c cancel. + */ + ~basic_waitable_timer() + { + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return impl_.get_executor(); + } + + /// Cancel any asynchronous operations that are waiting on the timer. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the timer. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel() + { + asio::error_code ec; + std::size_t s = impl_.get_service().cancel(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + return s; + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use non-error_code overload.) Cancel any asynchronous + /// operations that are waiting on the timer. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the timer. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel(asio::error_code& ec) + { + return impl_.get_service().cancel(impl_.get_implementation(), ec); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Cancels one asynchronous operation that is waiting on the timer. + /** + * This function forces the completion of one pending asynchronous wait + * operation against the timer. Handlers are cancelled in FIFO order. The + * handler for the cancelled operation will be invoked with the + * asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @return The number of asynchronous operations that were cancelled. That is, + * either 0 or 1. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel_one() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel_one() + { + asio::error_code ec; + std::size_t s = impl_.get_service().cancel_one( + impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "cancel_one"); + return s; + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use non-error_code overload.) Cancels one asynchronous + /// operation that is waiting on the timer. + /** + * This function forces the completion of one pending asynchronous wait + * operation against the timer. Handlers are cancelled in FIFO order. The + * handler for the cancelled operation will be invoked with the + * asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. That is, + * either 0 or 1. + * + * @note If the timer has already expired when cancel_one() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel_one(asio::error_code& ec) + { + return impl_.get_service().cancel_one(impl_.get_implementation(), ec); + } + + /// (Deprecated: Use expiry().) Get the timer's expiry time as an absolute + /// time. + /** + * This function may be used to obtain the timer's current expiry time. + * Whether the timer has expired or not does not affect this value. + */ + time_point expires_at() const + { + return impl_.get_service().expires_at(impl_.get_implementation()); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Get the timer's expiry time as an absolute time. + /** + * This function may be used to obtain the timer's current expiry time. + * Whether the timer has expired or not does not affect this value. + */ + time_point expiry() const + { + return impl_.get_service().expiry(impl_.get_implementation()); + } + + /// Set the timer's expiry time as an absolute time. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_at(const time_point& expiry_time) + { + asio::error_code ec; + std::size_t s = impl_.get_service().expires_at( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + return s; + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use non-error_code overload.) Set the timer's expiry time as + /// an absolute time. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_at(const time_point& expiry_time, + asio::error_code& ec) + { + return impl_.get_service().expires_at( + impl_.get_implementation(), expiry_time, ec); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Set the timer's expiry time relative to now. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_after() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_after(const duration& expiry_time) + { + asio::error_code ec; + std::size_t s = impl_.get_service().expires_after( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_after"); + return s; + } + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use expiry().) Get the timer's expiry time relative to now. + /** + * This function may be used to obtain the timer's current expiry time. + * Whether the timer has expired or not does not affect this value. + */ + duration expires_from_now() const + { + return impl_.get_service().expires_from_now(impl_.get_implementation()); + } + + /// (Deprecated: Use expires_after().) Set the timer's expiry time relative + /// to now. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_from_now(const duration& expiry_time) + { + asio::error_code ec; + std::size_t s = impl_.get_service().expires_from_now( + impl_.get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_from_now"); + return s; + } + + /// (Deprecated: Use expires_after().) Set the timer's expiry time relative + /// to now. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_from_now(const duration& expiry_time, + asio::error_code& ec) + { + return impl_.get_service().expires_from_now( + impl_.get_implementation(), expiry_time, ec); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Perform a blocking wait on the timer. + /** + * This function is used to wait for the timer to expire. This function + * blocks and does not return until the timer has expired. + * + * @throws asio::system_error Thrown on failure. + */ + void wait() + { + asio::error_code ec; + impl_.get_service().wait(impl_.get_implementation(), ec); + asio::detail::throw_error(ec, "wait"); + } + + /// Perform a blocking wait on the timer. + /** + * This function is used to wait for the timer to expire. This function + * blocks and does not return until the timer has expired. + * + * @param ec Set to indicate what error occurred, if any. + */ + void wait(asio::error_code& ec) + { + impl_.get_service().wait(impl_.get_implementation(), ec); + } + + /// Start an asynchronous wait on the timer. + /** + * This function may be used to initiate an asynchronous wait against the + * timer. It always returns immediately. + * + * For each call to async_wait(), the supplied handler will be called exactly + * once. The handler will be called when: + * + * @li The timer has expired. + * + * @li The timer was cancelled, in which case the handler is passed the error + * code asio::error::operation_aborted. + * + * @param handler The handler to be called when the timer expires. Copies + * will be made of the handler as required. The function signature of the + * handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + */ + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code)) + WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler, + void (asio::error_code)) + async_wait( + ASIO_MOVE_ARG(WaitHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return async_initiate( + initiate_async_wait(this), handler); + } + +private: + // Disallow copying and assignment. + basic_waitable_timer(const basic_waitable_timer&) ASIO_DELETED; + basic_waitable_timer& operator=( + const basic_waitable_timer&) ASIO_DELETED; + + class initiate_async_wait + { + public: + typedef Executor executor_type; + + explicit initiate_async_wait(basic_waitable_timer* self) + : self_(self) + { + } + + executor_type get_executor() const ASIO_NOEXCEPT + { + return self_->get_executor(); + } + + template + void operator()(ASIO_MOVE_ARG(WaitHandler) handler) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WaitHandler. + ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self_->impl_.get_service().async_wait( + self_->impl_.get_implementation(), + handler2.value, self_->impl_.get_executor()); + } + + private: + basic_waitable_timer* self_; + }; + + detail::io_object_impl< + detail::deadline_timer_service< + detail::chrono_time_traits >, + executor_type > impl_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_WAITABLE_TIMER_HPP diff --git a/include/asio/include/asio/bind_executor.hpp b/include/asio/include/asio/bind_executor.hpp new file mode 100644 index 0000000..db30db6 --- /dev/null +++ b/include/asio/include/asio/bind_executor.hpp @@ -0,0 +1,575 @@ +// +// bind_executor.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BIND_EXECUTOR_HPP +#define ASIO_BIND_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/detail/variadic_templates.hpp" +#include "asio/associated_executor.hpp" +#include "asio/associated_allocator.hpp" +#include "asio/async_result.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution_context.hpp" +#include "asio/is_executor.hpp" +#include "asio/uses_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper to automatically define nested typedef result_type. + +template +struct executor_binder_result_type +{ +protected: + typedef void result_type_or_void; +}; + +template +struct executor_binder_result_type::type> +{ + typedef typename T::result_type result_type; +protected: + typedef result_type result_type_or_void; +}; + +template +struct executor_binder_result_type +{ + typedef R result_type; +protected: + typedef result_type result_type_or_void; +}; + +template +struct executor_binder_result_type +{ + typedef R result_type; +protected: + typedef result_type result_type_or_void; +}; + +template +struct executor_binder_result_type +{ + typedef R result_type; +protected: + typedef result_type result_type_or_void; +}; + +template +struct executor_binder_result_type +{ + typedef R result_type; +protected: + typedef result_type result_type_or_void; +}; + +template +struct executor_binder_result_type +{ + typedef R result_type; +protected: + typedef result_type result_type_or_void; +}; + +template +struct executor_binder_result_type +{ + typedef R result_type; +protected: + typedef result_type result_type_or_void; +}; + +// Helper to automatically define nested typedef argument_type. + +template +struct executor_binder_argument_type {}; + +template +struct executor_binder_argument_type::type> +{ + typedef typename T::argument_type argument_type; +}; + +template +struct executor_binder_argument_type +{ + typedef A1 argument_type; +}; + +template +struct executor_binder_argument_type +{ + typedef A1 argument_type; +}; + +// Helper to automatically define nested typedefs first_argument_type and +// second_argument_type. + +template +struct executor_binder_argument_types {}; + +template +struct executor_binder_argument_types::type> +{ + typedef typename T::first_argument_type first_argument_type; + typedef typename T::second_argument_type second_argument_type; +}; + +template +struct executor_binder_argument_type +{ + typedef A1 first_argument_type; + typedef A2 second_argument_type; +}; + +template +struct executor_binder_argument_type +{ + typedef A1 first_argument_type; + typedef A2 second_argument_type; +}; + +// Helper to perform uses_executor construction of the target type, if +// required. + +template +class executor_binder_base; + +template +class executor_binder_base +{ +protected: + template + executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u) + : executor_(ASIO_MOVE_CAST(E)(e)), + target_(executor_arg_t(), executor_, ASIO_MOVE_CAST(U)(u)) + { + } + + Executor executor_; + T target_; +}; + +template +class executor_binder_base +{ +protected: + template + executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u) + : executor_(ASIO_MOVE_CAST(E)(e)), + target_(ASIO_MOVE_CAST(U)(u)) + { + } + + Executor executor_; + T target_; +}; + +// Helper to enable SFINAE on zero-argument operator() below. + +template +struct executor_binder_result_of0 +{ + typedef void type; +}; + +template +struct executor_binder_result_of0::type>::type> +{ + typedef typename result_of::type type; +}; + +} // namespace detail + +/// A call wrapper type to bind an executor of type @c Executor to an object of +/// type @c T. +template +class executor_binder +#if !defined(GENERATING_DOCUMENTATION) + : public detail::executor_binder_result_type, + public detail::executor_binder_argument_type, + public detail::executor_binder_argument_types, + private detail::executor_binder_base< + T, Executor, uses_executor::value> +#endif // !defined(GENERATING_DOCUMENTATION) +{ +public: + /// The type of the target object. + typedef T target_type; + + /// The type of the associated executor. + typedef Executor executor_type; + +#if defined(GENERATING_DOCUMENTATION) + /// The return type if a function. + /** + * The type of @c result_type is based on the type @c T of the wrapper's + * target object: + * + * @li if @c T is a pointer to function type, @c result_type is a synonym for + * the return type of @c T; + * + * @li if @c T is a class type with a member type @c result_type, then @c + * result_type is a synonym for @c T::result_type; + * + * @li otherwise @c result_type is not defined. + */ + typedef see_below result_type; + + /// The type of the function's argument. + /** + * The type of @c argument_type is based on the type @c T of the wrapper's + * target object: + * + * @li if @c T is a pointer to a function type accepting a single argument, + * @c argument_type is a synonym for the return type of @c T; + * + * @li if @c T is a class type with a member type @c argument_type, then @c + * argument_type is a synonym for @c T::argument_type; + * + * @li otherwise @c argument_type is not defined. + */ + typedef see_below argument_type; + + /// The type of the function's first argument. + /** + * The type of @c first_argument_type is based on the type @c T of the + * wrapper's target object: + * + * @li if @c T is a pointer to a function type accepting two arguments, @c + * first_argument_type is a synonym for the return type of @c T; + * + * @li if @c T is a class type with a member type @c first_argument_type, + * then @c first_argument_type is a synonym for @c T::first_argument_type; + * + * @li otherwise @c first_argument_type is not defined. + */ + typedef see_below first_argument_type; + + /// The type of the function's second argument. + /** + * The type of @c second_argument_type is based on the type @c T of the + * wrapper's target object: + * + * @li if @c T is a pointer to a function type accepting two arguments, @c + * second_argument_type is a synonym for the return type of @c T; + * + * @li if @c T is a class type with a member type @c first_argument_type, + * then @c second_argument_type is a synonym for @c T::second_argument_type; + * + * @li otherwise @c second_argument_type is not defined. + */ + typedef see_below second_argument_type; +#endif // defined(GENERATING_DOCUMENTATION) + + /// Construct an executor wrapper for the specified object. + /** + * This constructor is only valid if the type @c T is constructible from type + * @c U. + */ + template + executor_binder(executor_arg_t, const executor_type& e, + ASIO_MOVE_ARG(U) u) + : base_type(e, ASIO_MOVE_CAST(U)(u)) + { + } + + /// Copy constructor. + executor_binder(const executor_binder& other) + : base_type(other.get_executor(), other.get()) + { + } + + /// Construct a copy, but specify a different executor. + executor_binder(executor_arg_t, const executor_type& e, + const executor_binder& other) + : base_type(e, other.get()) + { + } + + /// Construct a copy of a different executor wrapper type. + /** + * This constructor is only valid if the @c Executor type is constructible + * from type @c OtherExecutor, and the type @c T is constructible from type + * @c U. + */ + template + executor_binder(const executor_binder& other) + : base_type(other.get_executor(), other.get()) + { + } + + /// Construct a copy of a different executor wrapper type, but specify a + /// different executor. + /** + * This constructor is only valid if the type @c T is constructible from type + * @c U. + */ + template + executor_binder(executor_arg_t, const executor_type& e, + const executor_binder& other) + : base_type(e, other.get()) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Move constructor. + executor_binder(executor_binder&& other) + : base_type(ASIO_MOVE_CAST(executor_type)(other.get_executor()), + ASIO_MOVE_CAST(T)(other.get())) + { + } + + /// Move construct the target object, but specify a different executor. + executor_binder(executor_arg_t, const executor_type& e, + executor_binder&& other) + : base_type(e, ASIO_MOVE_CAST(T)(other.get())) + { + } + + /// Move construct from a different executor wrapper type. + template + executor_binder(executor_binder&& other) + : base_type(ASIO_MOVE_CAST(OtherExecutor)(other.get_executor()), + ASIO_MOVE_CAST(U)(other.get())) + { + } + + /// Move construct from a different executor wrapper type, but specify a + /// different executor. + template + executor_binder(executor_arg_t, const executor_type& e, + executor_binder&& other) + : base_type(e, ASIO_MOVE_CAST(U)(other.get())) + { + } + +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destructor. + ~executor_binder() + { + } + + /// Obtain a reference to the target object. + target_type& get() ASIO_NOEXCEPT + { + return this->target_; + } + + /// Obtain a reference to the target object. + const target_type& get() const ASIO_NOEXCEPT + { + return this->target_; + } + + /// Obtain the associated executor. + executor_type get_executor() const ASIO_NOEXCEPT + { + return this->executor_; + } + +#if defined(GENERATING_DOCUMENTATION) + + template auto operator()(Args&& ...); + template auto operator()(Args&& ...) const; + +#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) + + /// Forwarding function call operator. + template + typename result_of::type operator()( + ASIO_MOVE_ARG(Args)... args) + { + return this->target_(ASIO_MOVE_CAST(Args)(args)...); + } + + /// Forwarding function call operator. + template + typename result_of::type operator()( + ASIO_MOVE_ARG(Args)... args) const + { + return this->target_(ASIO_MOVE_CAST(Args)(args)...); + } + +#elif defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) + + typename detail::executor_binder_result_of0::type operator()() + { + return this->target_(); + } + + typename detail::executor_binder_result_of0::type operator()() const + { + return this->target_(); + } + +#define ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \ + template \ + typename result_of::type operator()( \ + ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + \ + template \ + typename result_of::type operator()( \ + ASIO_VARIADIC_MOVE_PARAMS(n)) const \ + { \ + return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF) +#undef ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF + +#else // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) + + typedef typename detail::executor_binder_result_type::result_type_or_void + result_type_or_void; + + result_type_or_void operator()() + { + return this->target_(); + } + + result_type_or_void operator()() const + { + return this->target_(); + } + +#define ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \ + template \ + result_type_or_void operator()( \ + ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + \ + template \ + result_type_or_void operator()( \ + ASIO_VARIADIC_MOVE_PARAMS(n)) const \ + { \ + return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF) +#undef ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF + +#endif // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER) + +private: + typedef detail::executor_binder_base::value> base_type; +}; + +/// Associate an object of type @c T with an executor of type @c Executor. +template +inline executor_binder::type, Executor> +bind_executor(const Executor& ex, ASIO_MOVE_ARG(T) t, + typename enable_if< + is_executor::value || execution::is_executor::value + >::type* = 0) +{ + return executor_binder::type, Executor>( + executor_arg_t(), ex, ASIO_MOVE_CAST(T)(t)); +} + +/// Associate an object of type @c T with an execution context's executor. +template +inline executor_binder::type, + typename ExecutionContext::executor_type> +bind_executor(ExecutionContext& ctx, ASIO_MOVE_ARG(T) t, + typename enable_if::value>::type* = 0) +{ + return executor_binder::type, + typename ExecutionContext::executor_type>( + executor_arg_t(), ctx.get_executor(), ASIO_MOVE_CAST(T)(t)); +} + +#if !defined(GENERATING_DOCUMENTATION) + +template +struct uses_executor, Executor> + : true_type {}; + +template +class async_result, Signature> +{ +public: + typedef executor_binder< + typename async_result::completion_handler_type, Executor> + completion_handler_type; + + typedef typename async_result::return_type return_type; + + explicit async_result(executor_binder& b) + : target_(b.get()) + { + } + + return_type get() + { + return target_.get(); + } + +private: + async_result(const async_result&) ASIO_DELETED; + async_result& operator=(const async_result&) ASIO_DELETED; + + async_result target_; +}; + +template +struct associated_allocator, Allocator> +{ + typedef typename associated_allocator::type type; + + static type get(const executor_binder& b, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return associated_allocator::get(b.get(), a); + } +}; + +template +struct associated_executor, Executor1> +{ + typedef Executor type; + + static type get(const executor_binder& b, + const Executor1& = Executor1()) ASIO_NOEXCEPT + { + return b.get_executor(); + } +}; + +#endif // !defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BIND_EXECUTOR_HPP diff --git a/include/asio/include/asio/buffer.hpp b/include/asio/include/asio/buffer.hpp new file mode 100644 index 0000000..65e85c4 --- /dev/null +++ b/include/asio/include/asio/buffer.hpp @@ -0,0 +1,2496 @@ +// +// buffer.hpp +// ~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFER_HPP +#define ASIO_BUFFER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include +#include +#include +#include +#include +#include "asio/detail/array_fwd.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/string_view.hpp" +#include "asio/detail/throw_exception.hpp" +#include "asio/detail/type_traits.hpp" + +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1700) +# if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0) +# if !defined(ASIO_DISABLE_BUFFER_DEBUGGING) +# define ASIO_ENABLE_BUFFER_DEBUGGING +# endif // !defined(ASIO_DISABLE_BUFFER_DEBUGGING) +# endif // defined(_HAS_ITERATOR_DEBUGGING) +#endif // defined(ASIO_MSVC) && (ASIO_MSVC >= 1700) + +#if defined(__GNUC__) +# if defined(_GLIBCXX_DEBUG) +# if !defined(ASIO_DISABLE_BUFFER_DEBUGGING) +# define ASIO_ENABLE_BUFFER_DEBUGGING +# endif // !defined(ASIO_DISABLE_BUFFER_DEBUGGING) +# endif // defined(_GLIBCXX_DEBUG) +#endif // defined(__GNUC__) + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) +# include "asio/detail/functional.hpp" +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + +#if defined(ASIO_HAS_BOOST_WORKAROUND) +# include +# if !defined(__clang__) +# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +# define ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND +# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +# elif BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) +# define ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND +# endif // BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) +#endif // defined(ASIO_HAS_BOOST_WORKAROUND) + +#if defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) +# include "asio/detail/type_traits.hpp" +#endif // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +class mutable_buffer; +class const_buffer; + +/// Holds a buffer that can be modified. +/** + * The mutable_buffer class provides a safe representation of a buffer that can + * be modified. It does not own the underlying data, and so is cheap to copy or + * assign. + * + * @par Accessing Buffer Contents + * + * The contents of a buffer may be accessed using the @c data() and @c size() + * member functions: + * + * @code asio::mutable_buffer b1 = ...; + * std::size_t s1 = b1.size(); + * unsigned char* p1 = static_cast(b1.data()); + * @endcode + * + * The @c data() member function permits violations of type safety, so uses of + * it in application code should be carefully considered. + */ +class mutable_buffer +{ +public: + /// Construct an empty buffer. + mutable_buffer() ASIO_NOEXCEPT + : data_(0), + size_(0) + { + } + + /// Construct a buffer to represent a given memory range. + mutable_buffer(void* data, std::size_t size) ASIO_NOEXCEPT + : data_(data), + size_(size) + { + } + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + mutable_buffer(void* data, std::size_t size, + asio::detail::function debug_check) + : data_(data), + size_(size), + debug_check_(debug_check) + { + } + + const asio::detail::function& get_debug_check() const + { + return debug_check_; + } +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + + /// Get a pointer to the beginning of the memory range. + void* data() const ASIO_NOEXCEPT + { +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + if (size_ && debug_check_) + debug_check_(); +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + return data_; + } + + /// Get the size of the memory range. + std::size_t size() const ASIO_NOEXCEPT + { + return size_; + } + + /// Move the start of the buffer by the specified number of bytes. + mutable_buffer& operator+=(std::size_t n) ASIO_NOEXCEPT + { + std::size_t offset = n < size_ ? n : size_; + data_ = static_cast(data_) + offset; + size_ -= offset; + return *this; + } + +private: + void* data_; + std::size_t size_; + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + asio::detail::function debug_check_; +#endif // ASIO_ENABLE_BUFFER_DEBUGGING +}; + +#if !defined(ASIO_NO_DEPRECATED) + +/// (Deprecated: Use mutable_buffer.) Adapts a single modifiable buffer so that +/// it meets the requirements of the MutableBufferSequence concept. +class mutable_buffers_1 + : public mutable_buffer +{ +public: + /// The type for each element in the list of buffers. + typedef mutable_buffer value_type; + + /// A random-access iterator type that may be used to read elements. + typedef const mutable_buffer* const_iterator; + + /// Construct to represent a given memory range. + mutable_buffers_1(void* data, std::size_t size) ASIO_NOEXCEPT + : mutable_buffer(data, size) + { + } + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + mutable_buffers_1(void* data, std::size_t size, + asio::detail::function debug_check) + : mutable_buffer(data, size, debug_check) + { + } +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + + /// Construct to represent a single modifiable buffer. + explicit mutable_buffers_1(const mutable_buffer& b) ASIO_NOEXCEPT + : mutable_buffer(b) + { + } + + /// Get a random-access iterator to the first element. + const_iterator begin() const ASIO_NOEXCEPT + { + return this; + } + + /// Get a random-access iterator for one past the last element. + const_iterator end() const ASIO_NOEXCEPT + { + return begin() + 1; + } +}; + +#endif // !defined(ASIO_NO_DEPRECATED) + +/// Holds a buffer that cannot be modified. +/** + * The const_buffer class provides a safe representation of a buffer that cannot + * be modified. It does not own the underlying data, and so is cheap to copy or + * assign. + * + * @par Accessing Buffer Contents + * + * The contents of a buffer may be accessed using the @c data() and @c size() + * member functions: + * + * @code asio::const_buffer b1 = ...; + * std::size_t s1 = b1.size(); + * const unsigned char* p1 = static_cast(b1.data()); + * @endcode + * + * The @c data() member function permits violations of type safety, so uses of + * it in application code should be carefully considered. + */ +class const_buffer +{ +public: + /// Construct an empty buffer. + const_buffer() ASIO_NOEXCEPT + : data_(0), + size_(0) + { + } + + /// Construct a buffer to represent a given memory range. + const_buffer(const void* data, std::size_t size) ASIO_NOEXCEPT + : data_(data), + size_(size) + { + } + + /// Construct a non-modifiable buffer from a modifiable one. + const_buffer(const mutable_buffer& b) ASIO_NOEXCEPT + : data_(b.data()), + size_(b.size()) +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , debug_check_(b.get_debug_check()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + { + } + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + const_buffer(const void* data, std::size_t size, + asio::detail::function debug_check) + : data_(data), + size_(size), + debug_check_(debug_check) + { + } + + const asio::detail::function& get_debug_check() const + { + return debug_check_; + } +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + + /// Get a pointer to the beginning of the memory range. + const void* data() const ASIO_NOEXCEPT + { +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + if (size_ && debug_check_) + debug_check_(); +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + return data_; + } + + /// Get the size of the memory range. + std::size_t size() const ASIO_NOEXCEPT + { + return size_; + } + + /// Move the start of the buffer by the specified number of bytes. + const_buffer& operator+=(std::size_t n) ASIO_NOEXCEPT + { + std::size_t offset = n < size_ ? n : size_; + data_ = static_cast(data_) + offset; + size_ -= offset; + return *this; + } + +private: + const void* data_; + std::size_t size_; + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + asio::detail::function debug_check_; +#endif // ASIO_ENABLE_BUFFER_DEBUGGING +}; + +#if !defined(ASIO_NO_DEPRECATED) + +/// (Deprecated: Use const_buffer.) Adapts a single non-modifiable buffer so +/// that it meets the requirements of the ConstBufferSequence concept. +class const_buffers_1 + : public const_buffer +{ +public: + /// The type for each element in the list of buffers. + typedef const_buffer value_type; + + /// A random-access iterator type that may be used to read elements. + typedef const const_buffer* const_iterator; + + /// Construct to represent a given memory range. + const_buffers_1(const void* data, std::size_t size) ASIO_NOEXCEPT + : const_buffer(data, size) + { + } + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + const_buffers_1(const void* data, std::size_t size, + asio::detail::function debug_check) + : const_buffer(data, size, debug_check) + { + } +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + + /// Construct to represent a single non-modifiable buffer. + explicit const_buffers_1(const const_buffer& b) ASIO_NOEXCEPT + : const_buffer(b) + { + } + + /// Get a random-access iterator to the first element. + const_iterator begin() const ASIO_NOEXCEPT + { + return this; + } + + /// Get a random-access iterator for one past the last element. + const_iterator end() const ASIO_NOEXCEPT + { + return begin() + 1; + } +}; + +#endif // !defined(ASIO_NO_DEPRECATED) + +/// (Deprecated: Use the socket/descriptor wait() and async_wait() member +/// functions.) An implementation of both the ConstBufferSequence and +/// MutableBufferSequence concepts to represent a null buffer sequence. +class null_buffers +{ +public: + /// The type for each element in the list of buffers. + typedef mutable_buffer value_type; + + /// A random-access iterator type that may be used to read elements. + typedef const mutable_buffer* const_iterator; + + /// Get a random-access iterator to the first element. + const_iterator begin() const ASIO_NOEXCEPT + { + return &buf_; + } + + /// Get a random-access iterator for one past the last element. + const_iterator end() const ASIO_NOEXCEPT + { + return &buf_; + } + +private: + mutable_buffer buf_; +}; + +/** @defgroup buffer_sequence_begin asio::buffer_sequence_begin + * + * @brief The asio::buffer_sequence_begin function returns an iterator + * pointing to the first element in a buffer sequence. + */ +/*@{*/ + +/// Get an iterator to the first element in a buffer sequence. +template +inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b, + typename enable_if< + is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return static_cast(detail::addressof(b)); +} + +/// Get an iterator to the first element in a buffer sequence. +template +inline const const_buffer* buffer_sequence_begin(const ConstBuffer& b, + typename enable_if< + is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return static_cast(detail::addressof(b)); +} + +#if defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) + +/// Get an iterator to the first element in a buffer sequence. +template +inline auto buffer_sequence_begin(C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT -> decltype(c.begin()) +{ + return c.begin(); +} + +/// Get an iterator to the first element in a buffer sequence. +template +inline auto buffer_sequence_begin(const C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT -> decltype(c.begin()) +{ + return c.begin(); +} + +#else // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) + +template +inline typename C::iterator buffer_sequence_begin(C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return c.begin(); +} + +template +inline typename C::const_iterator buffer_sequence_begin(const C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return c.begin(); +} + +#endif // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) + +/*@}*/ + +/** @defgroup buffer_sequence_end asio::buffer_sequence_end + * + * @brief The asio::buffer_sequence_end function returns an iterator + * pointing to one past the end element in a buffer sequence. + */ +/*@{*/ + +/// Get an iterator to one past the end element in a buffer sequence. +template +inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b, + typename enable_if< + is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return static_cast(detail::addressof(b)) + 1; +} + +/// Get an iterator to one past the end element in a buffer sequence. +template +inline const const_buffer* buffer_sequence_end(const ConstBuffer& b, + typename enable_if< + is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return static_cast(detail::addressof(b)) + 1; +} + +#if defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) + +/// Get an iterator to one past the end element in a buffer sequence. +template +inline auto buffer_sequence_end(C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT -> decltype(c.end()) +{ + return c.end(); +} + +/// Get an iterator to one past the end element in a buffer sequence. +template +inline auto buffer_sequence_end(const C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT -> decltype(c.end()) +{ + return c.end(); +} + +#else // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) + +template +inline typename C::iterator buffer_sequence_end(C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return c.end(); +} + +template +inline typename C::const_iterator buffer_sequence_end(const C& c, + typename enable_if< + !is_convertible::value + && !is_convertible::value + >::type* = 0) ASIO_NOEXCEPT +{ + return c.end(); +} + +#endif // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION) + +/*@}*/ + +namespace detail { + +// Tag types used to select appropriately optimised overloads. +struct one_buffer {}; +struct multiple_buffers {}; + +// Helper trait to detect single buffers. +template +struct buffer_sequence_cardinality : + conditional< + is_same::value +#if !defined(ASIO_NO_DEPRECATED) + || is_same::value + || is_same::value +#endif // !defined(ASIO_NO_DEPRECATED) + || is_same::value, + one_buffer, multiple_buffers>::type {}; + +template +inline std::size_t buffer_size(one_buffer, + Iterator begin, Iterator) ASIO_NOEXCEPT +{ + return const_buffer(*begin).size(); +} + +template +inline std::size_t buffer_size(multiple_buffers, + Iterator begin, Iterator end) ASIO_NOEXCEPT +{ + std::size_t total_buffer_size = 0; + + Iterator iter = begin; + for (; iter != end; ++iter) + { + const_buffer b(*iter); + total_buffer_size += b.size(); + } + + return total_buffer_size; +} + +} // namespace detail + +/// Get the total number of bytes in a buffer sequence. +/** + * The @c buffer_size function determines the total size of all buffers in the + * buffer sequence, as if computed as follows: + * + * @code size_t total_size = 0; + * auto i = asio::buffer_sequence_begin(buffers); + * auto end = asio::buffer_sequence_end(buffers); + * for (; i != end; ++i) + * { + * const_buffer b(*i); + * total_size += b.size(); + * } + * return total_size; @endcode + * + * The @c BufferSequence template parameter may meet either of the @c + * ConstBufferSequence or @c MutableBufferSequence type requirements. + */ +template +inline std::size_t buffer_size(const BufferSequence& b) ASIO_NOEXCEPT +{ + return detail::buffer_size( + detail::buffer_sequence_cardinality(), + asio::buffer_sequence_begin(b), + asio::buffer_sequence_end(b)); +} + +#if !defined(ASIO_NO_DEPRECATED) + +/** @defgroup buffer_cast asio::buffer_cast + * + * @brief (Deprecated: Use the @c data() member function.) The + * asio::buffer_cast function is used to obtain a pointer to the + * underlying memory region associated with a buffer. + * + * @par Examples: + * + * To access the memory of a non-modifiable buffer, use: + * @code asio::const_buffer b1 = ...; + * const unsigned char* p1 = asio::buffer_cast(b1); + * @endcode + * + * To access the memory of a modifiable buffer, use: + * @code asio::mutable_buffer b2 = ...; + * unsigned char* p2 = asio::buffer_cast(b2); + * @endcode + * + * The asio::buffer_cast function permits violations of type safety, so + * uses of it in application code should be carefully considered. + */ +/*@{*/ + +/// Cast a non-modifiable buffer to a specified pointer to POD type. +template +inline PointerToPodType buffer_cast(const mutable_buffer& b) ASIO_NOEXCEPT +{ + return static_cast(b.data()); +} + +/// Cast a non-modifiable buffer to a specified pointer to POD type. +template +inline PointerToPodType buffer_cast(const const_buffer& b) ASIO_NOEXCEPT +{ + return static_cast(b.data()); +} + +/*@}*/ + +#endif // !defined(ASIO_NO_DEPRECATED) + +/// Create a new modifiable buffer that is offset from the start of another. +/** + * @relates mutable_buffer + */ +inline mutable_buffer operator+(const mutable_buffer& b, + std::size_t n) ASIO_NOEXCEPT +{ + std::size_t offset = n < b.size() ? n : b.size(); + char* new_data = static_cast(b.data()) + offset; + std::size_t new_size = b.size() - offset; + return mutable_buffer(new_data, new_size +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , b.get_debug_check() +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new modifiable buffer that is offset from the start of another. +/** + * @relates mutable_buffer + */ +inline mutable_buffer operator+(std::size_t n, + const mutable_buffer& b) ASIO_NOEXCEPT +{ + return b + n; +} + +/// Create a new non-modifiable buffer that is offset from the start of another. +/** + * @relates const_buffer + */ +inline const_buffer operator+(const const_buffer& b, + std::size_t n) ASIO_NOEXCEPT +{ + std::size_t offset = n < b.size() ? n : b.size(); + const char* new_data = static_cast(b.data()) + offset; + std::size_t new_size = b.size() - offset; + return const_buffer(new_data, new_size +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , b.get_debug_check() +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new non-modifiable buffer that is offset from the start of another. +/** + * @relates const_buffer + */ +inline const_buffer operator+(std::size_t n, + const const_buffer& b) ASIO_NOEXCEPT +{ + return b + n; +} + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) +namespace detail { + +template +class buffer_debug_check +{ +public: + buffer_debug_check(Iterator iter) + : iter_(iter) + { + } + + ~buffer_debug_check() + { +#if defined(ASIO_MSVC) && (ASIO_MSVC == 1400) + // MSVC 8's string iterator checking may crash in a std::string::iterator + // object's destructor when the iterator points to an already-destroyed + // std::string object, unless the iterator is cleared first. + iter_ = Iterator(); +#endif // defined(ASIO_MSVC) && (ASIO_MSVC == 1400) + } + + void operator()() + { + (void)*iter_; + } + +private: + Iterator iter_; +}; + +} // namespace detail +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + +/** @defgroup buffer asio::buffer + * + * @brief The asio::buffer function is used to create a buffer object to + * represent raw memory, an array of POD elements, a vector of POD elements, + * or a std::string. + * + * A buffer object represents a contiguous region of memory as a 2-tuple + * consisting of a pointer and size in bytes. A tuple of the form {void*, + * size_t} specifies a mutable (modifiable) region of memory. Similarly, a + * tuple of the form {const void*, size_t} specifies a const + * (non-modifiable) region of memory. These two forms correspond to the classes + * mutable_buffer and const_buffer, respectively. To mirror C++'s conversion + * rules, a mutable_buffer is implicitly convertible to a const_buffer, and the + * opposite conversion is not permitted. + * + * The simplest use case involves reading or writing a single buffer of a + * specified size: + * + * @code sock.send(asio::buffer(data, size)); @endcode + * + * In the above example, the return value of asio::buffer meets the + * requirements of the ConstBufferSequence concept so that it may be directly + * passed to the socket's write function. A buffer created for modifiable + * memory also meets the requirements of the MutableBufferSequence concept. + * + * An individual buffer may be created from a builtin array, std::vector, + * std::array or boost::array of POD elements. This helps prevent buffer + * overruns by automatically determining the size of the buffer: + * + * @code char d1[128]; + * size_t bytes_transferred = sock.receive(asio::buffer(d1)); + * + * std::vector d2(128); + * bytes_transferred = sock.receive(asio::buffer(d2)); + * + * std::array d3; + * bytes_transferred = sock.receive(asio::buffer(d3)); + * + * boost::array d4; + * bytes_transferred = sock.receive(asio::buffer(d4)); @endcode + * + * In all three cases above, the buffers created are exactly 128 bytes long. + * Note that a vector is @e never automatically resized when creating or using + * a buffer. The buffer size is determined using the vector's size() + * member function, and not its capacity. + * + * @par Accessing Buffer Contents + * + * The contents of a buffer may be accessed using the @c data() and @c size() + * member functions: + * + * @code asio::mutable_buffer b1 = ...; + * std::size_t s1 = b1.size(); + * unsigned char* p1 = static_cast(b1.data()); + * + * asio::const_buffer b2 = ...; + * std::size_t s2 = b2.size(); + * const void* p2 = b2.data(); @endcode + * + * The @c data() member function permits violations of type safety, so + * uses of it in application code should be carefully considered. + * + * For convenience, a @ref buffer_size function is provided that works with + * both buffers and buffer sequences (that is, types meeting the + * ConstBufferSequence or MutableBufferSequence type requirements). In this + * case, the function returns the total size of all buffers in the sequence. + * + * @par Buffer Copying + * + * The @ref buffer_copy function may be used to copy raw bytes between + * individual buffers and buffer sequences. +* + * In particular, when used with the @ref buffer_size function, the @ref + * buffer_copy function can be used to linearise a sequence of buffers. For + * example: + * + * @code vector buffers = ...; + * + * vector data(asio::buffer_size(buffers)); + * asio::buffer_copy(asio::buffer(data), buffers); @endcode + * + * Note that @ref buffer_copy is implemented in terms of @c memcpy, and + * consequently it cannot be used to copy between overlapping memory regions. + * + * @par Buffer Invalidation + * + * A buffer object does not have any ownership of the memory it refers to. It + * is the responsibility of the application to ensure the memory region remains + * valid until it is no longer required for an I/O operation. When the memory + * is no longer available, the buffer is said to have been invalidated. + * + * For the asio::buffer overloads that accept an argument of type + * std::vector, the buffer objects returned are invalidated by any vector + * operation that also invalidates all references, pointers and iterators + * referring to the elements in the sequence (C++ Std, 23.2.4) + * + * For the asio::buffer overloads that accept an argument of type + * std::basic_string, the buffer objects returned are invalidated according to + * the rules defined for invalidation of references, pointers and iterators + * referring to elements of the sequence (C++ Std, 21.3). + * + * @par Buffer Arithmetic + * + * Buffer objects may be manipulated using simple arithmetic in a safe way + * which helps prevent buffer overruns. Consider an array initialised as + * follows: + * + * @code boost::array a = { 'a', 'b', 'c', 'd', 'e' }; @endcode + * + * A buffer object @c b1 created using: + * + * @code b1 = asio::buffer(a); @endcode + * + * represents the entire array, { 'a', 'b', 'c', 'd', 'e' }. An + * optional second argument to the asio::buffer function may be used to + * limit the size, in bytes, of the buffer: + * + * @code b2 = asio::buffer(a, 3); @endcode + * + * such that @c b2 represents the data { 'a', 'b', 'c' }. Even if the + * size argument exceeds the actual size of the array, the size of the buffer + * object created will be limited to the array size. + * + * An offset may be applied to an existing buffer to create a new one: + * + * @code b3 = b1 + 2; @endcode + * + * where @c b3 will set to represent { 'c', 'd', 'e' }. If the offset + * exceeds the size of the existing buffer, the newly created buffer will be + * empty. + * + * Both an offset and size may be specified to create a buffer that corresponds + * to a specific range of bytes within an existing buffer: + * + * @code b4 = asio::buffer(b1 + 1, 3); @endcode + * + * so that @c b4 will refer to the bytes { 'b', 'c', 'd' }. + * + * @par Buffers and Scatter-Gather I/O + * + * To read or write using multiple buffers (i.e. scatter-gather I/O), multiple + * buffer objects may be assigned into a container that supports the + * MutableBufferSequence (for read) or ConstBufferSequence (for write) concepts: + * + * @code + * char d1[128]; + * std::vector d2(128); + * boost::array d3; + * + * boost::array bufs1 = { + * asio::buffer(d1), + * asio::buffer(d2), + * asio::buffer(d3) }; + * bytes_transferred = sock.receive(bufs1); + * + * std::vector bufs2; + * bufs2.push_back(asio::buffer(d1)); + * bufs2.push_back(asio::buffer(d2)); + * bufs2.push_back(asio::buffer(d3)); + * bytes_transferred = sock.send(bufs2); @endcode + */ +/*@{*/ + +#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) +# define ASIO_MUTABLE_BUFFER mutable_buffer +# define ASIO_CONST_BUFFER const_buffer +#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) +# define ASIO_MUTABLE_BUFFER mutable_buffers_1 +# define ASIO_CONST_BUFFER const_buffers_1 +#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + +/// Create a new modifiable buffer from an existing buffer. +/** + * @returns mutable_buffer(b). + */ +inline ASIO_MUTABLE_BUFFER buffer( + const mutable_buffer& b) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(b); +} + +/// Create a new modifiable buffer from an existing buffer. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * b.data(), + * min(b.size(), max_size_in_bytes)); @endcode + */ +inline ASIO_MUTABLE_BUFFER buffer(const mutable_buffer& b, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER( + mutable_buffer(b.data(), + b.size() < max_size_in_bytes + ? b.size() : max_size_in_bytes +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , b.get_debug_check() +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + )); +} + +/// Create a new non-modifiable buffer from an existing buffer. +/** + * @returns const_buffer(b). + */ +inline ASIO_CONST_BUFFER buffer( + const const_buffer& b) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(b); +} + +/// Create a new non-modifiable buffer from an existing buffer. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * b.data(), + * min(b.size(), max_size_in_bytes)); @endcode + */ +inline ASIO_CONST_BUFFER buffer(const const_buffer& b, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(b.data(), + b.size() < max_size_in_bytes + ? b.size() : max_size_in_bytes +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , b.get_debug_check() +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new modifiable buffer that represents the given memory range. +/** + * @returns mutable_buffer(data, size_in_bytes). + */ +inline ASIO_MUTABLE_BUFFER buffer(void* data, + std::size_t size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data, size_in_bytes); +} + +/// Create a new non-modifiable buffer that represents the given memory range. +/** + * @returns const_buffer(data, size_in_bytes). + */ +inline ASIO_CONST_BUFFER buffer(const void* data, + std::size_t size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data, size_in_bytes); +} + +/// Create a new modifiable buffer that represents the given POD array. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * static_cast(data), + * N * sizeof(PodType)); @endcode + */ +template +inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N]) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data, N * sizeof(PodType)); +} + +/// Create a new modifiable buffer that represents the given POD array. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * static_cast(data), + * min(N * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N], + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data, + N * sizeof(PodType) < max_size_in_bytes + ? N * sizeof(PodType) : max_size_in_bytes); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * static_cast(data), + * N * sizeof(PodType)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer( + const PodType (&data)[N]) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data, N * sizeof(PodType)); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * static_cast(data), + * min(N * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer(const PodType (&data)[N], + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data, + N * sizeof(PodType) < max_size_in_bytes + ? N * sizeof(PodType) : max_size_in_bytes); +} + +#if defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) + +// Borland C++ and Sun Studio think the overloads: +// +// unspecified buffer(boost::array& array ...); +// +// and +// +// unspecified buffer(boost::array& array ...); +// +// are ambiguous. This will be worked around by using a buffer_types traits +// class that contains typedefs for the appropriate buffer and container +// classes, based on whether PodType is const or non-const. + +namespace detail { + +template +struct buffer_types_base; + +template <> +struct buffer_types_base +{ + typedef mutable_buffer buffer_type; + typedef ASIO_MUTABLE_BUFFER container_type; +}; + +template <> +struct buffer_types_base +{ + typedef const_buffer buffer_type; + typedef ASIO_CONST_BUFFER container_type; +}; + +template +struct buffer_types + : public buffer_types_base::value> +{ +}; + +} // namespace detail + +template +inline typename detail::buffer_types::container_type +buffer(boost::array& data) ASIO_NOEXCEPT +{ + typedef typename asio::detail::buffer_types::buffer_type + buffer_type; + typedef typename asio::detail::buffer_types::container_type + container_type; + return container_type( + buffer_type(data.c_array(), data.size() * sizeof(PodType))); +} + +template +inline typename detail::buffer_types::container_type +buffer(boost::array& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + typedef typename asio::detail::buffer_types::buffer_type + buffer_type; + typedef typename asio::detail::buffer_types::container_type + container_type; + return container_type( + buffer_type(data.c_array(), + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes)); +} + +#else // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) + +/// Create a new modifiable buffer that represents the given POD array. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.data(), + * data.size() * sizeof(PodType)); @endcode + */ +template +inline ASIO_MUTABLE_BUFFER buffer( + boost::array& data) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER( + data.c_array(), data.size() * sizeof(PodType)); +} + +/// Create a new modifiable buffer that represents the given POD array. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.data(), + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_MUTABLE_BUFFER buffer(boost::array& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data.c_array(), + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * data.size() * sizeof(PodType)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer( + boost::array& data) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer(boost::array& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes); +} + +#endif // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND) + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * data.size() * sizeof(PodType)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer( + const boost::array& data) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer(const boost::array& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes); +} + +#if defined(ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION) + +/// Create a new modifiable buffer that represents the given POD array. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.data(), + * data.size() * sizeof(PodType)); @endcode + */ +template +inline ASIO_MUTABLE_BUFFER buffer( + std::array& data) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data.data(), data.size() * sizeof(PodType)); +} + +/// Create a new modifiable buffer that represents the given POD array. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.data(), + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_MUTABLE_BUFFER buffer(std::array& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data.data(), + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * data.size() * sizeof(PodType)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer( + std::array& data) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer(std::array& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * data.size() * sizeof(PodType)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer( + const std::array& data) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType)); +} + +/// Create a new non-modifiable buffer that represents the given POD array. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer(const std::array& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes); +} + +#endif // defined(ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION) + +/// Create a new modifiable buffer that represents the given POD vector. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.size() ? &data[0] : 0, + * data.size() * sizeof(PodType)); @endcode + * + * @note The buffer is invalidated by any vector operation that would also + * invalidate iterators. + */ +template +inline ASIO_MUTABLE_BUFFER buffer( + std::vector& data) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER( + data.size() ? &data[0] : 0, data.size() * sizeof(PodType) +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::vector::iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new modifiable buffer that represents the given POD vector. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.size() ? &data[0] : 0, + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + * + * @note The buffer is invalidated by any vector operation that would also + * invalidate iterators. + */ +template +inline ASIO_MUTABLE_BUFFER buffer(std::vector& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0, + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::vector::iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new non-modifiable buffer that represents the given POD vector. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.size() ? &data[0] : 0, + * data.size() * sizeof(PodType)); @endcode + * + * @note The buffer is invalidated by any vector operation that would also + * invalidate iterators. + */ +template +inline ASIO_CONST_BUFFER buffer( + const std::vector& data) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER( + data.size() ? &data[0] : 0, data.size() * sizeof(PodType) +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::vector::const_iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new non-modifiable buffer that represents the given POD vector. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.size() ? &data[0] : 0, + * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode + * + * @note The buffer is invalidated by any vector operation that would also + * invalidate iterators. + */ +template +inline ASIO_CONST_BUFFER buffer( + const std::vector& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0, + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::vector::const_iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new modifiable buffer that represents the given string. +/** + * @returns mutable_buffer(data.size() ? &data[0] : 0, + * data.size() * sizeof(Elem)). + * + * @note The buffer is invalidated by any non-const operation called on the + * given string object. + */ +template +inline ASIO_MUTABLE_BUFFER buffer( + std::basic_string& data) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0, + data.size() * sizeof(Elem) +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::basic_string::iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new modifiable buffer that represents the given string. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.size() ? &data[0] : 0, + * min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode + * + * @note The buffer is invalidated by any non-const operation called on the + * given string object. + */ +template +inline ASIO_MUTABLE_BUFFER buffer( + std::basic_string& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0, + data.size() * sizeof(Elem) < max_size_in_bytes + ? data.size() * sizeof(Elem) : max_size_in_bytes +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::basic_string::iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new non-modifiable buffer that represents the given string. +/** + * @returns const_buffer(data.data(), data.size() * sizeof(Elem)). + * + * @note The buffer is invalidated by any non-const operation called on the + * given string object. + */ +template +inline ASIO_CONST_BUFFER buffer( + const std::basic_string& data) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(Elem) +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::basic_string::const_iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new non-modifiable buffer that represents the given string. +/** + * @returns A const_buffer value equivalent to: + * @code const_buffer( + * data.data(), + * min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode + * + * @note The buffer is invalidated by any non-const operation called on the + * given string object. + */ +template +inline ASIO_CONST_BUFFER buffer( + const std::basic_string& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.data(), + data.size() * sizeof(Elem) < max_size_in_bytes + ? data.size() * sizeof(Elem) : max_size_in_bytes +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename std::basic_string::const_iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +#if defined(ASIO_HAS_STRING_VIEW) \ + || defined(GENERATING_DOCUMENTATION) + +/// Create a new modifiable buffer that represents the given string_view. +/** + * @returns mutable_buffer(data.size() ? &data[0] : 0, + * data.size() * sizeof(Elem)). + */ +template +inline ASIO_CONST_BUFFER buffer( + basic_string_view data) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0, + data.size() * sizeof(Elem) +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename basic_string_view::iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +/// Create a new non-modifiable buffer that represents the given string. +/** + * @returns A mutable_buffer value equivalent to: + * @code mutable_buffer( + * data.size() ? &data[0] : 0, + * min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode + */ +template +inline ASIO_CONST_BUFFER buffer( + basic_string_view data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT +{ + return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0, + data.size() * sizeof(Elem) < max_size_in_bytes + ? data.size() * sizeof(Elem) : max_size_in_bytes +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + , detail::buffer_debug_check< + typename basic_string_view::iterator + >(data.begin()) +#endif // ASIO_ENABLE_BUFFER_DEBUGGING + ); +} + +#endif // defined(ASIO_HAS_STRING_VIEW) + // || defined(GENERATING_DOCUMENTATION) + +/*@}*/ + +/// Adapt a basic_string to the DynamicBuffer requirements. +/** + * Requires that sizeof(Elem) == 1. + */ +template +class dynamic_string_buffer +{ +public: + /// The type used to represent a sequence of constant buffers that refers to + /// the underlying memory. + typedef ASIO_CONST_BUFFER const_buffers_type; + + /// The type used to represent a sequence of mutable buffers that refers to + /// the underlying memory. + typedef ASIO_MUTABLE_BUFFER mutable_buffers_type; + + /// Construct a dynamic buffer from a string. + /** + * @param s The string to be used as backing storage for the dynamic buffer. + * The object stores a reference to the string and the user is responsible + * for ensuring that the string object remains valid while the + * dynamic_string_buffer object, and copies of the object, are in use. + * + * @b DynamicBuffer_v1: Any existing data in the string is treated as the + * dynamic buffer's input sequence. + * + * @param maximum_size Specifies a maximum size for the buffer, in bytes. + */ + explicit dynamic_string_buffer(std::basic_string& s, + std::size_t maximum_size = + (std::numeric_limits::max)()) ASIO_NOEXCEPT + : string_(s), +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + size_((std::numeric_limits::max)()), +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + max_size_(maximum_size) + { + } + + /// @b DynamicBuffer_v2: Copy construct a dynamic buffer. + dynamic_string_buffer(const dynamic_string_buffer& other) ASIO_NOEXCEPT + : string_(other.string_), +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + size_(other.size_), +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + max_size_(other.max_size_) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move construct a dynamic buffer. + dynamic_string_buffer(dynamic_string_buffer&& other) ASIO_NOEXCEPT + : string_(other.string_), +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + size_(other.size_), +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + max_size_(other.max_size_) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// @b DynamicBuffer_v1: Get the size of the input sequence. + /// @b DynamicBuffer_v2: Get the current size of the underlying memory. + /** + * @returns @b DynamicBuffer_v1 The current size of the input sequence. + * @b DynamicBuffer_v2: The current size of the underlying string if less than + * max_size(). Otherwise returns max_size(). + */ + std::size_t size() const ASIO_NOEXCEPT + { +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + if (size_ != (std::numeric_limits::max)()) + return size_; +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + return (std::min)(string_.size(), max_size()); + } + + /// Get the maximum size of the dynamic buffer. + /** + * @returns The allowed maximum size of the underlying memory. + */ + std::size_t max_size() const ASIO_NOEXCEPT + { + return max_size_; + } + + /// Get the maximum size that the buffer may grow to without triggering + /// reallocation. + /** + * @returns The current capacity of the underlying string if less than + * max_size(). Otherwise returns max_size(). + */ + std::size_t capacity() const ASIO_NOEXCEPT + { + return (std::min)(string_.capacity(), max_size()); + } + +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + /// @b DynamicBuffer_v1: Get a list of buffers that represents the input + /// sequence. + /** + * @returns An object of type @c const_buffers_type that satisfies + * ConstBufferSequence requirements, representing the basic_string memory in + * the input sequence. + * + * @note The returned object is invalidated by any @c dynamic_string_buffer + * or @c basic_string member function that resizes or erases the string. + */ + const_buffers_type data() const ASIO_NOEXCEPT + { + return const_buffers_type(asio::buffer(string_, size_)); + } +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + + /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the + /// underlying memory. + /** + * @param pos Position of the first byte to represent in the buffer sequence + * + * @param n The number of bytes to return in the buffer sequence. If the + * underlying memory is shorter, the buffer sequence represents as many bytes + * as are available. + * + * @returns An object of type @c mutable_buffers_type that satisfies + * MutableBufferSequence requirements, representing the basic_string memory. + * + * @note The returned object is invalidated by any @c dynamic_string_buffer + * or @c basic_string member function that resizes or erases the string. + */ + mutable_buffers_type data(std::size_t pos, std::size_t n) ASIO_NOEXCEPT + { + return mutable_buffers_type(asio::buffer( + asio::buffer(string_, max_size_) + pos, n)); + } + + /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the + /// underlying memory. + /** + * @param pos Position of the first byte to represent in the buffer sequence + * + * @param n The number of bytes to return in the buffer sequence. If the + * underlying memory is shorter, the buffer sequence represents as many bytes + * as are available. + * + * @note The returned object is invalidated by any @c dynamic_string_buffer + * or @c basic_string member function that resizes or erases the string. + */ + const_buffers_type data(std::size_t pos, + std::size_t n) const ASIO_NOEXCEPT + { + return const_buffers_type(asio::buffer( + asio::buffer(string_, max_size_) + pos, n)); + } + +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + /// @b DynamicBuffer_v1: Get a list of buffers that represents the output + /// sequence, with the given size. + /** + * Ensures that the output sequence can accommodate @c n bytes, resizing the + * basic_string object as necessary. + * + * @returns An object of type @c mutable_buffers_type that satisfies + * MutableBufferSequence requirements, representing basic_string memory + * at the start of the output sequence of size @c n. + * + * @throws std::length_error If size() + n > max_size(). + * + * @note The returned object is invalidated by any @c dynamic_string_buffer + * or @c basic_string member function that modifies the input sequence or + * output sequence. + */ + mutable_buffers_type prepare(std::size_t n) + { + if (size() > max_size() || max_size() - size() < n) + { + std::length_error ex("dynamic_string_buffer too long"); + asio::detail::throw_exception(ex); + } + + if (size_ == (std::numeric_limits::max)()) + size_ = string_.size(); // Enable v1 behaviour. + + string_.resize(size_ + n); + + return asio::buffer(asio::buffer(string_) + size_, n); + } + + /// @b DynamicBuffer_v1: Move bytes from the output sequence to the input + /// sequence. + /** + * @param n The number of bytes to append from the start of the output + * sequence to the end of the input sequence. The remainder of the output + * sequence is discarded. + * + * Requires a preceding call prepare(x) where x >= n, and + * no intervening operations that modify the input or output sequence. + * + * @note If @c n is greater than the size of the output sequence, the entire + * output sequence is moved to the input sequence and no error is issued. + */ + void commit(std::size_t n) + { + size_ += (std::min)(n, string_.size() - size_); + string_.resize(size_); + } +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + + /// @b DynamicBuffer_v2: Grow the underlying memory by the specified number of + /// bytes. + /** + * Resizes the string to accommodate an additional @c n bytes at the end. + * + * @throws std::length_error If size() + n > max_size(). + */ + void grow(std::size_t n) + { + if (size() > max_size() || max_size() - size() < n) + { + std::length_error ex("dynamic_string_buffer too long"); + asio::detail::throw_exception(ex); + } + + string_.resize(size() + n); + } + + /// @b DynamicBuffer_v2: Shrink the underlying memory by the specified number + /// of bytes. + /** + * Erases @c n bytes from the end of the string by resizing the basic_string + * object. If @c n is greater than the current size of the string, the string + * is emptied. + */ + void shrink(std::size_t n) + { + string_.resize(n > size() ? 0 : size() - n); + } + + /// @b DynamicBuffer_v1: Remove characters from the input sequence. + /// @b DynamicBuffer_v2: Consume the specified number of bytes from the + /// beginning of the underlying memory. + /** + * @b DynamicBuffer_v1: Removes @c n characters from the beginning of the + * input sequence. @note If @c n is greater than the size of the input + * sequence, the entire input sequence is consumed and no error is issued. + * + * @b DynamicBuffer_v2: Erases @c n bytes from the beginning of the string. + * If @c n is greater than the current size of the string, the string is + * emptied. + */ + void consume(std::size_t n) + { +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + if (size_ != (std::numeric_limits::max)()) + { + std::size_t consume_length = (std::min)(n, size_); + string_.erase(0, consume_length); + size_ -= consume_length; + return; + } +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + string_.erase(0, n); + } + +private: + std::basic_string& string_; +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + std::size_t size_; +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + const std::size_t max_size_; +}; + +/// Adapt a vector to the DynamicBuffer requirements. +/** + * Requires that sizeof(Elem) == 1. + */ +template +class dynamic_vector_buffer +{ +public: + /// The type used to represent a sequence of constant buffers that refers to + /// the underlying memory. + typedef ASIO_CONST_BUFFER const_buffers_type; + + /// The type used to represent a sequence of mutable buffers that refers to + /// the underlying memory. + typedef ASIO_MUTABLE_BUFFER mutable_buffers_type; + + /// Construct a dynamic buffer from a vector. + /** + * @param v The vector to be used as backing storage for the dynamic buffer. + * The object stores a reference to the vector and the user is responsible + * for ensuring that the vector object remains valid while the + * dynamic_vector_buffer object, and copies of the object, are in use. + * + * @param maximum_size Specifies a maximum size for the buffer, in bytes. + */ + explicit dynamic_vector_buffer(std::vector& v, + std::size_t maximum_size = + (std::numeric_limits::max)()) ASIO_NOEXCEPT + : vector_(v), +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + size_((std::numeric_limits::max)()), +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + max_size_(maximum_size) + { + } + + /// @b DynamicBuffer_v2: Copy construct a dynamic buffer. + dynamic_vector_buffer(const dynamic_vector_buffer& other) ASIO_NOEXCEPT + : vector_(other.vector_), +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + size_(other.size_), +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + max_size_(other.max_size_) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move construct a dynamic buffer. + dynamic_vector_buffer(dynamic_vector_buffer&& other) ASIO_NOEXCEPT + : vector_(other.vector_), +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + size_(other.size_), +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + max_size_(other.max_size_) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// @b DynamicBuffer_v1: Get the size of the input sequence. + /// @b DynamicBuffer_v2: Get the current size of the underlying memory. + /** + * @returns @b DynamicBuffer_v1 The current size of the input sequence. + * @b DynamicBuffer_v2: The current size of the underlying vector if less than + * max_size(). Otherwise returns max_size(). + */ + std::size_t size() const ASIO_NOEXCEPT + { +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + if (size_ != (std::numeric_limits::max)()) + return size_; +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + return (std::min)(vector_.size(), max_size()); + } + + /// Get the maximum size of the dynamic buffer. + /** + * @returns @b DynamicBuffer_v1: The allowed maximum of the sum of the sizes + * of the input sequence and output sequence. @b DynamicBuffer_v2: The allowed + * maximum size of the underlying memory. + */ + std::size_t max_size() const ASIO_NOEXCEPT + { + return max_size_; + } + + /// Get the maximum size that the buffer may grow to without triggering + /// reallocation. + /** + * @returns @b DynamicBuffer_v1: The current total capacity of the buffer, + * i.e. for both the input sequence and output sequence. @b DynamicBuffer_v2: + * The current capacity of the underlying vector if less than max_size(). + * Otherwise returns max_size(). + */ + std::size_t capacity() const ASIO_NOEXCEPT + { + return (std::min)(vector_.capacity(), max_size()); + } + +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + /// @b DynamicBuffer_v1: Get a list of buffers that represents the input + /// sequence. + /** + * @returns An object of type @c const_buffers_type that satisfies + * ConstBufferSequence requirements, representing the vector memory in the + * input sequence. + * + * @note The returned object is invalidated by any @c dynamic_vector_buffer + * or @c vector member function that modifies the input sequence or output + * sequence. + */ + const_buffers_type data() const ASIO_NOEXCEPT + { + return const_buffers_type(asio::buffer(vector_, size_)); + } +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + + /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the + /// underlying memory. + /** + * @param pos Position of the first byte to represent in the buffer sequence + * + * @param n The number of bytes to return in the buffer sequence. If the + * underlying memory is shorter, the buffer sequence represents as many bytes + * as are available. + * + * @returns An object of type @c mutable_buffers_type that satisfies + * MutableBufferSequence requirements, representing the vector memory. + * + * @note The returned object is invalidated by any @c dynamic_vector_buffer + * or @c vector member function that resizes or erases the vector. + */ + mutable_buffers_type data(std::size_t pos, std::size_t n) ASIO_NOEXCEPT + { + return mutable_buffers_type(asio::buffer( + asio::buffer(vector_, max_size_) + pos, n)); + } + + /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the + /// underlying memory. + /** + * @param pos Position of the first byte to represent in the buffer sequence + * + * @param n The number of bytes to return in the buffer sequence. If the + * underlying memory is shorter, the buffer sequence represents as many bytes + * as are available. + * + * @note The returned object is invalidated by any @c dynamic_vector_buffer + * or @c vector member function that resizes or erases the vector. + */ + const_buffers_type data(std::size_t pos, + std::size_t n) const ASIO_NOEXCEPT + { + return const_buffers_type(asio::buffer( + asio::buffer(vector_, max_size_) + pos, n)); + } + +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + /// @b DynamicBuffer_v1: Get a list of buffers that represents the output + /// sequence, with the given size. + /** + * Ensures that the output sequence can accommodate @c n bytes, resizing the + * vector object as necessary. + * + * @returns An object of type @c mutable_buffers_type that satisfies + * MutableBufferSequence requirements, representing vector memory at the + * start of the output sequence of size @c n. + * + * @throws std::length_error If size() + n > max_size(). + * + * @note The returned object is invalidated by any @c dynamic_vector_buffer + * or @c vector member function that modifies the input sequence or output + * sequence. + */ + mutable_buffers_type prepare(std::size_t n) + { + if (size () > max_size() || max_size() - size() < n) + { + std::length_error ex("dynamic_vector_buffer too long"); + asio::detail::throw_exception(ex); + } + + if (size_ == (std::numeric_limits::max)()) + size_ = vector_.size(); // Enable v1 behaviour. + + vector_.resize(size_ + n); + + return asio::buffer(asio::buffer(vector_) + size_, n); + } + + /// @b DynamicBuffer_v1: Move bytes from the output sequence to the input + /// sequence. + /** + * @param n The number of bytes to append from the start of the output + * sequence to the end of the input sequence. The remainder of the output + * sequence is discarded. + * + * Requires a preceding call prepare(x) where x >= n, and + * no intervening operations that modify the input or output sequence. + * + * @note If @c n is greater than the size of the output sequence, the entire + * output sequence is moved to the input sequence and no error is issued. + */ + void commit(std::size_t n) + { + size_ += (std::min)(n, vector_.size() - size_); + vector_.resize(size_); + } +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + + /// @b DynamicBuffer_v2: Grow the underlying memory by the specified number of + /// bytes. + /** + * Resizes the vector to accommodate an additional @c n bytes at the end. + * + * @throws std::length_error If size() + n > max_size(). + */ + void grow(std::size_t n) + { + if (size() > max_size() || max_size() - size() < n) + { + std::length_error ex("dynamic_vector_buffer too long"); + asio::detail::throw_exception(ex); + } + + vector_.resize(size() + n); + } + + /// @b DynamicBuffer_v2: Shrink the underlying memory by the specified number + /// of bytes. + /** + * Erases @c n bytes from the end of the vector by resizing the vector + * object. If @c n is greater than the current size of the vector, the vector + * is emptied. + */ + void shrink(std::size_t n) + { + vector_.resize(n > size() ? 0 : size() - n); + } + + /// @b DynamicBuffer_v1: Remove characters from the input sequence. + /// @b DynamicBuffer_v2: Consume the specified number of bytes from the + /// beginning of the underlying memory. + /** + * @b DynamicBuffer_v1: Removes @c n characters from the beginning of the + * input sequence. @note If @c n is greater than the size of the input + * sequence, the entire input sequence is consumed and no error is issued. + * + * @b DynamicBuffer_v2: Erases @c n bytes from the beginning of the vector. + * If @c n is greater than the current size of the vector, the vector is + * emptied. + */ + void consume(std::size_t n) + { +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + if (size_ != (std::numeric_limits::max)()) + { + std::size_t consume_length = (std::min)(n, size_); + vector_.erase(vector_.begin(), vector_.begin() + consume_length); + size_ -= consume_length; + return; + } +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + vector_.erase(vector_.begin(), vector_.begin() + (std::min)(size(), n)); + } + +private: + std::vector& vector_; +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + std::size_t size_; +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + const std::size_t max_size_; +}; + +/** @defgroup dynamic_buffer asio::dynamic_buffer + * + * @brief The asio::dynamic_buffer function is used to create a + * dynamically resized buffer from a @c std::basic_string or @c std::vector. + */ +/*@{*/ + +/// Create a new dynamic buffer that represents the given string. +/** + * @returns dynamic_string_buffer(data). + */ +template +inline dynamic_string_buffer dynamic_buffer( + std::basic_string& data) ASIO_NOEXCEPT +{ + return dynamic_string_buffer(data); +} + +/// Create a new dynamic buffer that represents the given string. +/** + * @returns dynamic_string_buffer(data, + * max_size). + */ +template +inline dynamic_string_buffer dynamic_buffer( + std::basic_string& data, + std::size_t max_size) ASIO_NOEXCEPT +{ + return dynamic_string_buffer(data, max_size); +} + +/// Create a new dynamic buffer that represents the given vector. +/** + * @returns dynamic_vector_buffer(data). + */ +template +inline dynamic_vector_buffer dynamic_buffer( + std::vector& data) ASIO_NOEXCEPT +{ + return dynamic_vector_buffer(data); +} + +/// Create a new dynamic buffer that represents the given vector. +/** + * @returns dynamic_vector_buffer(data, max_size). + */ +template +inline dynamic_vector_buffer dynamic_buffer( + std::vector& data, + std::size_t max_size) ASIO_NOEXCEPT +{ + return dynamic_vector_buffer(data, max_size); +} + +/*@}*/ + +/** @defgroup buffer_copy asio::buffer_copy + * + * @brief The asio::buffer_copy function is used to copy bytes from a + * source buffer (or buffer sequence) to a target buffer (or buffer sequence). + * + * The @c buffer_copy function is available in two forms: + * + * @li A 2-argument form: @c buffer_copy(target, source) + * + * @li A 3-argument form: @c buffer_copy(target, source, max_bytes_to_copy) + * + * Both forms return the number of bytes actually copied. The number of bytes + * copied is the lesser of: + * + * @li @c buffer_size(target) + * + * @li @c buffer_size(source) + * + * @li @c If specified, @c max_bytes_to_copy. + * + * This prevents buffer overflow, regardless of the buffer sizes used in the + * copy operation. + * + * Note that @ref buffer_copy is implemented in terms of @c memcpy, and + * consequently it cannot be used to copy between overlapping memory regions. + */ +/*@{*/ + +namespace detail { + +inline std::size_t buffer_copy_1(const mutable_buffer& target, + const const_buffer& source) +{ + using namespace std; // For memcpy. + std::size_t target_size = target.size(); + std::size_t source_size = source.size(); + std::size_t n = target_size < source_size ? target_size : source_size; + if (n > 0) + memcpy(target.data(), source.data(), n); + return n; +} + +template +inline std::size_t buffer_copy(one_buffer, one_buffer, + TargetIterator target_begin, TargetIterator, + SourceIterator source_begin, SourceIterator) ASIO_NOEXCEPT +{ + return (buffer_copy_1)(*target_begin, *source_begin); +} + +template +inline std::size_t buffer_copy(one_buffer, one_buffer, + TargetIterator target_begin, TargetIterator, + SourceIterator source_begin, SourceIterator, + std::size_t max_bytes_to_copy) ASIO_NOEXCEPT +{ + return (buffer_copy_1)(*target_begin, + asio::buffer(*source_begin, max_bytes_to_copy)); +} + +template +std::size_t buffer_copy(one_buffer, multiple_buffers, + TargetIterator target_begin, TargetIterator, + SourceIterator source_begin, SourceIterator source_end, + std::size_t max_bytes_to_copy + = (std::numeric_limits::max)()) ASIO_NOEXCEPT +{ + std::size_t total_bytes_copied = 0; + SourceIterator source_iter = source_begin; + + for (mutable_buffer target_buffer( + asio::buffer(*target_begin, max_bytes_to_copy)); + target_buffer.size() && source_iter != source_end; ++source_iter) + { + const_buffer source_buffer(*source_iter); + std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer); + total_bytes_copied += bytes_copied; + target_buffer += bytes_copied; + } + + return total_bytes_copied; +} + +template +std::size_t buffer_copy(multiple_buffers, one_buffer, + TargetIterator target_begin, TargetIterator target_end, + SourceIterator source_begin, SourceIterator, + std::size_t max_bytes_to_copy + = (std::numeric_limits::max)()) ASIO_NOEXCEPT +{ + std::size_t total_bytes_copied = 0; + TargetIterator target_iter = target_begin; + + for (const_buffer source_buffer( + asio::buffer(*source_begin, max_bytes_to_copy)); + source_buffer.size() && target_iter != target_end; ++target_iter) + { + mutable_buffer target_buffer(*target_iter); + std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer); + total_bytes_copied += bytes_copied; + source_buffer += bytes_copied; + } + + return total_bytes_copied; +} + +template +std::size_t buffer_copy(multiple_buffers, multiple_buffers, + TargetIterator target_begin, TargetIterator target_end, + SourceIterator source_begin, SourceIterator source_end) ASIO_NOEXCEPT +{ + std::size_t total_bytes_copied = 0; + + TargetIterator target_iter = target_begin; + std::size_t target_buffer_offset = 0; + + SourceIterator source_iter = source_begin; + std::size_t source_buffer_offset = 0; + + while (target_iter != target_end && source_iter != source_end) + { + mutable_buffer target_buffer = + mutable_buffer(*target_iter) + target_buffer_offset; + + const_buffer source_buffer = + const_buffer(*source_iter) + source_buffer_offset; + + std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer); + total_bytes_copied += bytes_copied; + + if (bytes_copied == target_buffer.size()) + { + ++target_iter; + target_buffer_offset = 0; + } + else + target_buffer_offset += bytes_copied; + + if (bytes_copied == source_buffer.size()) + { + ++source_iter; + source_buffer_offset = 0; + } + else + source_buffer_offset += bytes_copied; + } + + return total_bytes_copied; +} + +template +std::size_t buffer_copy(multiple_buffers, multiple_buffers, + TargetIterator target_begin, TargetIterator target_end, + SourceIterator source_begin, SourceIterator source_end, + std::size_t max_bytes_to_copy) ASIO_NOEXCEPT +{ + std::size_t total_bytes_copied = 0; + + TargetIterator target_iter = target_begin; + std::size_t target_buffer_offset = 0; + + SourceIterator source_iter = source_begin; + std::size_t source_buffer_offset = 0; + + while (total_bytes_copied != max_bytes_to_copy + && target_iter != target_end && source_iter != source_end) + { + mutable_buffer target_buffer = + mutable_buffer(*target_iter) + target_buffer_offset; + + const_buffer source_buffer = + const_buffer(*source_iter) + source_buffer_offset; + + std::size_t bytes_copied = (buffer_copy_1)( + target_buffer, asio::buffer(source_buffer, + max_bytes_to_copy - total_bytes_copied)); + total_bytes_copied += bytes_copied; + + if (bytes_copied == target_buffer.size()) + { + ++target_iter; + target_buffer_offset = 0; + } + else + target_buffer_offset += bytes_copied; + + if (bytes_copied == source_buffer.size()) + { + ++source_iter; + source_buffer_offset = 0; + } + else + source_buffer_offset += bytes_copied; + } + + return total_bytes_copied; +} + +} // namespace detail + +/// Copies bytes from a source buffer sequence to a target buffer sequence. +/** + * @param target A modifiable buffer sequence representing the memory regions to + * which the bytes will be copied. + * + * @param source A non-modifiable buffer sequence representing the memory + * regions from which the bytes will be copied. + * + * @returns The number of bytes copied. + * + * @note The number of bytes copied is the lesser of: + * + * @li @c buffer_size(target) + * + * @li @c buffer_size(source) + * + * This function is implemented in terms of @c memcpy, and consequently it + * cannot be used to copy between overlapping memory regions. + */ +template +inline std::size_t buffer_copy(const MutableBufferSequence& target, + const ConstBufferSequence& source) ASIO_NOEXCEPT +{ + return detail::buffer_copy( + detail::buffer_sequence_cardinality(), + detail::buffer_sequence_cardinality(), + asio::buffer_sequence_begin(target), + asio::buffer_sequence_end(target), + asio::buffer_sequence_begin(source), + asio::buffer_sequence_end(source)); +} + +/// Copies a limited number of bytes from a source buffer sequence to a target +/// buffer sequence. +/** + * @param target A modifiable buffer sequence representing the memory regions to + * which the bytes will be copied. + * + * @param source A non-modifiable buffer sequence representing the memory + * regions from which the bytes will be copied. + * + * @param max_bytes_to_copy The maximum number of bytes to be copied. + * + * @returns The number of bytes copied. + * + * @note The number of bytes copied is the lesser of: + * + * @li @c buffer_size(target) + * + * @li @c buffer_size(source) + * + * @li @c max_bytes_to_copy + * + * This function is implemented in terms of @c memcpy, and consequently it + * cannot be used to copy between overlapping memory regions. + */ +template +inline std::size_t buffer_copy(const MutableBufferSequence& target, + const ConstBufferSequence& source, + std::size_t max_bytes_to_copy) ASIO_NOEXCEPT +{ + return detail::buffer_copy( + detail::buffer_sequence_cardinality(), + detail::buffer_sequence_cardinality(), + asio::buffer_sequence_begin(target), + asio::buffer_sequence_end(target), + asio::buffer_sequence_begin(source), + asio::buffer_sequence_end(source), max_bytes_to_copy); +} + +/*@}*/ + +} // namespace asio + +#include "asio/detail/pop_options.hpp" +#include "asio/detail/is_buffer_sequence.hpp" +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Trait to determine whether a type satisfies the MutableBufferSequence +/// requirements. +template +struct is_mutable_buffer_sequence +#if defined(GENERATING_DOCUMENTATION) + : integral_constant +#else // defined(GENERATING_DOCUMENTATION) + : asio::detail::is_buffer_sequence +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +/// Trait to determine whether a type satisfies the ConstBufferSequence +/// requirements. +template +struct is_const_buffer_sequence +#if defined(GENERATING_DOCUMENTATION) + : integral_constant +#else // defined(GENERATING_DOCUMENTATION) + : asio::detail::is_buffer_sequence +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) +/// Trait to determine whether a type satisfies the DynamicBuffer_v1 +/// requirements. +template +struct is_dynamic_buffer_v1 +#if defined(GENERATING_DOCUMENTATION) + : integral_constant +#else // defined(GENERATING_DOCUMENTATION) + : asio::detail::is_dynamic_buffer_v1 +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; +#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1) + +/// Trait to determine whether a type satisfies the DynamicBuffer_v2 +/// requirements. +template +struct is_dynamic_buffer_v2 +#if defined(GENERATING_DOCUMENTATION) + : integral_constant +#else // defined(GENERATING_DOCUMENTATION) + : asio::detail::is_dynamic_buffer_v2 +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +/// Trait to determine whether a type satisfies the DynamicBuffer requirements. +/** + * If @c ASIO_NO_DYNAMIC_BUFFER_V1 is not defined, determines whether the + * type satisfies the DynamicBuffer_v1 requirements. Otherwise, if @c + * ASIO_NO_DYNAMIC_BUFFER_V1 is defined, determines whether the type + * satisfies the DynamicBuffer_v2 requirements. + */ +template +struct is_dynamic_buffer +#if defined(GENERATING_DOCUMENTATION) + : integral_constant +#elif defined(ASIO_NO_DYNAMIC_BUFFER_V1) + : asio::is_dynamic_buffer_v2 +#else // defined(ASIO_NO_DYNAMIC_BUFFER_V1) + : asio::is_dynamic_buffer_v1 +#endif // defined(ASIO_NO_DYNAMIC_BUFFER_V1) +{ +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BUFFER_HPP diff --git a/include/asio/include/asio/buffered_read_stream.hpp b/include/asio/include/asio/buffered_read_stream.hpp new file mode 100644 index 0000000..7280a54 --- /dev/null +++ b/include/asio/include/asio/buffered_read_stream.hpp @@ -0,0 +1,253 @@ +// +// buffered_read_stream.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFERED_READ_STREAM_HPP +#define ASIO_BUFFERED_READ_STREAM_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/async_result.hpp" +#include "asio/buffered_read_stream_fwd.hpp" +#include "asio/buffer.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_resize_guard.hpp" +#include "asio/detail/buffered_stream_storage.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Adds buffering to the read-related operations of a stream. +/** + * The buffered_read_stream class template can be used to add buffering to the + * synchronous and asynchronous read operations of a stream. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Concepts: + * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. + */ +template +class buffered_read_stream + : private noncopyable +{ +public: + /// The type of the next layer. + typedef typename remove_reference::type next_layer_type; + + /// The type of the lowest layer. + typedef typename next_layer_type::lowest_layer_type lowest_layer_type; + + /// The type of the executor associated with the object. + typedef typename lowest_layer_type::executor_type executor_type; + +#if defined(GENERATING_DOCUMENTATION) + /// The default buffer size. + static const std::size_t default_buffer_size = implementation_defined; +#else + ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024); +#endif + + /// Construct, passing the specified argument to initialise the next layer. + template + explicit buffered_read_stream(Arg& a) + : next_layer_(a), + storage_(default_buffer_size) + { + } + + /// Construct, passing the specified argument to initialise the next layer. + template + buffered_read_stream(Arg& a, std::size_t buffer_size) + : next_layer_(a), + storage_(buffer_size) + { + } + + /// Get a reference to the next layer. + next_layer_type& next_layer() + { + return next_layer_; + } + + /// Get a reference to the lowest layer. + lowest_layer_type& lowest_layer() + { + return next_layer_.lowest_layer(); + } + + /// Get a const reference to the lowest layer. + const lowest_layer_type& lowest_layer() const + { + return next_layer_.lowest_layer(); + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return next_layer_.lowest_layer().get_executor(); + } + + /// Close the stream. + void close() + { + next_layer_.close(); + } + + /// Close the stream. + ASIO_SYNC_OP_VOID close(asio::error_code& ec) + { + next_layer_.close(ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Write the given data to the stream. Returns the number of bytes written. + /// Throws an exception on failure. + template + std::size_t write_some(const ConstBufferSequence& buffers) + { + return next_layer_.write_some(buffers); + } + + /// Write the given data to the stream. Returns the number of bytes written, + /// or 0 if an error occurred. + template + std::size_t write_some(const ConstBufferSequence& buffers, + asio::error_code& ec) + { + return next_layer_.write_some(buffers, ec); + } + + /// Start an asynchronous write. The data being written must be valid for the + /// lifetime of the asynchronous operation. + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_write_some(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return next_layer_.async_write_some(buffers, + ASIO_MOVE_CAST(WriteHandler)(handler)); + } + + /// Fill the buffer with some data. Returns the number of bytes placed in the + /// buffer as a result of the operation. Throws an exception on failure. + std::size_t fill(); + + /// Fill the buffer with some data. Returns the number of bytes placed in the + /// buffer as a result of the operation, or 0 if an error occurred. + std::size_t fill(asio::error_code& ec); + + /// Start an asynchronous fill. + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + std::size_t)) ReadHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_fill( + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); + + /// Read some data from the stream. Returns the number of bytes read. Throws + /// an exception on failure. + template + std::size_t read_some(const MutableBufferSequence& buffers); + + /// Read some data from the stream. Returns the number of bytes read or 0 if + /// an error occurred. + template + std::size_t read_some(const MutableBufferSequence& buffers, + asio::error_code& ec); + + /// Start an asynchronous read. The buffer into which the data will be read + /// must be valid for the lifetime of the asynchronous operation. + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_read_some(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); + + /// Peek at the incoming data on the stream. Returns the number of bytes read. + /// Throws an exception on failure. + template + std::size_t peek(const MutableBufferSequence& buffers); + + /// Peek at the incoming data on the stream. Returns the number of bytes read, + /// or 0 if an error occurred. + template + std::size_t peek(const MutableBufferSequence& buffers, + asio::error_code& ec); + + /// Determine the amount of data that may be read without blocking. + std::size_t in_avail() + { + return storage_.size(); + } + + /// Determine the amount of data that may be read without blocking. + std::size_t in_avail(asio::error_code& ec) + { + ec = asio::error_code(); + return storage_.size(); + } + +private: + /// Copy data out of the internal buffer to the specified target buffer. + /// Returns the number of bytes copied. + template + std::size_t copy(const MutableBufferSequence& buffers) + { + std::size_t bytes_copied = asio::buffer_copy( + buffers, storage_.data(), storage_.size()); + storage_.consume(bytes_copied); + return bytes_copied; + } + + /// Copy data from the internal buffer to the specified target buffer, without + /// removing the data from the internal buffer. Returns the number of bytes + /// copied. + template + std::size_t peek_copy(const MutableBufferSequence& buffers) + { + return asio::buffer_copy(buffers, storage_.data(), storage_.size()); + } + + /// The next layer. + Stream next_layer_; + + // The data in the buffer. + detail::buffered_stream_storage storage_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/buffered_read_stream.hpp" + +#endif // ASIO_BUFFERED_READ_STREAM_HPP diff --git a/include/asio/include/asio/buffered_read_stream_fwd.hpp b/include/asio/include/asio/buffered_read_stream_fwd.hpp new file mode 100644 index 0000000..301f68a --- /dev/null +++ b/include/asio/include/asio/buffered_read_stream_fwd.hpp @@ -0,0 +1,25 @@ +// +// buffered_read_stream_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFERED_READ_STREAM_FWD_HPP +#define ASIO_BUFFERED_READ_STREAM_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +namespace asio { + +template +class buffered_read_stream; + +} // namespace asio + +#endif // ASIO_BUFFERED_READ_STREAM_FWD_HPP diff --git a/include/asio/include/asio/buffered_stream.hpp b/include/asio/include/asio/buffered_stream.hpp new file mode 100644 index 0000000..63f8253 --- /dev/null +++ b/include/asio/include/asio/buffered_stream.hpp @@ -0,0 +1,279 @@ +// +// buffered_stream.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFERED_STREAM_HPP +#define ASIO_BUFFERED_STREAM_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/async_result.hpp" +#include "asio/buffered_read_stream.hpp" +#include "asio/buffered_write_stream.hpp" +#include "asio/buffered_stream_fwd.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Adds buffering to the read- and write-related operations of a stream. +/** + * The buffered_stream class template can be used to add buffering to the + * synchronous and asynchronous read and write operations of a stream. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Concepts: + * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. + */ +template +class buffered_stream + : private noncopyable +{ +public: + /// The type of the next layer. + typedef typename remove_reference::type next_layer_type; + + /// The type of the lowest layer. + typedef typename next_layer_type::lowest_layer_type lowest_layer_type; + + /// The type of the executor associated with the object. + typedef typename lowest_layer_type::executor_type executor_type; + + /// Construct, passing the specified argument to initialise the next layer. + template + explicit buffered_stream(Arg& a) + : inner_stream_impl_(a), + stream_impl_(inner_stream_impl_) + { + } + + /// Construct, passing the specified argument to initialise the next layer. + template + explicit buffered_stream(Arg& a, std::size_t read_buffer_size, + std::size_t write_buffer_size) + : inner_stream_impl_(a, write_buffer_size), + stream_impl_(inner_stream_impl_, read_buffer_size) + { + } + + /// Get a reference to the next layer. + next_layer_type& next_layer() + { + return stream_impl_.next_layer().next_layer(); + } + + /// Get a reference to the lowest layer. + lowest_layer_type& lowest_layer() + { + return stream_impl_.lowest_layer(); + } + + /// Get a const reference to the lowest layer. + const lowest_layer_type& lowest_layer() const + { + return stream_impl_.lowest_layer(); + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return stream_impl_.lowest_layer().get_executor(); + } + + /// Close the stream. + void close() + { + stream_impl_.close(); + } + + /// Close the stream. + ASIO_SYNC_OP_VOID close(asio::error_code& ec) + { + stream_impl_.close(ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Flush all data from the buffer to the next layer. Returns the number of + /// bytes written to the next layer on the last write operation. Throws an + /// exception on failure. + std::size_t flush() + { + return stream_impl_.next_layer().flush(); + } + + /// Flush all data from the buffer to the next layer. Returns the number of + /// bytes written to the next layer on the last write operation, or 0 if an + /// error occurred. + std::size_t flush(asio::error_code& ec) + { + return stream_impl_.next_layer().flush(ec); + } + + /// Start an asynchronous flush. + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + std::size_t)) WriteHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_flush( + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return stream_impl_.next_layer().async_flush( + ASIO_MOVE_CAST(WriteHandler)(handler)); + } + + /// Write the given data to the stream. Returns the number of bytes written. + /// Throws an exception on failure. + template + std::size_t write_some(const ConstBufferSequence& buffers) + { + return stream_impl_.write_some(buffers); + } + + /// Write the given data to the stream. Returns the number of bytes written, + /// or 0 if an error occurred. + template + std::size_t write_some(const ConstBufferSequence& buffers, + asio::error_code& ec) + { + return stream_impl_.write_some(buffers, ec); + } + + /// Start an asynchronous write. The data being written must be valid for the + /// lifetime of the asynchronous operation. + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_write_some(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return stream_impl_.async_write_some(buffers, + ASIO_MOVE_CAST(WriteHandler)(handler)); + } + + /// Fill the buffer with some data. Returns the number of bytes placed in the + /// buffer as a result of the operation. Throws an exception on failure. + std::size_t fill() + { + return stream_impl_.fill(); + } + + /// Fill the buffer with some data. Returns the number of bytes placed in the + /// buffer as a result of the operation, or 0 if an error occurred. + std::size_t fill(asio::error_code& ec) + { + return stream_impl_.fill(ec); + } + + /// Start an asynchronous fill. + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + std::size_t)) ReadHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_fill( + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return stream_impl_.async_fill(ASIO_MOVE_CAST(ReadHandler)(handler)); + } + + /// Read some data from the stream. Returns the number of bytes read. Throws + /// an exception on failure. + template + std::size_t read_some(const MutableBufferSequence& buffers) + { + return stream_impl_.read_some(buffers); + } + + /// Read some data from the stream. Returns the number of bytes read or 0 if + /// an error occurred. + template + std::size_t read_some(const MutableBufferSequence& buffers, + asio::error_code& ec) + { + return stream_impl_.read_some(buffers, ec); + } + + /// Start an asynchronous read. The buffer into which the data will be read + /// must be valid for the lifetime of the asynchronous operation. + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_read_some(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return stream_impl_.async_read_some(buffers, + ASIO_MOVE_CAST(ReadHandler)(handler)); + } + + /// Peek at the incoming data on the stream. Returns the number of bytes read. + /// Throws an exception on failure. + template + std::size_t peek(const MutableBufferSequence& buffers) + { + return stream_impl_.peek(buffers); + } + + /// Peek at the incoming data on the stream. Returns the number of bytes read, + /// or 0 if an error occurred. + template + std::size_t peek(const MutableBufferSequence& buffers, + asio::error_code& ec) + { + return stream_impl_.peek(buffers, ec); + } + + /// Determine the amount of data that may be read without blocking. + std::size_t in_avail() + { + return stream_impl_.in_avail(); + } + + /// Determine the amount of data that may be read without blocking. + std::size_t in_avail(asio::error_code& ec) + { + return stream_impl_.in_avail(ec); + } + +private: + // The buffered write stream. + typedef buffered_write_stream write_stream_type; + write_stream_type inner_stream_impl_; + + // The buffered read stream. + typedef buffered_read_stream read_stream_type; + read_stream_type stream_impl_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BUFFERED_STREAM_HPP diff --git a/include/asio/include/asio/buffered_stream_fwd.hpp b/include/asio/include/asio/buffered_stream_fwd.hpp new file mode 100644 index 0000000..a9f350c --- /dev/null +++ b/include/asio/include/asio/buffered_stream_fwd.hpp @@ -0,0 +1,25 @@ +// +// buffered_stream_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFERED_STREAM_FWD_HPP +#define ASIO_BUFFERED_STREAM_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +namespace asio { + +template +class buffered_stream; + +} // namespace asio + +#endif // ASIO_BUFFERED_STREAM_FWD_HPP diff --git a/include/asio/include/asio/buffered_write_stream.hpp b/include/asio/include/asio/buffered_write_stream.hpp new file mode 100644 index 0000000..96e0ec8 --- /dev/null +++ b/include/asio/include/asio/buffered_write_stream.hpp @@ -0,0 +1,245 @@ +// +// buffered_write_stream.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFERED_WRITE_STREAM_HPP +#define ASIO_BUFFERED_WRITE_STREAM_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/buffered_write_stream_fwd.hpp" +#include "asio/buffer.hpp" +#include "asio/completion_condition.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffered_stream_storage.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/write.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Adds buffering to the write-related operations of a stream. +/** + * The buffered_write_stream class template can be used to add buffering to the + * synchronous and asynchronous write operations of a stream. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Concepts: + * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. + */ +template +class buffered_write_stream + : private noncopyable +{ +public: + /// The type of the next layer. + typedef typename remove_reference::type next_layer_type; + + /// The type of the lowest layer. + typedef typename next_layer_type::lowest_layer_type lowest_layer_type; + + /// The type of the executor associated with the object. + typedef typename lowest_layer_type::executor_type executor_type; + +#if defined(GENERATING_DOCUMENTATION) + /// The default buffer size. + static const std::size_t default_buffer_size = implementation_defined; +#else + ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024); +#endif + + /// Construct, passing the specified argument to initialise the next layer. + template + explicit buffered_write_stream(Arg& a) + : next_layer_(a), + storage_(default_buffer_size) + { + } + + /// Construct, passing the specified argument to initialise the next layer. + template + buffered_write_stream(Arg& a, std::size_t buffer_size) + : next_layer_(a), + storage_(buffer_size) + { + } + + /// Get a reference to the next layer. + next_layer_type& next_layer() + { + return next_layer_; + } + + /// Get a reference to the lowest layer. + lowest_layer_type& lowest_layer() + { + return next_layer_.lowest_layer(); + } + + /// Get a const reference to the lowest layer. + const lowest_layer_type& lowest_layer() const + { + return next_layer_.lowest_layer(); + } + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return next_layer_.lowest_layer().get_executor(); + } + + /// Close the stream. + void close() + { + next_layer_.close(); + } + + /// Close the stream. + ASIO_SYNC_OP_VOID close(asio::error_code& ec) + { + next_layer_.close(ec); + ASIO_SYNC_OP_VOID_RETURN(ec); + } + + /// Flush all data from the buffer to the next layer. Returns the number of + /// bytes written to the next layer on the last write operation. Throws an + /// exception on failure. + std::size_t flush(); + + /// Flush all data from the buffer to the next layer. Returns the number of + /// bytes written to the next layer on the last write operation, or 0 if an + /// error occurred. + std::size_t flush(asio::error_code& ec); + + /// Start an asynchronous flush. + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + std::size_t)) WriteHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_flush( + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); + + /// Write the given data to the stream. Returns the number of bytes written. + /// Throws an exception on failure. + template + std::size_t write_some(const ConstBufferSequence& buffers); + + /// Write the given data to the stream. Returns the number of bytes written, + /// or 0 if an error occurred and the error handler did not throw. + template + std::size_t write_some(const ConstBufferSequence& buffers, + asio::error_code& ec); + + /// Start an asynchronous write. The data being written must be valid for the + /// lifetime of the asynchronous operation. + template + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_write_some(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); + + /// Read some data from the stream. Returns the number of bytes read. Throws + /// an exception on failure. + template + std::size_t read_some(const MutableBufferSequence& buffers) + { + return next_layer_.read_some(buffers); + } + + /// Read some data from the stream. Returns the number of bytes read or 0 if + /// an error occurred. + template + std::size_t read_some(const MutableBufferSequence& buffers, + asio::error_code& ec) + { + return next_layer_.read_some(buffers, ec); + } + + /// Start an asynchronous read. The buffer into which the data will be read + /// must be valid for the lifetime of the asynchronous operation. + template + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_read_some(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + { + return next_layer_.async_read_some(buffers, + ASIO_MOVE_CAST(ReadHandler)(handler)); + } + + /// Peek at the incoming data on the stream. Returns the number of bytes read. + /// Throws an exception on failure. + template + std::size_t peek(const MutableBufferSequence& buffers) + { + return next_layer_.peek(buffers); + } + + /// Peek at the incoming data on the stream. Returns the number of bytes read, + /// or 0 if an error occurred. + template + std::size_t peek(const MutableBufferSequence& buffers, + asio::error_code& ec) + { + return next_layer_.peek(buffers, ec); + } + + /// Determine the amount of data that may be read without blocking. + std::size_t in_avail() + { + return next_layer_.in_avail(); + } + + /// Determine the amount of data that may be read without blocking. + std::size_t in_avail(asio::error_code& ec) + { + return next_layer_.in_avail(ec); + } + +private: + /// Copy data into the internal buffer from the specified source buffer. + /// Returns the number of bytes copied. + template + std::size_t copy(const ConstBufferSequence& buffers); + + /// The next layer. + Stream next_layer_; + + // The data in the buffer. + detail::buffered_stream_storage storage_; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/buffered_write_stream.hpp" + +#endif // ASIO_BUFFERED_WRITE_STREAM_HPP diff --git a/include/asio/include/asio/buffered_write_stream_fwd.hpp b/include/asio/include/asio/buffered_write_stream_fwd.hpp new file mode 100644 index 0000000..0b3a4b0 --- /dev/null +++ b/include/asio/include/asio/buffered_write_stream_fwd.hpp @@ -0,0 +1,25 @@ +// +// buffered_write_stream_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFERED_WRITE_STREAM_FWD_HPP +#define ASIO_BUFFERED_WRITE_STREAM_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +namespace asio { + +template +class buffered_write_stream; + +} // namespace asio + +#endif // ASIO_BUFFERED_WRITE_STREAM_FWD_HPP diff --git a/include/asio/include/asio/buffers_iterator.hpp b/include/asio/include/asio/buffers_iterator.hpp new file mode 100644 index 0000000..5cc7ba3 --- /dev/null +++ b/include/asio/include/asio/buffers_iterator.hpp @@ -0,0 +1,521 @@ +// +// buffers_iterator.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BUFFERS_ITERATOR_HPP +#define ASIO_BUFFERS_ITERATOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include +#include "asio/buffer.hpp" +#include "asio/detail/assert.hpp" +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +namespace detail +{ + template + struct buffers_iterator_types_helper; + + template <> + struct buffers_iterator_types_helper + { + typedef const_buffer buffer_type; + template + struct byte_type + { + typedef typename add_const::type type; + }; + }; + + template <> + struct buffers_iterator_types_helper + { + typedef mutable_buffer buffer_type; + template + struct byte_type + { + typedef ByteType type; + }; + }; + + template + struct buffers_iterator_types + { + enum + { + is_mutable = is_convertible< + typename BufferSequence::value_type, + mutable_buffer>::value + }; + typedef buffers_iterator_types_helper helper; + typedef typename helper::buffer_type buffer_type; + typedef typename helper::template byte_type::type byte_type; + typedef typename BufferSequence::const_iterator const_iterator; + }; + + template + struct buffers_iterator_types + { + typedef mutable_buffer buffer_type; + typedef ByteType byte_type; + typedef const mutable_buffer* const_iterator; + }; + + template + struct buffers_iterator_types + { + typedef const_buffer buffer_type; + typedef typename add_const::type byte_type; + typedef const const_buffer* const_iterator; + }; + +#if !defined(ASIO_NO_DEPRECATED) + + template + struct buffers_iterator_types + { + typedef mutable_buffer buffer_type; + typedef ByteType byte_type; + typedef const mutable_buffer* const_iterator; + }; + + template + struct buffers_iterator_types + { + typedef const_buffer buffer_type; + typedef typename add_const::type byte_type; + typedef const const_buffer* const_iterator; + }; + +#endif // !defined(ASIO_NO_DEPRECATED) +} + +/// A random access iterator over the bytes in a buffer sequence. +template +class buffers_iterator +{ +private: + typedef typename detail::buffers_iterator_types< + BufferSequence, ByteType>::buffer_type buffer_type; + + typedef typename detail::buffers_iterator_types::const_iterator buffer_sequence_iterator_type; + +public: + /// The type used for the distance between two iterators. + typedef std::ptrdiff_t difference_type; + + /// The type of the value pointed to by the iterator. + typedef ByteType value_type; + +#if defined(GENERATING_DOCUMENTATION) + /// The type of the result of applying operator->() to the iterator. + /** + * If the buffer sequence stores buffer objects that are convertible to + * mutable_buffer, this is a pointer to a non-const ByteType. Otherwise, a + * pointer to a const ByteType. + */ + typedef const_or_non_const_ByteType* pointer; +#else // defined(GENERATING_DOCUMENTATION) + typedef typename detail::buffers_iterator_types< + BufferSequence, ByteType>::byte_type* pointer; +#endif // defined(GENERATING_DOCUMENTATION) + +#if defined(GENERATING_DOCUMENTATION) + /// The type of the result of applying operator*() to the iterator. + /** + * If the buffer sequence stores buffer objects that are convertible to + * mutable_buffer, this is a reference to a non-const ByteType. Otherwise, a + * reference to a const ByteType. + */ + typedef const_or_non_const_ByteType& reference; +#else // defined(GENERATING_DOCUMENTATION) + typedef typename detail::buffers_iterator_types< + BufferSequence, ByteType>::byte_type& reference; +#endif // defined(GENERATING_DOCUMENTATION) + + /// The iterator category. + typedef std::random_access_iterator_tag iterator_category; + + /// Default constructor. Creates an iterator in an undefined state. + buffers_iterator() + : current_buffer_(), + current_buffer_position_(0), + begin_(), + current_(), + end_(), + position_(0) + { + } + + /// Construct an iterator representing the beginning of the buffers' data. + static buffers_iterator begin(const BufferSequence& buffers) +#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) + __attribute__ ((__noinline__)) +#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) + { + buffers_iterator new_iter; + new_iter.begin_ = asio::buffer_sequence_begin(buffers); + new_iter.current_ = asio::buffer_sequence_begin(buffers); + new_iter.end_ = asio::buffer_sequence_end(buffers); + while (new_iter.current_ != new_iter.end_) + { + new_iter.current_buffer_ = *new_iter.current_; + if (new_iter.current_buffer_.size() > 0) + break; + ++new_iter.current_; + } + return new_iter; + } + + /// Construct an iterator representing the end of the buffers' data. + static buffers_iterator end(const BufferSequence& buffers) +#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) + __attribute__ ((__noinline__)) +#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) + { + buffers_iterator new_iter; + new_iter.begin_ = asio::buffer_sequence_begin(buffers); + new_iter.current_ = asio::buffer_sequence_begin(buffers); + new_iter.end_ = asio::buffer_sequence_end(buffers); + while (new_iter.current_ != new_iter.end_) + { + buffer_type buffer = *new_iter.current_; + new_iter.position_ += buffer.size(); + ++new_iter.current_; + } + return new_iter; + } + + /// Dereference an iterator. + reference operator*() const + { + return dereference(); + } + + /// Dereference an iterator. + pointer operator->() const + { + return &dereference(); + } + + /// Access an individual element. + reference operator[](std::ptrdiff_t difference) const + { + buffers_iterator tmp(*this); + tmp.advance(difference); + return *tmp; + } + + /// Increment operator (prefix). + buffers_iterator& operator++() + { + increment(); + return *this; + } + + /// Increment operator (postfix). + buffers_iterator operator++(int) + { + buffers_iterator tmp(*this); + ++*this; + return tmp; + } + + /// Decrement operator (prefix). + buffers_iterator& operator--() + { + decrement(); + return *this; + } + + /// Decrement operator (postfix). + buffers_iterator operator--(int) + { + buffers_iterator tmp(*this); + --*this; + return tmp; + } + + /// Addition operator. + buffers_iterator& operator+=(std::ptrdiff_t difference) + { + advance(difference); + return *this; + } + + /// Subtraction operator. + buffers_iterator& operator-=(std::ptrdiff_t difference) + { + advance(-difference); + return *this; + } + + /// Addition operator. + friend buffers_iterator operator+(const buffers_iterator& iter, + std::ptrdiff_t difference) + { + buffers_iterator tmp(iter); + tmp.advance(difference); + return tmp; + } + + /// Addition operator. + friend buffers_iterator operator+(std::ptrdiff_t difference, + const buffers_iterator& iter) + { + buffers_iterator tmp(iter); + tmp.advance(difference); + return tmp; + } + + /// Subtraction operator. + friend buffers_iterator operator-(const buffers_iterator& iter, + std::ptrdiff_t difference) + { + buffers_iterator tmp(iter); + tmp.advance(-difference); + return tmp; + } + + /// Subtraction operator. + friend std::ptrdiff_t operator-(const buffers_iterator& a, + const buffers_iterator& b) + { + return b.distance_to(a); + } + + /// Test two iterators for equality. + friend bool operator==(const buffers_iterator& a, const buffers_iterator& b) + { + return a.equal(b); + } + + /// Test two iterators for inequality. + friend bool operator!=(const buffers_iterator& a, const buffers_iterator& b) + { + return !a.equal(b); + } + + /// Compare two iterators. + friend bool operator<(const buffers_iterator& a, const buffers_iterator& b) + { + return a.distance_to(b) > 0; + } + + /// Compare two iterators. + friend bool operator<=(const buffers_iterator& a, const buffers_iterator& b) + { + return !(b < a); + } + + /// Compare two iterators. + friend bool operator>(const buffers_iterator& a, const buffers_iterator& b) + { + return b < a; + } + + /// Compare two iterators. + friend bool operator>=(const buffers_iterator& a, const buffers_iterator& b) + { + return !(a < b); + } + +private: + // Dereference the iterator. + reference dereference() const + { + return static_cast( + current_buffer_.data())[current_buffer_position_]; + } + + // Compare two iterators for equality. + bool equal(const buffers_iterator& other) const + { + return position_ == other.position_; + } + + // Increment the iterator. + void increment() + { + ASIO_ASSERT(current_ != end_ && "iterator out of bounds"); + ++position_; + + // Check if the increment can be satisfied by the current buffer. + ++current_buffer_position_; + if (current_buffer_position_ != current_buffer_.size()) + return; + + // Find the next non-empty buffer. + ++current_; + current_buffer_position_ = 0; + while (current_ != end_) + { + current_buffer_ = *current_; + if (current_buffer_.size() > 0) + return; + ++current_; + } + } + + // Decrement the iterator. + void decrement() + { + ASIO_ASSERT(position_ > 0 && "iterator out of bounds"); + --position_; + + // Check if the decrement can be satisfied by the current buffer. + if (current_buffer_position_ != 0) + { + --current_buffer_position_; + return; + } + + // Find the previous non-empty buffer. + buffer_sequence_iterator_type iter = current_; + while (iter != begin_) + { + --iter; + buffer_type buffer = *iter; + std::size_t buffer_size = buffer.size(); + if (buffer_size > 0) + { + current_ = iter; + current_buffer_ = buffer; + current_buffer_position_ = buffer_size - 1; + return; + } + } + } + + // Advance the iterator by the specified distance. + void advance(std::ptrdiff_t n) + { + if (n > 0) + { + ASIO_ASSERT(current_ != end_ && "iterator out of bounds"); + for (;;) + { + std::ptrdiff_t current_buffer_balance + = current_buffer_.size() - current_buffer_position_; + + // Check if the advance can be satisfied by the current buffer. + if (current_buffer_balance > n) + { + position_ += n; + current_buffer_position_ += n; + return; + } + + // Update position. + n -= current_buffer_balance; + position_ += current_buffer_balance; + + // Move to next buffer. If it is empty then it will be skipped on the + // next iteration of this loop. + if (++current_ == end_) + { + ASIO_ASSERT(n == 0 && "iterator out of bounds"); + current_buffer_ = buffer_type(); + current_buffer_position_ = 0; + return; + } + current_buffer_ = *current_; + current_buffer_position_ = 0; + } + } + else if (n < 0) + { + std::size_t abs_n = -n; + ASIO_ASSERT(position_ >= abs_n && "iterator out of bounds"); + for (;;) + { + // Check if the advance can be satisfied by the current buffer. + if (current_buffer_position_ >= abs_n) + { + position_ -= abs_n; + current_buffer_position_ -= abs_n; + return; + } + + // Update position. + abs_n -= current_buffer_position_; + position_ -= current_buffer_position_; + + // Check if we've reached the beginning of the buffers. + if (current_ == begin_) + { + ASIO_ASSERT(abs_n == 0 && "iterator out of bounds"); + current_buffer_position_ = 0; + return; + } + + // Find the previous non-empty buffer. + buffer_sequence_iterator_type iter = current_; + while (iter != begin_) + { + --iter; + buffer_type buffer = *iter; + std::size_t buffer_size = buffer.size(); + if (buffer_size > 0) + { + current_ = iter; + current_buffer_ = buffer; + current_buffer_position_ = buffer_size; + break; + } + } + } + } + } + + // Determine the distance between two iterators. + std::ptrdiff_t distance_to(const buffers_iterator& other) const + { + return other.position_ - position_; + } + + buffer_type current_buffer_; + std::size_t current_buffer_position_; + buffer_sequence_iterator_type begin_; + buffer_sequence_iterator_type current_; + buffer_sequence_iterator_type end_; + std::size_t position_; +}; + +/// Construct an iterator representing the beginning of the buffers' data. +template +inline buffers_iterator buffers_begin( + const BufferSequence& buffers) +{ + return buffers_iterator::begin(buffers); +} + +/// Construct an iterator representing the end of the buffers' data. +template +inline buffers_iterator buffers_end( + const BufferSequence& buffers) +{ + return buffers_iterator::end(buffers); +} + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BUFFERS_ITERATOR_HPP diff --git a/include/asio/include/asio/co_spawn.hpp b/include/asio/include/asio/co_spawn.hpp new file mode 100644 index 0000000..38ee7ff --- /dev/null +++ b/include/asio/include/asio/co_spawn.hpp @@ -0,0 +1,471 @@ +// +// co_spawn.hpp +// ~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_CO_SPAWN_HPP +#define ASIO_CO_SPAWN_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) + +#include "asio/awaitable.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution_context.hpp" +#include "asio/is_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct awaitable_signature; + +template +struct awaitable_signature> +{ + typedef void type(std::exception_ptr, T); +}; + +template +struct awaitable_signature> +{ + typedef void type(std::exception_ptr); +}; + +} // namespace detail + +/// Spawn a new coroutined-based thread of execution. +/** + * @param ex The executor that will be used to schedule the new thread of + * execution. + * + * @param a The asio::awaitable object that is the result of calling the + * coroutine's entry point function. + * + * @param token The completion token that will handle the notification that + * the thread of execution has completed. The function signature of the + * completion handler must be: + * @code void handler(std::exception_ptr, T); @endcode + * + * @par Example + * @code + * asio::awaitable echo(tcp::socket socket) + * { + * std::size_t bytes_transferred = 0; + * + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * + * bytes_transferred += n; + * } + * } + * catch (const std::exception&) + * { + * } + * + * co_return bytes_transferred; + * } + * + * // ... + * + * asio::co_spawn(my_executor, + * echo(std::move(my_tcp_socket)), + * [](std::exception_ptr e, std::size_t n) + * { + * std::cout << "transferred " << n << "\n"; + * }); + * @endcode + */ +template +inline ASIO_INITFN_AUTO_RESULT_TYPE( + CompletionToken, void(std::exception_ptr, T)) +co_spawn(const Executor& ex, awaitable a, + CompletionToken&& token + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if< + (is_executor::value || execution::is_executor::value) + && is_convertible::value + >::type* = 0); + +/// Spawn a new coroutined-based thread of execution. +/** + * @param ex The executor that will be used to schedule the new thread of + * execution. + * + * @param a The asio::awaitable object that is the result of calling the + * coroutine's entry point function. + * + * @param token The completion token that will handle the notification that + * the thread of execution has completed. The function signature of the + * completion handler must be: + * @code void handler(std::exception_ptr); @endcode + * + * @par Example + * @code + * asio::awaitable echo(tcp::socket socket) + * { + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * } + * } + * catch (const std::exception& e) + * { + * std::cerr << "Exception: " << e.what() << "\n"; + * } + * } + * + * // ... + * + * asio::co_spawn(my_executor, + * echo(std::move(my_tcp_socket)), + * asio::detached); + * @endcode + */ +template +inline ASIO_INITFN_AUTO_RESULT_TYPE( + CompletionToken, void(std::exception_ptr)) +co_spawn(const Executor& ex, awaitable a, + CompletionToken&& token + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if< + (is_executor::value || execution::is_executor::value) + && is_convertible::value + >::type* = 0); + +/// Spawn a new coroutined-based thread of execution. +/** + * @param ctx An execution context that will provide the executor to be used to + * schedule the new thread of execution. + * + * @param a The asio::awaitable object that is the result of calling the + * coroutine's entry point function. + * + * @param token The completion token that will handle the notification that + * the thread of execution has completed. The function signature of the + * completion handler must be: + * @code void handler(std::exception_ptr); @endcode + * + * @par Example + * @code + * asio::awaitable echo(tcp::socket socket) + * { + * std::size_t bytes_transferred = 0; + * + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * + * bytes_transferred += n; + * } + * } + * catch (const std::exception&) + * { + * } + * + * co_return bytes_transferred; + * } + * + * // ... + * + * asio::co_spawn(my_io_context, + * echo(std::move(my_tcp_socket)), + * [](std::exception_ptr e, std::size_t n) + * { + * std::cout << "transferred " << n << "\n"; + * }); + * @endcode + */ +template +inline ASIO_INITFN_AUTO_RESULT_TYPE( + CompletionToken, void(std::exception_ptr, T)) +co_spawn(ExecutionContext& ctx, awaitable a, + CompletionToken&& token + ASIO_DEFAULT_COMPLETION_TOKEN( + typename ExecutionContext::executor_type), + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0); + +/// Spawn a new coroutined-based thread of execution. +/** + * @param ctx An execution context that will provide the executor to be used to + * schedule the new thread of execution. + * + * @param a The asio::awaitable object that is the result of calling the + * coroutine's entry point function. + * + * @param token The completion token that will handle the notification that + * the thread of execution has completed. The function signature of the + * completion handler must be: + * @code void handler(std::exception_ptr); @endcode + * + * @par Example + * @code + * asio::awaitable echo(tcp::socket socket) + * { + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * } + * } + * catch (const std::exception& e) + * { + * std::cerr << "Exception: " << e.what() << "\n"; + * } + * } + * + * // ... + * + * asio::co_spawn(my_io_context, + * echo(std::move(my_tcp_socket)), + * asio::detached); + * @endcode + */ +template +inline ASIO_INITFN_AUTO_RESULT_TYPE( + CompletionToken, void(std::exception_ptr)) +co_spawn(ExecutionContext& ctx, awaitable a, + CompletionToken&& token + ASIO_DEFAULT_COMPLETION_TOKEN( + typename ExecutionContext::executor_type), + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0); + +/// Spawn a new coroutined-based thread of execution. +/** + * @param ex The executor that will be used to schedule the new thread of + * execution. + * + * @param f A nullary function object with a return type of the form + * @c asio::awaitable that will be used as the coroutine's entry + * point. + * + * @param token The completion token that will handle the notification that the + * thread of execution has completed. If @c R is @c void, the function + * signature of the completion handler must be: + * + * @code void handler(std::exception_ptr); @endcode + * Otherwise, the function signature of the completion handler must be: + * @code void handler(std::exception_ptr, R); @endcode + * + * + * @par Example + * @code + * asio::awaitable echo(tcp::socket socket) + * { + * std::size_t bytes_transferred = 0; + * + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * + * bytes_transferred += n; + * } + * } + * catch (const std::exception&) + * { + * } + * + * co_return bytes_transferred; + * } + * + * // ... + * + * asio::co_spawn(my_executor, + * [socket = std::move(my_tcp_socket)]() mutable + * -> asio::awaitable + * { + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * } + * } + * catch (const std::exception& e) + * { + * std::cerr << "Exception: " << e.what() << "\n"; + * } + * }, asio::detached); + * @endcode + */ +template ::type>::type) CompletionToken + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)> +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, + typename detail::awaitable_signature::type>::type) +co_spawn(const Executor& ex, F&& f, + CompletionToken&& token + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if< + is_executor::value || execution::is_executor::value + >::type* = 0); + +/// Spawn a new coroutined-based thread of execution. +/** + * @param ctx An execution context that will provide the executor to be used to + * schedule the new thread of execution. + * + * @param f A nullary function object with a return type of the form + * @c asio::awaitable that will be used as the coroutine's entry + * point. + * + * @param token The completion token that will handle the notification that the + * thread of execution has completed. If @c R is @c void, the function + * signature of the completion handler must be: + * + * @code void handler(std::exception_ptr); @endcode + * Otherwise, the function signature of the completion handler must be: + * @code void handler(std::exception_ptr, R); @endcode + * + * + * @par Example + * @code + * asio::awaitable echo(tcp::socket socket) + * { + * std::size_t bytes_transferred = 0; + * + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * + * bytes_transferred += n; + * } + * } + * catch (const std::exception&) + * { + * } + * + * co_return bytes_transferred; + * } + * + * // ... + * + * asio::co_spawn(my_io_context, + * [socket = std::move(my_tcp_socket)]() mutable + * -> asio::awaitable + * { + * try + * { + * char data[1024]; + * for (;;) + * { + * std::size_t n = co_await socket.async_read_some( + * asio::buffer(data), asio::use_awaitable); + * + * co_await asio::async_write(socket, + * asio::buffer(data, n), asio::use_awaitable); + * } + * } + * catch (const std::exception& e) + * { + * std::cerr << "Exception: " << e.what() << "\n"; + * } + * }, asio::detached); + * @endcode + */ +template ::type>::type) CompletionToken + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE( + typename ExecutionContext::executor_type)> +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, + typename detail::awaitable_signature::type>::type) +co_spawn(ExecutionContext& ctx, F&& f, + CompletionToken&& token + ASIO_DEFAULT_COMPLETION_TOKEN( + typename ExecutionContext::executor_type), + typename enable_if< + is_convertible::value + >::type* = 0); + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/co_spawn.hpp" + +#endif // defined(ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) + +#endif // ASIO_CO_SPAWN_HPP diff --git a/include/asio/include/asio/completion_condition.hpp b/include/asio/include/asio/completion_condition.hpp new file mode 100644 index 0000000..3df5789 --- /dev/null +++ b/include/asio/include/asio/completion_condition.hpp @@ -0,0 +1,218 @@ +// +// completion_condition.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_COMPLETION_CONDITION_HPP +#define ASIO_COMPLETION_CONDITION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include + +#include "asio/detail/push_options.hpp" + +namespace asio { + +namespace detail { + +// The default maximum number of bytes to transfer in a single operation. +enum default_max_transfer_size_t { default_max_transfer_size = 65536 }; + +// Adapt result of old-style completion conditions (which had a bool result +// where true indicated that the operation was complete). +inline std::size_t adapt_completion_condition_result(bool result) +{ + return result ? 0 : default_max_transfer_size; +} + +// Adapt result of current completion conditions (which have a size_t result +// where 0 means the operation is complete, and otherwise the result is the +// maximum number of bytes to transfer on the next underlying operation). +inline std::size_t adapt_completion_condition_result(std::size_t result) +{ + return result; +} + +class transfer_all_t +{ +public: + typedef std::size_t result_type; + + template + std::size_t operator()(const Error& err, std::size_t) + { + return !!err ? 0 : default_max_transfer_size; + } +}; + +class transfer_at_least_t +{ +public: + typedef std::size_t result_type; + + explicit transfer_at_least_t(std::size_t minimum) + : minimum_(minimum) + { + } + + template + std::size_t operator()(const Error& err, std::size_t bytes_transferred) + { + return (!!err || bytes_transferred >= minimum_) + ? 0 : default_max_transfer_size; + } + +private: + std::size_t minimum_; +}; + +class transfer_exactly_t +{ +public: + typedef std::size_t result_type; + + explicit transfer_exactly_t(std::size_t size) + : size_(size) + { + } + + template + std::size_t operator()(const Error& err, std::size_t bytes_transferred) + { + return (!!err || bytes_transferred >= size_) ? 0 : + (size_ - bytes_transferred < default_max_transfer_size + ? size_ - bytes_transferred : std::size_t(default_max_transfer_size)); + } + +private: + std::size_t size_; +}; + +} // namespace detail + +/** + * @defgroup completion_condition Completion Condition Function Objects + * + * Function objects used for determining when a read or write operation should + * complete. + */ +/*@{*/ + +/// Return a completion condition function object that indicates that a read or +/// write operation should continue until all of the data has been transferred, +/// or until an error occurs. +/** + * This function is used to create an object, of unspecified type, that meets + * CompletionCondition requirements. + * + * @par Example + * Reading until a buffer is full: + * @code + * boost::array buf; + * asio::error_code ec; + * std::size_t n = asio::read( + * sock, asio::buffer(buf), + * asio::transfer_all(), ec); + * if (ec) + * { + * // An error occurred. + * } + * else + * { + * // n == 128 + * } + * @endcode + */ +#if defined(GENERATING_DOCUMENTATION) +unspecified transfer_all(); +#else +inline detail::transfer_all_t transfer_all() +{ + return detail::transfer_all_t(); +} +#endif + +/// Return a completion condition function object that indicates that a read or +/// write operation should continue until a minimum number of bytes has been +/// transferred, or until an error occurs. +/** + * This function is used to create an object, of unspecified type, that meets + * CompletionCondition requirements. + * + * @par Example + * Reading until a buffer is full or contains at least 64 bytes: + * @code + * boost::array buf; + * asio::error_code ec; + * std::size_t n = asio::read( + * sock, asio::buffer(buf), + * asio::transfer_at_least(64), ec); + * if (ec) + * { + * // An error occurred. + * } + * else + * { + * // n >= 64 && n <= 128 + * } + * @endcode + */ +#if defined(GENERATING_DOCUMENTATION) +unspecified transfer_at_least(std::size_t minimum); +#else +inline detail::transfer_at_least_t transfer_at_least(std::size_t minimum) +{ + return detail::transfer_at_least_t(minimum); +} +#endif + +/// Return a completion condition function object that indicates that a read or +/// write operation should continue until an exact number of bytes has been +/// transferred, or until an error occurs. +/** + * This function is used to create an object, of unspecified type, that meets + * CompletionCondition requirements. + * + * @par Example + * Reading until a buffer is full or contains exactly 64 bytes: + * @code + * boost::array buf; + * asio::error_code ec; + * std::size_t n = asio::read( + * sock, asio::buffer(buf), + * asio::transfer_exactly(64), ec); + * if (ec) + * { + * // An error occurred. + * } + * else + * { + * // n == 64 + * } + * @endcode + */ +#if defined(GENERATING_DOCUMENTATION) +unspecified transfer_exactly(std::size_t size); +#else +inline detail::transfer_exactly_t transfer_exactly(std::size_t size) +{ + return detail::transfer_exactly_t(size); +} +#endif + +/*@}*/ + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_COMPLETION_CONDITION_HPP diff --git a/include/asio/include/asio/compose.hpp b/include/asio/include/asio/compose.hpp new file mode 100644 index 0000000..fbbb4fe --- /dev/null +++ b/include/asio/include/asio/compose.hpp @@ -0,0 +1,136 @@ +// +// compose.hpp +// ~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_COMPOSE_HPP +#define ASIO_COMPOSE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/async_result.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \ + || defined(GENERATING_DOCUMENTATION) + +/// Launch an asynchronous operation with a stateful implementation. +/** + * The async_compose function simplifies the implementation of composed + * asynchronous operations automatically wrapping a stateful function object + * with a conforming intermediate completion handler. + * + * @param implementation A function object that contains the implementation of + * the composed asynchronous operation. The first argument to the function + * object is a non-const reference to the enclosing intermediate completion + * handler. The remaining arguments are any arguments that originate from the + * completion handlers of any asynchronous operations performed by the + * implementation. + + * @param token The completion token. + * + * @param io_objects_or_executors Zero or more I/O objects or I/O executors for + * which outstanding work must be maintained. + * + * @par Example: + * + * @code struct async_echo_implementation + * { + * tcp::socket& socket_; + * asio::mutable_buffer buffer_; + * enum { starting, reading, writing } state_; + * + * template + * void operator()(Self& self, + * asio::error_code error = {}, + * std::size_t n = 0) + * { + * switch (state_) + * { + * case starting: + * state_ = reading; + * socket_.async_read_some( + * buffer_, std::move(self)); + * break; + * case reading: + * if (error) + * { + * self.complete(error, 0); + * } + * else + * { + * state_ = writing; + * asio::async_write(socket_, buffer_, + * asio::transfer_exactly(n), + * std::move(self)); + * } + * break; + * case writing: + * self.complete(error, n); + * break; + * } + * } + * }; + * + * template + * auto async_echo(tcp::socket& socket, + * asio::mutable_buffer buffer, + * CompletionToken&& token) -> + * typename asio::async_result< + * typename std::decay::type, + * void(asio::error_code, std::size_t)>::return_type + * { + * return asio::async_compose( + * async_echo_implementation{socket, buffer, + * async_echo_implementation::starting}, + * token, socket); + * } @endcode + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature) +async_compose(ASIO_MOVE_ARG(Implementation) implementation, + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, + ASIO_MOVE_ARG(IoObjectsOrExecutors)... io_objects_or_executors); + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature) +async_compose(ASIO_MOVE_ARG(Implementation) implementation, + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token); + +#define ASIO_PRIVATE_ASYNC_COMPOSE_DEF(n) \ + template \ + ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature) \ + async_compose(ASIO_MOVE_ARG(Implementation) implementation, \ + ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ + ASIO_VARIADIC_MOVE_PARAMS(n)); + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ASYNC_COMPOSE_DEF) +#undef ASIO_PRIVATE_ASYNC_COMPOSE_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/compose.hpp" + +#endif // ASIO_COMPOSE_HPP diff --git a/include/asio/include/asio/connect.hpp b/include/asio/include/asio/connect.hpp new file mode 100644 index 0000000..46a890c --- /dev/null +++ b/include/asio/include/asio/connect.hpp @@ -0,0 +1,1076 @@ +// +// connect.hpp +// ~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_CONNECT_HPP +#define ASIO_CONNECT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/async_result.hpp" +#include "asio/basic_socket.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +namespace detail +{ + char (&has_iterator_helper(...))[2]; + + template + char has_iterator_helper(T*, typename T::iterator* = 0); + + template + struct has_iterator_typedef + { + enum { value = (sizeof((has_iterator_helper)((T*)(0))) == 1) }; + }; +} // namespace detail + +/// Type trait used to determine whether a type is an endpoint sequence that can +/// be used with with @c connect and @c async_connect. +template +struct is_endpoint_sequence +{ +#if defined(GENERATING_DOCUMENTATION) + /// The value member is true if the type may be used as an endpoint sequence. + static const bool value; +#else + enum + { + value = detail::has_iterator_typedef::value + }; +#endif +}; + +/** + * @defgroup connect asio::connect + * + * @brief The @c connect function is a composed operation that establishes a + * socket connection by trying each endpoint in a sequence. + */ +/*@{*/ + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param endpoints A sequence of endpoints. + * + * @returns The successfully connected endpoint. + * + * @throws asio::system_error Thrown on failure. If the sequence is + * empty, the associated @c error_code is asio::error::not_found. + * Otherwise, contains the error from the last connection attempt. + * + * @par Example + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::socket s(my_context); + * asio::connect(s, r.resolve(q)); @endcode + */ +template +typename Protocol::endpoint connect(basic_socket& s, + const EndpointSequence& endpoints, + typename enable_if::value>::type* = 0); + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param endpoints A sequence of endpoints. + * + * @param ec Set to indicate what error occurred, if any. If the sequence is + * empty, set to asio::error::not_found. Otherwise, contains the error + * from the last connection attempt. + * + * @returns On success, the successfully connected endpoint. Otherwise, a + * default-constructed endpoint. + * + * @par Example + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::socket s(my_context); + * asio::error_code ec; + * asio::connect(s, r.resolve(q), ec); + * if (ec) + * { + * // An error occurred. + * } @endcode + */ +template +typename Protocol::endpoint connect(basic_socket& s, + const EndpointSequence& endpoints, asio::error_code& ec, + typename enable_if::value>::type* = 0); + +#if !defined(ASIO_NO_DEPRECATED) +/// (Deprecated: Use range overload.) Establishes a socket connection by trying +/// each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @returns On success, an iterator denoting the successfully connected + * endpoint. Otherwise, the end iterator. + * + * @throws asio::system_error Thrown on failure. If the sequence is + * empty, the associated @c error_code is asio::error::not_found. + * Otherwise, contains the error from the last connection attempt. + * + * @note This overload assumes that a default constructed object of type @c + * Iterator represents the end of the sequence. This is a valid assumption for + * iterator types such as @c asio::ip::tcp::resolver::iterator. + */ +template +Iterator connect(basic_socket& s, Iterator begin, + typename enable_if::value>::type* = 0); + +/// (Deprecated: Use range overload.) Establishes a socket connection by trying +/// each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param ec Set to indicate what error occurred, if any. If the sequence is + * empty, set to asio::error::not_found. Otherwise, contains the error + * from the last connection attempt. + * + * @returns On success, an iterator denoting the successfully connected + * endpoint. Otherwise, the end iterator. + * + * @note This overload assumes that a default constructed object of type @c + * Iterator represents the end of the sequence. This is a valid assumption for + * iterator types such as @c asio::ip::tcp::resolver::iterator. + */ +template +Iterator connect(basic_socket& s, + Iterator begin, asio::error_code& ec, + typename enable_if::value>::type* = 0); +#endif // !defined(ASIO_NO_DEPRECATED) + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param end An iterator pointing to the end of a sequence of endpoints. + * + * @returns An iterator denoting the successfully connected endpoint. + * + * @throws asio::system_error Thrown on failure. If the sequence is + * empty, the associated @c error_code is asio::error::not_found. + * Otherwise, contains the error from the last connection attempt. + * + * @par Example + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::resolver::results_type e = r.resolve(q); + * tcp::socket s(my_context); + * asio::connect(s, e.begin(), e.end()); @endcode + */ +template +Iterator connect(basic_socket& s, + Iterator begin, Iterator end); + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param end An iterator pointing to the end of a sequence of endpoints. + * + * @param ec Set to indicate what error occurred, if any. If the sequence is + * empty, set to asio::error::not_found. Otherwise, contains the error + * from the last connection attempt. + * + * @returns On success, an iterator denoting the successfully connected + * endpoint. Otherwise, the end iterator. + * + * @par Example + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::resolver::results_type e = r.resolve(q); + * tcp::socket s(my_context); + * asio::error_code ec; + * asio::connect(s, e.begin(), e.end(), ec); + * if (ec) + * { + * // An error occurred. + * } @endcode + */ +template +Iterator connect(basic_socket& s, + Iterator begin, Iterator end, asio::error_code& ec); + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param endpoints A sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @returns The successfully connected endpoint. + * + * @throws asio::system_error Thrown on failure. If the sequence is + * empty, the associated @c error_code is asio::error::not_found. + * Otherwise, contains the error from the last connection attempt. + * + * @par Example + * The following connect condition function object can be used to output + * information about the individual connection attempts: + * @code struct my_connect_condition + * { + * bool operator()( + * const asio::error_code& ec, + * const::tcp::endpoint& next) + * { + * if (ec) std::cout << "Error: " << ec.message() << std::endl; + * std::cout << "Trying: " << next << std::endl; + * return true; + * } + * }; @endcode + * It would be used with the asio::connect function as follows: + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::socket s(my_context); + * tcp::endpoint e = asio::connect(s, + * r.resolve(q), my_connect_condition()); + * std::cout << "Connected to: " << e << std::endl; @endcode + */ +template +typename Protocol::endpoint connect(basic_socket& s, + const EndpointSequence& endpoints, ConnectCondition connect_condition, + typename enable_if::value>::type* = 0); + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param endpoints A sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @param ec Set to indicate what error occurred, if any. If the sequence is + * empty, set to asio::error::not_found. Otherwise, contains the error + * from the last connection attempt. + * + * @returns On success, the successfully connected endpoint. Otherwise, a + * default-constructed endpoint. + * + * @par Example + * The following connect condition function object can be used to output + * information about the individual connection attempts: + * @code struct my_connect_condition + * { + * bool operator()( + * const asio::error_code& ec, + * const::tcp::endpoint& next) + * { + * if (ec) std::cout << "Error: " << ec.message() << std::endl; + * std::cout << "Trying: " << next << std::endl; + * return true; + * } + * }; @endcode + * It would be used with the asio::connect function as follows: + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::socket s(my_context); + * asio::error_code ec; + * tcp::endpoint e = asio::connect(s, + * r.resolve(q), my_connect_condition(), ec); + * if (ec) + * { + * // An error occurred. + * } + * else + * { + * std::cout << "Connected to: " << e << std::endl; + * } @endcode + */ +template +typename Protocol::endpoint connect(basic_socket& s, + const EndpointSequence& endpoints, ConnectCondition connect_condition, + asio::error_code& ec, + typename enable_if::value>::type* = 0); + +#if !defined(ASIO_NO_DEPRECATED) +/// (Deprecated: Use range overload.) Establishes a socket connection by trying +/// each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @returns On success, an iterator denoting the successfully connected + * endpoint. Otherwise, the end iterator. + * + * @throws asio::system_error Thrown on failure. If the sequence is + * empty, the associated @c error_code is asio::error::not_found. + * Otherwise, contains the error from the last connection attempt. + * + * @note This overload assumes that a default constructed object of type @c + * Iterator represents the end of the sequence. This is a valid assumption for + * iterator types such as @c asio::ip::tcp::resolver::iterator. + */ +template +Iterator connect(basic_socket& s, + Iterator begin, ConnectCondition connect_condition, + typename enable_if::value>::type* = 0); + +/// (Deprecated: Use range overload.) Establishes a socket connection by trying +/// each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @param ec Set to indicate what error occurred, if any. If the sequence is + * empty, set to asio::error::not_found. Otherwise, contains the error + * from the last connection attempt. + * + * @returns On success, an iterator denoting the successfully connected + * endpoint. Otherwise, the end iterator. + * + * @note This overload assumes that a default constructed object of type @c + * Iterator represents the end of the sequence. This is a valid assumption for + * iterator types such as @c asio::ip::tcp::resolver::iterator. + */ +template +Iterator connect(basic_socket& s, Iterator begin, + ConnectCondition connect_condition, asio::error_code& ec, + typename enable_if::value>::type* = 0); +#endif // !defined(ASIO_NO_DEPRECATED) + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param end An iterator pointing to the end of a sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @returns An iterator denoting the successfully connected endpoint. + * + * @throws asio::system_error Thrown on failure. If the sequence is + * empty, the associated @c error_code is asio::error::not_found. + * Otherwise, contains the error from the last connection attempt. + * + * @par Example + * The following connect condition function object can be used to output + * information about the individual connection attempts: + * @code struct my_connect_condition + * { + * bool operator()( + * const asio::error_code& ec, + * const::tcp::endpoint& next) + * { + * if (ec) std::cout << "Error: " << ec.message() << std::endl; + * std::cout << "Trying: " << next << std::endl; + * return true; + * } + * }; @endcode + * It would be used with the asio::connect function as follows: + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::resolver::results_type e = r.resolve(q); + * tcp::socket s(my_context); + * tcp::resolver::results_type::iterator i = asio::connect( + * s, e.begin(), e.end(), my_connect_condition()); + * std::cout << "Connected to: " << i->endpoint() << std::endl; @endcode + */ +template +Iterator connect(basic_socket& s, Iterator begin, + Iterator end, ConnectCondition connect_condition); + +/// Establishes a socket connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c connect member + * function, once for each endpoint in the sequence, until a connection is + * successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param end An iterator pointing to the end of a sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @param ec Set to indicate what error occurred, if any. If the sequence is + * empty, set to asio::error::not_found. Otherwise, contains the error + * from the last connection attempt. + * + * @returns On success, an iterator denoting the successfully connected + * endpoint. Otherwise, the end iterator. + * + * @par Example + * The following connect condition function object can be used to output + * information about the individual connection attempts: + * @code struct my_connect_condition + * { + * bool operator()( + * const asio::error_code& ec, + * const::tcp::endpoint& next) + * { + * if (ec) std::cout << "Error: " << ec.message() << std::endl; + * std::cout << "Trying: " << next << std::endl; + * return true; + * } + * }; @endcode + * It would be used with the asio::connect function as follows: + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::resolver::results_type e = r.resolve(q); + * tcp::socket s(my_context); + * asio::error_code ec; + * tcp::resolver::results_type::iterator i = asio::connect( + * s, e.begin(), e.end(), my_connect_condition()); + * if (ec) + * { + * // An error occurred. + * } + * else + * { + * std::cout << "Connected to: " << i->endpoint() << std::endl; + * } @endcode + */ +template +Iterator connect(basic_socket& s, + Iterator begin, Iterator end, ConnectCondition connect_condition, + asio::error_code& ec); + +/*@}*/ + +/** + * @defgroup async_connect asio::async_connect + * + * @brief The @c async_connect function is a composed asynchronous operation + * that establishes a socket connection by trying each endpoint in a sequence. + */ +/*@{*/ + +/// Asynchronously establishes a socket connection by trying each endpoint in a +/// sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c async_connect + * member function, once for each endpoint in the sequence, until a connection + * is successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param endpoints A sequence of endpoints. + * + * @param handler The handler to be called when the connect operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. if the sequence is empty, set to + * // asio::error::not_found. Otherwise, contains the + * // error from the last connection attempt. + * const asio::error_code& error, + * + * // On success, the successfully connected endpoint. + * // Otherwise, a default-constructed endpoint. + * const typename Protocol::endpoint& endpoint + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::socket s(my_context); + * + * // ... + * + * r.async_resolve(q, resolve_handler); + * + * // ... + * + * void resolve_handler( + * const asio::error_code& ec, + * tcp::resolver::results_type results) + * { + * if (!ec) + * { + * asio::async_connect(s, results, connect_handler); + * } + * } + * + * // ... + * + * void connect_handler( + * const asio::error_code& ec, + * const tcp::endpoint& endpoint) + * { + * // ... + * } @endcode + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler, + void (asio::error_code, typename Protocol::endpoint)) +async_connect(basic_socket& s, + const EndpointSequence& endpoints, + ASIO_MOVE_ARG(RangeConnectHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if::value>::type* = 0); + +#if !defined(ASIO_NO_DEPRECATED) +/// (Deprecated: Use range overload.) Asynchronously establishes a socket +/// connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c async_connect + * member function, once for each endpoint in the sequence, until a connection + * is successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param handler The handler to be called when the connect operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. if the sequence is empty, set to + * // asio::error::not_found. Otherwise, contains the + * // error from the last connection attempt. + * const asio::error_code& error, + * + * // On success, an iterator denoting the successfully + * // connected endpoint. Otherwise, the end iterator. + * Iterator iterator + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note This overload assumes that a default constructed object of type @c + * Iterator represents the end of the sequence. This is a valid assumption for + * iterator types such as @c asio::ip::tcp::resolver::iterator. + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler, + void (asio::error_code, Iterator)) +async_connect(basic_socket& s, Iterator begin, + ASIO_MOVE_ARG(IteratorConnectHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if::value>::type* = 0); +#endif // !defined(ASIO_NO_DEPRECATED) + +/// Asynchronously establishes a socket connection by trying each endpoint in a +/// sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c async_connect + * member function, once for each endpoint in the sequence, until a connection + * is successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param end An iterator pointing to the end of a sequence of endpoints. + * + * @param handler The handler to be called when the connect operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. if the sequence is empty, set to + * // asio::error::not_found. Otherwise, contains the + * // error from the last connection attempt. + * const asio::error_code& error, + * + * // On success, an iterator denoting the successfully + * // connected endpoint. Otherwise, the end iterator. + * Iterator iterator + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * @code std::vector endpoints = ...; + * tcp::socket s(my_context); + * asio::async_connect(s, + * endpoints.begin(), endpoints.end(), + * connect_handler); + * + * // ... + * + * void connect_handler( + * const asio::error_code& ec, + * std::vector::iterator i) + * { + * // ... + * } @endcode + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler, + void (asio::error_code, Iterator)) +async_connect(basic_socket& s, Iterator begin, Iterator end, + ASIO_MOVE_ARG(IteratorConnectHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(Executor)); + +/// Asynchronously establishes a socket connection by trying each endpoint in a +/// sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c async_connect + * member function, once for each endpoint in the sequence, until a connection + * is successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param endpoints A sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @param handler The handler to be called when the connect operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. if the sequence is empty, set to + * // asio::error::not_found. Otherwise, contains the + * // error from the last connection attempt. + * const asio::error_code& error, + * + * // On success, an iterator denoting the successfully + * // connected endpoint. Otherwise, the end iterator. + * Iterator iterator + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * The following connect condition function object can be used to output + * information about the individual connection attempts: + * @code struct my_connect_condition + * { + * bool operator()( + * const asio::error_code& ec, + * const::tcp::endpoint& next) + * { + * if (ec) std::cout << "Error: " << ec.message() << std::endl; + * std::cout << "Trying: " << next << std::endl; + * return true; + * } + * }; @endcode + * It would be used with the asio::connect function as follows: + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::socket s(my_context); + * + * // ... + * + * r.async_resolve(q, resolve_handler); + * + * // ... + * + * void resolve_handler( + * const asio::error_code& ec, + * tcp::resolver::results_type results) + * { + * if (!ec) + * { + * asio::async_connect(s, results, + * my_connect_condition(), + * connect_handler); + * } + * } + * + * // ... + * + * void connect_handler( + * const asio::error_code& ec, + * const tcp::endpoint& endpoint) + * { + * if (ec) + * { + * // An error occurred. + * } + * else + * { + * std::cout << "Connected to: " << endpoint << std::endl; + * } + * } @endcode + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler, + void (asio::error_code, typename Protocol::endpoint)) +async_connect(basic_socket& s, + const EndpointSequence& endpoints, ConnectCondition connect_condition, + ASIO_MOVE_ARG(RangeConnectHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if::value>::type* = 0); + +#if !defined(ASIO_NO_DEPRECATED) +/// (Deprecated: Use range overload.) Asynchronously establishes a socket +/// connection by trying each endpoint in a sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c async_connect + * member function, once for each endpoint in the sequence, until a connection + * is successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @param handler The handler to be called when the connect operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. if the sequence is empty, set to + * // asio::error::not_found. Otherwise, contains the + * // error from the last connection attempt. + * const asio::error_code& error, + * + * // On success, an iterator denoting the successfully + * // connected endpoint. Otherwise, the end iterator. + * Iterator iterator + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @note This overload assumes that a default constructed object of type @c + * Iterator represents the end of the sequence. This is a valid assumption for + * iterator types such as @c asio::ip::tcp::resolver::iterator. + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler, + void (asio::error_code, Iterator)) +async_connect(basic_socket& s, Iterator begin, + ConnectCondition connect_condition, + ASIO_MOVE_ARG(IteratorConnectHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if::value>::type* = 0); +#endif // !defined(ASIO_NO_DEPRECATED) + +/// Asynchronously establishes a socket connection by trying each endpoint in a +/// sequence. +/** + * This function attempts to connect a socket to one of a sequence of + * endpoints. It does this by repeated calls to the socket's @c async_connect + * member function, once for each endpoint in the sequence, until a connection + * is successfully established. + * + * @param s The socket to be connected. If the socket is already open, it will + * be closed. + * + * @param begin An iterator pointing to the start of a sequence of endpoints. + * + * @param end An iterator pointing to the end of a sequence of endpoints. + * + * @param connect_condition A function object that is called prior to each + * connection attempt. The signature of the function object must be: + * @code bool connect_condition( + * const asio::error_code& ec, + * const typename Protocol::endpoint& next); @endcode + * The @c ec parameter contains the result from the most recent connect + * operation. Before the first connection attempt, @c ec is always set to + * indicate success. The @c next parameter is the next endpoint to be tried. + * The function object should return true if the next endpoint should be tried, + * and false if it should be skipped. + * + * @param handler The handler to be called when the connect operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * // Result of operation. if the sequence is empty, set to + * // asio::error::not_found. Otherwise, contains the + * // error from the last connection attempt. + * const asio::error_code& error, + * + * // On success, an iterator denoting the successfully + * // connected endpoint. Otherwise, the end iterator. + * Iterator iterator + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using asio::post(). + * + * @par Example + * The following connect condition function object can be used to output + * information about the individual connection attempts: + * @code struct my_connect_condition + * { + * bool operator()( + * const asio::error_code& ec, + * const::tcp::endpoint& next) + * { + * if (ec) std::cout << "Error: " << ec.message() << std::endl; + * std::cout << "Trying: " << next << std::endl; + * return true; + * } + * }; @endcode + * It would be used with the asio::connect function as follows: + * @code tcp::resolver r(my_context); + * tcp::resolver::query q("host", "service"); + * tcp::socket s(my_context); + * + * // ... + * + * r.async_resolve(q, resolve_handler); + * + * // ... + * + * void resolve_handler( + * const asio::error_code& ec, + * tcp::resolver::iterator i) + * { + * if (!ec) + * { + * tcp::resolver::iterator end; + * asio::async_connect(s, i, end, + * my_connect_condition(), + * connect_handler); + * } + * } + * + * // ... + * + * void connect_handler( + * const asio::error_code& ec, + * tcp::resolver::iterator i) + * { + * if (ec) + * { + * // An error occurred. + * } + * else + * { + * std::cout << "Connected to: " << i->endpoint() << std::endl; + * } + * } @endcode + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler, + void (asio::error_code, Iterator)) +async_connect(basic_socket& s, Iterator begin, + Iterator end, ConnectCondition connect_condition, + ASIO_MOVE_ARG(IteratorConnectHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(Executor)); + +/*@}*/ + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/connect.hpp" + +#endif diff --git a/include/asio/include/asio/coroutine.hpp b/include/asio/include/asio/coroutine.hpp new file mode 100644 index 0000000..b970bba --- /dev/null +++ b/include/asio/include/asio/coroutine.hpp @@ -0,0 +1,328 @@ +// +// coroutine.hpp +// ~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_COROUTINE_HPP +#define ASIO_COROUTINE_HPP + +namespace asio { +namespace detail { + +class coroutine_ref; + +} // namespace detail + +/// Provides support for implementing stackless coroutines. +/** + * The @c coroutine class may be used to implement stackless coroutines. The + * class itself is used to store the current state of the coroutine. + * + * Coroutines are copy-constructible and assignable, and the space overhead is + * a single int. They can be used as a base class: + * + * @code class session : coroutine + * { + * ... + * }; @endcode + * + * or as a data member: + * + * @code class session + * { + * ... + * coroutine coro_; + * }; @endcode + * + * or even bound in as a function argument using lambdas or @c bind(). The + * important thing is that as the application maintains a copy of the object + * for as long as the coroutine must be kept alive. + * + * @par Pseudo-keywords + * + * A coroutine is used in conjunction with certain "pseudo-keywords", which + * are implemented as macros. These macros are defined by a header file: + * + * @code #include @endcode + * + * and may conversely be undefined as follows: + * + * @code #include @endcode + * + * reenter + * + * The @c reenter macro is used to define the body of a coroutine. It takes a + * single argument: a pointer or reference to a coroutine object. For example, + * if the base class is a coroutine object you may write: + * + * @code reenter (this) + * { + * ... coroutine body ... + * } @endcode + * + * and if a data member or other variable you can write: + * + * @code reenter (coro_) + * { + * ... coroutine body ... + * } @endcode + * + * When @c reenter is executed at runtime, control jumps to the location of the + * last @c yield or @c fork. + * + * The coroutine body may also be a single statement, such as: + * + * @code reenter (this) for (;;) + * { + * ... + * } @endcode + * + * @b Limitation: The @c reenter macro is implemented using a switch. This + * means that you must take care when using local variables within the + * coroutine body. The local variable is not allowed in a position where + * reentering the coroutine could bypass the variable definition. + * + * yield statement + * + * This form of the @c yield keyword is often used with asynchronous operations: + * + * @code yield socket_->async_read_some(buffer(*buffer_), *this); @endcode + * + * This divides into four logical steps: + * + * @li @c yield saves the current state of the coroutine. + * @li The statement initiates the asynchronous operation. + * @li The resume point is defined immediately following the statement. + * @li Control is transferred to the end of the coroutine body. + * + * When the asynchronous operation completes, the function object is invoked + * and @c reenter causes control to transfer to the resume point. It is + * important to remember to carry the coroutine state forward with the + * asynchronous operation. In the above snippet, the current class is a + * function object object with a coroutine object as base class or data member. + * + * The statement may also be a compound statement, and this permits us to + * define local variables with limited scope: + * + * @code yield + * { + * mutable_buffers_1 b = buffer(*buffer_); + * socket_->async_read_some(b, *this); + * } @endcode + * + * yield return expression ; + * + * This form of @c yield is often used in generators or coroutine-based parsers. + * For example, the function object: + * + * @code struct interleave : coroutine + * { + * istream& is1; + * istream& is2; + * char operator()(char c) + * { + * reenter (this) for (;;) + * { + * yield return is1.get(); + * yield return is2.get(); + * } + * } + * }; @endcode + * + * defines a trivial coroutine that interleaves the characters from two input + * streams. + * + * This type of @c yield divides into three logical steps: + * + * @li @c yield saves the current state of the coroutine. + * @li The resume point is defined immediately following the semicolon. + * @li The value of the expression is returned from the function. + * + * yield ; + * + * This form of @c yield is equivalent to the following steps: + * + * @li @c yield saves the current state of the coroutine. + * @li The resume point is defined immediately following the semicolon. + * @li Control is transferred to the end of the coroutine body. + * + * This form might be applied when coroutines are used for cooperative + * threading and scheduling is explicitly managed. For example: + * + * @code struct task : coroutine + * { + * ... + * void operator()() + * { + * reenter (this) + * { + * while (... not finished ...) + * { + * ... do something ... + * yield; + * ... do some more ... + * yield; + * } + * } + * } + * ... + * }; + * ... + * task t1, t2; + * for (;;) + * { + * t1(); + * t2(); + * } @endcode + * + * yield break ; + * + * The final form of @c yield is used to explicitly terminate the coroutine. + * This form is comprised of two steps: + * + * @li @c yield sets the coroutine state to indicate termination. + * @li Control is transferred to the end of the coroutine body. + * + * Once terminated, calls to is_complete() return true and the coroutine cannot + * be reentered. + * + * Note that a coroutine may also be implicitly terminated if the coroutine + * body is exited without a yield, e.g. by return, throw or by running to the + * end of the body. + * + * fork statement + * + * The @c fork pseudo-keyword is used when "forking" a coroutine, i.e. splitting + * it into two (or more) copies. One use of @c fork is in a server, where a new + * coroutine is created to handle each client connection: + * + * @code reenter (this) + * { + * do + * { + * socket_.reset(new tcp::socket(my_context_)); + * yield acceptor->async_accept(*socket_, *this); + * fork server(*this)(); + * } while (is_parent()); + * ... client-specific handling follows ... + * } @endcode + * + * The logical steps involved in a @c fork are: + * + * @li @c fork saves the current state of the coroutine. + * @li The statement creates a copy of the coroutine and either executes it + * immediately or schedules it for later execution. + * @li The resume point is defined immediately following the semicolon. + * @li For the "parent", control immediately continues from the next line. + * + * The functions is_parent() and is_child() can be used to differentiate + * between parent and child. You would use these functions to alter subsequent + * control flow. + * + * Note that @c fork doesn't do the actual forking by itself. It is the + * application's responsibility to create a clone of the coroutine and call it. + * The clone can be called immediately, as above, or scheduled for delayed + * execution using something like asio::post(). + * + * @par Alternate macro names + * + * If preferred, an application can use macro names that follow a more typical + * naming convention, rather than the pseudo-keywords. These are: + * + * @li @c ASIO_CORO_REENTER instead of @c reenter + * @li @c ASIO_CORO_YIELD instead of @c yield + * @li @c ASIO_CORO_FORK instead of @c fork + */ +class coroutine +{ +public: + /// Constructs a coroutine in its initial state. + coroutine() : value_(0) {} + + /// Returns true if the coroutine is the child of a fork. + bool is_child() const { return value_ < 0; } + + /// Returns true if the coroutine is the parent of a fork. + bool is_parent() const { return !is_child(); } + + /// Returns true if the coroutine has reached its terminal state. + bool is_complete() const { return value_ == -1; } + +private: + friend class detail::coroutine_ref; + int value_; +}; + + +namespace detail { + +class coroutine_ref +{ +public: + coroutine_ref(coroutine& c) : value_(c.value_), modified_(false) {} + coroutine_ref(coroutine* c) : value_(c->value_), modified_(false) {} + ~coroutine_ref() { if (!modified_) value_ = -1; } + operator int() const { return value_; } + int& operator=(int v) { modified_ = true; return value_ = v; } +private: + void operator=(const coroutine_ref&); + int& value_; + bool modified_; +}; + +} // namespace detail +} // namespace asio + +#define ASIO_CORO_REENTER(c) \ + switch (::asio::detail::coroutine_ref _coro_value = c) \ + case -1: if (_coro_value) \ + { \ + goto terminate_coroutine; \ + terminate_coroutine: \ + _coro_value = -1; \ + goto bail_out_of_coroutine; \ + bail_out_of_coroutine: \ + break; \ + } \ + else /* fall-through */ case 0: + +#define ASIO_CORO_YIELD_IMPL(n) \ + for (_coro_value = (n);;) \ + if (_coro_value == 0) \ + { \ + case (n): ; \ + break; \ + } \ + else \ + switch (_coro_value ? 0 : 1) \ + for (;;) \ + /* fall-through */ case -1: if (_coro_value) \ + goto terminate_coroutine; \ + else for (;;) \ + /* fall-through */ case 1: if (_coro_value) \ + goto bail_out_of_coroutine; \ + else /* fall-through */ case 0: + +#define ASIO_CORO_FORK_IMPL(n) \ + for (_coro_value = -(n);; _coro_value = (n)) \ + if (_coro_value == (n)) \ + { \ + case -(n): ; \ + break; \ + } \ + else + +#if defined(_MSC_VER) +# define ASIO_CORO_YIELD ASIO_CORO_YIELD_IMPL(__COUNTER__ + 1) +# define ASIO_CORO_FORK ASIO_CORO_FORK_IMPL(__COUNTER__ + 1) +#else // defined(_MSC_VER) +# define ASIO_CORO_YIELD ASIO_CORO_YIELD_IMPL(__LINE__) +# define ASIO_CORO_FORK ASIO_CORO_FORK_IMPL(__LINE__) +#endif // defined(_MSC_VER) + +#endif // ASIO_COROUTINE_HPP diff --git a/include/asio/include/asio/deadline_timer.hpp b/include/asio/include/asio/deadline_timer.hpp new file mode 100644 index 0000000..2288027 --- /dev/null +++ b/include/asio/include/asio/deadline_timer.hpp @@ -0,0 +1,38 @@ +// +// deadline_timer.hpp +// ~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DEADLINE_TIMER_HPP +#define ASIO_DEADLINE_TIMER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + || defined(GENERATING_DOCUMENTATION) + +#include "asio/detail/socket_types.hpp" // Must come before posix_time. +#include "asio/basic_deadline_timer.hpp" + +#include + +namespace asio { + +/// Typedef for the typical usage of timer. Uses a UTC clock. +typedef basic_deadline_timer deadline_timer; + +} // namespace asio + +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // || defined(GENERATING_DOCUMENTATION) + +#endif // ASIO_DEADLINE_TIMER_HPP diff --git a/include/asio/include/asio/defer.hpp b/include/asio/include/asio/defer.hpp new file mode 100644 index 0000000..a034ff0 --- /dev/null +++ b/include/asio/include/asio/defer.hpp @@ -0,0 +1,130 @@ +// +// defer.hpp +// ~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DEFER_HPP +#define ASIO_DEFER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/async_result.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution_context.hpp" +#include "asio/execution/executor.hpp" +#include "asio/is_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Submits a completion token or function object for execution. +/** + * This function submits an object for execution using the object's associated + * executor. The function object is queued for execution, and is never called + * from the current thread prior to returning from defer(). + * + * The use of @c defer(), rather than @ref post(), indicates the caller's + * preference that the executor defer the queueing of the function object. This + * may allow the executor to optimise queueing for cases when the function + * object represents a continuation of the current call context. + * + * This function has the following effects: + * + * @li Constructs a function object handler of type @c Handler, initialized + * with handler(forward(token)). + * + * @li Constructs an object @c result of type async_result, + * initializing the object as result(handler). + * + * @li Obtains the handler's associated executor object @c ex by performing + * get_associated_executor(handler). + * + * @li Obtains the handler's associated allocator object @c alloc by performing + * get_associated_allocator(handler). + * + * @li Performs ex.defer(std::move(handler), alloc). + * + * @li Returns result.get(). + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer( + ASIO_MOVE_ARG(CompletionToken) token); + +/// Submits a completion token or function object for execution. +/** + * This function submits an object for execution using the specified executor. + * The function object is queued for execution, and is never called from the + * current thread prior to returning from defer(). + * + * The use of @c defer(), rather than @ref post(), indicates the caller's + * preference that the executor defer the queueing of the function object. This + * may allow the executor to optimise queueing for cases when the function + * object represents a continuation of the current call context. + * + * This function has the following effects: + * + * @li Constructs a function object handler of type @c Handler, initialized + * with handler(forward(token)). + * + * @li Constructs an object @c result of type async_result, + * initializing the object as result(handler). + * + * @li Obtains the handler's associated executor object @c ex1 by performing + * get_associated_executor(handler). + * + * @li Creates a work object @c w by performing make_work(ex1). + * + * @li Obtains the handler's associated allocator object @c alloc by performing + * get_associated_allocator(handler). + * + * @li Constructs a function object @c f with a function call operator that + * performs ex1.dispatch(std::move(handler), alloc) followed by + * w.reset(). + * + * @li Performs Executor(ex).defer(std::move(f), alloc). + * + * @li Returns result.get(). + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer( + const Executor& ex, + ASIO_MOVE_ARG(CompletionToken) token + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if< + execution::is_executor::value || is_executor::value + >::type* = 0); + +/// Submits a completion token or function object for execution. +/** + * @returns defer(ctx.get_executor(), forward(token)). + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer( + ExecutionContext& ctx, + ASIO_MOVE_ARG(CompletionToken) token + ASIO_DEFAULT_COMPLETION_TOKEN( + typename ExecutionContext::executor_type), + typename enable_if::value>::type* = 0); + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/defer.hpp" + +#endif // ASIO_DEFER_HPP diff --git a/include/asio/include/asio/detached.hpp b/include/asio/include/asio/detached.hpp new file mode 100644 index 0000000..d53879d --- /dev/null +++ b/include/asio/include/asio/detached.hpp @@ -0,0 +1,112 @@ +// +// detached.hpp +// ~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETACHED_HPP +#define ASIO_DETACHED_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Class used to specify that an asynchronous operation is detached. +/** + + * The detached_t class is used to indicate that an asynchronous operation is + * detached. That is, there is no completion handler waiting for the + * operation's result. A detached_t object may be passed as a handler to an + * asynchronous operation, typically using the special value + * @c asio::detached. For example: + + * @code my_socket.async_send(my_buffer, asio::detached); + * @endcode + */ +class detached_t +{ +public: + /// Constructor. + ASIO_CONSTEXPR detached_t() + { + } + + /// Adapts an executor to add the @c detached_t completion token as the + /// default. + template + struct executor_with_default : InnerExecutor + { + /// Specify @c detached_t as the default completion token type. + typedef detached_t default_completion_token_type; + + /// Construct the adapted executor from the inner executor type. + executor_with_default(const InnerExecutor& ex) ASIO_NOEXCEPT + : InnerExecutor(ex) + { + } + + /// Convert the specified executor to the inner executor type, then use + /// that to construct the adapted executor. + template + executor_with_default(const OtherExecutor& ex, + typename enable_if< + is_convertible::value + >::type* = 0) ASIO_NOEXCEPT + : InnerExecutor(ex) + { + } + }; + + /// Type alias to adapt an I/O object to use @c detached_t as its + /// default completion token type. +#if defined(ASIO_HAS_ALIAS_TEMPLATES) \ + || defined(GENERATING_DOCUMENTATION) + template + using as_default_on_t = typename T::template rebind_executor< + executor_with_default >::other; +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + + /// Function helper to adapt an I/O object to use @c detached_t as its + /// default completion token type. + template + static typename decay::type::template rebind_executor< + executor_with_default::type::executor_type> + >::other + as_default_on(ASIO_MOVE_ARG(T) object) + { + return typename decay::type::template rebind_executor< + executor_with_default::type::executor_type> + >::other(ASIO_MOVE_CAST(T)(object)); + } +}; + +/// A special value, similar to std::nothrow. +/** + * See the documentation for asio::detached_t for a usage example. + */ +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr detached_t detached; +#elif defined(ASIO_MSVC) +__declspec(selectany) detached_t detached; +#endif + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/detached.hpp" + +#endif // ASIO_DETACHED_HPP diff --git a/include/asio/include/asio/detail/array.hpp b/include/asio/include/asio/detail/array.hpp new file mode 100644 index 0000000..dbc9c30 --- /dev/null +++ b/include/asio/include/asio/detail/array.hpp @@ -0,0 +1,38 @@ +// +// detail/array.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_ARRAY_HPP +#define ASIO_DETAIL_ARRAY_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_ARRAY) +# include +#else // defined(ASIO_HAS_STD_ARRAY) +# include +#endif // defined(ASIO_HAS_STD_ARRAY) + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_STD_ARRAY) +using std::array; +#else // defined(ASIO_HAS_STD_ARRAY) +using boost::array; +#endif // defined(ASIO_HAS_STD_ARRAY) + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_ARRAY_HPP diff --git a/include/asio/include/asio/detail/array_fwd.hpp b/include/asio/include/asio/detail/array_fwd.hpp new file mode 100644 index 0000000..b7f81ec --- /dev/null +++ b/include/asio/include/asio/detail/array_fwd.hpp @@ -0,0 +1,34 @@ +// +// detail/array_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_ARRAY_FWD_HPP +#define ASIO_DETAIL_ARRAY_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +namespace boost { + +template +class array; + +} // namespace boost + +// Standard library components can't be forward declared, so we'll have to +// include the array header. Fortunately, it's fairly lightweight and doesn't +// add significantly to the compile time. +#if defined(ASIO_HAS_STD_ARRAY) +# include +#endif // defined(ASIO_HAS_STD_ARRAY) + +#endif // ASIO_DETAIL_ARRAY_FWD_HPP diff --git a/include/asio/include/asio/detail/assert.hpp b/include/asio/include/asio/detail/assert.hpp new file mode 100644 index 0000000..6f93e38 --- /dev/null +++ b/include/asio/include/asio/detail/assert.hpp @@ -0,0 +1,32 @@ +// +// detail/assert.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_ASSERT_HPP +#define ASIO_DETAIL_ASSERT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_ASSERT) +# include +#else // defined(ASIO_HAS_BOOST_ASSERT) +# include +#endif // defined(ASIO_HAS_BOOST_ASSERT) + +#if defined(ASIO_HAS_BOOST_ASSERT) +# define ASIO_ASSERT(expr) BOOST_ASSERT(expr) +#else // defined(ASIO_HAS_BOOST_ASSERT) +# define ASIO_ASSERT(expr) assert(expr) +#endif // defined(ASIO_HAS_BOOST_ASSERT) + +#endif // ASIO_DETAIL_ASSERT_HPP diff --git a/include/asio/include/asio/detail/atomic_count.hpp b/include/asio/include/asio/detail/atomic_count.hpp new file mode 100644 index 0000000..b1d257d --- /dev/null +++ b/include/asio/include/asio/detail/atomic_count.hpp @@ -0,0 +1,64 @@ +// +// detail/atomic_count.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_ATOMIC_COUNT_HPP +#define ASIO_DETAIL_ATOMIC_COUNT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) +// Nothing to include. +#elif defined(ASIO_HAS_STD_ATOMIC) +# include +#else // defined(ASIO_HAS_STD_ATOMIC) +# include +#endif // defined(ASIO_HAS_STD_ATOMIC) + +namespace asio { +namespace detail { + +#if !defined(ASIO_HAS_THREADS) +typedef long atomic_count; +inline void increment(atomic_count& a, long b) { a += b; } +inline void ref_count_up(atomic_count& a) { ++a; } +inline bool ref_count_down(atomic_count& a) { return --a == 0; } +#elif defined(ASIO_HAS_STD_ATOMIC) +typedef std::atomic atomic_count; +inline void increment(atomic_count& a, long b) { a += b; } + +inline void ref_count_up(atomic_count& a) +{ + a.fetch_add(1, std::memory_order_relaxed); +} + +inline bool ref_count_down(atomic_count& a) +{ + if (a.fetch_sub(1, std::memory_order_release) == 1) + { + std::atomic_thread_fence(std::memory_order_acquire); + return true; + } + return false; +} +#else // defined(ASIO_HAS_STD_ATOMIC) +typedef boost::detail::atomic_count atomic_count; +inline void increment(atomic_count& a, long b) { while (b > 0) ++a, --b; } +inline void ref_count_up(atomic_count& a) { ++a; } +inline bool ref_count_down(atomic_count& a) { return --a == 0; } +#endif // defined(ASIO_HAS_STD_ATOMIC) + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_ATOMIC_COUNT_HPP diff --git a/include/asio/include/asio/detail/base_from_completion_cond.hpp b/include/asio/include/asio/detail/base_from_completion_cond.hpp new file mode 100644 index 0000000..37b8626 --- /dev/null +++ b/include/asio/include/asio/detail/base_from_completion_cond.hpp @@ -0,0 +1,69 @@ +// +// detail/base_from_completion_cond.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_BASE_FROM_COMPLETION_COND_HPP +#define ASIO_DETAIL_BASE_FROM_COMPLETION_COND_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/completion_condition.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class base_from_completion_cond +{ +protected: + explicit base_from_completion_cond(CompletionCondition& completion_condition) + : completion_condition_( + ASIO_MOVE_CAST(CompletionCondition)(completion_condition)) + { + } + + std::size_t check_for_completion( + const asio::error_code& ec, + std::size_t total_transferred) + { + return detail::adapt_completion_condition_result( + completion_condition_(ec, total_transferred)); + } + +private: + CompletionCondition completion_condition_; +}; + +template <> +class base_from_completion_cond +{ +protected: + explicit base_from_completion_cond(transfer_all_t) + { + } + + static std::size_t check_for_completion( + const asio::error_code& ec, + std::size_t total_transferred) + { + return transfer_all_t()(ec, total_transferred); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_BASE_FROM_COMPLETION_COND_HPP diff --git a/include/asio/include/asio/detail/bind_handler.hpp b/include/asio/include/asio/detail/bind_handler.hpp new file mode 100644 index 0000000..5181788 --- /dev/null +++ b/include/asio/include/asio/detail/bind_handler.hpp @@ -0,0 +1,934 @@ +// +// detail/bind_handler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_BIND_HANDLER_HPP +#define ASIO_DETAIL_BIND_HANDLER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/associated_allocator.hpp" +#include "asio/associated_executor.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_cont_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class binder1 +{ +public: + template + binder1(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1) + : handler_(ASIO_MOVE_CAST(T)(handler)), + arg1_(arg1) + { + } + + binder1(Handler& handler, const Arg1& arg1) + : handler_(ASIO_MOVE_CAST(Handler)(handler)), + arg1_(arg1) + { + } + +#if defined(ASIO_HAS_MOVE) + binder1(const binder1& other) + : handler_(other.handler_), + arg1_(other.arg1_) + { + } + + binder1(binder1&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + handler_(static_cast(arg1_)); + } + + void operator()() const + { + handler_(arg1_); + } + +//private: + Handler handler_; + Arg1 arg1_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + binder1* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + binder1* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + binder1* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, + binder1* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, + binder1* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline binder1::type, Arg1> bind_handler( + ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1) +{ + return binder1::type, Arg1>(0, + ASIO_MOVE_CAST(Handler)(handler), arg1); +} + +template +class binder2 +{ +public: + template + binder2(int, ASIO_MOVE_ARG(T) handler, + const Arg1& arg1, const Arg2& arg2) + : handler_(ASIO_MOVE_CAST(T)(handler)), + arg1_(arg1), + arg2_(arg2) + { + } + + binder2(Handler& handler, const Arg1& arg1, const Arg2& arg2) + : handler_(ASIO_MOVE_CAST(Handler)(handler)), + arg1_(arg1), + arg2_(arg2) + { + } + +#if defined(ASIO_HAS_MOVE) + binder2(const binder2& other) + : handler_(other.handler_), + arg1_(other.arg1_), + arg2_(other.arg2_) + { + } + + binder2(binder2&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), + arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + handler_(static_cast(arg1_), + static_cast(arg2_)); + } + + void operator()() const + { + handler_(arg1_, arg2_); + } + +//private: + Handler handler_; + Arg1 arg1_; + Arg2 arg2_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + binder2* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + binder2* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + binder2* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, + binder2* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, + binder2* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline binder2::type, Arg1, Arg2> bind_handler( + ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, const Arg2& arg2) +{ + return binder2::type, Arg1, Arg2>(0, + ASIO_MOVE_CAST(Handler)(handler), arg1, arg2); +} + +template +class binder3 +{ +public: + template + binder3(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3) + : handler_(ASIO_MOVE_CAST(T)(handler)), + arg1_(arg1), + arg2_(arg2), + arg3_(arg3) + { + } + + binder3(Handler& handler, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3) + : handler_(ASIO_MOVE_CAST(Handler)(handler)), + arg1_(arg1), + arg2_(arg2), + arg3_(arg3) + { + } + +#if defined(ASIO_HAS_MOVE) + binder3(const binder3& other) + : handler_(other.handler_), + arg1_(other.arg1_), + arg2_(other.arg2_), + arg3_(other.arg3_) + { + } + + binder3(binder3&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), + arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)), + arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + handler_(static_cast(arg1_), + static_cast(arg2_), static_cast(arg3_)); + } + + void operator()() const + { + handler_(arg1_, arg2_, arg3_); + } + +//private: + Handler handler_; + Arg1 arg1_; + Arg2 arg2_; + Arg3 arg3_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + binder3* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + binder3* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + binder3* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, + binder3* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, + binder3* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline binder3::type, Arg1, Arg2, Arg3> bind_handler( + ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, const Arg2& arg2, + const Arg3& arg3) +{ + return binder3::type, Arg1, Arg2, Arg3>(0, + ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3); +} + +template +class binder4 +{ +public: + template + binder4(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4) + : handler_(ASIO_MOVE_CAST(T)(handler)), + arg1_(arg1), + arg2_(arg2), + arg3_(arg3), + arg4_(arg4) + { + } + + binder4(Handler& handler, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4) + : handler_(ASIO_MOVE_CAST(Handler)(handler)), + arg1_(arg1), + arg2_(arg2), + arg3_(arg3), + arg4_(arg4) + { + } + +#if defined(ASIO_HAS_MOVE) + binder4(const binder4& other) + : handler_(other.handler_), + arg1_(other.arg1_), + arg2_(other.arg2_), + arg3_(other.arg3_), + arg4_(other.arg4_) + { + } + + binder4(binder4&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), + arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)), + arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)), + arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + handler_(static_cast(arg1_), + static_cast(arg2_), static_cast(arg3_), + static_cast(arg4_)); + } + + void operator()() const + { + handler_(arg1_, arg2_, arg3_, arg4_); + } + +//private: + Handler handler_; + Arg1 arg1_; + Arg2 arg2_; + Arg3 arg3_; + Arg4 arg4_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + binder4* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + binder4* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + binder4* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, + binder4* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, + binder4* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline binder4::type, Arg1, Arg2, Arg3, Arg4> +bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4) +{ + return binder4::type, Arg1, Arg2, Arg3, Arg4>(0, + ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4); +} + +template +class binder5 +{ +public: + template + binder5(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5) + : handler_(ASIO_MOVE_CAST(T)(handler)), + arg1_(arg1), + arg2_(arg2), + arg3_(arg3), + arg4_(arg4), + arg5_(arg5) + { + } + + binder5(Handler& handler, const Arg1& arg1, const Arg2& arg2, + const Arg3& arg3, const Arg4& arg4, const Arg5& arg5) + : handler_(ASIO_MOVE_CAST(Handler)(handler)), + arg1_(arg1), + arg2_(arg2), + arg3_(arg3), + arg4_(arg4), + arg5_(arg5) + { + } + +#if defined(ASIO_HAS_MOVE) + binder5(const binder5& other) + : handler_(other.handler_), + arg1_(other.arg1_), + arg2_(other.arg2_), + arg3_(other.arg3_), + arg4_(other.arg4_), + arg5_(other.arg5_) + { + } + + binder5(binder5&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), + arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)), + arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)), + arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_)), + arg5_(ASIO_MOVE_CAST(Arg5)(other.arg5_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + handler_(static_cast(arg1_), + static_cast(arg2_), static_cast(arg3_), + static_cast(arg4_), static_cast(arg5_)); + } + + void operator()() const + { + handler_(arg1_, arg2_, arg3_, arg4_, arg5_); + } + +//private: + Handler handler_; + Arg1 arg1_; + Arg2 arg2_; + Arg3 arg3_; + Arg4 arg4_; + Arg5 arg5_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + binder5* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + binder5* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + binder5* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, + binder5* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, + binder5* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline binder5::type, Arg1, Arg2, Arg3, Arg4, Arg5> +bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5) +{ + return binder5::type, Arg1, Arg2, Arg3, Arg4, Arg5>(0, + ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4, arg5); +} + +#if defined(ASIO_HAS_MOVE) + +template +class move_binder1 +{ +public: + move_binder1(int, ASIO_MOVE_ARG(Handler) handler, + ASIO_MOVE_ARG(Arg1) arg1) + : handler_(ASIO_MOVE_CAST(Handler)(handler)), + arg1_(ASIO_MOVE_CAST(Arg1)(arg1)) + { + } + + move_binder1(move_binder1&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)) + { + } + + void operator()() + { + handler_(ASIO_MOVE_CAST(Arg1)(arg1_)); + } + +//private: + Handler handler_; + Arg1 arg1_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + move_binder1* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + move_binder1* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + move_binder1* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(ASIO_MOVE_ARG(Function) function, + move_binder1* this_handler) +{ + asio_handler_invoke_helpers::invoke( + ASIO_MOVE_CAST(Function)(function), this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +class move_binder2 +{ +public: + move_binder2(int, ASIO_MOVE_ARG(Handler) handler, + const Arg1& arg1, ASIO_MOVE_ARG(Arg2) arg2) + : handler_(ASIO_MOVE_CAST(Handler)(handler)), + arg1_(arg1), + arg2_(ASIO_MOVE_CAST(Arg2)(arg2)) + { + } + + move_binder2(move_binder2&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)), + arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)) + { + } + + void operator()() + { + handler_(static_cast(arg1_), + ASIO_MOVE_CAST(Arg2)(arg2_)); + } + +//private: + Handler handler_; + Arg1 arg1_; + Arg2 arg2_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + move_binder2* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + move_binder2* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + move_binder2* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(ASIO_MOVE_ARG(Function) function, + move_binder2* this_handler) +{ + asio_handler_invoke_helpers::invoke( + ASIO_MOVE_CAST(Function)(function), this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +#endif // defined(ASIO_HAS_MOVE) + +} // namespace detail + +template +struct associated_allocator, Allocator> +{ + typedef typename associated_allocator::type type; + + static type get(const detail::binder1& h, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return associated_allocator::get(h.handler_, a); + } +}; + +template +struct associated_allocator, Allocator> +{ + typedef typename associated_allocator::type type; + + static type get(const detail::binder2& h, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return associated_allocator::get(h.handler_, a); + } +}; + +template +struct associated_executor, Executor> +{ + typedef typename associated_executor::type type; + + static type get(const detail::binder1& h, + const Executor& ex = Executor()) ASIO_NOEXCEPT + { + return associated_executor::get(h.handler_, ex); + } +}; + +template +struct associated_executor, Executor> +{ + typedef typename associated_executor::type type; + + static type get(const detail::binder2& h, + const Executor& ex = Executor()) ASIO_NOEXCEPT + { + return associated_executor::get(h.handler_, ex); + } +}; + +#if defined(ASIO_HAS_MOVE) + +template +struct associated_allocator, Allocator> +{ + typedef typename associated_allocator::type type; + + static type get(const detail::move_binder1& h, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return associated_allocator::get(h.handler_, a); + } +}; + +template +struct associated_allocator< + detail::move_binder2, Allocator> +{ + typedef typename associated_allocator::type type; + + static type get(const detail::move_binder2& h, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return associated_allocator::get(h.handler_, a); + } +}; + +template +struct associated_executor, Executor> +{ + typedef typename associated_executor::type type; + + static type get(const detail::move_binder1& h, + const Executor& ex = Executor()) ASIO_NOEXCEPT + { + return associated_executor::get(h.handler_, ex); + } +}; + +template +struct associated_executor, Executor> +{ + typedef typename associated_executor::type type; + + static type get(const detail::move_binder2& h, + const Executor& ex = Executor()) ASIO_NOEXCEPT + { + return associated_executor::get(h.handler_, ex); + } +}; + +#endif // defined(ASIO_HAS_MOVE) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_BIND_HANDLER_HPP diff --git a/include/asio/include/asio/detail/blocking_executor_op.hpp b/include/asio/include/asio/detail/blocking_executor_op.hpp new file mode 100644 index 0000000..7ea3cc4 --- /dev/null +++ b/include/asio/include/asio/detail/blocking_executor_op.hpp @@ -0,0 +1,107 @@ +// +// detail/blocking_executor_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_BLOCKING_EXECUTOR_OP_HPP +#define ASIO_DETAIL_BLOCKING_EXECUTOR_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/event.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/scheduler_operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class blocking_executor_op_base : public Operation +{ +public: + blocking_executor_op_base(typename Operation::func_type complete_func) + : Operation(complete_func), + is_complete_(false) + { + } + + void wait() + { + asio::detail::mutex::scoped_lock lock(mutex_); + while (!is_complete_) + event_.wait(lock); + } + +protected: + struct do_complete_cleanup + { + ~do_complete_cleanup() + { + asio::detail::mutex::scoped_lock lock(op_->mutex_); + op_->is_complete_ = true; + op_->event_.unlock_and_signal_one_for_destruction(lock); + } + + blocking_executor_op_base* op_; + }; + +private: + asio::detail::mutex mutex_; + asio::detail::event event_; + bool is_complete_; +}; + +template +class blocking_executor_op : public blocking_executor_op_base +{ +public: + blocking_executor_op(Handler& h) + : blocking_executor_op_base(&blocking_executor_op::do_complete), + handler_(h) + { + } + + static void do_complete(void* owner, Operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + blocking_executor_op* o(static_cast(base)); + + typename blocking_executor_op_base::do_complete_cleanup + on_exit = { o }; + (void)on_exit; + + ASIO_HANDLER_COMPLETION((*o)); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN(()); + asio_handler_invoke_helpers::invoke(o->handler_, o->handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler& handler_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_BLOCKING_EXECUTOR_OP_HPP diff --git a/include/asio/include/asio/detail/buffer_resize_guard.hpp b/include/asio/include/asio/detail/buffer_resize_guard.hpp new file mode 100644 index 0000000..c447368 --- /dev/null +++ b/include/asio/include/asio/detail/buffer_resize_guard.hpp @@ -0,0 +1,66 @@ +// +// detail/buffer_resize_guard.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_BUFFER_RESIZE_GUARD_HPP +#define ASIO_DETAIL_BUFFER_RESIZE_GUARD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/limits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper class to manage buffer resizing in an exception safe way. +template +class buffer_resize_guard +{ +public: + // Constructor. + buffer_resize_guard(Buffer& buffer) + : buffer_(buffer), + old_size_(buffer.size()) + { + } + + // Destructor rolls back the buffer resize unless commit was called. + ~buffer_resize_guard() + { + if (old_size_ != (std::numeric_limits::max)()) + { + buffer_.resize(old_size_); + } + } + + // Commit the resize transaction. + void commit() + { + old_size_ = (std::numeric_limits::max)(); + } + +private: + // The buffer being managed. + Buffer& buffer_; + + // The size of the buffer at the time the guard was constructed. + size_t old_size_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_BUFFER_RESIZE_GUARD_HPP diff --git a/include/asio/include/asio/detail/buffer_sequence_adapter.hpp b/include/asio/include/asio/detail/buffer_sequence_adapter.hpp new file mode 100644 index 0000000..2044bd5 --- /dev/null +++ b/include/asio/include/asio/detail/buffer_sequence_adapter.hpp @@ -0,0 +1,650 @@ +// +// detail/buffer_sequence_adapter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_BUFFER_SEQUENCE_ADAPTER_HPP +#define ASIO_DETAIL_BUFFER_SEQUENCE_ADAPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/buffer.hpp" +#include "asio/detail/array_fwd.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class buffer_sequence_adapter_base +{ +#if defined(ASIO_WINDOWS_RUNTIME) +public: + // The maximum number of buffers to support in a single operation. + enum { max_buffers = 1 }; + +protected: + typedef Windows::Storage::Streams::IBuffer^ native_buffer_type; + + ASIO_DECL static void init_native_buffer( + native_buffer_type& buf, + const asio::mutable_buffer& buffer); + + ASIO_DECL static void init_native_buffer( + native_buffer_type& buf, + const asio::const_buffer& buffer); +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) +public: + // The maximum number of buffers to support in a single operation. + enum { max_buffers = 64 < max_iov_len ? 64 : max_iov_len }; + +protected: + typedef WSABUF native_buffer_type; + + static void init_native_buffer(WSABUF& buf, + const asio::mutable_buffer& buffer) + { + buf.buf = static_cast(buffer.data()); + buf.len = static_cast(buffer.size()); + } + + static void init_native_buffer(WSABUF& buf, + const asio::const_buffer& buffer) + { + buf.buf = const_cast(static_cast(buffer.data())); + buf.len = static_cast(buffer.size()); + } +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +public: + // The maximum number of buffers to support in a single operation. + enum { max_buffers = 64 < max_iov_len ? 64 : max_iov_len }; + +protected: + typedef iovec native_buffer_type; + + static void init_iov_base(void*& base, void* addr) + { + base = addr; + } + + template + static void init_iov_base(T& base, void* addr) + { + base = static_cast(addr); + } + + static void init_native_buffer(iovec& iov, + const asio::mutable_buffer& buffer) + { + init_iov_base(iov.iov_base, buffer.data()); + iov.iov_len = buffer.size(); + } + + static void init_native_buffer(iovec& iov, + const asio::const_buffer& buffer) + { + init_iov_base(iov.iov_base, const_cast(buffer.data())); + iov.iov_len = buffer.size(); + } +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +}; + +// Helper class to translate buffers into the native buffer representation. +template +class buffer_sequence_adapter + : buffer_sequence_adapter_base +{ +public: + enum { is_single_buffer = false }; + + explicit buffer_sequence_adapter(const Buffers& buffer_sequence) + : count_(0), total_buffer_size_(0) + { + buffer_sequence_adapter::init( + asio::buffer_sequence_begin(buffer_sequence), + asio::buffer_sequence_end(buffer_sequence)); + } + + native_buffer_type* buffers() + { + return buffers_; + } + + std::size_t count() const + { + return count_; + } + + std::size_t total_size() const + { + return total_buffer_size_; + } + + bool all_empty() const + { + return total_buffer_size_ == 0; + } + + static bool all_empty(const Buffers& buffer_sequence) + { + return buffer_sequence_adapter::all_empty( + asio::buffer_sequence_begin(buffer_sequence), + asio::buffer_sequence_end(buffer_sequence)); + } + + static void validate(const Buffers& buffer_sequence) + { + buffer_sequence_adapter::validate( + asio::buffer_sequence_begin(buffer_sequence), + asio::buffer_sequence_end(buffer_sequence)); + } + + static Buffer first(const Buffers& buffer_sequence) + { + return buffer_sequence_adapter::first( + asio::buffer_sequence_begin(buffer_sequence), + asio::buffer_sequence_end(buffer_sequence)); + } + + enum { linearisation_storage_size = 8192 }; + + static Buffer linearise(const Buffers& buffer_sequence, + const asio::mutable_buffer& storage) + { + return buffer_sequence_adapter::linearise( + asio::buffer_sequence_begin(buffer_sequence), + asio::buffer_sequence_end(buffer_sequence), storage); + } + +private: + template + void init(Iterator begin, Iterator end) + { + Iterator iter = begin; + for (; iter != end && count_ < max_buffers; ++iter, ++count_) + { + Buffer buffer(*iter); + init_native_buffer(buffers_[count_], buffer); + total_buffer_size_ += buffer.size(); + } + } + + template + static bool all_empty(Iterator begin, Iterator end) + { + Iterator iter = begin; + std::size_t i = 0; + for (; iter != end && i < max_buffers; ++iter, ++i) + if (Buffer(*iter).size() > 0) + return false; + return true; + } + + template + static void validate(Iterator begin, Iterator end) + { + Iterator iter = begin; + for (; iter != end; ++iter) + { + Buffer buffer(*iter); + buffer.data(); + } + } + + template + static Buffer first(Iterator begin, Iterator end) + { + Iterator iter = begin; + for (; iter != end; ++iter) + { + Buffer buffer(*iter); + if (buffer.size() != 0) + return buffer; + } + return Buffer(); + } + + template + static Buffer linearise(Iterator begin, Iterator end, + const asio::mutable_buffer& storage) + { + asio::mutable_buffer unused_storage = storage; + Iterator iter = begin; + while (iter != end && unused_storage.size() != 0) + { + Buffer buffer(*iter); + ++iter; + if (buffer.size() == 0) + continue; + if (unused_storage.size() == storage.size()) + { + if (iter == end) + return buffer; + if (buffer.size() >= unused_storage.size()) + return buffer; + } + unused_storage += asio::buffer_copy(unused_storage, buffer); + } + return Buffer(storage.data(), storage.size() - unused_storage.size()); + } + + native_buffer_type buffers_[max_buffers]; + std::size_t count_; + std::size_t total_buffer_size_; +}; + +template +class buffer_sequence_adapter + : buffer_sequence_adapter_base +{ +public: + enum { is_single_buffer = true }; + + explicit buffer_sequence_adapter( + const asio::mutable_buffer& buffer_sequence) + { + init_native_buffer(buffer_, Buffer(buffer_sequence)); + total_buffer_size_ = buffer_sequence.size(); + } + + native_buffer_type* buffers() + { + return &buffer_; + } + + std::size_t count() const + { + return 1; + } + + std::size_t total_size() const + { + return total_buffer_size_; + } + + bool all_empty() const + { + return total_buffer_size_ == 0; + } + + static bool all_empty(const asio::mutable_buffer& buffer_sequence) + { + return buffer_sequence.size() == 0; + } + + static void validate(const asio::mutable_buffer& buffer_sequence) + { + buffer_sequence.data(); + } + + static Buffer first(const asio::mutable_buffer& buffer_sequence) + { + return Buffer(buffer_sequence); + } + + enum { linearisation_storage_size = 1 }; + + static Buffer linearise(const asio::mutable_buffer& buffer_sequence, + const Buffer&) + { + return Buffer(buffer_sequence); + } + +private: + native_buffer_type buffer_; + std::size_t total_buffer_size_; +}; + +template +class buffer_sequence_adapter + : buffer_sequence_adapter_base +{ +public: + enum { is_single_buffer = true }; + + explicit buffer_sequence_adapter( + const asio::const_buffer& buffer_sequence) + { + init_native_buffer(buffer_, Buffer(buffer_sequence)); + total_buffer_size_ = buffer_sequence.size(); + } + + native_buffer_type* buffers() + { + return &buffer_; + } + + std::size_t count() const + { + return 1; + } + + std::size_t total_size() const + { + return total_buffer_size_; + } + + bool all_empty() const + { + return total_buffer_size_ == 0; + } + + static bool all_empty(const asio::const_buffer& buffer_sequence) + { + return buffer_sequence.size() == 0; + } + + static void validate(const asio::const_buffer& buffer_sequence) + { + buffer_sequence.data(); + } + + static Buffer first(const asio::const_buffer& buffer_sequence) + { + return Buffer(buffer_sequence); + } + + enum { linearisation_storage_size = 1 }; + + static Buffer linearise(const asio::const_buffer& buffer_sequence, + const Buffer&) + { + return Buffer(buffer_sequence); + } + +private: + native_buffer_type buffer_; + std::size_t total_buffer_size_; +}; + +#if !defined(ASIO_NO_DEPRECATED) + +template +class buffer_sequence_adapter + : buffer_sequence_adapter_base +{ +public: + enum { is_single_buffer = true }; + + explicit buffer_sequence_adapter( + const asio::mutable_buffers_1& buffer_sequence) + { + init_native_buffer(buffer_, Buffer(buffer_sequence)); + total_buffer_size_ = buffer_sequence.size(); + } + + native_buffer_type* buffers() + { + return &buffer_; + } + + std::size_t count() const + { + return 1; + } + + std::size_t total_size() const + { + return total_buffer_size_; + } + + bool all_empty() const + { + return total_buffer_size_ == 0; + } + + static bool all_empty(const asio::mutable_buffers_1& buffer_sequence) + { + return buffer_sequence.size() == 0; + } + + static void validate(const asio::mutable_buffers_1& buffer_sequence) + { + buffer_sequence.data(); + } + + static Buffer first(const asio::mutable_buffers_1& buffer_sequence) + { + return Buffer(buffer_sequence); + } + + enum { linearisation_storage_size = 1 }; + + static Buffer linearise(const asio::mutable_buffers_1& buffer_sequence, + const Buffer&) + { + return Buffer(buffer_sequence); + } + +private: + native_buffer_type buffer_; + std::size_t total_buffer_size_; +}; + +template +class buffer_sequence_adapter + : buffer_sequence_adapter_base +{ +public: + enum { is_single_buffer = true }; + + explicit buffer_sequence_adapter( + const asio::const_buffers_1& buffer_sequence) + { + init_native_buffer(buffer_, Buffer(buffer_sequence)); + total_buffer_size_ = buffer_sequence.size(); + } + + native_buffer_type* buffers() + { + return &buffer_; + } + + std::size_t count() const + { + return 1; + } + + std::size_t total_size() const + { + return total_buffer_size_; + } + + bool all_empty() const + { + return total_buffer_size_ == 0; + } + + static bool all_empty(const asio::const_buffers_1& buffer_sequence) + { + return buffer_sequence.size() == 0; + } + + static void validate(const asio::const_buffers_1& buffer_sequence) + { + buffer_sequence.data(); + } + + static Buffer first(const asio::const_buffers_1& buffer_sequence) + { + return Buffer(buffer_sequence); + } + + enum { linearisation_storage_size = 1 }; + + static Buffer linearise(const asio::const_buffers_1& buffer_sequence, + const Buffer&) + { + return Buffer(buffer_sequence); + } + +private: + native_buffer_type buffer_; + std::size_t total_buffer_size_; +}; + +#endif // !defined(ASIO_NO_DEPRECATED) + +template +class buffer_sequence_adapter > + : buffer_sequence_adapter_base +{ +public: + enum { is_single_buffer = false }; + + explicit buffer_sequence_adapter( + const boost::array& buffer_sequence) + { + init_native_buffer(buffers_[0], Buffer(buffer_sequence[0])); + init_native_buffer(buffers_[1], Buffer(buffer_sequence[1])); + total_buffer_size_ = buffer_sequence[0].size() + buffer_sequence[1].size(); + } + + native_buffer_type* buffers() + { + return buffers_; + } + + std::size_t count() const + { + return 2; + } + + std::size_t total_size() const + { + return total_buffer_size_; + } + + bool all_empty() const + { + return total_buffer_size_ == 0; + } + + static bool all_empty(const boost::array& buffer_sequence) + { + return buffer_sequence[0].size() == 0 && buffer_sequence[1].size() == 0; + } + + static void validate(const boost::array& buffer_sequence) + { + buffer_sequence[0].data(); + buffer_sequence[1].data(); + } + + static Buffer first(const boost::array& buffer_sequence) + { + return Buffer(buffer_sequence[0].size() != 0 + ? buffer_sequence[0] : buffer_sequence[1]); + } + + enum { linearisation_storage_size = 8192 }; + + static Buffer linearise(const boost::array& buffer_sequence, + const asio::mutable_buffer& storage) + { + if (buffer_sequence[0].size() == 0) + return Buffer(buffer_sequence[1]); + if (buffer_sequence[1].size() == 0) + return Buffer(buffer_sequence[0]); + return Buffer(storage.data(), + asio::buffer_copy(storage, buffer_sequence)); + } + +private: + native_buffer_type buffers_[2]; + std::size_t total_buffer_size_; +}; + +#if defined(ASIO_HAS_STD_ARRAY) + +template +class buffer_sequence_adapter > + : buffer_sequence_adapter_base +{ +public: + enum { is_single_buffer = false }; + + explicit buffer_sequence_adapter( + const std::array& buffer_sequence) + { + init_native_buffer(buffers_[0], Buffer(buffer_sequence[0])); + init_native_buffer(buffers_[1], Buffer(buffer_sequence[1])); + total_buffer_size_ = buffer_sequence[0].size() + buffer_sequence[1].size(); + } + + native_buffer_type* buffers() + { + return buffers_; + } + + std::size_t count() const + { + return 2; + } + + std::size_t total_size() const + { + return total_buffer_size_; + } + + bool all_empty() const + { + return total_buffer_size_ == 0; + } + + static bool all_empty(const std::array& buffer_sequence) + { + return buffer_sequence[0].size() == 0 && buffer_sequence[1].size() == 0; + } + + static void validate(const std::array& buffer_sequence) + { + buffer_sequence[0].data(); + buffer_sequence[1].data(); + } + + static Buffer first(const std::array& buffer_sequence) + { + return Buffer(buffer_sequence[0].size() != 0 + ? buffer_sequence[0] : buffer_sequence[1]); + } + + enum { linearisation_storage_size = 8192 }; + + static Buffer linearise(const std::array& buffer_sequence, + const asio::mutable_buffer& storage) + { + if (buffer_sequence[0].size() == 0) + return Buffer(buffer_sequence[1]); + if (buffer_sequence[1].size() == 0) + return Buffer(buffer_sequence[0]); + return Buffer(storage.data(), + asio::buffer_copy(storage, buffer_sequence)); + } + +private: + native_buffer_type buffers_[2]; + std::size_t total_buffer_size_; +}; + +#endif // defined(ASIO_HAS_STD_ARRAY) + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/buffer_sequence_adapter.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_BUFFER_SEQUENCE_ADAPTER_HPP diff --git a/include/asio/include/asio/detail/buffered_stream_storage.hpp b/include/asio/include/asio/detail/buffered_stream_storage.hpp new file mode 100644 index 0000000..ea5882d --- /dev/null +++ b/include/asio/include/asio/detail/buffered_stream_storage.hpp @@ -0,0 +1,126 @@ +// +// detail/buffered_stream_storage.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_BUFFERED_STREAM_STORAGE_HPP +#define ASIO_DETAIL_BUFFERED_STREAM_STORAGE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/buffer.hpp" +#include "asio/detail/assert.hpp" +#include +#include +#include + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class buffered_stream_storage +{ +public: + // The type of the bytes stored in the buffer. + typedef unsigned char byte_type; + + // The type used for offsets into the buffer. + typedef std::size_t size_type; + + // Constructor. + explicit buffered_stream_storage(std::size_t buffer_capacity) + : begin_offset_(0), + end_offset_(0), + buffer_(buffer_capacity) + { + } + + /// Clear the buffer. + void clear() + { + begin_offset_ = 0; + end_offset_ = 0; + } + + // Return a pointer to the beginning of the unread data. + mutable_buffer data() + { + return asio::buffer(buffer_) + begin_offset_; + } + + // Return a pointer to the beginning of the unread data. + const_buffer data() const + { + return asio::buffer(buffer_) + begin_offset_; + } + + // Is there no unread data in the buffer. + bool empty() const + { + return begin_offset_ == end_offset_; + } + + // Return the amount of unread data the is in the buffer. + size_type size() const + { + return end_offset_ - begin_offset_; + } + + // Resize the buffer to the specified length. + void resize(size_type length) + { + ASIO_ASSERT(length <= capacity()); + if (begin_offset_ + length <= capacity()) + { + end_offset_ = begin_offset_ + length; + } + else + { + using namespace std; // For memmove. + memmove(&buffer_[0], &buffer_[0] + begin_offset_, size()); + end_offset_ = length; + begin_offset_ = 0; + } + } + + // Return the maximum size for data in the buffer. + size_type capacity() const + { + return buffer_.size(); + } + + // Consume multiple bytes from the beginning of the buffer. + void consume(size_type count) + { + ASIO_ASSERT(begin_offset_ + count <= end_offset_); + begin_offset_ += count; + if (empty()) + clear(); + } + +private: + // The offset to the beginning of the unread data. + size_type begin_offset_; + + // The offset to the end of the unread data. + size_type end_offset_; + + // The data in the buffer. + std::vector buffer_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_BUFFERED_STREAM_STORAGE_HPP diff --git a/include/asio/include/asio/detail/bulk_executor_op.hpp b/include/asio/include/asio/detail/bulk_executor_op.hpp new file mode 100644 index 0000000..dc41753 --- /dev/null +++ b/include/asio/include/asio/detail/bulk_executor_op.hpp @@ -0,0 +1,88 @@ +// +// detail/bulk_executor_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_BULK_EXECUTOR_OP_HPP +#define ASIO_DETAIL_BULK_EXECUTOR_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/scheduler_operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class bulk_executor_op : public Operation +{ +public: + ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(bulk_executor_op); + + template + bulk_executor_op(ASIO_MOVE_ARG(H) h, + const Alloc& allocator, std::size_t i) + : Operation(&bulk_executor_op::do_complete), + handler_(ASIO_MOVE_CAST(H)(h)), + allocator_(allocator), + index_(i) + { + } + + static void do_complete(void* owner, Operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + bulk_executor_op* o(static_cast(base)); + Alloc allocator(o->allocator_); + ptr p = { detail::addressof(allocator), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 handler(o->handler_, o->index_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN(()); + asio_handler_invoke_helpers::invoke(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + Alloc allocator_; + std::size_t index_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_BULK_EXECUTOR_OP_HPP diff --git a/include/asio/include/asio/detail/call_stack.hpp b/include/asio/include/asio/detail/call_stack.hpp new file mode 100644 index 0000000..1594589 --- /dev/null +++ b/include/asio/include/asio/detail/call_stack.hpp @@ -0,0 +1,125 @@ +// +// detail/call_stack.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CALL_STACK_HPP +#define ASIO_DETAIL_CALL_STACK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/tss_ptr.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper class to determine whether or not the current thread is inside an +// invocation of io_context::run() for a specified io_context object. +template +class call_stack +{ +public: + // Context class automatically pushes the key/value pair on to the stack. + class context + : private noncopyable + { + public: + // Push the key on to the stack. + explicit context(Key* k) + : key_(k), + next_(call_stack::top_) + { + value_ = reinterpret_cast(this); + call_stack::top_ = this; + } + + // Push the key/value pair on to the stack. + context(Key* k, Value& v) + : key_(k), + value_(&v), + next_(call_stack::top_) + { + call_stack::top_ = this; + } + + // Pop the key/value pair from the stack. + ~context() + { + call_stack::top_ = next_; + } + + // Find the next context with the same key. + Value* next_by_key() const + { + context* elem = next_; + while (elem) + { + if (elem->key_ == key_) + return elem->value_; + elem = elem->next_; + } + return 0; + } + + private: + friend class call_stack; + + // The key associated with the context. + Key* key_; + + // The value associated with the context. + Value* value_; + + // The next element in the stack. + context* next_; + }; + + friend class context; + + // Determine whether the specified owner is on the stack. Returns address of + // key if present, 0 otherwise. + static Value* contains(Key* k) + { + context* elem = top_; + while (elem) + { + if (elem->key_ == k) + return elem->value_; + elem = elem->next_; + } + return 0; + } + + // Obtain the value at the top of the stack. + static Value* top() + { + context* elem = top_; + return elem ? elem->value_ : 0; + } + +private: + // The top of the stack of calls for the current thread. + static tss_ptr top_; +}; + +template +tss_ptr::context> +call_stack::top_; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_CALL_STACK_HPP diff --git a/include/asio/include/asio/detail/chrono.hpp b/include/asio/include/asio/detail/chrono.hpp new file mode 100644 index 0000000..f2df56f --- /dev/null +++ b/include/asio/include/asio/detail/chrono.hpp @@ -0,0 +1,66 @@ +// +// detail/chrono.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CHRONO_HPP +#define ASIO_DETAIL_CHRONO_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_CHRONO) +# include +#elif defined(ASIO_HAS_BOOST_CHRONO) +# include +#endif // defined(ASIO_HAS_BOOST_CHRONO) + +namespace asio { +namespace chrono { + +#if defined(ASIO_HAS_STD_CHRONO) +using std::chrono::duration; +using std::chrono::time_point; +using std::chrono::duration_cast; +using std::chrono::nanoseconds; +using std::chrono::microseconds; +using std::chrono::milliseconds; +using std::chrono::seconds; +using std::chrono::minutes; +using std::chrono::hours; +using std::chrono::time_point_cast; +#if defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK) +typedef std::chrono::monotonic_clock steady_clock; +#else // defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK) +using std::chrono::steady_clock; +#endif // defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK) +using std::chrono::system_clock; +using std::chrono::high_resolution_clock; +#elif defined(ASIO_HAS_BOOST_CHRONO) +using boost::chrono::duration; +using boost::chrono::time_point; +using boost::chrono::duration_cast; +using boost::chrono::nanoseconds; +using boost::chrono::microseconds; +using boost::chrono::milliseconds; +using boost::chrono::seconds; +using boost::chrono::minutes; +using boost::chrono::hours; +using boost::chrono::time_point_cast; +using boost::chrono::system_clock; +using boost::chrono::steady_clock; +using boost::chrono::high_resolution_clock; +#endif // defined(ASIO_HAS_BOOST_CHRONO) + +} // namespace chrono +} // namespace asio + +#endif // ASIO_DETAIL_CHRONO_HPP diff --git a/include/asio/include/asio/detail/chrono_time_traits.hpp b/include/asio/include/asio/detail/chrono_time_traits.hpp new file mode 100644 index 0000000..47355c9 --- /dev/null +++ b/include/asio/include/asio/detail/chrono_time_traits.hpp @@ -0,0 +1,190 @@ +// +// detail/chrono_time_traits.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CHRONO_TIME_TRAITS_HPP +#define ASIO_DETAIL_CHRONO_TIME_TRAITS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/cstdint.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper template to compute the greatest common divisor. +template +struct gcd { enum { value = gcd::value }; }; + +template +struct gcd { enum { value = v1 }; }; + +// Adapts std::chrono clocks for use with a deadline timer. +template +struct chrono_time_traits +{ + // The clock type. + typedef Clock clock_type; + + // The duration type of the clock. + typedef typename clock_type::duration duration_type; + + // The time point type of the clock. + typedef typename clock_type::time_point time_type; + + // The period of the clock. + typedef typename duration_type::period period_type; + + // Get the current time. + static time_type now() + { + return clock_type::now(); + } + + // Add a duration to a time. + static time_type add(const time_type& t, const duration_type& d) + { + const time_type epoch; + if (t >= epoch) + { + if ((time_type::max)() - t < d) + return (time_type::max)(); + } + else // t < epoch + { + if (-(t - (time_type::min)()) > d) + return (time_type::min)(); + } + + return t + d; + } + + // Subtract one time from another. + static duration_type subtract(const time_type& t1, const time_type& t2) + { + const time_type epoch; + if (t1 >= epoch) + { + if (t2 >= epoch) + { + return t1 - t2; + } + else if (t2 == (time_type::min)()) + { + return (duration_type::max)(); + } + else if ((time_type::max)() - t1 < epoch - t2) + { + return (duration_type::max)(); + } + else + { + return t1 - t2; + } + } + else // t1 < epoch + { + if (t2 < epoch) + { + return t1 - t2; + } + else if (t1 == (time_type::min)()) + { + return (duration_type::min)(); + } + else if ((time_type::max)() - t2 < epoch - t1) + { + return (duration_type::min)(); + } + else + { + return -(t2 - t1); + } + } + } + + // Test whether one time is less than another. + static bool less_than(const time_type& t1, const time_type& t2) + { + return t1 < t2; + } + + // Implement just enough of the posix_time::time_duration interface to supply + // what the timer_queue requires. + class posix_time_duration + { + public: + explicit posix_time_duration(const duration_type& d) + : d_(d) + { + } + + int64_t ticks() const + { + return d_.count(); + } + + int64_t total_seconds() const + { + return duration_cast<1, 1>(); + } + + int64_t total_milliseconds() const + { + return duration_cast<1, 1000>(); + } + + int64_t total_microseconds() const + { + return duration_cast<1, 1000000>(); + } + + private: + template + int64_t duration_cast() const + { + const int64_t num1 = period_type::num / gcd::value; + const int64_t num2 = Num / gcd::value; + + const int64_t den1 = period_type::den / gcd::value; + const int64_t den2 = Den / gcd::value; + + const int64_t num = num1 * den2; + const int64_t den = num2 * den1; + + if (num == 1 && den == 1) + return ticks(); + else if (num != 1 && den == 1) + return ticks() * num; + else if (num == 1 && period_type::den != 1) + return ticks() / den; + else + return ticks() * num / den; + } + + duration_type d_; + }; + + // Convert to POSIX duration type. + static posix_time_duration to_posix_duration(const duration_type& d) + { + return posix_time_duration(WaitTraits::to_wait_duration(d)); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_CHRONO_TIME_TRAITS_HPP diff --git a/include/asio/include/asio/detail/completion_handler.hpp b/include/asio/include/asio/detail/completion_handler.hpp new file mode 100644 index 0000000..1de45f8 --- /dev/null +++ b/include/asio/include/asio/detail/completion_handler.hpp @@ -0,0 +1,88 @@ +// +// detail/completion_handler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_COMPLETION_HANDLER_HPP +#define ASIO_DETAIL_COMPLETION_HANDLER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class completion_handler : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(completion_handler); + + completion_handler(Handler& h, const IoExecutor& io_ex) + : operation(&completion_handler::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(h)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + completion_handler* h(static_cast(base)); + ptr p = { asio::detail::addressof(h->handler_), h, h }; + + ASIO_HANDLER_COMPLETION((*h)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + h->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + Handler handler(ASIO_MOVE_CAST(Handler)(h->handler_)); + p.h = asio::detail::addressof(handler); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN(()); + w.complete(handler, handler); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_COMPLETION_HANDLER_HPP diff --git a/include/asio/include/asio/detail/concurrency_hint.hpp b/include/asio/include/asio/detail/concurrency_hint.hpp new file mode 100644 index 0000000..04eaa90 --- /dev/null +++ b/include/asio/include/asio/detail/concurrency_hint.hpp @@ -0,0 +1,94 @@ +// +// detail/concurrency_hint.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CONCURRENCY_HINT_HPP +#define ASIO_DETAIL_CONCURRENCY_HINT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/noncopyable.hpp" + +// The concurrency hint ID and mask are used to identify when a "well-known" +// concurrency hint value has been passed to the io_context. +#define ASIO_CONCURRENCY_HINT_ID 0xA5100000u +#define ASIO_CONCURRENCY_HINT_ID_MASK 0xFFFF0000u + +// If set, this bit indicates that the scheduler should perform locking. +#define ASIO_CONCURRENCY_HINT_LOCKING_SCHEDULER 0x1u + +// If set, this bit indicates that the reactor should perform locking when +// managing descriptor registrations. +#define ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_REGISTRATION 0x2u + +// If set, this bit indicates that the reactor should perform locking for I/O. +#define ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_IO 0x4u + +// Helper macro to determine if we have a special concurrency hint. +#define ASIO_CONCURRENCY_HINT_IS_SPECIAL(hint) \ + ((static_cast(hint) \ + & ASIO_CONCURRENCY_HINT_ID_MASK) \ + == ASIO_CONCURRENCY_HINT_ID) + +// Helper macro to determine if locking is enabled for a given facility. +#define ASIO_CONCURRENCY_HINT_IS_LOCKING(facility, hint) \ + (((static_cast(hint) \ + & (ASIO_CONCURRENCY_HINT_ID_MASK \ + | ASIO_CONCURRENCY_HINT_LOCKING_ ## facility)) \ + ^ ASIO_CONCURRENCY_HINT_ID) != 0) + +// This special concurrency hint disables locking in both the scheduler and +// reactor I/O. This hint has the following restrictions: +// +// - Care must be taken to ensure that all operations on the io_context and any +// of its associated I/O objects (such as sockets and timers) occur in only +// one thread at a time. +// +// - Asynchronous resolve operations fail with operation_not_supported. +// +// - If a signal_set is used with the io_context, signal_set objects cannot be +// used with any other io_context in the program. +#define ASIO_CONCURRENCY_HINT_UNSAFE \ + static_cast(ASIO_CONCURRENCY_HINT_ID) + +// This special concurrency hint disables locking in the reactor I/O. This hint +// has the following restrictions: +// +// - Care must be taken to ensure that run functions on the io_context, and all +// operations on the io_context's associated I/O objects (such as sockets and +// timers), occur in only one thread at a time. +#define ASIO_CONCURRENCY_HINT_UNSAFE_IO \ + static_cast(ASIO_CONCURRENCY_HINT_ID \ + | ASIO_CONCURRENCY_HINT_LOCKING_SCHEDULER \ + | ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_REGISTRATION) + +// The special concurrency hint provides full thread safety. +#define ASIO_CONCURRENCY_HINT_SAFE \ + static_cast(ASIO_CONCURRENCY_HINT_ID \ + | ASIO_CONCURRENCY_HINT_LOCKING_SCHEDULER \ + | ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_REGISTRATION \ + | ASIO_CONCURRENCY_HINT_LOCKING_REACTOR_IO) + +// This #define may be overridden at compile time to specify a program-wide +// default concurrency hint, used by the zero-argument io_context constructor. +#if !defined(ASIO_CONCURRENCY_HINT_DEFAULT) +# define ASIO_CONCURRENCY_HINT_DEFAULT -1 +#endif // !defined(ASIO_CONCURRENCY_HINT_DEFAULT) + +// This #define may be overridden at compile time to specify a program-wide +// concurrency hint, used by the one-argument io_context constructor when +// passed a value of 1. +#if !defined(ASIO_CONCURRENCY_HINT_1) +# define ASIO_CONCURRENCY_HINT_1 1 +#endif // !defined(ASIO_CONCURRENCY_HINT_DEFAULT) + +#endif // ASIO_DETAIL_CONCURRENCY_HINT_HPP diff --git a/include/asio/include/asio/detail/conditionally_enabled_event.hpp b/include/asio/include/asio/detail/conditionally_enabled_event.hpp new file mode 100644 index 0000000..d40263e --- /dev/null +++ b/include/asio/include/asio/detail/conditionally_enabled_event.hpp @@ -0,0 +1,120 @@ +// +// detail/conditionally_enabled_event.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CONDITIONALLY_ENABLED_EVENT_HPP +#define ASIO_DETAIL_CONDITIONALLY_ENABLED_EVENT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/conditionally_enabled_mutex.hpp" +#include "asio/detail/event.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/null_event.hpp" +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Mutex adapter used to conditionally enable or disable locking. +class conditionally_enabled_event + : private noncopyable +{ +public: + // Constructor. + conditionally_enabled_event() + { + } + + // Destructor. + ~conditionally_enabled_event() + { + } + + // Signal the event. (Retained for backward compatibility.) + void signal(conditionally_enabled_mutex::scoped_lock& lock) + { + if (lock.mutex_.enabled_) + event_.signal(lock); + } + + // Signal all waiters. + void signal_all(conditionally_enabled_mutex::scoped_lock& lock) + { + if (lock.mutex_.enabled_) + event_.signal_all(lock); + } + + // Unlock the mutex and signal one waiter. + void unlock_and_signal_one( + conditionally_enabled_mutex::scoped_lock& lock) + { + if (lock.mutex_.enabled_) + event_.unlock_and_signal_one(lock); + } + + // Unlock the mutex and signal one waiter who may destroy us. + void unlock_and_signal_one_for_destruction( + conditionally_enabled_mutex::scoped_lock& lock) + { + if (lock.mutex_.enabled_) + event_.unlock_and_signal_one(lock); + } + + // If there's a waiter, unlock the mutex and signal it. + bool maybe_unlock_and_signal_one( + conditionally_enabled_mutex::scoped_lock& lock) + { + if (lock.mutex_.enabled_) + return event_.maybe_unlock_and_signal_one(lock); + else + return false; + } + + // Reset the event. + void clear(conditionally_enabled_mutex::scoped_lock& lock) + { + if (lock.mutex_.enabled_) + event_.clear(lock); + } + + // Wait for the event to become signalled. + void wait(conditionally_enabled_mutex::scoped_lock& lock) + { + if (lock.mutex_.enabled_) + event_.wait(lock); + else + null_event().wait(lock); + } + + // Timed wait for the event to become signalled. + bool wait_for_usec( + conditionally_enabled_mutex::scoped_lock& lock, long usec) + { + if (lock.mutex_.enabled_) + return event_.wait_for_usec(lock, usec); + else + return null_event().wait_for_usec(lock, usec); + } + +private: + asio::detail::event event_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_CONDITIONALLY_ENABLED_EVENT_HPP diff --git a/include/asio/include/asio/detail/conditionally_enabled_mutex.hpp b/include/asio/include/asio/detail/conditionally_enabled_mutex.hpp new file mode 100644 index 0000000..185fbe9 --- /dev/null +++ b/include/asio/include/asio/detail/conditionally_enabled_mutex.hpp @@ -0,0 +1,149 @@ +// +// detail/conditionally_enabled_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CONDITIONALLY_ENABLED_MUTEX_HPP +#define ASIO_DETAIL_CONDITIONALLY_ENABLED_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Mutex adapter used to conditionally enable or disable locking. +class conditionally_enabled_mutex + : private noncopyable +{ +public: + // Helper class to lock and unlock a mutex automatically. + class scoped_lock + : private noncopyable + { + public: + // Tag type used to distinguish constructors. + enum adopt_lock_t { adopt_lock }; + + // Constructor adopts a lock that is already held. + scoped_lock(conditionally_enabled_mutex& m, adopt_lock_t) + : mutex_(m), + locked_(m.enabled_) + { + } + + // Constructor acquires the lock. + explicit scoped_lock(conditionally_enabled_mutex& m) + : mutex_(m) + { + if (m.enabled_) + { + mutex_.mutex_.lock(); + locked_ = true; + } + else + locked_ = false; + } + + // Destructor releases the lock. + ~scoped_lock() + { + if (locked_) + mutex_.mutex_.unlock(); + } + + // Explicitly acquire the lock. + void lock() + { + if (mutex_.enabled_ && !locked_) + { + mutex_.mutex_.lock(); + locked_ = true; + } + } + + // Explicitly release the lock. + void unlock() + { + if (locked_) + { + mutex_.unlock(); + locked_ = false; + } + } + + // Test whether the lock is held. + bool locked() const + { + return locked_; + } + + // Get the underlying mutex. + asio::detail::mutex& mutex() + { + return mutex_.mutex_; + } + + private: + friend class conditionally_enabled_event; + conditionally_enabled_mutex& mutex_; + bool locked_; + }; + + // Constructor. + explicit conditionally_enabled_mutex(bool enabled) + : enabled_(enabled) + { + } + + // Destructor. + ~conditionally_enabled_mutex() + { + } + + // Determine whether locking is enabled. + bool enabled() const + { + return enabled_; + } + + // Lock the mutex. + void lock() + { + if (enabled_) + mutex_.lock(); + } + + // Unlock the mutex. + void unlock() + { + if (enabled_) + mutex_.unlock(); + } + +private: + friend class scoped_lock; + friend class conditionally_enabled_event; + asio::detail::mutex mutex_; + const bool enabled_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_CONDITIONALLY_ENABLED_MUTEX_HPP diff --git a/include/asio/include/asio/detail/config.hpp b/include/asio/include/asio/detail/config.hpp new file mode 100644 index 0000000..f9faa67 --- /dev/null +++ b/include/asio/include/asio/detail/config.hpp @@ -0,0 +1,1822 @@ +// +// detail/config.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CONFIG_HPP +#define ASIO_DETAIL_CONFIG_HPP + +// boostify: non-boost code starts here +#if !defined(ASIO_STANDALONE) +# if !defined(ASIO_ENABLE_BOOST) +# if (__cplusplus >= 201103) +# define ASIO_STANDALONE 1 +# elif defined(_MSC_VER) && defined(_MSVC_LANG) +# if (_MSC_VER >= 1900) && (_MSVC_LANG >= 201103) +# define ASIO_STANDALONE 1 +# endif // (_MSC_VER >= 1900) && (_MSVC_LANG >= 201103) +# endif // defined(_MSC_VER) && defined(_MSVC_LANG) +# endif // !defined(ASIO_ENABLE_BOOST) +#endif // !defined(ASIO_STANDALONE) + +// boostify: non-boost code ends here +#if defined(ASIO_STANDALONE) +# define ASIO_DISABLE_BOOST_ARRAY 1 +# define ASIO_DISABLE_BOOST_ASSERT 1 +# define ASIO_DISABLE_BOOST_BIND 1 +# define ASIO_DISABLE_BOOST_CHRONO 1 +# define ASIO_DISABLE_BOOST_DATE_TIME 1 +# define ASIO_DISABLE_BOOST_LIMITS 1 +# define ASIO_DISABLE_BOOST_REGEX 1 +# define ASIO_DISABLE_BOOST_STATIC_CONSTANT 1 +# define ASIO_DISABLE_BOOST_THROW_EXCEPTION 1 +# define ASIO_DISABLE_BOOST_WORKAROUND 1 +#else // defined(ASIO_STANDALONE) +# include +# include +# define ASIO_HAS_BOOST_CONFIG 1 +#endif // defined(ASIO_STANDALONE) + +// Default to a header-only implementation. The user must specifically request +// separate compilation by defining either ASIO_SEPARATE_COMPILATION or +// ASIO_DYN_LINK (as a DLL/shared library implies separate compilation). +#if !defined(ASIO_HEADER_ONLY) +# if !defined(ASIO_SEPARATE_COMPILATION) +# if !defined(ASIO_DYN_LINK) +# define ASIO_HEADER_ONLY 1 +# endif // !defined(ASIO_DYN_LINK) +# endif // !defined(ASIO_SEPARATE_COMPILATION) +#endif // !defined(ASIO_HEADER_ONLY) + +#if defined(ASIO_HEADER_ONLY) +# define ASIO_DECL inline +#else // defined(ASIO_HEADER_ONLY) +# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__) +// We need to import/export our code only if the user has specifically asked +// for it by defining ASIO_DYN_LINK. +# if defined(ASIO_DYN_LINK) +// Export if this is our own source, otherwise import. +# if defined(ASIO_SOURCE) +# define ASIO_DECL __declspec(dllexport) +# else // defined(ASIO_SOURCE) +# define ASIO_DECL __declspec(dllimport) +# endif // defined(ASIO_SOURCE) +# endif // defined(ASIO_DYN_LINK) +# endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__) +#endif // defined(ASIO_HEADER_ONLY) + +// If ASIO_DECL isn't defined yet define it now. +#if !defined(ASIO_DECL) +# define ASIO_DECL +#endif // !defined(ASIO_DECL) + +// Helper macro for documentation. +#define ASIO_UNSPECIFIED(e) e + +// Microsoft Visual C++ detection. +#if !defined(ASIO_MSVC) +# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC) +# define ASIO_MSVC BOOST_MSVC +# elif defined(_MSC_VER) && (defined(__INTELLISENSE__) \ + || (!defined(__MWERKS__) && !defined(__EDG_VERSION__))) +# define ASIO_MSVC _MSC_VER +# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC) +#endif // !defined(ASIO_MSVC) + +// Clang / libc++ detection. +#if defined(__clang__) +# if (__cplusplus >= 201103) +# if __has_include(<__config>) +# include <__config> +# if defined(_LIBCPP_VERSION) +# define ASIO_HAS_CLANG_LIBCXX 1 +# endif // defined(_LIBCPP_VERSION) +# endif // __has_include(<__config>) +# endif // (__cplusplus >= 201103) +#endif // defined(__clang__) + +// Android platform detection. +#if defined(__ANDROID__) +# include +#endif // defined(__ANDROID__) + +// Support move construction and assignment on compilers known to allow it. +#if !defined(ASIO_HAS_MOVE) +# if !defined(ASIO_DISABLE_MOVE) +# if defined(__clang__) +# if __has_feature(__cxx_rvalue_references__) +# define ASIO_HAS_MOVE 1 +# endif // __has_feature(__cxx_rvalue_references__) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_MOVE 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_MOVE 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# if defined(__INTEL_CXX11_MODE__) +# if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) +# define ASIO_HAS_MOVE 1 +# endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) +# if defined(__ICL) && (__ICL >= 1500) +# define ASIO_HAS_MOVE 1 +# endif // defined(__ICL) && (__ICL >= 1500) +# endif // defined(__INTEL_CXX11_MODE__) +# endif // !defined(ASIO_DISABLE_MOVE) +#endif // !defined(ASIO_HAS_MOVE) + +// If ASIO_MOVE_CAST isn't defined, and move support is available, define +// * ASIO_MOVE_ARG, +// * ASIO_NONDEDUCED_MOVE_ARG, and +// * ASIO_MOVE_CAST +// to take advantage of rvalue references and perfect forwarding. +#if defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST) +# define ASIO_MOVE_ARG(type) type&& +# define ASIO_MOVE_ARG2(type1, type2) type1, type2&& +# define ASIO_NONDEDUCED_MOVE_ARG(type) type& +# define ASIO_MOVE_CAST(type) static_cast +# define ASIO_MOVE_CAST2(type1, type2) static_cast +# define ASIO_MOVE_OR_LVALUE(type) static_cast +# define ASIO_MOVE_OR_LVALUE_TYPE(type) type +#endif // defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST) + +// If ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible +// implementation. Note that older g++ and MSVC versions don't like it when you +// pass a non-member function through a const reference, so for most compilers +// we'll play it safe and stick with the old approach of passing the handler by +// value. +#if !defined(ASIO_MOVE_CAST) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) +# define ASIO_MOVE_ARG(type) const type& +# else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) +# define ASIO_MOVE_ARG(type) type +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) +# elif defined(ASIO_MSVC) +# if (_MSC_VER >= 1400) +# define ASIO_MOVE_ARG(type) const type& +# else // (_MSC_VER >= 1400) +# define ASIO_MOVE_ARG(type) type +# endif // (_MSC_VER >= 1400) +# else +# define ASIO_MOVE_ARG(type) type +# endif +# define ASIO_NONDEDUCED_MOVE_ARG(type) const type& +# define ASIO_MOVE_CAST(type) static_cast +# define ASIO_MOVE_CAST2(type1, type2) static_cast +# define ASIO_MOVE_OR_LVALUE(type) +# define ASIO_MOVE_OR_LVALUE_TYPE(type) type& +#endif // !defined(ASIO_MOVE_CAST) + +// Support variadic templates on compilers known to allow it. +#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) +# if !defined(ASIO_DISABLE_VARIADIC_TEMPLATES) +# if defined(__clang__) +# if __has_feature(__cxx_variadic_templates__) +# define ASIO_HAS_VARIADIC_TEMPLATES 1 +# endif // __has_feature(__cxx_variadic_templates__) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_VARIADIC_TEMPLATES 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_HAS_VARIADIC_TEMPLATES 1 +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_VARIADIC_TEMPLATES) +#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) +#if !defined(ASIO_ELLIPSIS) +# if defined(ASIO_HAS_VARIADIC_TEMPLATES) +# define ASIO_ELLIPSIS ... +# else // defined(ASIO_HAS_VARIADIC_TEMPLATES) +# define ASIO_ELLIPSIS +# endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) +#endif // !defined(ASIO_ELLIPSIS) + +// Support deleted functions on compilers known to allow it. +#if !defined(ASIO_DELETED) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_DELETED = delete +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(__clang__) +# if __has_feature(__cxx_deleted_functions__) +# define ASIO_DELETED = delete +# endif // __has_feature(__cxx_deleted_functions__) +# endif // defined(__clang__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_DELETED = delete +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# if !defined(ASIO_DELETED) +# define ASIO_DELETED +# endif // !defined(ASIO_DELETED) +#endif // !defined(ASIO_DELETED) + +// Support constexpr on compilers known to allow it. +#if !defined(ASIO_HAS_CONSTEXPR) +# if !defined(ASIO_DISABLE_CONSTEXPR) +# if defined(__clang__) +# if __has_feature(__cxx_constexpr__) +# define ASIO_HAS_CONSTEXPR 1 +# endif // __has_feature(__cxx_constexpr__) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_CONSTEXPR 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_HAS_CONSTEXPR 1 +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_CONSTEXPR) +#endif // !defined(ASIO_HAS_CONSTEXPR) +#if !defined(ASIO_CONSTEXPR) +# if defined(ASIO_HAS_CONSTEXPR) +# define ASIO_CONSTEXPR constexpr +# else // defined(ASIO_HAS_CONSTEXPR) +# define ASIO_CONSTEXPR +# endif // defined(ASIO_HAS_CONSTEXPR) +#endif // !defined(ASIO_CONSTEXPR) +#if !defined(ASIO_STATIC_CONSTEXPR) +# if defined(ASIO_HAS_CONSTEXPR) +# define ASIO_STATIC_CONSTEXPR(type, assignment) \ + static constexpr type assignment +# else // defined(ASIO_HAS_CONSTEXPR) +# define ASIO_STATIC_CONSTEXPR(type, assignment) \ + static const type assignment +# endif // defined(ASIO_HAS_CONSTEXPR) +#endif // !defined(ASIO_STATIC_CONSTEXPR) +#if !defined(ASIO_STATIC_CONSTEXPR_DEFAULT_INIT) +# if defined(ASIO_HAS_CONSTEXPR) +# if defined(__GNUC__) +# if (__GNUC__ >= 8) +# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \ + static constexpr const type name{} +# else // (__GNUC__ >= 8) +# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \ + static const type name +# endif // (__GNUC__ >= 8) +# elif defined(ASIO_MSVC) +# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \ + static const type name +# else // defined(ASIO_MSVC) +# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \ + static constexpr const type name{} +# endif // defined(ASIO_MSVC) +# else // defined(ASIO_HAS_CONSTEXPR) +# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \ + static const type name +# endif // defined(ASIO_HAS_CONSTEXPR) +#endif // !defined(ASIO_STATIC_CONSTEXPR_DEFAULT_INIT) + +// Support noexcept on compilers known to allow it. +#if !defined(ASIO_HAS_NOEXCEPT) +# if !defined(ASIO_DISABLE_NOEXCEPT) +# if defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300) +# if !defined(BOOST_NO_NOEXCEPT) +# define ASIO_HAS_NOEXCEPT 1 +# endif // !defined(BOOST_NO_NOEXCEPT) +# define ASIO_NOEXCEPT BOOST_NOEXCEPT +# define ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW +# define ASIO_NOEXCEPT_IF(c) BOOST_NOEXCEPT_IF(c) +# elif defined(__clang__) +# if __has_feature(__cxx_noexcept__) +# define ASIO_HAS_NOEXCEPT 1 +# endif // __has_feature(__cxx_noexcept__) +# elif defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_NOEXCEPT 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# elif defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_HAS_NOEXCEPT 1 +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_NOEXCEPT) +# if !defined(ASIO_NOEXCEPT) +# endif // !defined(ASIO_NOEXCEPT) +# if !defined(ASIO_NOEXCEPT_OR_NOTHROW) +# endif // !defined(ASIO_NOEXCEPT_OR_NOTHROW) +#endif // !defined(ASIO_HAS_NOEXCEPT) +#if !defined(ASIO_NOEXCEPT) +# if defined(ASIO_HAS_NOEXCEPT) +# define ASIO_NOEXCEPT noexcept(true) +# else // defined(ASIO_HAS_NOEXCEPT) +# define ASIO_NOEXCEPT +# endif // defined(ASIO_HAS_NOEXCEPT) +#endif // !defined(ASIO_NOEXCEPT) +#if !defined(ASIO_NOEXCEPT_OR_NOTHROW) +# if defined(ASIO_HAS_NOEXCEPT) +# define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true) +# else // defined(ASIO_HAS_NOEXCEPT) +# define ASIO_NOEXCEPT_OR_NOTHROW throw() +# endif // defined(ASIO_HAS_NOEXCEPT) +#endif // !defined(ASIO_NOEXCEPT_OR_NOTHROW) +#if !defined(ASIO_NOEXCEPT_IF) +# if defined(ASIO_HAS_NOEXCEPT) +# define ASIO_NOEXCEPT_IF(c) noexcept(c) +# else // defined(ASIO_HAS_NOEXCEPT) +# define ASIO_NOEXCEPT_IF(c) +# endif // defined(ASIO_HAS_NOEXCEPT) +#endif // !defined(ASIO_NOEXCEPT_IF) + +// Support automatic type deduction on compilers known to support it. +#if !defined(ASIO_HAS_DECLTYPE) +# if !defined(ASIO_DISABLE_DECLTYPE) +# if defined(__clang__) +# if __has_feature(__cxx_decltype__) +# define ASIO_HAS_DECLTYPE 1 +# endif // __has_feature(__cxx_decltype__) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_DECLTYPE 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1800) +# define ASIO_HAS_DECLTYPE 1 +# endif // (_MSC_VER >= 1800) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_DECLTYPE) +#endif // !defined(ASIO_HAS_DECLTYPE) + +// Support alias templates on compilers known to allow it. +#if !defined(ASIO_HAS_ALIAS_TEMPLATES) +# if !defined(ASIO_DISABLE_ALIAS_TEMPLATES) +# if defined(__clang__) +# if __has_feature(__cxx_alias_templates__) +# define ASIO_HAS_ALIAS_TEMPLATES 1 +# endif // __has_feature(__cxx_alias_templates__) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_ALIAS_TEMPLATES 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_HAS_ALIAS_TEMPLATES 1 +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_ALIAS_TEMPLATES) +#endif // !defined(ASIO_HAS_ALIAS_TEMPLATES) + +// Support return type deduction on compilers known to allow it. +#if !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION) +# if !defined(ASIO_DISABLE_RETURN_TYPE_DEDUCTION) +# if defined(__clang__) +# if __has_feature(__cxx_return_type_deduction__) +# define ASIO_HAS_RETURN_TYPE_DEDUCTION 1 +# endif // __has_feature(__cxx_return_type_deduction__) +# elif (__cplusplus >= 201402) +# define ASIO_HAS_RETURN_TYPE_DEDUCTION 1 +# elif defined(__cpp_return_type_deduction) +# if (__cpp_return_type_deduction >= 201304) +# define ASIO_HAS_RETURN_TYPE_DEDUCTION 1 +# endif // (__cpp_return_type_deduction >= 201304) +# endif // defined(__cpp_return_type_deduction) +# endif // !defined(ASIO_DISABLE_RETURN_TYPE_DEDUCTION) +#endif // !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION) + +// Support default function template arguments on compilers known to allow it. +#if !defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS) +# if !defined(ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS) +# if (__cplusplus >= 201103) +# define ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1 +# endif // (__cplusplus >= 201103) +# endif // !defined(ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS) +#endif // !defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS) + +// Support concepts on compilers known to allow them. +#if !defined(ASIO_HAS_CONCEPTS) +# if !defined(ASIO_DISABLE_CONCEPTS) +# if defined(__cpp_concepts) +# define ASIO_HAS_CONCEPTS 1 +# if (__cpp_concepts >= 201707) +# define ASIO_CONCEPT concept +# else // (__cpp_concepts >= 201707) +# define ASIO_CONCEPT concept bool +# endif // (__cpp_concepts >= 201707) +# endif // defined(__cpp_concepts) +# endif // !defined(ASIO_DISABLE_CONCEPTS) +#endif // !defined(ASIO_HAS_CONCEPTS) + +// Support template variables on compilers known to allow it. +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) +# if !defined(ASIO_DISABLE_VARIABLE_TEMPLATES) +# if defined(__clang__) +# if (__cplusplus >= 201402) +# if __has_feature(__cxx_variable_templates__) +# define ASIO_HAS_VARIABLE_TEMPLATES 1 +# endif // __has_feature(__cxx_variable_templates__) +# endif // (__cplusplus >= 201402) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if (__GNUC__ >= 6) +# if (__cplusplus >= 201402) +# define ASIO_HAS_VARIABLE_TEMPLATES 1 +# endif // (__cplusplus >= 201402) +# endif // (__GNUC__ >= 6) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1901) +# define ASIO_HAS_VARIABLE_TEMPLATES 1 +# endif // (_MSC_VER >= 1901) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_VARIABLE_TEMPLATES) +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +// Support SFINAEd template variables on compilers known to allow it. +#if !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +# if !defined(ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES) +# if defined(__clang__) +# if (__cplusplus >= 201703) +# if __has_feature(__cxx_variable_templates__) +# define ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1 +# endif // __has_feature(__cxx_variable_templates__) +# endif // (__cplusplus >= 201703) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8) +# if (__cplusplus >= 201402) +# define ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1 +# endif // (__cplusplus >= 201402) +# endif // ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1901) +# define ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1 +# endif // (_MSC_VER >= 1901) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES) +#endif // !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +// Support SFINAE use of constant expressions on compilers known to allow it. +#if !defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE) +# if !defined(ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE) +# if defined(__clang__) +# if (__cplusplus >= 201402) +# define ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1 +# endif // (__cplusplus >= 201402) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if (__GNUC__ >= 7) +# if (__cplusplus >= 201402) +# define ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1 +# endif // (__cplusplus >= 201402) +# endif // (__GNUC__ >= 7) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1901) +# define ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1 +# endif // (_MSC_VER >= 1901) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE) +#endif // !defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE) + +// Enable workarounds for lack of working expression SFINAE. +#if !defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE) +# if !defined(ASIO_DISABLE_WORKING_EXPRESSION_SFINAE) +# if !defined(ASIO_MSVC) +# if (__cplusplus >= 201103) +# define ASIO_HAS_WORKING_EXPRESSION_SFINAE 1 +# endif // (__cplusplus >= 201103) +# endif // !defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_WORKING_EXPRESSION_SFINAE) +#endif // !defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE) + +// Support ref-qualified functions on compilers known to allow it. +#if !defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) +# if !defined(ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS) +# if defined(__clang__) +# if __has_feature(__cxx_reference_qualified_functions__) +# define ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1 +# endif // __has_feature(__cxx_reference_qualified_functions__) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1 +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS) +#endif // !defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) +#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) +# if !defined(ASIO_LVALUE_REF_QUAL) +# define ASIO_LVALUE_REF_QUAL & +# endif // !defined(ASIO_LVALUE_REF_QUAL) +# if !defined(ASIO_RVALUE_REF_QUAL) +# define ASIO_RVALUE_REF_QUAL && +# endif // !defined(ASIO_RVALUE_REF_QUAL) +#else // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) +# if !defined(ASIO_LVALUE_REF_QUAL) +# define ASIO_LVALUE_REF_QUAL +# endif // !defined(ASIO_LVALUE_REF_QUAL) +# if !defined(ASIO_RVALUE_REF_QUAL) +# define ASIO_RVALUE_REF_QUAL +# endif // !defined(ASIO_RVALUE_REF_QUAL) +#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) + +// Standard library support for system errors. +#if !defined(ASIO_HAS_STD_SYSTEM_ERROR) +# if !defined(ASIO_DISABLE_STD_SYSTEM_ERROR) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_SYSTEM_ERROR 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_SYSTEM_ERROR 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_SYSTEM_ERROR 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_SYSTEM_ERROR 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_SYSTEM_ERROR) +#endif // !defined(ASIO_HAS_STD_SYSTEM_ERROR) + +// Compliant C++11 compilers put noexcept specifiers on error_category members. +#if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) +# if defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300) +# define ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT +# elif defined(__clang__) +# if __has_feature(__cxx_noexcept__) +# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) +# endif // __has_feature(__cxx_noexcept__) +# elif defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# elif defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) +# define ASIO_ERROR_CATEGORY_NOEXCEPT +# endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) +#endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) + +// Standard library support for arrays. +#if !defined(ASIO_HAS_STD_ARRAY) +# if !defined(ASIO_DISABLE_STD_ARRAY) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_ARRAY 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_ARRAY 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_ARRAY 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1600) +# define ASIO_HAS_STD_ARRAY 1 +# endif // (_MSC_VER >= 1600) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_ARRAY) +#endif // !defined(ASIO_HAS_STD_ARRAY) + +// Standard library support for shared_ptr and weak_ptr. +#if !defined(ASIO_HAS_STD_SHARED_PTR) +# if !defined(ASIO_DISABLE_STD_SHARED_PTR) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_SHARED_PTR 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_STD_SHARED_PTR 1 +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_SHARED_PTR 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1600) +# define ASIO_HAS_STD_SHARED_PTR 1 +# endif // (_MSC_VER >= 1600) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_SHARED_PTR) +#endif // !defined(ASIO_HAS_STD_SHARED_PTR) + +// Standard library support for allocator_arg_t. +#if !defined(ASIO_HAS_STD_ALLOCATOR_ARG) +# if !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_ALLOCATOR_ARG 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_STD_ALLOCATOR_ARG 1 +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_ALLOCATOR_ARG 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1600) +# define ASIO_HAS_STD_ALLOCATOR_ARG 1 +# endif // (_MSC_VER >= 1600) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG) +#endif // !defined(ASIO_HAS_STD_ALLOCATOR_ARG) + +// Standard library support for atomic operations. +#if !defined(ASIO_HAS_STD_ATOMIC) +# if !defined(ASIO_DISABLE_STD_ATOMIC) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_ATOMIC 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_ATOMIC 1 +# endif // __has_include() +# elif defined(__apple_build_version__) && defined(_LIBCPP_VERSION) +# if (__clang_major__ >= 10) +# if __has_include() +# define ASIO_HAS_STD_ATOMIC 1 +# endif // __has_include() +# endif // (__clang_major__ >= 10) +# endif // defined(__apple_build_version__) && defined(_LIBCPP_VERSION) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_ATOMIC 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_ATOMIC 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_ATOMIC) +#endif // !defined(ASIO_HAS_STD_ATOMIC) + +// Standard library support for chrono. Some standard libraries (such as the +// libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x +// drafts, rather than the eventually standardised name of steady_clock. +#if !defined(ASIO_HAS_STD_CHRONO) +# if !defined(ASIO_DISABLE_STD_CHRONO) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_CHRONO 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_CHRONO 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_CHRONO 1 +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) +# define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1 +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_CHRONO 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_CHRONO) +#endif // !defined(ASIO_HAS_STD_CHRONO) + +// Boost support for chrono. +#if !defined(ASIO_HAS_BOOST_CHRONO) +# if !defined(ASIO_DISABLE_BOOST_CHRONO) +# if defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700) +# define ASIO_HAS_BOOST_CHRONO 1 +# endif // defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700) +# endif // !defined(ASIO_DISABLE_BOOST_CHRONO) +#endif // !defined(ASIO_HAS_BOOST_CHRONO) + +// Some form of chrono library is available. +#if !defined(ASIO_HAS_CHRONO) +# if defined(ASIO_HAS_STD_CHRONO) \ + || defined(ASIO_HAS_BOOST_CHRONO) +# define ASIO_HAS_CHRONO 1 +# endif // defined(ASIO_HAS_STD_CHRONO) + // || defined(ASIO_HAS_BOOST_CHRONO) +#endif // !defined(ASIO_HAS_CHRONO) + +// Boost support for the DateTime library. +#if !defined(ASIO_HAS_BOOST_DATE_TIME) +# if !defined(ASIO_DISABLE_BOOST_DATE_TIME) +# define ASIO_HAS_BOOST_DATE_TIME 1 +# endif // !defined(ASIO_DISABLE_BOOST_DATE_TIME) +#endif // !defined(ASIO_HAS_BOOST_DATE_TIME) + +// Standard library support for addressof. +#if !defined(ASIO_HAS_STD_ADDRESSOF) +# if !defined(ASIO_DISABLE_STD_ADDRESSOF) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_ADDRESSOF 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_STD_ADDRESSOF 1 +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_ADDRESSOF 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_ADDRESSOF 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_ADDRESSOF) +#endif // !defined(ASIO_HAS_STD_ADDRESSOF) + +// Standard library support for the function class. +#if !defined(ASIO_HAS_STD_FUNCTION) +# if !defined(ASIO_DISABLE_STD_FUNCTION) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_FUNCTION 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_STD_FUNCTION 1 +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_FUNCTION 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_FUNCTION 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_FUNCTION) +#endif // !defined(ASIO_HAS_STD_FUNCTION) + +// Standard library support for type traits. +#if !defined(ASIO_HAS_STD_TYPE_TRAITS) +# if !defined(ASIO_DISABLE_STD_TYPE_TRAITS) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_TYPE_TRAITS 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_TYPE_TRAITS 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_TYPE_TRAITS 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_TYPE_TRAITS 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_TYPE_TRAITS) +#endif // !defined(ASIO_HAS_STD_TYPE_TRAITS) + +// Standard library support for the nullptr_t type. +#if !defined(ASIO_HAS_NULLPTR) +# if !defined(ASIO_DISABLE_NULLPTR) +# if defined(__clang__) +# if __has_feature(__cxx_nullptr__) +# define ASIO_HAS_NULLPTR 1 +# endif // __has_feature(__cxx_nullptr__) +# elif defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_NULLPTR 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_NULLPTR 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_NULLPTR) +#endif // !defined(ASIO_HAS_NULLPTR) + +// Standard library support for the C++11 allocator additions. +#if !defined(ASIO_HAS_CXX11_ALLOCATORS) +# if !defined(ASIO_DISABLE_CXX11_ALLOCATORS) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_CXX11_ALLOCATORS 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_CXX11_ALLOCATORS 1 +# endif // (__cplusplus >= 201103) +# elif defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_CXX11_ALLOCATORS 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1800) +# define ASIO_HAS_CXX11_ALLOCATORS 1 +# endif // (_MSC_VER >= 1800) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_CXX11_ALLOCATORS) +#endif // !defined(ASIO_HAS_CXX11_ALLOCATORS) + +// Standard library support for the cstdint header. +#if !defined(ASIO_HAS_CSTDINT) +# if !defined(ASIO_DISABLE_CSTDINT) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_CSTDINT 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_CSTDINT 1 +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_CSTDINT 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_CSTDINT 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_CSTDINT) +#endif // !defined(ASIO_HAS_CSTDINT) + +// Standard library support for the thread class. +#if !defined(ASIO_HAS_STD_THREAD) +# if !defined(ASIO_DISABLE_STD_THREAD) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_THREAD 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_THREAD 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_THREAD 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_THREAD 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_THREAD) +#endif // !defined(ASIO_HAS_STD_THREAD) + +// Standard library support for the mutex and condition variable classes. +#if !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) +# if !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) +#endif // !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) + +// Standard library support for the call_once function. +#if !defined(ASIO_HAS_STD_CALL_ONCE) +# if !defined(ASIO_DISABLE_STD_CALL_ONCE) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_CALL_ONCE 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_CALL_ONCE 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_CALL_ONCE 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_CALL_ONCE 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_CALL_ONCE) +#endif // !defined(ASIO_HAS_STD_CALL_ONCE) + +// Standard library support for futures. +#if !defined(ASIO_HAS_STD_FUTURE) +# if !defined(ASIO_DISABLE_STD_FUTURE) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_FUTURE 1 +# elif (__cplusplus >= 201103) +# if __has_include() +# define ASIO_HAS_STD_FUTURE 1 +# endif // __has_include() +# endif // (__cplusplus >= 201103) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_FUTURE 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_FUTURE 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_FUTURE) +#endif // !defined(ASIO_HAS_STD_FUTURE) + +// Standard library support for std::string_view. +#if !defined(ASIO_HAS_STD_STRING_VIEW) +# if !defined(ASIO_DISABLE_STD_STRING_VIEW) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# if (__cplusplus >= 201402) +# if __has_include() +# define ASIO_HAS_STD_STRING_VIEW 1 +# endif // __has_include() +# endif // (__cplusplus >= 201402) +# else // defined(ASIO_HAS_CLANG_LIBCXX) +# if (__cplusplus >= 201703) +# if __has_include() +# define ASIO_HAS_STD_STRING_VIEW 1 +# endif // __has_include() +# endif // (__cplusplus >= 201703) +# endif // defined(ASIO_HAS_CLANG_LIBCXX) +# elif defined(__GNUC__) +# if (__GNUC__ >= 7) +# if (__cplusplus >= 201703) +# define ASIO_HAS_STD_STRING_VIEW 1 +# endif // (__cplusplus >= 201703) +# endif // (__GNUC__ >= 7) +# elif defined(ASIO_MSVC) +# if (_MSC_VER >= 1910 && _MSVC_LANG >= 201703) +# define ASIO_HAS_STD_STRING_VIEW 1 +# endif // (_MSC_VER >= 1910 && _MSVC_LANG >= 201703) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_STRING_VIEW) +#endif // !defined(ASIO_HAS_STD_STRING_VIEW) + +// Standard library support for std::experimental::string_view. +#if !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) +# if !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# if (_LIBCPP_VERSION < 7000) +# if (__cplusplus >= 201402) +# if __has_include() +# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 +# endif // __has_include() +# endif // (__cplusplus >= 201402) +# endif // (_LIBCPP_VERSION < 7000) +# else // defined(ASIO_HAS_CLANG_LIBCXX) +# if (__cplusplus >= 201402) +# if __has_include() +# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 +# endif // __has_include() +# endif // (__cplusplus >= 201402) +# endif // // defined(ASIO_HAS_CLANG_LIBCXX) +# endif // defined(__clang__) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) +# if (__cplusplus >= 201402) +# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 +# endif // (__cplusplus >= 201402) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# endif // !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW) +#endif // !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) + +// Standard library has a string_view that we can use. +#if !defined(ASIO_HAS_STRING_VIEW) +# if !defined(ASIO_DISABLE_STRING_VIEW) +# if defined(ASIO_HAS_STD_STRING_VIEW) +# define ASIO_HAS_STRING_VIEW 1 +# elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) +# define ASIO_HAS_STRING_VIEW 1 +# endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) +# endif // !defined(ASIO_DISABLE_STRING_VIEW) +#endif // !defined(ASIO_HAS_STRING_VIEW) + +// Standard library support for iostream move construction and assignment. +#if !defined(ASIO_HAS_STD_IOSTREAM_MOVE) +# if !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE) +# if defined(__GNUC__) +# if (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_IOSTREAM_MOVE 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_STD_IOSTREAM_MOVE 1 +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE) +#endif // !defined(ASIO_HAS_STD_IOSTREAM_MOVE) + +// Standard library has invoke_result (which supersedes result_of). +#if !defined(ASIO_HAS_STD_INVOKE_RESULT) +# if !defined(ASIO_DISABLE_STD_INVOKE_RESULT) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1911 && _MSVC_LANG >= 201703) +# define ASIO_HAS_STD_INVOKE_RESULT 1 +# endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_INVOKE_RESULT) +#endif // !defined(ASIO_HAS_STD_INVOKE_RESULT) + +// Standard library support for std::exception_ptr and std::current_exception. +#if !defined(ASIO_HAS_STD_EXCEPTION_PTR) +# if !defined(ASIO_DISABLE_STD_EXCEPTION_PTR) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_EXCEPTION_PTR 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_STD_EXCEPTION_PTR 1 +# endif // (__cplusplus >= 201103) +# elif defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_EXCEPTION_PTR 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1800) +# define ASIO_HAS_STD_EXCEPTION_PTR 1 +# endif // (_MSC_VER >= 1800) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_EXCEPTION_PTR) +#endif // !defined(ASIO_HAS_STD_EXCEPTION_PTR) + +// Standard library support for std::nested_exception. +#if !defined(ASIO_HAS_STD_NESTED_EXCEPTION) +# if !defined(ASIO_DISABLE_STD_NESTED_EXCEPTION) +# if defined(__clang__) +# if defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_NESTED_EXCEPTION 1 +# elif (__cplusplus >= 201103) +# define ASIO_HAS_STD_NESTED_EXCEPTION 1 +# endif // (__cplusplus >= 201103) +# elif defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_HAS_STD_NESTED_EXCEPTION 1 +# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1900) +# define ASIO_HAS_STD_NESTED_EXCEPTION 1 +# endif // (_MSC_VER >= 1900) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_NESTED_EXCEPTION) +#endif // !defined(ASIO_HAS_STD_NESTED_EXCEPTION) + +// Standard library support for std::any. +#if !defined(ASIO_HAS_STD_ANY) +# if !defined(ASIO_DISABLE_STD_ANY) +# if defined(__clang__) +# if (__cplusplus >= 201703) +# if __has_include() +# define ASIO_HAS_STD_ANY 1 +# endif // __has_include() +# endif // (__cplusplus >= 201703) +# elif defined(__GNUC__) +# if (__GNUC__ >= 7) +# if (__cplusplus >= 201703) +# define ASIO_HAS_STD_ANY 1 +# endif // (__cplusplus >= 201703) +# endif // (__GNUC__ >= 7) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703) +# define ASIO_HAS_STD_ANY 1 +# endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703) +# endif // defined(ASIO_MSVC) +# endif // !defined(ASIO_DISABLE_STD_ANY) +#endif // !defined(ASIO_HAS_STD_ANY) + +// Standard library support for std::source_location. +#if !defined(ASIO_HAS_STD_SOURCE_LOCATION) +# if !defined(ASIO_DISABLE_STD_SOURCE_LOCATION) +// ... +# endif // !defined(ASIO_DISABLE_STD_SOURCE_LOCATION) +#endif // !defined(ASIO_HAS_STD_SOURCE_LOCATION) + +// Standard library support for std::experimental::source_location. +#if !defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) +# if !defined(ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION) +# if defined(__GNUC__) +# if (__cplusplus >= 201709) +# if __has_include() +# define ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION 1 +# endif // __has_include() +# endif // (__cplusplus >= 201709) +# endif // defined(__GNUC__) +# endif // !defined(ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION) +#endif // !defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) + +// Standard library has a source_location that we can use. +#if !defined(ASIO_HAS_SOURCE_LOCATION) +# if !defined(ASIO_DISABLE_SOURCE_LOCATION) +# if defined(ASIO_HAS_STD_SOURCE_LOCATION) +# define ASIO_HAS_SOURCE_LOCATION 1 +# elif defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) +# define ASIO_HAS_SOURCE_LOCATION 1 +# endif // defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) +# endif // !defined(ASIO_DISABLE_SOURCE_LOCATION) +#endif // !defined(ASIO_HAS_SOURCE_LOCATION) + +// Windows App target. Windows but with a limited API. +#if !defined(ASIO_WINDOWS_APP) +# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) +# include +# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ + || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)) \ + && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# define ASIO_WINDOWS_APP 1 +# endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) + // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) +#endif // !defined(ASIO_WINDOWS_APP) + +// Legacy WinRT target. Windows App is preferred. +#if !defined(ASIO_WINDOWS_RUNTIME) +# if !defined(ASIO_WINDOWS_APP) +# if defined(__cplusplus_winrt) +# include +# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ + && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# define ASIO_WINDOWS_RUNTIME 1 +# endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) + // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# endif // defined(__cplusplus_winrt) +# endif // !defined(ASIO_WINDOWS_APP) +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +// Windows target. Excludes WinRT but includes Windows App targets. +#if !defined(ASIO_WINDOWS) +# if !defined(ASIO_WINDOWS_RUNTIME) +# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) +# define ASIO_WINDOWS 1 +# elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) +# define ASIO_WINDOWS 1 +# elif defined(ASIO_WINDOWS_APP) +# define ASIO_WINDOWS 1 +# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) +# endif // !defined(ASIO_WINDOWS_RUNTIME) +#endif // !defined(ASIO_WINDOWS) + +// Windows: target OS version. +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) +# if defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__)) +# pragma message( \ + "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\ + "- add -D_WIN32_WINNT=0x0601 to the compiler command line; or\n"\ + "- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.\n"\ + "Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).") +# else // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__)) +# warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. +# warning For example, add -D_WIN32_WINNT=0x0601 to the compiler command line. +# warning Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target). +# endif // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__)) +# define _WIN32_WINNT 0x0601 +# endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) +# if defined(_MSC_VER) +# if defined(_WIN32) && !defined(WIN32) +# if !defined(_WINSOCK2API_) +# define WIN32 // Needed for correct types in winsock2.h +# else // !defined(_WINSOCK2API_) +# error Please define the macro WIN32 in your compiler options +# endif // !defined(_WINSOCK2API_) +# endif // defined(_WIN32) && !defined(WIN32) +# endif // defined(_MSC_VER) +# if defined(__BORLANDC__) +# if defined(__WIN32__) && !defined(WIN32) +# if !defined(_WINSOCK2API_) +# define WIN32 // Needed for correct types in winsock2.h +# else // !defined(_WINSOCK2API_) +# error Please define the macro WIN32 in your compiler options +# endif // !defined(_WINSOCK2API_) +# endif // defined(__WIN32__) && !defined(WIN32) +# endif // defined(__BORLANDC__) +# if defined(__CYGWIN__) +# if !defined(__USE_W32_SOCKETS) +# error You must add -D__USE_W32_SOCKETS to your compiler options. +# endif // !defined(__USE_W32_SOCKETS) +# endif // defined(__CYGWIN__) +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +// Windows: minimise header inclusion. +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) +# if !defined(WIN32_LEAN_AND_MEAN) +# define WIN32_LEAN_AND_MEAN +# endif // !defined(WIN32_LEAN_AND_MEAN) +# endif // !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +// Windows: suppress definition of "min" and "max" macros. +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if !defined(ASIO_NO_NOMINMAX) +# if !defined(NOMINMAX) +# define NOMINMAX 1 +# endif // !defined(NOMINMAX) +# endif // !defined(ASIO_NO_NOMINMAX) +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +// Windows: IO Completion Ports. +#if !defined(ASIO_HAS_IOCP) +# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) +# if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) +# if !defined(ASIO_DISABLE_IOCP) +# define ASIO_HAS_IOCP 1 +# endif // !defined(ASIO_DISABLE_IOCP) +# endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) +# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) +# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +#endif // !defined(ASIO_HAS_IOCP) + +// On POSIX (and POSIX-like) platforms we need to include unistd.h in order to +// get access to the various platform feature macros, e.g. to be able to test +// for threads support. +#if !defined(ASIO_HAS_UNISTD_H) +# if !defined(ASIO_HAS_BOOST_CONFIG) +# if defined(unix) \ + || defined(__unix) \ + || defined(_XOPEN_SOURCE) \ + || defined(_POSIX_SOURCE) \ + || (defined(__MACH__) && defined(__APPLE__)) \ + || defined(__FreeBSD__) \ + || defined(__NetBSD__) \ + || defined(__OpenBSD__) \ + || defined(__linux__) \ + || defined(__HAIKU__) +# define ASIO_HAS_UNISTD_H 1 +# endif +# endif // !defined(ASIO_HAS_BOOST_CONFIG) +#endif // !defined(ASIO_HAS_UNISTD_H) +#if defined(ASIO_HAS_UNISTD_H) +# include +#endif // defined(ASIO_HAS_UNISTD_H) + +// Linux: epoll, eventfd and timerfd. +#if defined(__linux__) +# include +# if !defined(ASIO_HAS_EPOLL) +# if !defined(ASIO_DISABLE_EPOLL) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) +# define ASIO_HAS_EPOLL 1 +# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) +# endif // !defined(ASIO_DISABLE_EPOLL) +# endif // !defined(ASIO_HAS_EPOLL) +# if !defined(ASIO_HAS_EVENTFD) +# if !defined(ASIO_DISABLE_EVENTFD) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +# define ASIO_HAS_EVENTFD 1 +# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +# endif // !defined(ASIO_DISABLE_EVENTFD) +# endif // !defined(ASIO_HAS_EVENTFD) +# if !defined(ASIO_HAS_TIMERFD) +# if defined(ASIO_HAS_EPOLL) +# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) +# define ASIO_HAS_TIMERFD 1 +# endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) +# endif // defined(ASIO_HAS_EPOLL) +# endif // !defined(ASIO_HAS_TIMERFD) +#endif // defined(__linux__) + +// Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue. +#if (defined(__MACH__) && defined(__APPLE__)) \ + || defined(__FreeBSD__) \ + || defined(__NetBSD__) \ + || defined(__OpenBSD__) +# if !defined(ASIO_HAS_KQUEUE) +# if !defined(ASIO_DISABLE_KQUEUE) +# define ASIO_HAS_KQUEUE 1 +# endif // !defined(ASIO_DISABLE_KQUEUE) +# endif // !defined(ASIO_HAS_KQUEUE) +#endif // (defined(__MACH__) && defined(__APPLE__)) + // || defined(__FreeBSD__) + // || defined(__NetBSD__) + // || defined(__OpenBSD__) + +// Solaris: /dev/poll. +#if defined(__sun) +# if !defined(ASIO_HAS_DEV_POLL) +# if !defined(ASIO_DISABLE_DEV_POLL) +# define ASIO_HAS_DEV_POLL 1 +# endif // !defined(ASIO_DISABLE_DEV_POLL) +# endif // !defined(ASIO_HAS_DEV_POLL) +#endif // defined(__sun) + +// Serial ports. +#if !defined(ASIO_HAS_SERIAL_PORT) +# if defined(ASIO_HAS_IOCP) \ + || !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) +# if !defined(__SYMBIAN32__) +# if !defined(ASIO_DISABLE_SERIAL_PORT) +# define ASIO_HAS_SERIAL_PORT 1 +# endif // !defined(ASIO_DISABLE_SERIAL_PORT) +# endif // !defined(__SYMBIAN32__) +# endif // defined(ASIO_HAS_IOCP) + // || !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +#endif // !defined(ASIO_HAS_SERIAL_PORT) + +// Windows: stream handles. +#if !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) +# if !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) +# if defined(ASIO_HAS_IOCP) +# define ASIO_HAS_WINDOWS_STREAM_HANDLE 1 +# endif // defined(ASIO_HAS_IOCP) +# endif // !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) +#endif // !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) + +// Windows: random access handles. +#if !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) +# if !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) +# if defined(ASIO_HAS_IOCP) +# define ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1 +# endif // defined(ASIO_HAS_IOCP) +# endif // !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) +#endif // !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) + +// Windows: object handles. +#if !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) +# if !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) +# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) +# define ASIO_HAS_WINDOWS_OBJECT_HANDLE 1 +# endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) +# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# endif // !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) +#endif // !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) + +// Windows: OVERLAPPED wrapper. +#if !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) +# if !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) +# if defined(ASIO_HAS_IOCP) +# define ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1 +# endif // defined(ASIO_HAS_IOCP) +# endif // !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) +#endif // !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) + +// POSIX: stream-oriented file descriptors. +#if !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) +# if !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) +# if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) +# define ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1 +# endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +# endif // !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) +#endif // !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) + +// UNIX domain sockets. +#if !defined(ASIO_HAS_LOCAL_SOCKETS) +# if !defined(ASIO_DISABLE_LOCAL_SOCKETS) +# if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) +# define ASIO_HAS_LOCAL_SOCKETS 1 +# endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +# endif // !defined(ASIO_DISABLE_LOCAL_SOCKETS) +#endif // !defined(ASIO_HAS_LOCAL_SOCKETS) + +// Can use sigaction() instead of signal(). +#if !defined(ASIO_HAS_SIGACTION) +# if !defined(ASIO_DISABLE_SIGACTION) +# if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) +# define ASIO_HAS_SIGACTION 1 +# endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +# endif // !defined(ASIO_DISABLE_SIGACTION) +#endif // !defined(ASIO_HAS_SIGACTION) + +// Can use signal(). +#if !defined(ASIO_HAS_SIGNAL) +# if !defined(ASIO_DISABLE_SIGNAL) +# if !defined(UNDER_CE) +# define ASIO_HAS_SIGNAL 1 +# endif // !defined(UNDER_CE) +# endif // !defined(ASIO_DISABLE_SIGNAL) +#endif // !defined(ASIO_HAS_SIGNAL) + +// Can use getaddrinfo() and getnameinfo(). +#if !defined(ASIO_HAS_GETADDRINFO) +# if !defined(ASIO_DISABLE_GETADDRINFO) +# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) +# define ASIO_HAS_GETADDRINFO 1 +# elif defined(UNDER_CE) +# define ASIO_HAS_GETADDRINFO 1 +# endif // defined(UNDER_CE) +# elif defined(__MACH__) && defined(__APPLE__) +# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +# if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) +# define ASIO_HAS_GETADDRINFO 1 +# endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) +# else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +# define ASIO_HAS_GETADDRINFO 1 +# endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +# else // defined(__MACH__) && defined(__APPLE__) +# define ASIO_HAS_GETADDRINFO 1 +# endif // defined(__MACH__) && defined(__APPLE__) +# endif // !defined(ASIO_DISABLE_GETADDRINFO) +#endif // !defined(ASIO_HAS_GETADDRINFO) + +// Whether standard iostreams are disabled. +#if !defined(ASIO_NO_IOSTREAM) +# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM) +# define ASIO_NO_IOSTREAM 1 +# endif // !defined(BOOST_NO_IOSTREAM) +#endif // !defined(ASIO_NO_IOSTREAM) + +// Whether exception handling is disabled. +#if !defined(ASIO_NO_EXCEPTIONS) +# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS) +# define ASIO_NO_EXCEPTIONS 1 +# endif // !defined(BOOST_NO_EXCEPTIONS) +#endif // !defined(ASIO_NO_EXCEPTIONS) + +// Whether the typeid operator is supported. +#if !defined(ASIO_NO_TYPEID) +# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID) +# define ASIO_NO_TYPEID 1 +# endif // !defined(BOOST_NO_TYPEID) +#endif // !defined(ASIO_NO_TYPEID) + +// Threads. +#if !defined(ASIO_HAS_THREADS) +# if !defined(ASIO_DISABLE_THREADS) +# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) +# define ASIO_HAS_THREADS 1 +# elif defined(__GNUC__) && !defined(__MINGW32__) \ + && !defined(linux) && !defined(__linux) && !defined(__linux__) +# define ASIO_HAS_THREADS 1 +# elif defined(_MT) || defined(__MT__) +# define ASIO_HAS_THREADS 1 +# elif defined(_REENTRANT) +# define ASIO_HAS_THREADS 1 +# elif defined(__APPLE__) +# define ASIO_HAS_THREADS 1 +# elif defined(__HAIKU__) +# define ASIO_HAS_THREADS 1 +# elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0) +# define ASIO_HAS_THREADS 1 +# elif defined(_PTHREADS) +# define ASIO_HAS_THREADS 1 +# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) +# endif // !defined(ASIO_DISABLE_THREADS) +#endif // !defined(ASIO_HAS_THREADS) + +// POSIX threads. +#if !defined(ASIO_HAS_PTHREADS) +# if defined(ASIO_HAS_THREADS) +# if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) +# define ASIO_HAS_PTHREADS 1 +# elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0) +# define ASIO_HAS_PTHREADS 1 +# elif defined(__HAIKU__) +# define ASIO_HAS_PTHREADS 1 +# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) +# endif // defined(ASIO_HAS_THREADS) +#endif // !defined(ASIO_HAS_PTHREADS) + +// Helper to prevent macro expansion. +#define ASIO_PREVENT_MACRO_SUBSTITUTION + +// Helper to define in-class constants. +#if !defined(ASIO_STATIC_CONSTANT) +# if !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) +# define ASIO_STATIC_CONSTANT(type, assignment) \ + BOOST_STATIC_CONSTANT(type, assignment) +# else // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) +# define ASIO_STATIC_CONSTANT(type, assignment) \ + static const type assignment +# endif // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) +#endif // !defined(ASIO_STATIC_CONSTANT) + +// Boost array library. +#if !defined(ASIO_HAS_BOOST_ARRAY) +# if !defined(ASIO_DISABLE_BOOST_ARRAY) +# define ASIO_HAS_BOOST_ARRAY 1 +# endif // !defined(ASIO_DISABLE_BOOST_ARRAY) +#endif // !defined(ASIO_HAS_BOOST_ARRAY) + +// Boost assert macro. +#if !defined(ASIO_HAS_BOOST_ASSERT) +# if !defined(ASIO_DISABLE_BOOST_ASSERT) +# define ASIO_HAS_BOOST_ASSERT 1 +# endif // !defined(ASIO_DISABLE_BOOST_ASSERT) +#endif // !defined(ASIO_HAS_BOOST_ASSERT) + +// Boost limits header. +#if !defined(ASIO_HAS_BOOST_LIMITS) +# if !defined(ASIO_DISABLE_BOOST_LIMITS) +# define ASIO_HAS_BOOST_LIMITS 1 +# endif // !defined(ASIO_DISABLE_BOOST_LIMITS) +#endif // !defined(ASIO_HAS_BOOST_LIMITS) + +// Boost throw_exception function. +#if !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) +# if !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) +# define ASIO_HAS_BOOST_THROW_EXCEPTION 1 +# endif // !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) +#endif // !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) + +// Boost regex library. +#if !defined(ASIO_HAS_BOOST_REGEX) +# if !defined(ASIO_DISABLE_BOOST_REGEX) +# define ASIO_HAS_BOOST_REGEX 1 +# endif // !defined(ASIO_DISABLE_BOOST_REGEX) +#endif // !defined(ASIO_HAS_BOOST_REGEX) + +// Boost bind function. +#if !defined(ASIO_HAS_BOOST_BIND) +# if !defined(ASIO_DISABLE_BOOST_BIND) +# define ASIO_HAS_BOOST_BIND 1 +# endif // !defined(ASIO_DISABLE_BOOST_BIND) +#endif // !defined(ASIO_HAS_BOOST_BIND) + +// Boost's BOOST_WORKAROUND macro. +#if !defined(ASIO_HAS_BOOST_WORKAROUND) +# if !defined(ASIO_DISABLE_BOOST_WORKAROUND) +# define ASIO_HAS_BOOST_WORKAROUND 1 +# endif // !defined(ASIO_DISABLE_BOOST_WORKAROUND) +#endif // !defined(ASIO_HAS_BOOST_WORKAROUND) + +// Microsoft Visual C++'s secure C runtime library. +#if !defined(ASIO_HAS_SECURE_RTL) +# if !defined(ASIO_DISABLE_SECURE_RTL) +# if defined(ASIO_MSVC) \ + && (ASIO_MSVC >= 1400) \ + && !defined(UNDER_CE) +# define ASIO_HAS_SECURE_RTL 1 +# endif // defined(ASIO_MSVC) + // && (ASIO_MSVC >= 1400) + // && !defined(UNDER_CE) +# endif // !defined(ASIO_DISABLE_SECURE_RTL) +#endif // !defined(ASIO_HAS_SECURE_RTL) + +// Handler hooking. Disabled for ancient Borland C++ and gcc compilers. +#if !defined(ASIO_HAS_HANDLER_HOOKS) +# if !defined(ASIO_DISABLE_HANDLER_HOOKS) +# if defined(__GNUC__) +# if (__GNUC__ >= 3) +# define ASIO_HAS_HANDLER_HOOKS 1 +# endif // (__GNUC__ >= 3) +# elif !defined(__BORLANDC__) || defined(__clang__) +# define ASIO_HAS_HANDLER_HOOKS 1 +# endif // !defined(__BORLANDC__) || defined(__clang__) +# endif // !defined(ASIO_DISABLE_HANDLER_HOOKS) +#endif // !defined(ASIO_HAS_HANDLER_HOOKS) + +// Support for the __thread keyword extension. +#if !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) +# if defined(__linux__) +# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +# if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) +# if !defined(__INTEL_COMPILER) && !defined(__ICL) \ + && !(defined(__clang__) && defined(__ANDROID__)) +# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 +# define ASIO_THREAD_KEYWORD __thread +# elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) +# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 +# endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) + // && !(defined(__clang__) && defined(__ANDROID__)) +# endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) +# endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +# endif // defined(__linux__) +# if defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) +# if (_MSC_VER >= 1700) +# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 +# define ASIO_THREAD_KEYWORD __declspec(thread) +# endif // (_MSC_VER >= 1700) +# endif // defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) +#endif // !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) +#if !defined(ASIO_THREAD_KEYWORD) +# define ASIO_THREAD_KEYWORD __thread +#endif // !defined(ASIO_THREAD_KEYWORD) + +// Support for POSIX ssize_t typedef. +#if !defined(ASIO_DISABLE_SSIZE_T) +# if defined(__linux__) \ + || (defined(__MACH__) && defined(__APPLE__)) +# define ASIO_HAS_SSIZE_T 1 +# endif // defined(__linux__) + // || (defined(__MACH__) && defined(__APPLE__)) +#endif // !defined(ASIO_DISABLE_SSIZE_T) + +// Helper macros to manage transition away from error_code return values. +#if defined(ASIO_NO_DEPRECATED) +# define ASIO_SYNC_OP_VOID void +# define ASIO_SYNC_OP_VOID_RETURN(e) return +#else // defined(ASIO_NO_DEPRECATED) +# define ASIO_SYNC_OP_VOID asio::error_code +# define ASIO_SYNC_OP_VOID_RETURN(e) return e +#endif // defined(ASIO_NO_DEPRECATED) + +// Newer gcc, clang need special treatment to suppress unused typedef warnings. +#if defined(__clang__) +# if defined(__apple_build_version__) +# if (__clang_major__ >= 7) +# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) +# endif // (__clang_major__ >= 7) +# elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \ + || (__clang_major__ > 3) +# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) +# endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6)) + // || (__clang_major__ > 3) +#elif defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) +#endif // defined(__GNUC__) +#if !defined(ASIO_UNUSED_TYPEDEF) +# define ASIO_UNUSED_TYPEDEF +#endif // !defined(ASIO_UNUSED_TYPEDEF) + +// Some versions of gcc generate spurious warnings about unused variables. +#if defined(__GNUC__) +# if (__GNUC__ >= 4) +# define ASIO_UNUSED_VARIABLE __attribute__((__unused__)) +# endif // (__GNUC__ >= 4) +#endif // defined(__GNUC__) +#if !defined(ASIO_UNUSED_VARIABLE) +# define ASIO_UNUSED_VARIABLE +#endif // !defined(ASIO_UNUSED_VARIABLE) + +// Support the co_await keyword on compilers known to allow it. +#if !defined(ASIO_HAS_CO_AWAIT) +# if !defined(ASIO_DISABLE_CO_AWAIT) +# if defined(ASIO_MSVC) +# if (_MSC_FULL_VER >= 190023506) +# if defined(_RESUMABLE_FUNCTIONS_SUPPORTED) +# define ASIO_HAS_CO_AWAIT 1 +# endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED) +# endif // (_MSC_FULL_VER >= 190023506) +# endif // defined(ASIO_MSVC) +# if defined(__clang__) +# if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703) +# if __has_include() +# define ASIO_HAS_CO_AWAIT 1 +# endif // __has_include() +# endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703) +# elif defined(__GNUC__) +# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# if __has_include() +# define ASIO_HAS_CO_AWAIT 1 +# endif // __has_include() +# endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# endif // defined(__GNUC__) +# endif // !defined(ASIO_DISABLE_CO_AWAIT) +#endif // !defined(ASIO_HAS_CO_AWAIT) + +// Standard library support for coroutines. +#if !defined(ASIO_HAS_STD_COROUTINE) +# if !defined(ASIO_DISABLE_STD_COROUTINE) +# if defined(__GNUC__) +# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# if __has_include() +# define ASIO_HAS_STD_COROUTINE 1 +# endif // __has_include() +# endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902) +# endif // defined(__GNUC__) +# endif // !defined(ASIO_DISABLE_STD_COROUTINE) +#endif // !defined(ASIO_HAS_STD_COROUTINE) + +// Compiler support for the the [[nodiscard]] attribute. +#if !defined(ASIO_NODISCARD) +# if defined(__has_cpp_attribute) +# if __has_cpp_attribute(nodiscard) +# if (__cplusplus >= 201703) +# define ASIO_NODISCARD [[nodiscard]] +# endif // (__cplusplus >= 201703) +# endif // __has_cpp_attribute(nodiscard) +# endif // defined(__has_cpp_attribute) +#endif // !defined(ASIO_NODISCARD) +#if !defined(ASIO_NODISCARD) +# define ASIO_NODISCARD +#endif // !defined(ASIO_NODISCARD) + +#endif // ASIO_DETAIL_CONFIG_HPP diff --git a/include/asio/include/asio/detail/consuming_buffers.hpp b/include/asio/include/asio/detail/consuming_buffers.hpp new file mode 100644 index 0000000..0caf557 --- /dev/null +++ b/include/asio/include/asio/detail/consuming_buffers.hpp @@ -0,0 +1,414 @@ +// +// detail/consuming_buffers.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CONSUMING_BUFFERS_HPP +#define ASIO_DETAIL_CONSUMING_BUFFERS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/buffer.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/limits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper template to determine the maximum number of prepared buffers. +template +struct prepared_buffers_max +{ + enum { value = buffer_sequence_adapter_base::max_buffers }; +}; + +template +struct prepared_buffers_max > +{ + enum { value = N }; +}; + +#if defined(ASIO_HAS_STD_ARRAY) + +template +struct prepared_buffers_max > +{ + enum { value = N }; +}; + +#endif // defined(ASIO_HAS_STD_ARRAY) + +// A buffer sequence used to represent a subsequence of the buffers. +template +struct prepared_buffers +{ + typedef Buffer value_type; + typedef const Buffer* const_iterator; + + enum { max_buffers = MaxBuffers < 16 ? MaxBuffers : 16 }; + + prepared_buffers() : count(0) {} + const_iterator begin() const { return elems; } + const_iterator end() const { return elems + count; } + + Buffer elems[max_buffers]; + std::size_t count; +}; + +// A proxy for a sub-range in a list of buffers. +template +class consuming_buffers +{ +public: + typedef prepared_buffers::value> + prepared_buffers_type; + + // Construct to represent the entire list of buffers. + explicit consuming_buffers(const Buffers& buffers) + : buffers_(buffers), + total_consumed_(0), + next_elem_(0), + next_elem_offset_(0) + { + using asio::buffer_size; + total_size_ = buffer_size(buffers); + } + + // Determine if we are at the end of the buffers. + bool empty() const + { + return total_consumed_ >= total_size_; + } + + // Get the buffer for a single transfer, with a size. + prepared_buffers_type prepare(std::size_t max_size) + { + prepared_buffers_type result; + + Buffer_Iterator next = asio::buffer_sequence_begin(buffers_); + Buffer_Iterator end = asio::buffer_sequence_end(buffers_); + + std::advance(next, next_elem_); + std::size_t elem_offset = next_elem_offset_; + while (next != end && max_size > 0 && (result.count) < result.max_buffers) + { + Buffer next_buf = Buffer(*next) + elem_offset; + result.elems[result.count] = asio::buffer(next_buf, max_size); + max_size -= result.elems[result.count].size(); + elem_offset = 0; + if (result.elems[result.count].size() > 0) + ++result.count; + ++next; + } + + return result; + } + + // Consume the specified number of bytes from the buffers. + void consume(std::size_t size) + { + total_consumed_ += size; + + Buffer_Iterator next = asio::buffer_sequence_begin(buffers_); + Buffer_Iterator end = asio::buffer_sequence_end(buffers_); + + std::advance(next, next_elem_); + while (next != end && size > 0) + { + Buffer next_buf = Buffer(*next) + next_elem_offset_; + if (size < next_buf.size()) + { + next_elem_offset_ += size; + size = 0; + } + else + { + size -= next_buf.size(); + next_elem_offset_ = 0; + ++next_elem_; + ++next; + } + } + } + + // Get the total number of bytes consumed from the buffers. + std::size_t total_consumed() const + { + return total_consumed_; + } + +private: + Buffers buffers_; + std::size_t total_size_; + std::size_t total_consumed_; + std::size_t next_elem_; + std::size_t next_elem_offset_; +}; + +// Base class of all consuming_buffers specialisations for single buffers. +template +class consuming_single_buffer +{ +public: + // Construct to represent the entire list of buffers. + template + explicit consuming_single_buffer(const Buffer1& buffer) + : buffer_(buffer), + total_consumed_(0) + { + } + + // Determine if we are at the end of the buffers. + bool empty() const + { + return total_consumed_ >= buffer_.size(); + } + + // Get the buffer for a single transfer, with a size. + Buffer prepare(std::size_t max_size) + { + return asio::buffer(buffer_ + total_consumed_, max_size); + } + + // Consume the specified number of bytes from the buffers. + void consume(std::size_t size) + { + total_consumed_ += size; + } + + // Get the total number of bytes consumed from the buffers. + std::size_t total_consumed() const + { + return total_consumed_; + } + +private: + Buffer buffer_; + std::size_t total_consumed_; +}; + +template <> +class consuming_buffers + : public consuming_single_buffer +{ +public: + explicit consuming_buffers(const mutable_buffer& buffer) + : consuming_single_buffer(buffer) + { + } +}; + +template <> +class consuming_buffers + : public consuming_single_buffer +{ +public: + explicit consuming_buffers(const mutable_buffer& buffer) + : consuming_single_buffer(buffer) + { + } +}; + +template <> +class consuming_buffers + : public consuming_single_buffer +{ +public: + explicit consuming_buffers(const const_buffer& buffer) + : consuming_single_buffer(buffer) + { + } +}; + +#if !defined(ASIO_NO_DEPRECATED) + +template <> +class consuming_buffers + : public consuming_single_buffer +{ +public: + explicit consuming_buffers(const mutable_buffers_1& buffer) + : consuming_single_buffer(buffer) + { + } +}; + +template <> +class consuming_buffers + : public consuming_single_buffer +{ +public: + explicit consuming_buffers(const mutable_buffers_1& buffer) + : consuming_single_buffer(buffer) + { + } +}; + +template <> +class consuming_buffers + : public consuming_single_buffer +{ +public: + explicit consuming_buffers(const const_buffers_1& buffer) + : consuming_single_buffer(buffer) + { + } +}; + +#endif // !defined(ASIO_NO_DEPRECATED) + +template +class consuming_buffers, + typename boost::array::const_iterator> +{ +public: + // Construct to represent the entire list of buffers. + explicit consuming_buffers(const boost::array& buffers) + : buffers_(buffers), + total_consumed_(0) + { + } + + // Determine if we are at the end of the buffers. + bool empty() const + { + return total_consumed_ >= + Buffer(buffers_[0]).size() + Buffer(buffers_[1]).size(); + } + + // Get the buffer for a single transfer, with a size. + boost::array prepare(std::size_t max_size) + { + boost::array result = {{ + Buffer(buffers_[0]), Buffer(buffers_[1]) }}; + std::size_t buffer0_size = result[0].size(); + result[0] = asio::buffer(result[0] + total_consumed_, max_size); + result[1] = asio::buffer( + result[1] + (total_consumed_ < buffer0_size + ? 0 : total_consumed_ - buffer0_size), + max_size - result[0].size()); + return result; + } + + // Consume the specified number of bytes from the buffers. + void consume(std::size_t size) + { + total_consumed_ += size; + } + + // Get the total number of bytes consumed from the buffers. + std::size_t total_consumed() const + { + return total_consumed_; + } + +private: + boost::array buffers_; + std::size_t total_consumed_; +}; + +#if defined(ASIO_HAS_STD_ARRAY) + +template +class consuming_buffers, + typename std::array::const_iterator> +{ +public: + // Construct to represent the entire list of buffers. + explicit consuming_buffers(const std::array& buffers) + : buffers_(buffers), + total_consumed_(0) + { + } + + // Determine if we are at the end of the buffers. + bool empty() const + { + return total_consumed_ >= + Buffer(buffers_[0]).size() + Buffer(buffers_[1]).size(); + } + + // Get the buffer for a single transfer, with a size. + std::array prepare(std::size_t max_size) + { + std::array result = {{ + Buffer(buffers_[0]), Buffer(buffers_[1]) }}; + std::size_t buffer0_size = result[0].size(); + result[0] = asio::buffer(result[0] + total_consumed_, max_size); + result[1] = asio::buffer( + result[1] + (total_consumed_ < buffer0_size + ? 0 : total_consumed_ - buffer0_size), + max_size - result[0].size()); + return result; + } + + // Consume the specified number of bytes from the buffers. + void consume(std::size_t size) + { + total_consumed_ += size; + } + + // Get the total number of bytes consumed from the buffers. + std::size_t total_consumed() const + { + return total_consumed_; + } + +private: + std::array buffers_; + std::size_t total_consumed_; +}; + +#endif // defined(ASIO_HAS_STD_ARRAY) + +// Specialisation for null_buffers to ensure that the null_buffers type is +// always passed through to the underlying read or write operation. +template +class consuming_buffers + : public asio::null_buffers +{ +public: + consuming_buffers(const null_buffers&) + { + // No-op. + } + + bool empty() + { + return false; + } + + null_buffers prepare(std::size_t) + { + return null_buffers(); + } + + void consume(std::size_t) + { + // No-op. + } + + std::size_t total_consumed() const + { + return 0; + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_CONSUMING_BUFFERS_HPP diff --git a/include/asio/include/asio/detail/cstddef.hpp b/include/asio/include/asio/detail/cstddef.hpp new file mode 100644 index 0000000..1b58be0 --- /dev/null +++ b/include/asio/include/asio/detail/cstddef.hpp @@ -0,0 +1,31 @@ +// +// detail/cstddef.hpp +// ~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CSTDDEF_HPP +#define ASIO_DETAIL_CSTDDEF_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include + +namespace asio { + +#if defined(ASIO_HAS_NULLPTR) +using std::nullptr_t; +#else // defined(ASIO_HAS_NULLPTR) +struct nullptr_t {}; +#endif // defined(ASIO_HAS_NULLPTR) + +} // namespace asio + +#endif // ASIO_DETAIL_CSTDDEF_HPP diff --git a/include/asio/include/asio/detail/cstdint.hpp b/include/asio/include/asio/detail/cstdint.hpp new file mode 100644 index 0000000..b65941a --- /dev/null +++ b/include/asio/include/asio/detail/cstdint.hpp @@ -0,0 +1,60 @@ +// +// detail/cstdint.hpp +// ~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_CSTDINT_HPP +#define ASIO_DETAIL_CSTDINT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_CSTDINT) +# include +#else // defined(ASIO_HAS_CSTDINT) +# include +#endif // defined(ASIO_HAS_CSTDINT) + +namespace asio { + +#if defined(ASIO_HAS_CSTDINT) +using std::int16_t; +using std::int_least16_t; +using std::uint16_t; +using std::uint_least16_t; +using std::int32_t; +using std::int_least32_t; +using std::uint32_t; +using std::uint_least32_t; +using std::int64_t; +using std::int_least64_t; +using std::uint64_t; +using std::uint_least64_t; +using std::uintmax_t; +#else // defined(ASIO_HAS_CSTDINT) +using boost::int16_t; +using boost::int_least16_t; +using boost::uint16_t; +using boost::uint_least16_t; +using boost::int32_t; +using boost::int_least32_t; +using boost::uint32_t; +using boost::uint_least32_t; +using boost::int64_t; +using boost::int_least64_t; +using boost::uint64_t; +using boost::uint_least64_t; +using boost::uintmax_t; +#endif // defined(ASIO_HAS_CSTDINT) + +} // namespace asio + +#endif // ASIO_DETAIL_CSTDINT_HPP diff --git a/include/asio/include/asio/detail/date_time_fwd.hpp b/include/asio/include/asio/detail/date_time_fwd.hpp new file mode 100644 index 0000000..f4a9dde --- /dev/null +++ b/include/asio/include/asio/detail/date_time_fwd.hpp @@ -0,0 +1,34 @@ +// +// detail/date_time_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_DATE_TIME_FWD_HPP +#define ASIO_DETAIL_DATE_TIME_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +namespace boost { +namespace date_time { + +template +class base_time; + +} // namespace date_time +namespace posix_time { + +class ptime; + +} // namespace posix_time +} // namespace boost + +#endif // ASIO_DETAIL_DATE_TIME_FWD_HPP diff --git a/include/asio/include/asio/detail/deadline_timer_service.hpp b/include/asio/include/asio/detail/deadline_timer_service.hpp new file mode 100644 index 0000000..dd03d09 --- /dev/null +++ b/include/asio/include/asio/detail/deadline_timer_service.hpp @@ -0,0 +1,295 @@ +// +// detail/deadline_timer_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_DEADLINE_TIMER_SERVICE_HPP +#define ASIO_DETAIL_DEADLINE_TIMER_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/timer_queue.hpp" +#include "asio/detail/timer_queue_ptime.hpp" +#include "asio/detail/timer_scheduler.hpp" +#include "asio/detail/wait_handler.hpp" +#include "asio/detail/wait_op.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) +# include +# include +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class deadline_timer_service + : public execution_context_service_base > +{ +public: + // The time type. + typedef typename Time_Traits::time_type time_type; + + // The duration type. + typedef typename Time_Traits::duration_type duration_type; + + // The implementation type of the timer. This type is dependent on the + // underlying implementation of the timer service. + struct implementation_type + : private asio::detail::noncopyable + { + time_type expiry; + bool might_have_pending_waits; + typename timer_queue::per_timer_data timer_data; + }; + + // Constructor. + deadline_timer_service(execution_context& context) + : execution_context_service_base< + deadline_timer_service >(context), + scheduler_(asio::use_service(context)) + { + scheduler_.init_task(); + scheduler_.add_timer_queue(timer_queue_); + } + + // Destructor. + ~deadline_timer_service() + { + scheduler_.remove_timer_queue(timer_queue_); + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + } + + // Construct a new timer implementation. + void construct(implementation_type& impl) + { + impl.expiry = time_type(); + impl.might_have_pending_waits = false; + } + + // Destroy a timer implementation. + void destroy(implementation_type& impl) + { + asio::error_code ec; + cancel(impl, ec); + } + + // Move-construct a new timer implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) + { + scheduler_.move_timer(timer_queue_, impl.timer_data, other_impl.timer_data); + + impl.expiry = other_impl.expiry; + other_impl.expiry = time_type(); + + impl.might_have_pending_waits = other_impl.might_have_pending_waits; + other_impl.might_have_pending_waits = false; + } + + // Move-assign from another timer implementation. + void move_assign(implementation_type& impl, + deadline_timer_service& other_service, + implementation_type& other_impl) + { + if (this != &other_service) + if (impl.might_have_pending_waits) + scheduler_.cancel_timer(timer_queue_, impl.timer_data); + + other_service.scheduler_.move_timer(other_service.timer_queue_, + impl.timer_data, other_impl.timer_data); + + impl.expiry = other_impl.expiry; + other_impl.expiry = time_type(); + + impl.might_have_pending_waits = other_impl.might_have_pending_waits; + other_impl.might_have_pending_waits = false; + } + + // Move-construct a new timer implementation. + void converting_move_construct(implementation_type& impl, + deadline_timer_service&, implementation_type& other_impl) + { + move_construct(impl, other_impl); + } + + // Move-assign from another timer implementation. + void converting_move_assign(implementation_type& impl, + deadline_timer_service& other_service, + implementation_type& other_impl) + { + move_assign(impl, other_service, other_impl); + } + + // Cancel any asynchronous wait operations associated with the timer. + std::size_t cancel(implementation_type& impl, asio::error_code& ec) + { + if (!impl.might_have_pending_waits) + { + ec = asio::error_code(); + return 0; + } + + ASIO_HANDLER_OPERATION((scheduler_.context(), + "deadline_timer", &impl, 0, "cancel")); + + std::size_t count = scheduler_.cancel_timer(timer_queue_, impl.timer_data); + impl.might_have_pending_waits = false; + ec = asio::error_code(); + return count; + } + + // Cancels one asynchronous wait operation associated with the timer. + std::size_t cancel_one(implementation_type& impl, + asio::error_code& ec) + { + if (!impl.might_have_pending_waits) + { + ec = asio::error_code(); + return 0; + } + + ASIO_HANDLER_OPERATION((scheduler_.context(), + "deadline_timer", &impl, 0, "cancel_one")); + + std::size_t count = scheduler_.cancel_timer( + timer_queue_, impl.timer_data, 1); + if (count == 0) + impl.might_have_pending_waits = false; + ec = asio::error_code(); + return count; + } + + // Get the expiry time for the timer as an absolute time. + time_type expiry(const implementation_type& impl) const + { + return impl.expiry; + } + + // Get the expiry time for the timer as an absolute time. + time_type expires_at(const implementation_type& impl) const + { + return impl.expiry; + } + + // Get the expiry time for the timer relative to now. + duration_type expires_from_now(const implementation_type& impl) const + { + return Time_Traits::subtract(this->expiry(impl), Time_Traits::now()); + } + + // Set the expiry time for the timer as an absolute time. + std::size_t expires_at(implementation_type& impl, + const time_type& expiry_time, asio::error_code& ec) + { + std::size_t count = cancel(impl, ec); + impl.expiry = expiry_time; + ec = asio::error_code(); + return count; + } + + // Set the expiry time for the timer relative to now. + std::size_t expires_after(implementation_type& impl, + const duration_type& expiry_time, asio::error_code& ec) + { + return expires_at(impl, + Time_Traits::add(Time_Traits::now(), expiry_time), ec); + } + + // Set the expiry time for the timer relative to now. + std::size_t expires_from_now(implementation_type& impl, + const duration_type& expiry_time, asio::error_code& ec) + { + return expires_at(impl, + Time_Traits::add(Time_Traits::now(), expiry_time), ec); + } + + // Perform a blocking wait on the timer. + void wait(implementation_type& impl, asio::error_code& ec) + { + time_type now = Time_Traits::now(); + ec = asio::error_code(); + while (Time_Traits::less_than(now, impl.expiry) && !ec) + { + this->do_wait(Time_Traits::to_posix_duration( + Time_Traits::subtract(impl.expiry, now)), ec); + now = Time_Traits::now(); + } + } + + // Start an asynchronous wait on the timer. + template + void async_wait(implementation_type& impl, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef wait_handler op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(handler, io_ex); + + impl.might_have_pending_waits = true; + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "deadline_timer", &impl, 0, "async_wait")); + + scheduler_.schedule_timer(timer_queue_, impl.expiry, impl.timer_data, p.p); + p.v = p.p = 0; + } + +private: + // Helper function to wait given a duration type. The duration type should + // either be of type boost::posix_time::time_duration, or implement the + // required subset of its interface. + template + void do_wait(const Duration& timeout, asio::error_code& ec) + { +#if defined(ASIO_WINDOWS_RUNTIME) + std::this_thread::sleep_for( + std::chrono::seconds(timeout.total_seconds()) + + std::chrono::microseconds(timeout.total_microseconds())); + ec = asio::error_code(); +#else // defined(ASIO_WINDOWS_RUNTIME) + ::timeval tv; + tv.tv_sec = timeout.total_seconds(); + tv.tv_usec = timeout.total_microseconds() % 1000000; + socket_ops::select(0, 0, 0, 0, &tv, ec); +#endif // defined(ASIO_WINDOWS_RUNTIME) + } + + // The queue of timers. + timer_queue timer_queue_; + + // The object that schedules and executes timers. Usually a reactor. + timer_scheduler& scheduler_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_DEADLINE_TIMER_SERVICE_HPP diff --git a/include/asio/include/asio/detail/dependent_type.hpp b/include/asio/include/asio/detail/dependent_type.hpp new file mode 100644 index 0000000..0c00db5 --- /dev/null +++ b/include/asio/include/asio/detail/dependent_type.hpp @@ -0,0 +1,36 @@ +// +// detail/dependent_type.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_DEPENDENT_TYPE_HPP +#define ASIO_DETAIL_DEPENDENT_TYPE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct dependent_type +{ + typedef T type; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_DEPENDENT_TYPE_HPP diff --git a/include/asio/include/asio/detail/descriptor_ops.hpp b/include/asio/include/asio/detail/descriptor_ops.hpp new file mode 100644 index 0000000..dfe2f8c --- /dev/null +++ b/include/asio/include/asio/detail/descriptor_ops.hpp @@ -0,0 +1,139 @@ +// +// detail/descriptor_ops.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_DESCRIPTOR_OPS_HPP +#define ASIO_DETAIL_DESCRIPTOR_OPS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + +#include +#include "asio/error.hpp" +#include "asio/error_code.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { +namespace descriptor_ops { + +// Descriptor state bits. +enum +{ + // The user wants a non-blocking descriptor. + user_set_non_blocking = 1, + + // The descriptor has been set non-blocking. + internal_non_blocking = 2, + + // Helper "state" used to determine whether the descriptor is non-blocking. + non_blocking = user_set_non_blocking | internal_non_blocking, + + // The descriptor may have been dup()-ed. + possible_dup = 4 +}; + +typedef unsigned char state_type; + +inline void get_last_error( + asio::error_code& ec, bool is_error_condition) +{ + if (!is_error_condition) + { + ec.assign(0, ec.category()); + } + else + { + ec = asio::error_code(errno, + asio::error::get_system_category()); + } +} + +ASIO_DECL int open(const char* path, int flags, + asio::error_code& ec); + +ASIO_DECL int close(int d, state_type& state, + asio::error_code& ec); + +ASIO_DECL bool set_user_non_blocking(int d, + state_type& state, bool value, asio::error_code& ec); + +ASIO_DECL bool set_internal_non_blocking(int d, + state_type& state, bool value, asio::error_code& ec); + +typedef iovec buf; + +ASIO_DECL std::size_t sync_read(int d, state_type state, buf* bufs, + std::size_t count, bool all_empty, asio::error_code& ec); + +ASIO_DECL std::size_t sync_read1(int d, state_type state, void* data, + std::size_t size, asio::error_code& ec); + +ASIO_DECL bool non_blocking_read(int d, buf* bufs, std::size_t count, + asio::error_code& ec, std::size_t& bytes_transferred); + +ASIO_DECL bool non_blocking_read1(int d, void* data, std::size_t size, + asio::error_code& ec, std::size_t& bytes_transferred); + +ASIO_DECL std::size_t sync_write(int d, state_type state, + const buf* bufs, std::size_t count, bool all_empty, + asio::error_code& ec); + +ASIO_DECL std::size_t sync_write1(int d, state_type state, + const void* data, std::size_t size, asio::error_code& ec); + +ASIO_DECL bool non_blocking_write(int d, + const buf* bufs, std::size_t count, + asio::error_code& ec, std::size_t& bytes_transferred); + +ASIO_DECL bool non_blocking_write1(int d, + const void* data, std::size_t size, + asio::error_code& ec, std::size_t& bytes_transferred); + +ASIO_DECL int ioctl(int d, state_type& state, long cmd, + ioctl_arg_type* arg, asio::error_code& ec); + +ASIO_DECL int fcntl(int d, int cmd, asio::error_code& ec); + +ASIO_DECL int fcntl(int d, int cmd, + long arg, asio::error_code& ec); + +ASIO_DECL int poll_read(int d, + state_type state, asio::error_code& ec); + +ASIO_DECL int poll_write(int d, + state_type state, asio::error_code& ec); + +ASIO_DECL int poll_error(int d, + state_type state, asio::error_code& ec); + +} // namespace descriptor_ops +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/descriptor_ops.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + +#endif // ASIO_DETAIL_DESCRIPTOR_OPS_HPP diff --git a/include/asio/include/asio/detail/descriptor_read_op.hpp b/include/asio/include/asio/detail/descriptor_read_op.hpp new file mode 100644 index 0000000..bb4bc6d --- /dev/null +++ b/include/asio/include/asio/detail/descriptor_read_op.hpp @@ -0,0 +1,148 @@ +// +// detail/descriptor_read_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP +#define ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/descriptor_ops.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class descriptor_read_op_base : public reactor_op +{ +public: + descriptor_read_op_base(const asio::error_code& success_ec, + int descriptor, const MutableBufferSequence& buffers, + func_type complete_func) + : reactor_op(success_ec, + &descriptor_read_op_base::do_perform, complete_func), + descriptor_(descriptor), + buffers_(buffers) + { + } + + static status do_perform(reactor_op* base) + { + descriptor_read_op_base* o(static_cast(base)); + + typedef buffer_sequence_adapter bufs_type; + + status result; + if (bufs_type::is_single_buffer) + { + result = descriptor_ops::non_blocking_read1(o->descriptor_, + bufs_type::first(o->buffers_).data(), + bufs_type::first(o->buffers_).size(), + o->ec_, o->bytes_transferred_) ? done : not_done; + } + else + { + bufs_type bufs(o->buffers_); + result = descriptor_ops::non_blocking_read(o->descriptor_, + bufs.buffers(), bufs.count(), o->ec_, o->bytes_transferred_) + ? done : not_done; + } + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_read", + o->ec_, o->bytes_transferred_)); + + return result; + } + +private: + int descriptor_; + MutableBufferSequence buffers_; +}; + +template +class descriptor_read_op + : public descriptor_read_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(descriptor_read_op); + + descriptor_read_op(const asio::error_code& success_ec, + int descriptor, const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + : descriptor_read_op_base(success_ec, + descriptor, buffers, &descriptor_read_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + descriptor_read_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#endif // ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP diff --git a/include/asio/include/asio/detail/descriptor_write_op.hpp b/include/asio/include/asio/detail/descriptor_write_op.hpp new file mode 100644 index 0000000..15d98df --- /dev/null +++ b/include/asio/include/asio/detail/descriptor_write_op.hpp @@ -0,0 +1,148 @@ +// +// detail/descriptor_write_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP +#define ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/descriptor_ops.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class descriptor_write_op_base : public reactor_op +{ +public: + descriptor_write_op_base(const asio::error_code& success_ec, + int descriptor, const ConstBufferSequence& buffers, + func_type complete_func) + : reactor_op(success_ec, + &descriptor_write_op_base::do_perform, complete_func), + descriptor_(descriptor), + buffers_(buffers) + { + } + + static status do_perform(reactor_op* base) + { + descriptor_write_op_base* o(static_cast(base)); + + typedef buffer_sequence_adapter bufs_type; + + status result; + if (bufs_type::is_single_buffer) + { + result = descriptor_ops::non_blocking_write1(o->descriptor_, + bufs_type::first(o->buffers_).data(), + bufs_type::first(o->buffers_).size(), + o->ec_, o->bytes_transferred_) ? done : not_done; + } + else + { + bufs_type bufs(o->buffers_); + result = descriptor_ops::non_blocking_write(o->descriptor_, + bufs.buffers(), bufs.count(), o->ec_, o->bytes_transferred_) + ? done : not_done; + } + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_write", + o->ec_, o->bytes_transferred_)); + + return result; + } + +private: + int descriptor_; + ConstBufferSequence buffers_; +}; + +template +class descriptor_write_op + : public descriptor_write_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(descriptor_write_op); + + descriptor_write_op(const asio::error_code& success_ec, + int descriptor, const ConstBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + : descriptor_write_op_base(success_ec, + descriptor, buffers, &descriptor_write_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + descriptor_write_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#endif // ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP diff --git a/include/asio/include/asio/detail/dev_poll_reactor.hpp b/include/asio/include/asio/detail/dev_poll_reactor.hpp new file mode 100644 index 0000000..0d62153 --- /dev/null +++ b/include/asio/include/asio/detail/dev_poll_reactor.hpp @@ -0,0 +1,218 @@ +// +// detail/dev_poll_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_DEV_POLL_REACTOR_HPP +#define ASIO_DETAIL_DEV_POLL_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_DEV_POLL) + +#include +#include +#include +#include "asio/detail/hash_map.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/reactor_op_queue.hpp" +#include "asio/detail/select_interrupter.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/timer_queue_base.hpp" +#include "asio/detail/timer_queue_set.hpp" +#include "asio/detail/wait_op.hpp" +#include "asio/execution_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class dev_poll_reactor + : public execution_context_service_base +{ +public: + enum op_types { read_op = 0, write_op = 1, + connect_op = 1, except_op = 2, max_ops = 3 }; + + // Per-descriptor data. + struct per_descriptor_data + { + }; + + // Constructor. + ASIO_DECL dev_poll_reactor(asio::execution_context& ctx); + + // Destructor. + ASIO_DECL ~dev_poll_reactor(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Recreate internal descriptors following a fork. + ASIO_DECL void notify_fork( + asio::execution_context::fork_event fork_ev); + + // Initialise the task. + ASIO_DECL void init_task(); + + // Register a socket with the reactor. Returns 0 on success, system error + // code on failure. + ASIO_DECL int register_descriptor(socket_type, per_descriptor_data&); + + // Register a descriptor with an associated single operation. Returns 0 on + // success, system error code on failure. + ASIO_DECL int register_internal_descriptor( + int op_type, socket_type descriptor, + per_descriptor_data& descriptor_data, reactor_op* op); + + // Move descriptor registration from one descriptor_data object to another. + ASIO_DECL void move_descriptor(socket_type descriptor, + per_descriptor_data& target_descriptor_data, + per_descriptor_data& source_descriptor_data); + + // Post a reactor operation for immediate completion. + void post_immediate_completion(reactor_op* op, bool is_continuation) + { + scheduler_.post_immediate_completion(op, is_continuation); + } + + // Start a new operation. The reactor operation will be performed when the + // given descriptor is flagged as ready, or an error has occurred. + ASIO_DECL void start_op(int op_type, socket_type descriptor, + per_descriptor_data&, reactor_op* op, + bool is_continuation, bool allow_speculative); + + // Cancel all operations associated with the given descriptor. The + // handlers associated with the descriptor will be invoked with the + // operation_aborted error. + ASIO_DECL void cancel_ops(socket_type descriptor, per_descriptor_data&); + + // Cancel any operations that are running against the descriptor and remove + // its registration from the reactor. The reactor resources associated with + // the descriptor must be released by calling cleanup_descriptor_data. + ASIO_DECL void deregister_descriptor(socket_type descriptor, + per_descriptor_data&, bool closing); + + // Remove the descriptor's registration from the reactor. The reactor + // resources associated with the descriptor must be released by calling + // cleanup_descriptor_data. + ASIO_DECL void deregister_internal_descriptor( + socket_type descriptor, per_descriptor_data&); + + // Perform any post-deregistration cleanup tasks associated with the + // descriptor data. + ASIO_DECL void cleanup_descriptor_data(per_descriptor_data&); + + // Add a new timer queue to the reactor. + template + void add_timer_queue(timer_queue& queue); + + // Remove a timer queue from the reactor. + template + void remove_timer_queue(timer_queue& queue); + + // Schedule a new operation in the given timer queue to expire at the + // specified absolute time. + template + void schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op); + + // Cancel the timer operations associated with the given token. Returns the + // number of operations that have been posted or dispatched. + template + std::size_t cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled = (std::numeric_limits::max)()); + + // Move the timer operations associated with the given timer. + template + void move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source); + + // Run /dev/poll once until interrupted or events are ready to be dispatched. + ASIO_DECL void run(long usec, op_queue& ops); + + // Interrupt the select loop. + ASIO_DECL void interrupt(); + +private: + // Create the /dev/poll file descriptor. Throws an exception if the descriptor + // cannot be created. + ASIO_DECL static int do_dev_poll_create(); + + // Helper function to add a new timer queue. + ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); + + // Helper function to remove a timer queue. + ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); + + // Get the timeout value for the /dev/poll DP_POLL operation. The timeout + // value is returned as a number of milliseconds. A return value of -1 + // indicates that the poll should block indefinitely. + ASIO_DECL int get_timeout(int msec); + + // Cancel all operations associated with the given descriptor. The do_cancel + // function of the handler objects will be invoked. This function does not + // acquire the dev_poll_reactor's mutex. + ASIO_DECL void cancel_ops_unlocked(socket_type descriptor, + const asio::error_code& ec); + + // Add a pending event entry for the given descriptor. + ASIO_DECL ::pollfd& add_pending_event_change(int descriptor); + + // The scheduler implementation used to post completions. + scheduler& scheduler_; + + // Mutex to protect access to internal data. + asio::detail::mutex mutex_; + + // The /dev/poll file descriptor. + int dev_poll_fd_; + + // Vector of /dev/poll events waiting to be written to the descriptor. + std::vector< ::pollfd> pending_event_changes_; + + // Hash map to associate a descriptor with a pending event change index. + hash_map pending_event_change_index_; + + // The interrupter is used to break a blocking DP_POLL operation. + select_interrupter interrupter_; + + // The queues of read, write and except operations. + reactor_op_queue op_queue_[max_ops]; + + // The timer queues. + timer_queue_set timer_queues_; + + // Whether the service has been shut down. + bool shutdown_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/dev_poll_reactor.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/dev_poll_reactor.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_DEV_POLL) + +#endif // ASIO_DETAIL_DEV_POLL_REACTOR_HPP diff --git a/include/asio/include/asio/detail/epoll_reactor.hpp b/include/asio/include/asio/detail/epoll_reactor.hpp new file mode 100644 index 0000000..032fc85 --- /dev/null +++ b/include/asio/include/asio/detail/epoll_reactor.hpp @@ -0,0 +1,266 @@ +// +// detail/epoll_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_EPOLL_REACTOR_HPP +#define ASIO_DETAIL_EPOLL_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_EPOLL) + +#include "asio/detail/atomic_count.hpp" +#include "asio/detail/conditionally_enabled_mutex.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/object_pool.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/select_interrupter.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/timer_queue_base.hpp" +#include "asio/detail/timer_queue_set.hpp" +#include "asio/detail/wait_op.hpp" +#include "asio/execution_context.hpp" + +#if defined(ASIO_HAS_TIMERFD) +# include +#endif // defined(ASIO_HAS_TIMERFD) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class epoll_reactor + : public execution_context_service_base +{ +private: + // The mutex type used by this reactor. + typedef conditionally_enabled_mutex mutex; + +public: + enum op_types { read_op = 0, write_op = 1, + connect_op = 1, except_op = 2, max_ops = 3 }; + + // Per-descriptor queues. + class descriptor_state : operation + { + friend class epoll_reactor; + friend class object_pool_access; + + descriptor_state* next_; + descriptor_state* prev_; + + mutex mutex_; + epoll_reactor* reactor_; + int descriptor_; + uint32_t registered_events_; + op_queue op_queue_[max_ops]; + bool try_speculative_[max_ops]; + bool shutdown_; + + ASIO_DECL descriptor_state(bool locking); + void set_ready_events(uint32_t events) { task_result_ = events; } + void add_ready_events(uint32_t events) { task_result_ |= events; } + ASIO_DECL operation* perform_io(uint32_t events); + ASIO_DECL static void do_complete( + void* owner, operation* base, + const asio::error_code& ec, std::size_t bytes_transferred); + }; + + // Per-descriptor data. + typedef descriptor_state* per_descriptor_data; + + // Constructor. + ASIO_DECL epoll_reactor(asio::execution_context& ctx); + + // Destructor. + ASIO_DECL ~epoll_reactor(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Recreate internal descriptors following a fork. + ASIO_DECL void notify_fork( + asio::execution_context::fork_event fork_ev); + + // Initialise the task. + ASIO_DECL void init_task(); + + // Register a socket with the reactor. Returns 0 on success, system error + // code on failure. + ASIO_DECL int register_descriptor(socket_type descriptor, + per_descriptor_data& descriptor_data); + + // Register a descriptor with an associated single operation. Returns 0 on + // success, system error code on failure. + ASIO_DECL int register_internal_descriptor( + int op_type, socket_type descriptor, + per_descriptor_data& descriptor_data, reactor_op* op); + + // Move descriptor registration from one descriptor_data object to another. + ASIO_DECL void move_descriptor(socket_type descriptor, + per_descriptor_data& target_descriptor_data, + per_descriptor_data& source_descriptor_data); + + // Post a reactor operation for immediate completion. + void post_immediate_completion(reactor_op* op, bool is_continuation) + { + scheduler_.post_immediate_completion(op, is_continuation); + } + + // Start a new operation. The reactor operation will be performed when the + // given descriptor is flagged as ready, or an error has occurred. + ASIO_DECL void start_op(int op_type, socket_type descriptor, + per_descriptor_data& descriptor_data, reactor_op* op, + bool is_continuation, bool allow_speculative); + + // Cancel all operations associated with the given descriptor. The + // handlers associated with the descriptor will be invoked with the + // operation_aborted error. + ASIO_DECL void cancel_ops(socket_type descriptor, + per_descriptor_data& descriptor_data); + + // Cancel any operations that are running against the descriptor and remove + // its registration from the reactor. The reactor resources associated with + // the descriptor must be released by calling cleanup_descriptor_data. + ASIO_DECL void deregister_descriptor(socket_type descriptor, + per_descriptor_data& descriptor_data, bool closing); + + // Remove the descriptor's registration from the reactor. The reactor + // resources associated with the descriptor must be released by calling + // cleanup_descriptor_data. + ASIO_DECL void deregister_internal_descriptor( + socket_type descriptor, per_descriptor_data& descriptor_data); + + // Perform any post-deregistration cleanup tasks associated with the + // descriptor data. + ASIO_DECL void cleanup_descriptor_data( + per_descriptor_data& descriptor_data); + + // Add a new timer queue to the reactor. + template + void add_timer_queue(timer_queue& timer_queue); + + // Remove a timer queue from the reactor. + template + void remove_timer_queue(timer_queue& timer_queue); + + // Schedule a new operation in the given timer queue to expire at the + // specified absolute time. + template + void schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op); + + // Cancel the timer operations associated with the given token. Returns the + // number of operations that have been posted or dispatched. + template + std::size_t cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled = (std::numeric_limits::max)()); + + // Move the timer operations associated with the given timer. + template + void move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source); + + // Run epoll once until interrupted or events are ready to be dispatched. + ASIO_DECL void run(long usec, op_queue& ops); + + // Interrupt the select loop. + ASIO_DECL void interrupt(); + +private: + // The hint to pass to epoll_create to size its data structures. + enum { epoll_size = 20000 }; + + // Create the epoll file descriptor. Throws an exception if the descriptor + // cannot be created. + ASIO_DECL static int do_epoll_create(); + + // Create the timerfd file descriptor. Does not throw. + ASIO_DECL static int do_timerfd_create(); + + // Allocate a new descriptor state object. + ASIO_DECL descriptor_state* allocate_descriptor_state(); + + // Free an existing descriptor state object. + ASIO_DECL void free_descriptor_state(descriptor_state* s); + + // Helper function to add a new timer queue. + ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); + + // Helper function to remove a timer queue. + ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); + + // Called to recalculate and update the timeout. + ASIO_DECL void update_timeout(); + + // Get the timeout value for the epoll_wait call. The timeout value is + // returned as a number of milliseconds. A return value of -1 indicates + // that epoll_wait should block indefinitely. + ASIO_DECL int get_timeout(int msec); + +#if defined(ASIO_HAS_TIMERFD) + // Get the timeout value for the timer descriptor. The return value is the + // flag argument to be used when calling timerfd_settime. + ASIO_DECL int get_timeout(itimerspec& ts); +#endif // defined(ASIO_HAS_TIMERFD) + + // The scheduler implementation used to post completions. + scheduler& scheduler_; + + // Mutex to protect access to internal data. + mutex mutex_; + + // The interrupter is used to break a blocking epoll_wait call. + select_interrupter interrupter_; + + // The epoll file descriptor. + int epoll_fd_; + + // The timer file descriptor. + int timer_fd_; + + // The timer queues. + timer_queue_set timer_queues_; + + // Whether the service has been shut down. + bool shutdown_; + + // Mutex to protect access to the registered descriptors. + mutex registered_descriptors_mutex_; + + // Keep track of all registered descriptors. + object_pool registered_descriptors_; + + // Helper class to do post-perform_io cleanup. + struct perform_io_cleanup_on_block_exit; + friend struct perform_io_cleanup_on_block_exit; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/epoll_reactor.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/epoll_reactor.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_EPOLL) + +#endif // ASIO_DETAIL_EPOLL_REACTOR_HPP diff --git a/include/asio/include/asio/detail/event.hpp b/include/asio/include/asio/detail/event.hpp new file mode 100644 index 0000000..9268278 --- /dev/null +++ b/include/asio/include/asio/detail/event.hpp @@ -0,0 +1,48 @@ +// +// detail/event.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_EVENT_HPP +#define ASIO_DETAIL_EVENT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) +# include "asio/detail/null_event.hpp" +#elif defined(ASIO_WINDOWS) +# include "asio/detail/win_event.hpp" +#elif defined(ASIO_HAS_PTHREADS) +# include "asio/detail/posix_event.hpp" +#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) +# include "asio/detail/std_event.hpp" +#else +# error Only Windows, POSIX and std::condition_variable are supported! +#endif + +namespace asio { +namespace detail { + +#if !defined(ASIO_HAS_THREADS) +typedef null_event event; +#elif defined(ASIO_WINDOWS) +typedef win_event event; +#elif defined(ASIO_HAS_PTHREADS) +typedef posix_event event; +#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) +typedef std_event event; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_EVENT_HPP diff --git a/include/asio/include/asio/detail/eventfd_select_interrupter.hpp b/include/asio/include/asio/detail/eventfd_select_interrupter.hpp new file mode 100644 index 0000000..9e25056 --- /dev/null +++ b/include/asio/include/asio/detail/eventfd_select_interrupter.hpp @@ -0,0 +1,83 @@ +// +// detail/eventfd_select_interrupter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_EVENTFD_SELECT_INTERRUPTER_HPP +#define ASIO_DETAIL_EVENTFD_SELECT_INTERRUPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_EVENTFD) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class eventfd_select_interrupter +{ +public: + // Constructor. + ASIO_DECL eventfd_select_interrupter(); + + // Destructor. + ASIO_DECL ~eventfd_select_interrupter(); + + // Recreate the interrupter's descriptors. Used after a fork. + ASIO_DECL void recreate(); + + // Interrupt the select call. + ASIO_DECL void interrupt(); + + // Reset the select interrupter. Returns true if the reset was successful. + ASIO_DECL bool reset(); + + // Get the read descriptor to be passed to select. + int read_descriptor() const + { + return read_descriptor_; + } + +private: + // Open the descriptors. Throws on error. + ASIO_DECL void open_descriptors(); + + // Close the descriptors. + ASIO_DECL void close_descriptors(); + + // The read end of a connection used to interrupt the select call. This file + // descriptor is passed to select such that when it is time to stop, a single + // 64bit value will be written on the other end of the connection and this + // descriptor will become readable. + int read_descriptor_; + + // The write end of a connection used to interrupt the select call. A single + // 64bit non-zero value may be written to this to wake up the select which is + // waiting for the other end to become readable. This descriptor will only + // differ from the read descriptor when a pipe is used. + int write_descriptor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/eventfd_select_interrupter.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_EVENTFD) + +#endif // ASIO_DETAIL_EVENTFD_SELECT_INTERRUPTER_HPP diff --git a/include/asio/include/asio/detail/executor_function.hpp b/include/asio/include/asio/detail/executor_function.hpp new file mode 100644 index 0000000..af76316 --- /dev/null +++ b/include/asio/include/asio/detail/executor_function.hpp @@ -0,0 +1,203 @@ +// +// detail/executor_function.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_EXECUTOR_FUNCTION_HPP +#define ASIO_DETAIL_EXECUTOR_FUNCTION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/memory.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_MOVE) + +// Lightweight, move-only function object wrapper. +class executor_function +{ +public: + template + explicit executor_function(F f, const Alloc& a) + { + // Allocate and construct an object to wrap the function. + typedef impl impl_type; + typename impl_type::ptr p = { + detail::addressof(a), impl_type::ptr::allocate(a), 0 }; + impl_ = new (p.v) impl_type(ASIO_MOVE_CAST(F)(f), a); + p.v = 0; + } + + executor_function(executor_function&& other) ASIO_NOEXCEPT + : impl_(other.impl_) + { + other.impl_ = 0; + } + + ~executor_function() + { + if (impl_) + impl_->complete_(impl_, false); + } + + void operator()() + { + if (impl_) + { + impl_base* i = impl_; + impl_ = 0; + i->complete_(i, true); + } + } + +private: + // Base class for polymorphic function implementations. + struct impl_base + { + void (*complete_)(impl_base*, bool); + }; + + // Polymorphic function implementation. + template + struct impl : impl_base + { + ASIO_DEFINE_TAGGED_HANDLER_ALLOCATOR_PTR( + thread_info_base::executor_function_tag, impl); + + template + impl(ASIO_MOVE_ARG(F) f, const Alloc& a) + : function_(ASIO_MOVE_CAST(F)(f)), + allocator_(a) + { + complete_ = &executor_function::complete; + } + + Function function_; + Alloc allocator_; + }; + + // Helper to complete function invocation. + template + static void complete(impl_base* base, bool call) + { + // Take ownership of the function object. + impl* i(static_cast*>(base)); + Alloc allocator(i->allocator_); + typename impl::ptr p = { + detail::addressof(allocator), i, i }; + + // Make a copy of the function so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the function may be the true owner of the memory + // associated with the function. Consequently, a local copy of the function + // is required to ensure that any owning sub-object remains valid until + // after we have deallocated the memory here. + Function function(ASIO_MOVE_CAST(Function)(i->function_)); + p.reset(); + + // Make the upcall if required. + if (call) + { + function(); + } + } + + impl_base* impl_; +}; + +#else // defined(ASIO_HAS_MOVE) + +// Not so lightweight, copyable function object wrapper. +class executor_function +{ +public: + template + explicit executor_function(const F& f, const Alloc&) + : impl_(new impl::type>(f)) + { + } + + void operator()() + { + impl_->complete_(impl_.get()); + } + +private: + // Base class for polymorphic function implementations. + struct impl_base + { + void (*complete_)(impl_base*); + }; + + // Polymorphic function implementation. + template + struct impl : impl_base + { + impl(const F& f) + : function_(f) + { + complete_ = &executor_function::complete; + } + + F function_; + }; + + // Helper to complete function invocation. + template + static void complete(impl_base* i) + { + static_cast*>(i)->function_(); + } + + shared_ptr impl_; +}; + +#endif // defined(ASIO_HAS_MOVE) + +// Lightweight, non-owning, copyable function object wrapper. +class executor_function_view +{ +public: + template + explicit executor_function_view(F& f) ASIO_NOEXCEPT + : complete_(&executor_function_view::complete), + function_(&f) + { + } + + void operator()() + { + complete_(function_); + } + +private: + // Helper to complete function invocation. + template + static void complete(void* f) + { + (*static_cast(f))(); + } + + void (*complete_)(void*); + void* function_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_EXECUTOR_FUNCTION_HPP diff --git a/include/asio/include/asio/detail/executor_op.hpp b/include/asio/include/asio/detail/executor_op.hpp new file mode 100644 index 0000000..c2acdb6 --- /dev/null +++ b/include/asio/include/asio/detail/executor_op.hpp @@ -0,0 +1,84 @@ +// +// detail/executor_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_EXECUTOR_OP_HPP +#define ASIO_DETAIL_EXECUTOR_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/scheduler_operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class executor_op : public Operation +{ +public: + ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(executor_op); + + template + executor_op(ASIO_MOVE_ARG(H) h, const Alloc& allocator) + : Operation(&executor_op::do_complete), + handler_(ASIO_MOVE_CAST(H)(h)), + allocator_(allocator) + { + } + + static void do_complete(void* owner, Operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + executor_op* o(static_cast(base)); + Alloc allocator(o->allocator_); + ptr p = { detail::addressof(allocator), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + Handler handler(ASIO_MOVE_CAST(Handler)(o->handler_)); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN(()); + asio_handler_invoke_helpers::invoke(handler, handler); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + Alloc allocator_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_EXECUTOR_OP_HPP diff --git a/include/asio/include/asio/detail/fd_set_adapter.hpp b/include/asio/include/asio/detail/fd_set_adapter.hpp new file mode 100644 index 0000000..4fe7b27 --- /dev/null +++ b/include/asio/include/asio/detail/fd_set_adapter.hpp @@ -0,0 +1,39 @@ +// +// detail/fd_set_adapter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_FD_SET_ADAPTER_HPP +#define ASIO_DETAIL_FD_SET_ADAPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/posix_fd_set_adapter.hpp" +#include "asio/detail/win_fd_set_adapter.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +typedef win_fd_set_adapter fd_set_adapter; +#else +typedef posix_fd_set_adapter fd_set_adapter; +#endif + +} // namespace detail +} // namespace asio + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_FD_SET_ADAPTER_HPP diff --git a/include/asio/include/asio/detail/fenced_block.hpp b/include/asio/include/asio/detail/fenced_block.hpp new file mode 100644 index 0000000..17550ff --- /dev/null +++ b/include/asio/include/asio/detail/fenced_block.hpp @@ -0,0 +1,80 @@ +// +// detail/fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_FENCED_BLOCK_HPP +#define ASIO_DETAIL_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) \ + || defined(ASIO_DISABLE_FENCED_BLOCK) +# include "asio/detail/null_fenced_block.hpp" +#elif defined(ASIO_HAS_STD_ATOMIC) +# include "asio/detail/std_fenced_block.hpp" +#elif defined(__MACH__) && defined(__APPLE__) +# include "asio/detail/macos_fenced_block.hpp" +#elif defined(__sun) +# include "asio/detail/solaris_fenced_block.hpp" +#elif defined(__GNUC__) && defined(__arm__) \ + && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) +# include "asio/detail/gcc_arm_fenced_block.hpp" +#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) +# include "asio/detail/gcc_hppa_fenced_block.hpp" +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +# include "asio/detail/gcc_x86_fenced_block.hpp" +#elif defined(__GNUC__) \ + && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \ + && !defined(__INTEL_COMPILER) && !defined(__ICL) \ + && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) +# include "asio/detail/gcc_sync_fenced_block.hpp" +#elif defined(ASIO_WINDOWS) && !defined(UNDER_CE) +# include "asio/detail/win_fenced_block.hpp" +#else +# include "asio/detail/null_fenced_block.hpp" +#endif + +namespace asio { +namespace detail { + +#if !defined(ASIO_HAS_THREADS) \ + || defined(ASIO_DISABLE_FENCED_BLOCK) +typedef null_fenced_block fenced_block; +#elif defined(ASIO_HAS_STD_ATOMIC) +typedef std_fenced_block fenced_block; +#elif defined(__MACH__) && defined(__APPLE__) +typedef macos_fenced_block fenced_block; +#elif defined(__sun) +typedef solaris_fenced_block fenced_block; +#elif defined(__GNUC__) && defined(__arm__) \ + && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) +typedef gcc_arm_fenced_block fenced_block; +#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) +typedef gcc_hppa_fenced_block fenced_block; +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +typedef gcc_x86_fenced_block fenced_block; +#elif defined(__GNUC__) \ + && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \ + && !defined(__INTEL_COMPILER) && !defined(__ICL) \ + && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) +typedef gcc_sync_fenced_block fenced_block; +#elif defined(ASIO_WINDOWS) && !defined(UNDER_CE) +typedef win_fenced_block fenced_block; +#else +typedef null_fenced_block fenced_block; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/functional.hpp b/include/asio/include/asio/detail/functional.hpp new file mode 100644 index 0000000..ed73ce6 --- /dev/null +++ b/include/asio/include/asio/detail/functional.hpp @@ -0,0 +1,38 @@ +// +// detail/functional.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_FUNCTIONAL_HPP +#define ASIO_DETAIL_FUNCTIONAL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include + +#if !defined(ASIO_HAS_STD_FUNCTION) +# include +#endif // !defined(ASIO_HAS_STD_FUNCTION) + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_STD_FUNCTION) +using std::function; +#else // defined(ASIO_HAS_STD_FUNCTION) +using boost::function; +#endif // defined(ASIO_HAS_STD_FUNCTION) + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_FUNCTIONAL_HPP diff --git a/include/asio/include/asio/detail/future.hpp b/include/asio/include/asio/detail/future.hpp new file mode 100644 index 0000000..4a2a080 --- /dev/null +++ b/include/asio/include/asio/detail/future.hpp @@ -0,0 +1,33 @@ +// +// detail/future.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_FUTURE_HPP +#define ASIO_DETAIL_FUTURE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#if defined(ASIO_HAS_STD_FUTURE) +# include +// Even though the future header is available, libstdc++ may not implement the +// std::future class itself. However, we need to have already included the +// future header to reliably test for _GLIBCXX_HAS_GTHREADS. +# if defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX) +# if defined(_GLIBCXX_HAS_GTHREADS) +# define ASIO_HAS_STD_FUTURE_CLASS 1 +# endif // defined(_GLIBCXX_HAS_GTHREADS) +# else // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX) +# define ASIO_HAS_STD_FUTURE_CLASS 1 +# endif // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX) +#endif // defined(ASIO_HAS_STD_FUTURE) + +#endif // ASIO_DETAIL_FUTURE_HPP diff --git a/include/asio/include/asio/detail/gcc_arm_fenced_block.hpp b/include/asio/include/asio/detail/gcc_arm_fenced_block.hpp new file mode 100644 index 0000000..d032324 --- /dev/null +++ b/include/asio/include/asio/detail/gcc_arm_fenced_block.hpp @@ -0,0 +1,91 @@ +// +// detail/gcc_arm_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP +#define ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(__GNUC__) && defined(__arm__) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class gcc_arm_fenced_block + : private noncopyable +{ +public: + enum half_t { half }; + enum full_t { full }; + + // Constructor for a half fenced block. + explicit gcc_arm_fenced_block(half_t) + { + } + + // Constructor for a full fenced block. + explicit gcc_arm_fenced_block(full_t) + { + barrier(); + } + + // Destructor. + ~gcc_arm_fenced_block() + { + barrier(); + } + +private: + static void barrier() + { +#if defined(__ARM_ARCH_4__) \ + || defined(__ARM_ARCH_4T__) \ + || defined(__ARM_ARCH_5__) \ + || defined(__ARM_ARCH_5E__) \ + || defined(__ARM_ARCH_5T__) \ + || defined(__ARM_ARCH_5TE__) \ + || defined(__ARM_ARCH_5TEJ__) \ + || defined(__ARM_ARCH_6__) \ + || defined(__ARM_ARCH_6J__) \ + || defined(__ARM_ARCH_6K__) \ + || defined(__ARM_ARCH_6Z__) \ + || defined(__ARM_ARCH_6ZK__) \ + || defined(__ARM_ARCH_6T2__) +# if defined(__thumb__) + // This is just a placeholder and almost certainly not sufficient. + __asm__ __volatile__ ("" : : : "memory"); +# else // defined(__thumb__) + int a = 0, b = 0; + __asm__ __volatile__ ("swp %0, %1, [%2]" + : "=&r"(a) : "r"(1), "r"(&b) : "memory", "cc"); +# endif // defined(__thumb__) +#else + // ARMv7 and later. + __asm__ __volatile__ ("dmb" : : : "memory"); +#endif + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(__GNUC__) && defined(__arm__) + +#endif // ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/gcc_hppa_fenced_block.hpp b/include/asio/include/asio/detail/gcc_hppa_fenced_block.hpp new file mode 100644 index 0000000..68f3629 --- /dev/null +++ b/include/asio/include/asio/detail/gcc_hppa_fenced_block.hpp @@ -0,0 +1,68 @@ +// +// detail/gcc_hppa_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP +#define ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class gcc_hppa_fenced_block + : private noncopyable +{ +public: + enum half_t { half }; + enum full_t { full }; + + // Constructor for a half fenced block. + explicit gcc_hppa_fenced_block(half_t) + { + } + + // Constructor for a full fenced block. + explicit gcc_hppa_fenced_block(full_t) + { + barrier(); + } + + // Destructor. + ~gcc_hppa_fenced_block() + { + barrier(); + } + +private: + static void barrier() + { + // This is just a placeholder and almost certainly not sufficient. + __asm__ __volatile__ ("" : : : "memory"); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) + +#endif // ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/gcc_sync_fenced_block.hpp b/include/asio/include/asio/detail/gcc_sync_fenced_block.hpp new file mode 100644 index 0000000..c0c814b --- /dev/null +++ b/include/asio/include/asio/detail/gcc_sync_fenced_block.hpp @@ -0,0 +1,65 @@ +// +// detail/gcc_sync_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP +#define ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(__GNUC__) \ + && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \ + && !defined(__INTEL_COMPILER) && !defined(__ICL) \ + && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class gcc_sync_fenced_block + : private noncopyable +{ +public: + enum half_or_full_t { half, full }; + + // Constructor. + explicit gcc_sync_fenced_block(half_or_full_t) + : value_(0) + { + __sync_lock_test_and_set(&value_, 1); + } + + // Destructor. + ~gcc_sync_fenced_block() + { + __sync_lock_release(&value_); + } + +private: + int value_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(__GNUC__) + // && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) + // && !defined(__INTEL_COMPILER) && !defined(__ICL) + // && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) + +#endif // ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/gcc_x86_fenced_block.hpp b/include/asio/include/asio/detail/gcc_x86_fenced_block.hpp new file mode 100644 index 0000000..422482c --- /dev/null +++ b/include/asio/include/asio/detail/gcc_x86_fenced_block.hpp @@ -0,0 +1,99 @@ +// +// detail/gcc_x86_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP +#define ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class gcc_x86_fenced_block + : private noncopyable +{ +public: + enum half_t { half }; + enum full_t { full }; + + // Constructor for a half fenced block. + explicit gcc_x86_fenced_block(half_t) + { + } + + // Constructor for a full fenced block. + explicit gcc_x86_fenced_block(full_t) + { + lbarrier(); + } + + // Destructor. + ~gcc_x86_fenced_block() + { + sbarrier(); + } + +private: + static int barrier() + { + int r = 0, m = 1; + __asm__ __volatile__ ( + "xchgl %0, %1" : + "=r"(r), "=m"(m) : + "0"(1), "m"(m) : + "memory", "cc"); + return r; + } + + static void lbarrier() + { +#if defined(__SSE2__) +# if (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) + __builtin_ia32_lfence(); +# else // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) + __asm__ __volatile__ ("lfence" ::: "memory"); +# endif // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) +#else // defined(__SSE2__) + barrier(); +#endif // defined(__SSE2__) + } + + static void sbarrier() + { +#if defined(__SSE2__) +# if (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) + __builtin_ia32_sfence(); +# else // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) + __asm__ __volatile__ ("sfence" ::: "memory"); +# endif // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) +#else // defined(__SSE2__) + barrier(); +#endif // defined(__SSE2__) + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + +#endif // ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/global.hpp b/include/asio/include/asio/detail/global.hpp new file mode 100644 index 0000000..fad2959 --- /dev/null +++ b/include/asio/include/asio/detail/global.hpp @@ -0,0 +1,52 @@ +// +// detail/global.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_GLOBAL_HPP +#define ASIO_DETAIL_GLOBAL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) +# include "asio/detail/null_global.hpp" +#elif defined(ASIO_WINDOWS) +# include "asio/detail/win_global.hpp" +#elif defined(ASIO_HAS_PTHREADS) +# include "asio/detail/posix_global.hpp" +#elif defined(ASIO_HAS_STD_CALL_ONCE) +# include "asio/detail/std_global.hpp" +#else +# error Only Windows, POSIX and std::call_once are supported! +#endif + +namespace asio { +namespace detail { + +template +inline T& global() +{ +#if !defined(ASIO_HAS_THREADS) + return null_global(); +#elif defined(ASIO_WINDOWS) + return win_global(); +#elif defined(ASIO_HAS_PTHREADS) + return posix_global(); +#elif defined(ASIO_HAS_STD_CALL_ONCE) + return std_global(); +#endif +} + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_GLOBAL_HPP diff --git a/include/asio/include/asio/detail/handler_alloc_helpers.hpp b/include/asio/include/asio/detail/handler_alloc_helpers.hpp new file mode 100644 index 0000000..4ddaf93 --- /dev/null +++ b/include/asio/include/asio/detail/handler_alloc_helpers.hpp @@ -0,0 +1,284 @@ +// +// detail/handler_alloc_helpers.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_HANDLER_ALLOC_HELPERS_HPP +#define ASIO_DETAIL_HANDLER_ALLOC_HELPERS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/recycling_allocator.hpp" +#include "asio/detail/thread_info_base.hpp" +#include "asio/associated_allocator.hpp" +#include "asio/handler_alloc_hook.hpp" + +#include "asio/detail/push_options.hpp" + +// Calls to asio_handler_allocate and asio_handler_deallocate must be made from +// a namespace that does not contain any overloads of these functions. The +// asio_handler_alloc_helpers namespace is defined here for that purpose. +namespace asio_handler_alloc_helpers { + +#if defined(ASIO_NO_DEPRECATED) +template +inline void error_if_hooks_are_defined(Handler& h) +{ + using asio::asio_handler_allocate; + // If you get an error here it is because some of your handlers still + // overload asio_handler_allocate, but this hook is no longer used. + (void)static_cast( + asio_handler_allocate(static_cast(0), + asio::detail::addressof(h))); + + using asio::asio_handler_deallocate; + // If you get an error here it is because some of your handlers still + // overload asio_handler_deallocate, but this hook is no longer used. + (void)static_cast( + asio_handler_deallocate(static_cast(0), + static_cast(0), asio::detail::addressof(h))); +} +#endif // defined(ASIO_NO_DEPRECATED) + +template +inline void* allocate(std::size_t s, Handler& h) +{ +#if !defined(ASIO_HAS_HANDLER_HOOKS) + return ::operator new(s); +#elif defined(ASIO_NO_DEPRECATED) + // The asio_handler_allocate hook is no longer used to obtain memory. + (void)&error_if_hooks_are_defined; + (void)h; +#if !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING) + return asio::detail::thread_info_base::allocate( + asio::detail::thread_context::thread_call_stack::top(), s); +#else // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING) + return ::operator new(size); +#endif // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING) +#else + using asio::asio_handler_allocate; + return asio_handler_allocate(s, asio::detail::addressof(h)); +#endif +} + +template +inline void deallocate(void* p, std::size_t s, Handler& h) +{ +#if !defined(ASIO_HAS_HANDLER_HOOKS) + ::operator delete(p); +#elif defined(ASIO_NO_DEPRECATED) + // The asio_handler_allocate hook is no longer used to obtain memory. + (void)&error_if_hooks_are_defined; + (void)h; +#if !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING) + asio::detail::thread_info_base::deallocate( + asio::detail::thread_context::thread_call_stack::top(), p, s); +#else // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING) + (void)s; + ::operator delete(p); +#endif // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING) +#else + using asio::asio_handler_deallocate; + asio_handler_deallocate(p, s, asio::detail::addressof(h)); +#endif +} + +} // namespace asio_handler_alloc_helpers + +namespace asio { +namespace detail { + +template +class hook_allocator +{ +public: + typedef T value_type; + + template + struct rebind + { + typedef hook_allocator other; + }; + + explicit hook_allocator(Handler& h) + : handler_(h) + { + } + + template + hook_allocator(const hook_allocator& a) + : handler_(a.handler_) + { + } + + T* allocate(std::size_t n) + { + return static_cast( + asio_handler_alloc_helpers::allocate(sizeof(T) * n, handler_)); + } + + void deallocate(T* p, std::size_t n) + { + asio_handler_alloc_helpers::deallocate(p, sizeof(T) * n, handler_); + } + +//private: + Handler& handler_; +}; + +template +class hook_allocator +{ +public: + typedef void value_type; + + template + struct rebind + { + typedef hook_allocator other; + }; + + explicit hook_allocator(Handler& h) + : handler_(h) + { + } + + template + hook_allocator(const hook_allocator& a) + : handler_(a.handler_) + { + } + +//private: + Handler& handler_; +}; + +template +struct get_hook_allocator +{ + typedef Allocator type; + + static type get(Handler&, const Allocator& a) + { + return a; + } +}; + +template +struct get_hook_allocator > +{ + typedef hook_allocator type; + + static type get(Handler& handler, const std::allocator&) + { + return type(handler); + } +}; + +} // namespace detail +} // namespace asio + +#define ASIO_DEFINE_HANDLER_PTR(op) \ + struct ptr \ + { \ + Handler* h; \ + op* v; \ + op* p; \ + ~ptr() \ + { \ + reset(); \ + } \ + static op* allocate(Handler& handler) \ + { \ + typedef typename ::asio::associated_allocator< \ + Handler>::type associated_allocator_type; \ + typedef typename ::asio::detail::get_hook_allocator< \ + Handler, associated_allocator_type>::type hook_allocator_type; \ + ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \ + ::asio::detail::get_hook_allocator< \ + Handler, associated_allocator_type>::get( \ + handler, ::asio::get_associated_allocator(handler))); \ + return a.allocate(1); \ + } \ + void reset() \ + { \ + if (p) \ + { \ + p->~op(); \ + p = 0; \ + } \ + if (v) \ + { \ + typedef typename ::asio::associated_allocator< \ + Handler>::type associated_allocator_type; \ + typedef typename ::asio::detail::get_hook_allocator< \ + Handler, associated_allocator_type>::type hook_allocator_type; \ + ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \ + ::asio::detail::get_hook_allocator< \ + Handler, associated_allocator_type>::get( \ + *h, ::asio::get_associated_allocator(*h))); \ + a.deallocate(static_cast(v), 1); \ + v = 0; \ + } \ + } \ + } \ + /**/ + +#define ASIO_DEFINE_TAGGED_HANDLER_ALLOCATOR_PTR(purpose, op) \ + struct ptr \ + { \ + const Alloc* a; \ + void* v; \ + op* p; \ + ~ptr() \ + { \ + reset(); \ + } \ + static op* allocate(const Alloc& a) \ + { \ + typedef typename ::asio::detail::get_recycling_allocator< \ + Alloc, purpose>::type recycling_allocator_type; \ + ASIO_REBIND_ALLOC(recycling_allocator_type, op) a1( \ + ::asio::detail::get_recycling_allocator< \ + Alloc, purpose>::get(a)); \ + return a1.allocate(1); \ + } \ + void reset() \ + { \ + if (p) \ + { \ + p->~op(); \ + p = 0; \ + } \ + if (v) \ + { \ + typedef typename ::asio::detail::get_recycling_allocator< \ + Alloc, purpose>::type recycling_allocator_type; \ + ASIO_REBIND_ALLOC(recycling_allocator_type, op) a1( \ + ::asio::detail::get_recycling_allocator< \ + Alloc, purpose>::get(*a)); \ + a1.deallocate(static_cast(v), 1); \ + v = 0; \ + } \ + } \ + } \ + /**/ + +#define ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(op) \ + ASIO_DEFINE_TAGGED_HANDLER_ALLOCATOR_PTR( \ + ::asio::detail::thread_info_base::default_tag, op ) \ + /**/ + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_HANDLER_ALLOC_HELPERS_HPP diff --git a/include/asio/include/asio/detail/handler_cont_helpers.hpp b/include/asio/include/asio/detail/handler_cont_helpers.hpp new file mode 100644 index 0000000..1aaa7e5 --- /dev/null +++ b/include/asio/include/asio/detail/handler_cont_helpers.hpp @@ -0,0 +1,45 @@ +// +// detail/handler_cont_helpers.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP +#define ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/memory.hpp" +#include "asio/handler_continuation_hook.hpp" + +#include "asio/detail/push_options.hpp" + +// Calls to asio_handler_is_continuation must be made from a namespace that +// does not contain overloads of this function. This namespace is defined here +// for that purpose. +namespace asio_handler_cont_helpers { + +template +inline bool is_continuation(Context& context) +{ +#if !defined(ASIO_HAS_HANDLER_HOOKS) + return false; +#else + using asio::asio_handler_is_continuation; + return asio_handler_is_continuation( + asio::detail::addressof(context)); +#endif +} + +} // namespace asio_handler_cont_helpers + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP diff --git a/include/asio/include/asio/detail/handler_invoke_helpers.hpp b/include/asio/include/asio/detail/handler_invoke_helpers.hpp new file mode 100644 index 0000000..f2967a9 --- /dev/null +++ b/include/asio/include/asio/detail/handler_invoke_helpers.hpp @@ -0,0 +1,80 @@ +// +// detail/handler_invoke_helpers.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP +#define ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/memory.hpp" +#include "asio/handler_invoke_hook.hpp" + +#include "asio/detail/push_options.hpp" + +// Calls to asio_handler_invoke must be made from a namespace that does not +// contain overloads of this function. The asio_handler_invoke_helpers +// namespace is defined here for that purpose. +namespace asio_handler_invoke_helpers { + +#if defined(ASIO_NO_DEPRECATED) +template +inline void error_if_hook_is_defined(Function& function, Context& context) +{ + using asio::asio_handler_invoke; + // If you get an error here it is because some of your handlers still + // overload asio_handler_invoke, but this hook is no longer used. + (void)static_cast( + asio_handler_invoke(function, asio::detail::addressof(context))); +} +#endif // defined(ASIO_NO_DEPRECATED) + +template +inline void invoke(Function& function, Context& context) +{ +#if !defined(ASIO_HAS_HANDLER_HOOKS) + Function tmp(function); + tmp(); +#elif defined(ASIO_NO_DEPRECATED) + // The asio_handler_invoke hook is no longer used to invoke the function. + (void)&error_if_hook_is_defined; + (void)context; + function(); +#else + using asio::asio_handler_invoke; + asio_handler_invoke(function, asio::detail::addressof(context)); +#endif +} + +template +inline void invoke(const Function& function, Context& context) +{ +#if !defined(ASIO_HAS_HANDLER_HOOKS) + Function tmp(function); + tmp(); +#elif defined(ASIO_NO_DEPRECATED) + // The asio_handler_invoke hook is no longer used to invoke the function. + (void)&error_if_hook_is_defined; + (void)context; + Function tmp(function); + tmp(); +#else + using asio::asio_handler_invoke; + asio_handler_invoke(function, asio::detail::addressof(context)); +#endif +} + +} // namespace asio_handler_invoke_helpers + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP diff --git a/include/asio/include/asio/detail/handler_tracking.hpp b/include/asio/include/asio/detail/handler_tracking.hpp new file mode 100644 index 0000000..95cb96f --- /dev/null +++ b/include/asio/include/asio/detail/handler_tracking.hpp @@ -0,0 +1,264 @@ +// +// detail/handler_tracking.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_HANDLER_TRACKING_HPP +#define ASIO_DETAIL_HANDLER_TRACKING_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +namespace asio { + +class execution_context; + +} // namespace asio + +#if defined(ASIO_CUSTOM_HANDLER_TRACKING) +# include ASIO_CUSTOM_HANDLER_TRACKING +#elif defined(ASIO_ENABLE_HANDLER_TRACKING) +# include "asio/error_code.hpp" +# include "asio/detail/cstdint.hpp" +# include "asio/detail/static_mutex.hpp" +# include "asio/detail/tss_ptr.hpp" +#endif // defined(ASIO_ENABLE_HANDLER_TRACKING) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_CUSTOM_HANDLER_TRACKING) + +// The user-specified header must define the following macros: +// - ASIO_INHERIT_TRACKED_HANDLER +// - ASIO_ALSO_INHERIT_TRACKED_HANDLER +// - ASIO_HANDLER_TRACKING_INIT +// - ASIO_HANDLER_CREATION(args) +// - ASIO_HANDLER_COMPLETION(args) +// - ASIO_HANDLER_INVOCATION_BEGIN(args) +// - ASIO_HANDLER_INVOCATION_END +// - ASIO_HANDLER_OPERATION(args) +// - ASIO_HANDLER_REACTOR_REGISTRATION(args) +// - ASIO_HANDLER_REACTOR_DEREGISTRATION(args) +// - ASIO_HANDLER_REACTOR_READ_EVENT +// - ASIO_HANDLER_REACTOR_WRITE_EVENT +// - ASIO_HANDLER_REACTOR_ERROR_EVENT +// - ASIO_HANDLER_REACTOR_EVENTS(args) +// - ASIO_HANDLER_REACTOR_OPERATION(args) + +# if !defined(ASIO_ENABLE_HANDLER_TRACKING) +# define ASIO_ENABLE_HANDLER_TRACKING 1 +# endif /// !defined(ASIO_ENABLE_HANDLER_TRACKING) + +#elif defined(ASIO_ENABLE_HANDLER_TRACKING) + +class handler_tracking +{ +public: + class completion; + + // Base class for objects containing tracked handlers. + class tracked_handler + { + private: + // Only the handler_tracking class will have access to the id. + friend class handler_tracking; + friend class completion; + uint64_t id_; + + protected: + // Constructor initialises with no id. + tracked_handler() : id_(0) {} + + // Prevent deletion through this type. + ~tracked_handler() {} + }; + + // Initialise the tracking system. + ASIO_DECL static void init(); + + class location + { + public: + // Constructor adds a location to the stack. + ASIO_DECL explicit location(const char* file, + int line, const char* func); + + // Destructor removes a location from the stack. + ASIO_DECL ~location(); + + private: + // Disallow copying and assignment. + location(const location&) ASIO_DELETED; + location& operator=(const location&) ASIO_DELETED; + + friend class handler_tracking; + const char* file_; + int line_; + const char* func_; + location* next_; + }; + + // Record the creation of a tracked handler. + ASIO_DECL static void creation( + execution_context& context, tracked_handler& h, + const char* object_type, void* object, + uintmax_t native_handle, const char* op_name); + + class completion + { + public: + // Constructor records that handler is to be invoked with no arguments. + ASIO_DECL explicit completion(const tracked_handler& h); + + // Destructor records only when an exception is thrown from the handler, or + // if the memory is being freed without the handler having been invoked. + ASIO_DECL ~completion(); + + // Records that handler is to be invoked with no arguments. + ASIO_DECL void invocation_begin(); + + // Records that handler is to be invoked with one arguments. + ASIO_DECL void invocation_begin(const asio::error_code& ec); + + // Constructor records that handler is to be invoked with two arguments. + ASIO_DECL void invocation_begin( + const asio::error_code& ec, std::size_t bytes_transferred); + + // Constructor records that handler is to be invoked with two arguments. + ASIO_DECL void invocation_begin( + const asio::error_code& ec, int signal_number); + + // Constructor records that handler is to be invoked with two arguments. + ASIO_DECL void invocation_begin( + const asio::error_code& ec, const char* arg); + + // Record that handler invocation has ended. + ASIO_DECL void invocation_end(); + + private: + friend class handler_tracking; + uint64_t id_; + bool invoked_; + completion* next_; + }; + + // Record an operation that is not directly associated with a handler. + ASIO_DECL static void operation(execution_context& context, + const char* object_type, void* object, + uintmax_t native_handle, const char* op_name); + + // Record that a descriptor has been registered with the reactor. + ASIO_DECL static void reactor_registration(execution_context& context, + uintmax_t native_handle, uintmax_t registration); + + // Record that a descriptor has been deregistered from the reactor. + ASIO_DECL static void reactor_deregistration(execution_context& context, + uintmax_t native_handle, uintmax_t registration); + + // Record a reactor-based operation that is associated with a handler. + ASIO_DECL static void reactor_events(execution_context& context, + uintmax_t registration, unsigned events); + + // Record a reactor-based operation that is associated with a handler. + ASIO_DECL static void reactor_operation( + const tracked_handler& h, const char* op_name, + const asio::error_code& ec); + + // Record a reactor-based operation that is associated with a handler. + ASIO_DECL static void reactor_operation( + const tracked_handler& h, const char* op_name, + const asio::error_code& ec, std::size_t bytes_transferred); + + // Write a line of output. + ASIO_DECL static void write_line(const char* format, ...); + +private: + struct tracking_state; + ASIO_DECL static tracking_state* get_state(); +}; + +# define ASIO_INHERIT_TRACKED_HANDLER \ + : public asio::detail::handler_tracking::tracked_handler + +# define ASIO_ALSO_INHERIT_TRACKED_HANDLER \ + , public asio::detail::handler_tracking::tracked_handler + +# define ASIO_HANDLER_TRACKING_INIT \ + asio::detail::handler_tracking::init() + +# define ASIO_HANDLER_LOCATION(args) \ + asio::detail::handler_tracking::location tracked_location args + +# define ASIO_HANDLER_CREATION(args) \ + asio::detail::handler_tracking::creation args + +# define ASIO_HANDLER_COMPLETION(args) \ + asio::detail::handler_tracking::completion tracked_completion args + +# define ASIO_HANDLER_INVOCATION_BEGIN(args) \ + tracked_completion.invocation_begin args + +# define ASIO_HANDLER_INVOCATION_END \ + tracked_completion.invocation_end() + +# define ASIO_HANDLER_OPERATION(args) \ + asio::detail::handler_tracking::operation args + +# define ASIO_HANDLER_REACTOR_REGISTRATION(args) \ + asio::detail::handler_tracking::reactor_registration args + +# define ASIO_HANDLER_REACTOR_DEREGISTRATION(args) \ + asio::detail::handler_tracking::reactor_deregistration args + +# define ASIO_HANDLER_REACTOR_READ_EVENT 1 +# define ASIO_HANDLER_REACTOR_WRITE_EVENT 2 +# define ASIO_HANDLER_REACTOR_ERROR_EVENT 4 + +# define ASIO_HANDLER_REACTOR_EVENTS(args) \ + asio::detail::handler_tracking::reactor_events args + +# define ASIO_HANDLER_REACTOR_OPERATION(args) \ + asio::detail::handler_tracking::reactor_operation args + +#else // defined(ASIO_ENABLE_HANDLER_TRACKING) + +# define ASIO_INHERIT_TRACKED_HANDLER +# define ASIO_ALSO_INHERIT_TRACKED_HANDLER +# define ASIO_HANDLER_TRACKING_INIT (void)0 +# define ASIO_HANDLER_LOCATION(loc) (void)0 +# define ASIO_HANDLER_CREATION(args) (void)0 +# define ASIO_HANDLER_COMPLETION(args) (void)0 +# define ASIO_HANDLER_INVOCATION_BEGIN(args) (void)0 +# define ASIO_HANDLER_INVOCATION_END (void)0 +# define ASIO_HANDLER_OPERATION(args) (void)0 +# define ASIO_HANDLER_REACTOR_REGISTRATION(args) (void)0 +# define ASIO_HANDLER_REACTOR_DEREGISTRATION(args) (void)0 +# define ASIO_HANDLER_REACTOR_READ_EVENT 0 +# define ASIO_HANDLER_REACTOR_WRITE_EVENT 0 +# define ASIO_HANDLER_REACTOR_ERROR_EVENT 0 +# define ASIO_HANDLER_REACTOR_EVENTS(args) (void)0 +# define ASIO_HANDLER_REACTOR_OPERATION(args) (void)0 + +#endif // defined(ASIO_ENABLE_HANDLER_TRACKING) + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/handler_tracking.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_HANDLER_TRACKING_HPP diff --git a/include/asio/include/asio/detail/handler_type_requirements.hpp b/include/asio/include/asio/detail/handler_type_requirements.hpp new file mode 100644 index 0000000..420b0ab --- /dev/null +++ b/include/asio/include/asio/detail/handler_type_requirements.hpp @@ -0,0 +1,556 @@ +// +// detail/handler_type_requirements.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP +#define ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +// Older versions of gcc have difficulty compiling the sizeof expressions where +// we test the handler type requirements. We'll disable checking of handler type +// requirements for those compilers, but otherwise enable it by default. +#if !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) +# if !defined(__GNUC__) || (__GNUC__ >= 4) +# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS 1 +# endif // !defined(__GNUC__) || (__GNUC__ >= 4) +#endif // !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) + +// With C++0x we can use a combination of enhanced SFINAE and static_assert to +// generate better template error messages. As this technique is not yet widely +// portable, we'll only enable it for tested compilers. +#if !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) +# if defined(__GNUC__) +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) +# if defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 +# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) +# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) +# endif // defined(__GNUC__) +# if defined(ASIO_MSVC) +# if (_MSC_VER >= 1600) +# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 +# endif // (_MSC_VER >= 1600) +# endif // defined(ASIO_MSVC) +# if defined(__clang__) +# if __has_feature(__cxx_static_assert__) +# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 +# endif // __has_feature(cxx_static_assert) +# endif // defined(__clang__) +#endif // !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) + +#if defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) +# include "asio/async_result.hpp" +#endif // defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) + +namespace asio { +namespace detail { + +#if defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) + +# if defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) + +template +auto zero_arg_copyable_handler_test(Handler h, void*) + -> decltype( + sizeof(Handler(static_cast(h))), + ((h)()), + char(0)); + +template +char (&zero_arg_copyable_handler_test(Handler, ...))[2]; + +template +auto one_arg_handler_test(Handler h, Arg1* a1) + -> decltype( + sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))), + ((h)(*a1)), + char(0)); + +template +char (&one_arg_handler_test(Handler h, ...))[2]; + +template +auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2) + -> decltype( + sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))), + ((h)(*a1, *a2)), + char(0)); + +template +char (&two_arg_handler_test(Handler, ...))[2]; + +template +auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2) + -> decltype( + sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))), + ((h)(*a1, ASIO_MOVE_CAST(Arg2)(*a2))), + char(0)); + +template +char (&two_arg_move_handler_test(Handler, ...))[2]; + +# define ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) \ + static_assert(expr, msg); + +# else // defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) + +# define ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) + +# endif // defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) + +template T& lvref(); +template T& lvref(T); +template const T& clvref(); +template const T& clvref(T); +#if defined(ASIO_HAS_MOVE) +template T rvref(); +template T rvref(T); +#else // defined(ASIO_HAS_MOVE) +template const T& rvref(); +template const T& rvref(T); +#endif // defined(ASIO_HAS_MOVE) +template char argbyv(T); + +template +struct handler_type_requirements +{ +}; + +#define ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void()) asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::zero_arg_copyable_handler_test( \ + asio::detail::clvref< \ + asio_true_handler_type>(), 0)) == 1, \ + "CompletionHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::clvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()(), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_READ_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, std::size_t)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "ReadHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_WRITE_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, std::size_t)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "WriteHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_ACCEPT_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::one_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0))) == 1, \ + "AcceptHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ + handler_type, handler, socket_type) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, socket_type)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_move_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "MoveAcceptHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::rvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_CONNECT_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::one_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0))) == 1, \ + "ConnectHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_RANGE_CONNECT_HANDLER_CHECK( \ + handler_type, handler, endpoint_type) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, endpoint_type)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "RangeConnectHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ + handler_type, handler, iter_type) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, iter_type)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "IteratorConnectHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_RESOLVE_HANDLER_CHECK( \ + handler_type, handler, range_type) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, range_type)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "ResolveHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_WAIT_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::one_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0))) == 1, \ + "WaitHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_SIGNAL_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, int)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "SignalHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_HANDSHAKE_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::one_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0))) == 1, \ + "HandshakeHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code, std::size_t)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::two_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0), \ + static_cast(0))) == 1, \ + "BufferedHandshakeHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref(), \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#define ASIO_SHUTDOWN_HANDLER_CHECK( \ + handler_type, handler) \ + \ + typedef ASIO_HANDLER_TYPE(handler_type, \ + void(asio::error_code)) \ + asio_true_handler_type; \ + \ + ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ + sizeof(asio::detail::one_arg_handler_test( \ + asio::detail::rvref< \ + asio_true_handler_type>(), \ + static_cast(0))) == 1, \ + "ShutdownHandler type requirements not met") \ + \ + typedef asio::detail::handler_type_requirements< \ + sizeof( \ + asio::detail::argbyv( \ + asio::detail::rvref< \ + asio_true_handler_type>())) + \ + sizeof( \ + asio::detail::lvref< \ + asio_true_handler_type>()( \ + asio::detail::lvref()), \ + char(0))> ASIO_UNUSED_TYPEDEF + +#else // !defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) + +#define ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_READ_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_WRITE_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_ACCEPT_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ + handler_type, handler, socket_type) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_CONNECT_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_RANGE_CONNECT_HANDLER_CHECK( \ + handler_type, handler, iter_type) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ + handler_type, handler, iter_type) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_RESOLVE_HANDLER_CHECK( \ + handler_type, handler, iter_type) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_WAIT_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_SIGNAL_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_HANDSHAKE_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#define ASIO_SHUTDOWN_HANDLER_CHECK( \ + handler_type, handler) \ + typedef int ASIO_UNUSED_TYPEDEF + +#endif // !defined(ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP diff --git a/include/asio/include/asio/detail/handler_work.hpp b/include/asio/include/asio/detail/handler_work.hpp new file mode 100644 index 0000000..2475aa8 --- /dev/null +++ b/include/asio/include/asio/detail/handler_work.hpp @@ -0,0 +1,438 @@ +// +// detail/handler_work.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_HANDLER_WORK_HPP +#define ASIO_DETAIL_HANDLER_WORK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/associated_executor.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/allocator.hpp" +#include "asio/execution/blocking.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/outstanding_work.hpp" +#include "asio/executor_work_guard.hpp" +#include "asio/prefer.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +class executor; +class io_context; + +namespace execution { + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template class any_executor; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template class any_executor; + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +} // namespace execution +namespace detail { + +template +class handler_work_base +{ +public: + explicit handler_work_base(const Executor& ex) ASIO_NOEXCEPT + : executor_(asio::prefer(ex, execution::outstanding_work.tracked)) + { + } + + template + handler_work_base(const Executor& ex, + const OtherExecutor&) ASIO_NOEXCEPT + : executor_(asio::prefer(ex, execution::outstanding_work.tracked)) + { + } + + handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT + : executor_(other.executor_) + { + } + +#if defined(ASIO_HAS_MOVE) + handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT + : executor_(ASIO_MOVE_CAST(executor_type)(other.executor_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + bool owns_work() const ASIO_NOEXCEPT + { + return true; + } + + template + void dispatch(Function& function, Handler& handler) + { + execution::execute( + asio::prefer(executor_, + execution::blocking.possibly, + execution::allocator((get_associated_allocator)(handler))), + ASIO_MOVE_CAST(Function)(function)); + } + +private: + typedef typename decay< + typename prefer_result::type + >::type executor_type; + + executor_type executor_; +}; + +template +class handler_work_base::value + && (!is_same::value + || !is_same::value) + >::type> +{ +public: + explicit handler_work_base(const Executor& ex) ASIO_NOEXCEPT + : executor_(ex), + owns_work_(true) + { + executor_.on_work_started(); + } + + handler_work_base(const Executor& ex, + const Executor& candidate) ASIO_NOEXCEPT + : executor_(ex), + owns_work_(ex != candidate) + { + if (owns_work_) + executor_.on_work_started(); + } + + template + handler_work_base(const Executor& ex, + const OtherExecutor&) ASIO_NOEXCEPT + : executor_(ex), + owns_work_(true) + { + executor_.on_work_started(); + } + + handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT + : executor_(other.executor_), + owns_work_(other.owns_work_) + { + if (owns_work_) + executor_.on_work_started(); + } + +#if defined(ASIO_HAS_MOVE) + handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT + : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)), + owns_work_(other.owns_work_) + { + other.owns_work_ = false; + } +#endif // defined(ASIO_HAS_MOVE) + + ~handler_work_base() + { + if (owns_work_) + executor_.on_work_finished(); + } + + bool owns_work() const ASIO_NOEXCEPT + { + return owns_work_; + } + + template + void dispatch(Function& function, Handler& handler) + { + executor_.dispatch(ASIO_MOVE_CAST(Function)(function), + asio::get_associated_allocator(handler)); + } + +private: + Executor executor_; + bool owns_work_; +}; + +template +class handler_work_base::value + >::type> +{ +public: + explicit handler_work_base(const Executor&) + { + } + + bool owns_work() const ASIO_NOEXCEPT + { + return false; + } + + template + void dispatch(Function& function, Handler& handler) + { + // When using a native implementation, I/O completion handlers are + // already dispatched according to the execution context's executor's + // rules. We can call the function directly. + asio_handler_invoke_helpers::invoke(function, handler); + } +}; + +template +class handler_work_base +{ +public: + explicit handler_work_base(const Executor& ex) ASIO_NOEXCEPT +#if !defined(ASIO_NO_TYPEID) + : executor_( + ex.target_type() == typeid(typename IoContext::executor_type) + ? Executor() : ex) +#else // !defined(ASIO_NO_TYPEID) + : executor_(ex) +#endif // !defined(ASIO_NO_TYPEID) + { + if (executor_) + executor_.on_work_started(); + } + + handler_work_base(const Executor& ex, + const Executor& candidate) ASIO_NOEXCEPT + : executor_(ex != candidate ? ex : Executor()) + { + if (executor_) + executor_.on_work_started(); + } + + template + handler_work_base(const Executor& ex, + const OtherExecutor&) ASIO_NOEXCEPT + : executor_(ex) + { + executor_.on_work_started(); + } + + handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT + : executor_(other.executor_) + { + if (executor_) + executor_.on_work_started(); + } + +#if defined(ASIO_HAS_MOVE) + handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT + : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + ~handler_work_base() + { + if (executor_) + executor_.on_work_finished(); + } + + bool owns_work() const ASIO_NOEXCEPT + { + return !!executor_; + } + + template + void dispatch(Function& function, Handler& handler) + { + executor_.dispatch(ASIO_MOVE_CAST(Function)(function), + asio::get_associated_allocator(handler)); + } + +private: + Executor executor_; +}; + +template < +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + typename... SupportableProperties, +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + typename T1, typename T2, typename T3, typename T4, typename T5, + typename T6, typename T7, typename T8, typename T9, +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + typename IoContext, typename PolymorphicExecutor> +class handler_work_base< +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + execution::any_executor, +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + execution::any_executor, +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + void, IoContext, PolymorphicExecutor> +{ +public: + typedef +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + execution::any_executor +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + execution::any_executor +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + executor_type; + + explicit handler_work_base(const executor_type& ex) ASIO_NOEXCEPT +#if !defined(ASIO_NO_TYPEID) + : executor_( + ex.target_type() == typeid(typename IoContext::executor_type) + ? executor_type() + : asio::prefer(ex, execution::outstanding_work.tracked)) +#else // !defined(ASIO_NO_TYPEID) + : executor_(asio::prefer(ex, execution::outstanding_work.tracked)) +#endif // !defined(ASIO_NO_TYPEID) + { + } + + handler_work_base(const executor_type& ex, + const executor_type& candidate) ASIO_NOEXCEPT + : executor_(ex != candidate ? ex : executor_type()) + { + } + + template + handler_work_base(const executor_type& ex, + const OtherExecutor&) ASIO_NOEXCEPT + : executor_(asio::prefer(ex, execution::outstanding_work.tracked)) + { + } + + handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT + : executor_(other.executor_) + { + } + +#if defined(ASIO_HAS_MOVE) + handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT + : executor_(ASIO_MOVE_CAST(executor_type)(other.executor_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + bool owns_work() const ASIO_NOEXCEPT + { + return !!executor_; + } + + template + void dispatch(Function& function, Handler& handler) + { + execution::execute( + asio::prefer(executor_, + execution::blocking.possibly, + execution::allocator((get_associated_allocator)(handler))), + ASIO_MOVE_CAST(Function)(function)); + } + +private: + executor_type executor_; +}; + +template +class handler_work : + handler_work_base, + handler_work_base::type, IoExecutor> +{ +public: + typedef handler_work_base base1_type; + typedef handler_work_base::type, IoExecutor> base2_type; + + handler_work(Handler& handler, const IoExecutor& io_ex) ASIO_NOEXCEPT + : base1_type(io_ex), + base2_type(asio::get_associated_executor(handler, io_ex), io_ex) + { + } + + template + void complete(Function& function, Handler& handler) + { + if (!base1_type::owns_work() && !base2_type::owns_work()) + { + // When using a native implementation, I/O completion handlers are + // already dispatched according to the execution context's executor's + // rules. We can call the function directly. + asio_handler_invoke_helpers::invoke(function, handler); + } + else + { + base2_type::dispatch(function, handler); + } + } +}; + +template +class handler_work< + Handler, IoExecutor, + typename enable_if< + is_same< + typename associated_executor::asio_associated_executor_is_unspecialised, + void + >::value + >::type> : handler_work_base +{ +public: + typedef handler_work_base base1_type; + + handler_work(Handler&, const IoExecutor& io_ex) ASIO_NOEXCEPT + : base1_type(io_ex) + { + } + + template + void complete(Function& function, Handler& handler) + { + if (!base1_type::owns_work()) + { + // When using a native implementation, I/O completion handlers are + // already dispatched according to the execution context's executor's + // rules. We can call the function directly. + asio_handler_invoke_helpers::invoke(function, handler); + } + else + { + base1_type::dispatch(function, handler); + } + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_HANDLER_WORK_HPP diff --git a/include/asio/include/asio/detail/hash_map.hpp b/include/asio/include/asio/detail/hash_map.hpp new file mode 100644 index 0000000..2fdc473 --- /dev/null +++ b/include/asio/include/asio/detail/hash_map.hpp @@ -0,0 +1,331 @@ +// +// detail/hash_map.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_HASH_MAP_HPP +#define ASIO_DETAIL_HASH_MAP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include +#include "asio/detail/assert.hpp" +#include "asio/detail/noncopyable.hpp" + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# include "asio/detail/socket_types.hpp" +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +inline std::size_t calculate_hash_value(int i) +{ + return static_cast(i); +} + +inline std::size_t calculate_hash_value(void* p) +{ + return reinterpret_cast(p) + + (reinterpret_cast(p) >> 3); +} + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +inline std::size_t calculate_hash_value(SOCKET s) +{ + return static_cast(s); +} +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +// Note: assumes K and V are POD types. +template +class hash_map + : private noncopyable +{ +public: + // The type of a value in the map. + typedef std::pair value_type; + + // The type of a non-const iterator over the hash map. + typedef typename std::list::iterator iterator; + + // The type of a const iterator over the hash map. + typedef typename std::list::const_iterator const_iterator; + + // Constructor. + hash_map() + : size_(0), + buckets_(0), + num_buckets_(0) + { + } + + // Destructor. + ~hash_map() + { + delete[] buckets_; + } + + // Get an iterator for the beginning of the map. + iterator begin() + { + return values_.begin(); + } + + // Get an iterator for the beginning of the map. + const_iterator begin() const + { + return values_.begin(); + } + + // Get an iterator for the end of the map. + iterator end() + { + return values_.end(); + } + + // Get an iterator for the end of the map. + const_iterator end() const + { + return values_.end(); + } + + // Check whether the map is empty. + bool empty() const + { + return values_.empty(); + } + + // Find an entry in the map. + iterator find(const K& k) + { + if (num_buckets_) + { + size_t bucket = calculate_hash_value(k) % num_buckets_; + iterator it = buckets_[bucket].first; + if (it == values_.end()) + return values_.end(); + iterator end_it = buckets_[bucket].last; + ++end_it; + while (it != end_it) + { + if (it->first == k) + return it; + ++it; + } + } + return values_.end(); + } + + // Find an entry in the map. + const_iterator find(const K& k) const + { + if (num_buckets_) + { + size_t bucket = calculate_hash_value(k) % num_buckets_; + const_iterator it = buckets_[bucket].first; + if (it == values_.end()) + return it; + const_iterator end_it = buckets_[bucket].last; + ++end_it; + while (it != end_it) + { + if (it->first == k) + return it; + ++it; + } + } + return values_.end(); + } + + // Insert a new entry into the map. + std::pair insert(const value_type& v) + { + if (size_ + 1 >= num_buckets_) + rehash(hash_size(size_ + 1)); + size_t bucket = calculate_hash_value(v.first) % num_buckets_; + iterator it = buckets_[bucket].first; + if (it == values_.end()) + { + buckets_[bucket].first = buckets_[bucket].last = + values_insert(values_.end(), v); + ++size_; + return std::pair(buckets_[bucket].last, true); + } + iterator end_it = buckets_[bucket].last; + ++end_it; + while (it != end_it) + { + if (it->first == v.first) + return std::pair(it, false); + ++it; + } + buckets_[bucket].last = values_insert(end_it, v); + ++size_; + return std::pair(buckets_[bucket].last, true); + } + + // Erase an entry from the map. + void erase(iterator it) + { + ASIO_ASSERT(it != values_.end()); + ASIO_ASSERT(num_buckets_ != 0); + + size_t bucket = calculate_hash_value(it->first) % num_buckets_; + bool is_first = (it == buckets_[bucket].first); + bool is_last = (it == buckets_[bucket].last); + if (is_first && is_last) + buckets_[bucket].first = buckets_[bucket].last = values_.end(); + else if (is_first) + ++buckets_[bucket].first; + else if (is_last) + --buckets_[bucket].last; + + values_erase(it); + --size_; + } + + // Erase a key from the map. + void erase(const K& k) + { + iterator it = find(k); + if (it != values_.end()) + erase(it); + } + + // Remove all entries from the map. + void clear() + { + // Clear the values. + values_.clear(); + size_ = 0; + + // Initialise all buckets to empty. + iterator end_it = values_.end(); + for (size_t i = 0; i < num_buckets_; ++i) + buckets_[i].first = buckets_[i].last = end_it; + } + +private: + // Calculate the hash size for the specified number of elements. + static std::size_t hash_size(std::size_t num_elems) + { + static std::size_t sizes[] = + { +#if defined(ASIO_HASH_MAP_BUCKETS) + ASIO_HASH_MAP_BUCKETS +#else // ASIO_HASH_MAP_BUCKETS + 3, 13, 23, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, + 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, + 12582917, 25165843 +#endif // ASIO_HASH_MAP_BUCKETS + }; + const std::size_t nth_size = sizeof(sizes) / sizeof(std::size_t) - 1; + for (std::size_t i = 0; i < nth_size; ++i) + if (num_elems < sizes[i]) + return sizes[i]; + return sizes[nth_size]; + } + + // Re-initialise the hash from the values already contained in the list. + void rehash(std::size_t num_buckets) + { + if (num_buckets == num_buckets_) + return; + ASIO_ASSERT(num_buckets != 0); + + iterator end_iter = values_.end(); + + // Update number of buckets and initialise all buckets to empty. + bucket_type* tmp = new bucket_type[num_buckets]; + delete[] buckets_; + buckets_ = tmp; + num_buckets_ = num_buckets; + for (std::size_t i = 0; i < num_buckets_; ++i) + buckets_[i].first = buckets_[i].last = end_iter; + + // Put all values back into the hash. + iterator iter = values_.begin(); + while (iter != end_iter) + { + std::size_t bucket = calculate_hash_value(iter->first) % num_buckets_; + if (buckets_[bucket].last == end_iter) + { + buckets_[bucket].first = buckets_[bucket].last = iter++; + } + else if (++buckets_[bucket].last == iter) + { + ++iter; + } + else + { + values_.splice(buckets_[bucket].last, values_, iter++); + --buckets_[bucket].last; + } + } + } + + // Insert an element into the values list by splicing from the spares list, + // if a spare is available, and otherwise by inserting a new element. + iterator values_insert(iterator it, const value_type& v) + { + if (spares_.empty()) + { + return values_.insert(it, v); + } + else + { + spares_.front() = v; + values_.splice(it, spares_, spares_.begin()); + return --it; + } + } + + // Erase an element from the values list by splicing it to the spares list. + void values_erase(iterator it) + { + *it = value_type(); + spares_.splice(spares_.begin(), values_, it); + } + + // The number of elements in the hash. + std::size_t size_; + + // The list of all values in the hash map. + std::list values_; + + // The list of spare nodes waiting to be recycled. Assumes that POD types only + // are stored in the hash map. + std::list spares_; + + // The type for a bucket in the hash table. + struct bucket_type + { + iterator first; + iterator last; + }; + + // The buckets in the hash. + bucket_type* buckets_; + + // The number of buckets in the hash. + std::size_t num_buckets_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_HASH_MAP_HPP diff --git a/include/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp b/include/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp new file mode 100644 index 0000000..7bf2b0a --- /dev/null +++ b/include/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp @@ -0,0 +1,118 @@ +// +// detail/impl/buffer_sequence_adapter.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_BUFFER_SEQUENCE_ADAPTER_IPP +#define ASIO_DETAIL_IMPL_BUFFER_SEQUENCE_ADAPTER_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include +#include +#include +#include "asio/detail/buffer_sequence_adapter.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class winrt_buffer_impl : + public Microsoft::WRL::RuntimeClass< + Microsoft::WRL::RuntimeClassFlags< + Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>, + ABI::Windows::Storage::Streams::IBuffer, + Windows::Storage::Streams::IBufferByteAccess> +{ +public: + explicit winrt_buffer_impl(const asio::const_buffer& b) + { + bytes_ = const_cast(static_cast(b.data())); + length_ = b.size(); + capacity_ = b.size(); + } + + explicit winrt_buffer_impl(const asio::mutable_buffer& b) + { + bytes_ = static_cast(b.data()); + length_ = 0; + capacity_ = b.size(); + } + + ~winrt_buffer_impl() + { + } + + STDMETHODIMP Buffer(byte** value) + { + *value = bytes_; + return S_OK; + } + + STDMETHODIMP get_Capacity(UINT32* value) + { + *value = capacity_; + return S_OK; + } + + STDMETHODIMP get_Length(UINT32 *value) + { + *value = length_; + return S_OK; + } + + STDMETHODIMP put_Length(UINT32 value) + { + if (value > capacity_) + return E_INVALIDARG; + length_ = value; + return S_OK; + } + +private: + byte* bytes_; + UINT32 length_; + UINT32 capacity_; +}; + +void buffer_sequence_adapter_base::init_native_buffer( + buffer_sequence_adapter_base::native_buffer_type& buf, + const asio::mutable_buffer& buffer) +{ + std::memset(&buf, 0, sizeof(native_buffer_type)); + Microsoft::WRL::ComPtr insp + = Microsoft::WRL::Make(buffer); + buf = reinterpret_cast(insp.Get()); +} + +void buffer_sequence_adapter_base::init_native_buffer( + buffer_sequence_adapter_base::native_buffer_type& buf, + const asio::const_buffer& buffer) +{ + std::memset(&buf, 0, sizeof(native_buffer_type)); + Microsoft::WRL::ComPtr insp + = Microsoft::WRL::Make(buffer); + Platform::Object^ buf_obj = reinterpret_cast(insp.Get()); + buf = reinterpret_cast(insp.Get()); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_IMPL_BUFFER_SEQUENCE_ADAPTER_IPP diff --git a/include/asio/include/asio/detail/impl/descriptor_ops.ipp b/include/asio/include/asio/detail/impl/descriptor_ops.ipp new file mode 100644 index 0000000..a146ed5 --- /dev/null +++ b/include/asio/include/asio/detail/impl/descriptor_ops.ipp @@ -0,0 +1,608 @@ +// +// detail/impl/descriptor_ops.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_DESCRIPTOR_OPS_IPP +#define ASIO_DETAIL_IMPL_DESCRIPTOR_OPS_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/descriptor_ops.hpp" +#include "asio/error.hpp" + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { +namespace descriptor_ops { + +int open(const char* path, int flags, asio::error_code& ec) +{ + int result = ::open(path, flags); + get_last_error(ec, result < 0); + return result; +} + +int close(int d, state_type& state, asio::error_code& ec) +{ + int result = 0; + if (d != -1) + { + result = ::close(d); + get_last_error(ec, result < 0); + + if (result != 0 + && (ec == asio::error::would_block + || ec == asio::error::try_again)) + { + // According to UNIX Network Programming Vol. 1, it is possible for + // close() to fail with EWOULDBLOCK under certain circumstances. What + // isn't clear is the state of the descriptor after this error. The one + // current OS where this behaviour is seen, Windows, says that the socket + // remains open. Therefore we'll put the descriptor back into blocking + // mode and have another attempt at closing it. +#if defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + int flags = ::fcntl(d, F_GETFL, 0); + if (flags >= 0) + ::fcntl(d, F_SETFL, flags & ~O_NONBLOCK); +#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + ioctl_arg_type arg = 0; + ::ioctl(d, FIONBIO, &arg); +#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + state &= ~non_blocking; + + result = ::close(d); + get_last_error(ec, result < 0); + } + } + + return result; +} + +bool set_user_non_blocking(int d, state_type& state, + bool value, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return false; + } + +#if defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + int result = ::fcntl(d, F_GETFL, 0); + get_last_error(ec, result < 0); + if (result >= 0) + { + int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK)); + result = ::fcntl(d, F_SETFL, flag); + get_last_error(ec, result < 0); + } +#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + ioctl_arg_type arg = (value ? 1 : 0); + int result = ::ioctl(d, FIONBIO, &arg); + get_last_error(ec, result < 0); +#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + + if (result >= 0) + { + if (value) + state |= user_set_non_blocking; + else + { + // Clearing the user-set non-blocking mode always overrides any + // internally-set non-blocking flag. Any subsequent asynchronous + // operations will need to re-enable non-blocking I/O. + state &= ~(user_set_non_blocking | internal_non_blocking); + } + return true; + } + + return false; +} + +bool set_internal_non_blocking(int d, state_type& state, + bool value, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return false; + } + + if (!value && (state & user_set_non_blocking)) + { + // It does not make sense to clear the internal non-blocking flag if the + // user still wants non-blocking behaviour. Return an error and let the + // caller figure out whether to update the user-set non-blocking flag. + ec = asio::error::invalid_argument; + return false; + } + +#if defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + int result = ::fcntl(d, F_GETFL, 0); + get_last_error(ec, result < 0); + if (result >= 0) + { + int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK)); + result = ::fcntl(d, F_SETFL, flag); + get_last_error(ec, result < 0); + } +#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + ioctl_arg_type arg = (value ? 1 : 0); + int result = ::ioctl(d, FIONBIO, &arg); + get_last_error(ec, result < 0); +#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + + if (result >= 0) + { + if (value) + state |= internal_non_blocking; + else + state &= ~internal_non_blocking; + return true; + } + + return false; +} + +std::size_t sync_read(int d, state_type state, buf* bufs, + std::size_t count, bool all_empty, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to read 0 bytes on a stream is a no-op. + if (all_empty) + { + ec.assign(0, ec.category()); + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = ::readv(d, bufs, static_cast(count)); + get_last_error(ec, bytes < 0); + + // Check if operation succeeded. + if (bytes > 0) + return bytes; + + // Check for EOF. + if (bytes == 0) + { + ec = asio::error::eof; + return 0; + } + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for descriptor to become ready. + if (descriptor_ops::poll_read(d, 0, ec) < 0) + return 0; + } +} + +std::size_t sync_read1(int d, state_type state, void* data, + std::size_t size, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to read 0 bytes on a stream is a no-op. + if (size == 0) + { + ec.assign(0, ec.category()); + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = ::read(d, data, size); + get_last_error(ec, bytes < 0); + + // Check if operation succeeded. + if (bytes > 0) + return bytes; + + // Check for EOF. + if (bytes == 0) + { + ec = asio::error::eof; + return 0; + } + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for descriptor to become ready. + if (descriptor_ops::poll_read(d, 0, ec) < 0) + return 0; + } +} + +bool non_blocking_read(int d, buf* bufs, std::size_t count, + asio::error_code& ec, std::size_t& bytes_transferred) +{ + for (;;) + { + // Read some data. + signed_size_type bytes = ::readv(d, bufs, static_cast(count)); + get_last_error(ec, bytes < 0); + + // Check for end of stream. + if (bytes == 0) + { + ec = asio::error::eof; + return true; + } + + // Check if operation succeeded. + if (bytes > 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +bool non_blocking_read1(int d, void* data, std::size_t size, + asio::error_code& ec, std::size_t& bytes_transferred) +{ + for (;;) + { + // Read some data. + signed_size_type bytes = ::read(d, data, size); + get_last_error(ec, bytes < 0); + + // Check for end of stream. + if (bytes == 0) + { + ec = asio::error::eof; + return true; + } + + // Check if operation succeeded. + if (bytes > 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +std::size_t sync_write(int d, state_type state, const buf* bufs, + std::size_t count, bool all_empty, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to write 0 bytes on a stream is a no-op. + if (all_empty) + { + ec.assign(0, ec.category()); + return 0; + } + + // Write some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = ::writev(d, bufs, static_cast(count)); + get_last_error(ec, bytes < 0); + + // Check if operation succeeded. + if (bytes > 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for descriptor to become ready. + if (descriptor_ops::poll_write(d, 0, ec) < 0) + return 0; + } +} + +std::size_t sync_write1(int d, state_type state, const void* data, + std::size_t size, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to write 0 bytes on a stream is a no-op. + if (size == 0) + { + ec.assign(0, ec.category()); + return 0; + } + + // Write some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = ::write(d, data, size); + get_last_error(ec, bytes < 0); + + // Check if operation succeeded. + if (bytes > 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for descriptor to become ready. + if (descriptor_ops::poll_write(d, 0, ec) < 0) + return 0; + } +} + +bool non_blocking_write(int d, const buf* bufs, std::size_t count, + asio::error_code& ec, std::size_t& bytes_transferred) +{ + for (;;) + { + // Write some data. + signed_size_type bytes = ::writev(d, bufs, static_cast(count)); + get_last_error(ec, bytes < 0); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +bool non_blocking_write1(int d, const void* data, std::size_t size, + asio::error_code& ec, std::size_t& bytes_transferred) +{ + for (;;) + { + // Write some data. + signed_size_type bytes = ::write(d, data, size); + get_last_error(ec, bytes < 0); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +int ioctl(int d, state_type& state, long cmd, + ioctl_arg_type* arg, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return -1; + } + + int result = ::ioctl(d, cmd, arg); + get_last_error(ec, result < 0); + + if (result >= 0) + { + // When updating the non-blocking mode we always perform the ioctl syscall, + // even if the flags would otherwise indicate that the descriptor is + // already in the correct state. This ensures that the underlying + // descriptor is put into the state that has been requested by the user. If + // the ioctl syscall was successful then we need to update the flags to + // match. + if (cmd == static_cast(FIONBIO)) + { + if (*arg) + { + state |= user_set_non_blocking; + } + else + { + // Clearing the non-blocking mode always overrides any internally-set + // non-blocking flag. Any subsequent asynchronous operations will need + // to re-enable non-blocking I/O. + state &= ~(user_set_non_blocking | internal_non_blocking); + } + } + } + + return result; +} + +int fcntl(int d, int cmd, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return -1; + } + + int result = ::fcntl(d, cmd); + get_last_error(ec, result < 0); + return result; +} + +int fcntl(int d, int cmd, long arg, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return -1; + } + + int result = ::fcntl(d, cmd, arg); + get_last_error(ec, result < 0); + return result; +} + +int poll_read(int d, state_type state, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return -1; + } + + pollfd fds; + fds.fd = d; + fds.events = POLLIN; + fds.revents = 0; + int timeout = (state & user_set_non_blocking) ? 0 : -1; + int result = ::poll(&fds, 1, timeout); + get_last_error(ec, result < 0); + if (result == 0) + if (state & user_set_non_blocking) + ec = asio::error::would_block; + return result; +} + +int poll_write(int d, state_type state, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return -1; + } + + pollfd fds; + fds.fd = d; + fds.events = POLLOUT; + fds.revents = 0; + int timeout = (state & user_set_non_blocking) ? 0 : -1; + int result = ::poll(&fds, 1, timeout); + get_last_error(ec, result < 0); + if (result == 0) + if (state & user_set_non_blocking) + ec = asio::error::would_block; + return result; +} + +int poll_error(int d, state_type state, asio::error_code& ec) +{ + if (d == -1) + { + ec = asio::error::bad_descriptor; + return -1; + } + + pollfd fds; + fds.fd = d; + fds.events = POLLPRI | POLLERR | POLLHUP; + fds.revents = 0; + int timeout = (state & user_set_non_blocking) ? 0 : -1; + int result = ::poll(&fds, 1, timeout); + get_last_error(ec, result < 0); + if (result == 0) + if (state & user_set_non_blocking) + ec = asio::error::would_block; + return result; +} + +} // namespace descriptor_ops +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + +#endif // ASIO_DETAIL_IMPL_DESCRIPTOR_OPS_IPP diff --git a/include/asio/include/asio/detail/impl/dev_poll_reactor.hpp b/include/asio/include/asio/detail/impl/dev_poll_reactor.hpp new file mode 100644 index 0000000..31cd719 --- /dev/null +++ b/include/asio/include/asio/detail/impl/dev_poll_reactor.hpp @@ -0,0 +1,91 @@ +// +// detail/impl/dev_poll_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_HPP +#define ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_DEV_POLL) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +void dev_poll_reactor::add_timer_queue(timer_queue& queue) +{ + do_add_timer_queue(queue); +} + +template +void dev_poll_reactor::remove_timer_queue(timer_queue& queue) +{ + do_remove_timer_queue(queue); +} + +template +void dev_poll_reactor::schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + if (shutdown_) + { + scheduler_.post_immediate_completion(op, false); + return; + } + + bool earliest = queue.enqueue_timer(time, timer, op); + scheduler_.work_started(); + if (earliest) + interrupter_.interrupt(); +} + +template +std::size_t dev_poll_reactor::cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + op_queue ops; + std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); + lock.unlock(); + scheduler_.post_deferred_completions(ops); + return n; +} + +template +void dev_poll_reactor::move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + op_queue ops; + queue.cancel_timer(target, ops); + queue.move_timer(target, source); + lock.unlock(); + scheduler_.post_deferred_completions(ops); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_DEV_POLL) + +#endif // ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_HPP diff --git a/include/asio/include/asio/detail/impl/dev_poll_reactor.ipp b/include/asio/include/asio/detail/impl/dev_poll_reactor.ipp new file mode 100644 index 0000000..c7ad0cd --- /dev/null +++ b/include/asio/include/asio/detail/impl/dev_poll_reactor.ipp @@ -0,0 +1,446 @@ +// +// detail/impl/dev_poll_reactor.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_IPP +#define ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_DEV_POLL) + +#include "asio/detail/dev_poll_reactor.hpp" +#include "asio/detail/assert.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +dev_poll_reactor::dev_poll_reactor(asio::execution_context& ctx) + : asio::detail::execution_context_service_base(ctx), + scheduler_(use_service(ctx)), + mutex_(), + dev_poll_fd_(do_dev_poll_create()), + interrupter_(), + shutdown_(false) +{ + // Add the interrupter's descriptor to /dev/poll. + ::pollfd ev = { 0, 0, 0 }; + ev.fd = interrupter_.read_descriptor(); + ev.events = POLLIN | POLLERR; + ev.revents = 0; + ::write(dev_poll_fd_, &ev, sizeof(ev)); +} + +dev_poll_reactor::~dev_poll_reactor() +{ + shutdown(); + ::close(dev_poll_fd_); +} + +void dev_poll_reactor::shutdown() +{ + asio::detail::mutex::scoped_lock lock(mutex_); + shutdown_ = true; + lock.unlock(); + + op_queue ops; + + for (int i = 0; i < max_ops; ++i) + op_queue_[i].get_all_operations(ops); + + timer_queues_.get_all_timers(ops); + + scheduler_.abandon_operations(ops); +} + +void dev_poll_reactor::notify_fork( + asio::execution_context::fork_event fork_ev) +{ + if (fork_ev == asio::execution_context::fork_child) + { + detail::mutex::scoped_lock lock(mutex_); + + if (dev_poll_fd_ != -1) + ::close(dev_poll_fd_); + dev_poll_fd_ = -1; + dev_poll_fd_ = do_dev_poll_create(); + + interrupter_.recreate(); + + // Add the interrupter's descriptor to /dev/poll. + ::pollfd ev = { 0, 0, 0 }; + ev.fd = interrupter_.read_descriptor(); + ev.events = POLLIN | POLLERR; + ev.revents = 0; + ::write(dev_poll_fd_, &ev, sizeof(ev)); + + // Re-register all descriptors with /dev/poll. The changes will be written + // to the /dev/poll descriptor the next time the reactor is run. + for (int i = 0; i < max_ops; ++i) + { + reactor_op_queue::iterator iter = op_queue_[i].begin(); + reactor_op_queue::iterator end = op_queue_[i].end(); + for (; iter != end; ++iter) + { + ::pollfd& pending_ev = add_pending_event_change(iter->first); + pending_ev.events |= POLLERR | POLLHUP; + switch (i) + { + case read_op: pending_ev.events |= POLLIN; break; + case write_op: pending_ev.events |= POLLOUT; break; + case except_op: pending_ev.events |= POLLPRI; break; + default: break; + } + } + } + interrupter_.interrupt(); + } +} + +void dev_poll_reactor::init_task() +{ + scheduler_.init_task(); +} + +int dev_poll_reactor::register_descriptor(socket_type, per_descriptor_data&) +{ + return 0; +} + +int dev_poll_reactor::register_internal_descriptor(int op_type, + socket_type descriptor, per_descriptor_data&, reactor_op* op) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + op_queue_[op_type].enqueue_operation(descriptor, op); + ::pollfd& ev = add_pending_event_change(descriptor); + ev.events = POLLERR | POLLHUP; + switch (op_type) + { + case read_op: ev.events |= POLLIN; break; + case write_op: ev.events |= POLLOUT; break; + case except_op: ev.events |= POLLPRI; break; + default: break; + } + interrupter_.interrupt(); + + return 0; +} + +void dev_poll_reactor::move_descriptor(socket_type, + dev_poll_reactor::per_descriptor_data&, + dev_poll_reactor::per_descriptor_data&) +{ +} + +void dev_poll_reactor::start_op(int op_type, socket_type descriptor, + dev_poll_reactor::per_descriptor_data&, reactor_op* op, + bool is_continuation, bool allow_speculative) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + if (shutdown_) + { + post_immediate_completion(op, is_continuation); + return; + } + + if (allow_speculative) + { + if (op_type != read_op || !op_queue_[except_op].has_operation(descriptor)) + { + if (!op_queue_[op_type].has_operation(descriptor)) + { + if (op->perform()) + { + lock.unlock(); + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + } + } + } + + bool first = op_queue_[op_type].enqueue_operation(descriptor, op); + scheduler_.work_started(); + if (first) + { + ::pollfd& ev = add_pending_event_change(descriptor); + ev.events = POLLERR | POLLHUP; + if (op_type == read_op + || op_queue_[read_op].has_operation(descriptor)) + ev.events |= POLLIN; + if (op_type == write_op + || op_queue_[write_op].has_operation(descriptor)) + ev.events |= POLLOUT; + if (op_type == except_op + || op_queue_[except_op].has_operation(descriptor)) + ev.events |= POLLPRI; + interrupter_.interrupt(); + } +} + +void dev_poll_reactor::cancel_ops(socket_type descriptor, + dev_poll_reactor::per_descriptor_data&) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + cancel_ops_unlocked(descriptor, asio::error::operation_aborted); +} + +void dev_poll_reactor::deregister_descriptor(socket_type descriptor, + dev_poll_reactor::per_descriptor_data&, bool) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + // Remove the descriptor from /dev/poll. + ::pollfd& ev = add_pending_event_change(descriptor); + ev.events = POLLREMOVE; + interrupter_.interrupt(); + + // Cancel any outstanding operations associated with the descriptor. + cancel_ops_unlocked(descriptor, asio::error::operation_aborted); +} + +void dev_poll_reactor::deregister_internal_descriptor( + socket_type descriptor, dev_poll_reactor::per_descriptor_data&) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + // Remove the descriptor from /dev/poll. Since this function is only called + // during a fork, we can apply the change immediately. + ::pollfd ev = { 0, 0, 0 }; + ev.fd = descriptor; + ev.events = POLLREMOVE; + ev.revents = 0; + ::write(dev_poll_fd_, &ev, sizeof(ev)); + + // Destroy all operations associated with the descriptor. + op_queue ops; + asio::error_code ec; + for (int i = 0; i < max_ops; ++i) + op_queue_[i].cancel_operations(descriptor, ops, ec); +} + +void dev_poll_reactor::cleanup_descriptor_data( + dev_poll_reactor::per_descriptor_data&) +{ +} + +void dev_poll_reactor::run(long usec, op_queue& ops) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + // We can return immediately if there's no work to do and the reactor is + // not supposed to block. + if (usec == 0 && op_queue_[read_op].empty() && op_queue_[write_op].empty() + && op_queue_[except_op].empty() && timer_queues_.all_empty()) + return; + + // Write the pending event registration changes to the /dev/poll descriptor. + std::size_t events_size = sizeof(::pollfd) * pending_event_changes_.size(); + if (events_size > 0) + { + errno = 0; + int result = ::write(dev_poll_fd_, + &pending_event_changes_[0], events_size); + if (result != static_cast(events_size)) + { + asio::error_code ec = asio::error_code( + errno, asio::error::get_system_category()); + for (std::size_t i = 0; i < pending_event_changes_.size(); ++i) + { + int descriptor = pending_event_changes_[i].fd; + for (int j = 0; j < max_ops; ++j) + op_queue_[j].cancel_operations(descriptor, ops, ec); + } + } + pending_event_changes_.clear(); + pending_event_change_index_.clear(); + } + + // Calculate timeout. + int timeout; + if (usec == 0) + timeout = 0; + else + { + timeout = (usec < 0) ? -1 : ((usec - 1) / 1000 + 1); + timeout = get_timeout(timeout); + } + lock.unlock(); + + // Block on the /dev/poll descriptor. + ::pollfd events[128] = { { 0, 0, 0 } }; + ::dvpoll dp = { 0, 0, 0 }; + dp.dp_fds = events; + dp.dp_nfds = 128; + dp.dp_timeout = timeout; + int num_events = ::ioctl(dev_poll_fd_, DP_POLL, &dp); + + lock.lock(); + + // Dispatch the waiting events. + for (int i = 0; i < num_events; ++i) + { + int descriptor = events[i].fd; + if (descriptor == interrupter_.read_descriptor()) + { + interrupter_.reset(); + } + else + { + bool more_reads = false; + bool more_writes = false; + bool more_except = false; + + // Exception operations must be processed first to ensure that any + // out-of-band data is read before normal data. + if (events[i].events & (POLLPRI | POLLERR | POLLHUP)) + more_except = + op_queue_[except_op].perform_operations(descriptor, ops); + else + more_except = op_queue_[except_op].has_operation(descriptor); + + if (events[i].events & (POLLIN | POLLERR | POLLHUP)) + more_reads = op_queue_[read_op].perform_operations(descriptor, ops); + else + more_reads = op_queue_[read_op].has_operation(descriptor); + + if (events[i].events & (POLLOUT | POLLERR | POLLHUP)) + more_writes = op_queue_[write_op].perform_operations(descriptor, ops); + else + more_writes = op_queue_[write_op].has_operation(descriptor); + + if ((events[i].events & (POLLERR | POLLHUP)) != 0 + && !more_except && !more_reads && !more_writes) + { + // If we have an event and no operations associated with the + // descriptor then we need to delete the descriptor from /dev/poll. + // The poll operation can produce POLLHUP or POLLERR events when there + // is no operation pending, so if we do not remove the descriptor we + // can end up in a tight polling loop. + ::pollfd ev = { 0, 0, 0 }; + ev.fd = descriptor; + ev.events = POLLREMOVE; + ev.revents = 0; + ::write(dev_poll_fd_, &ev, sizeof(ev)); + } + else + { + ::pollfd ev = { 0, 0, 0 }; + ev.fd = descriptor; + ev.events = POLLERR | POLLHUP; + if (more_reads) + ev.events |= POLLIN; + if (more_writes) + ev.events |= POLLOUT; + if (more_except) + ev.events |= POLLPRI; + ev.revents = 0; + int result = ::write(dev_poll_fd_, &ev, sizeof(ev)); + if (result != sizeof(ev)) + { + asio::error_code ec(errno, + asio::error::get_system_category()); + for (int j = 0; j < max_ops; ++j) + op_queue_[j].cancel_operations(descriptor, ops, ec); + } + } + } + } + timer_queues_.get_ready_timers(ops); +} + +void dev_poll_reactor::interrupt() +{ + interrupter_.interrupt(); +} + +int dev_poll_reactor::do_dev_poll_create() +{ + int fd = ::open("/dev/poll", O_RDWR); + if (fd == -1) + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "/dev/poll"); + } + return fd; +} + +void dev_poll_reactor::do_add_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.insert(&queue); +} + +void dev_poll_reactor::do_remove_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.erase(&queue); +} + +int dev_poll_reactor::get_timeout(int msec) +{ + // By default we will wait no longer than 5 minutes. This will ensure that + // any changes to the system clock are detected after no longer than this. + const int max_msec = 5 * 60 * 1000; + return timer_queues_.wait_duration_msec( + (msec < 0 || max_msec < msec) ? max_msec : msec); +} + +void dev_poll_reactor::cancel_ops_unlocked(socket_type descriptor, + const asio::error_code& ec) +{ + bool need_interrupt = false; + op_queue ops; + for (int i = 0; i < max_ops; ++i) + need_interrupt = op_queue_[i].cancel_operations( + descriptor, ops, ec) || need_interrupt; + scheduler_.post_deferred_completions(ops); + if (need_interrupt) + interrupter_.interrupt(); +} + +::pollfd& dev_poll_reactor::add_pending_event_change(int descriptor) +{ + hash_map::iterator iter + = pending_event_change_index_.find(descriptor); + if (iter == pending_event_change_index_.end()) + { + std::size_t index = pending_event_changes_.size(); + pending_event_changes_.reserve(pending_event_changes_.size() + 1); + pending_event_change_index_.insert(std::make_pair(descriptor, index)); + pending_event_changes_.push_back(::pollfd()); + pending_event_changes_[index].fd = descriptor; + pending_event_changes_[index].revents = 0; + return pending_event_changes_[index]; + } + else + { + return pending_event_changes_[iter->second]; + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_DEV_POLL) + +#endif // ASIO_DETAIL_IMPL_DEV_POLL_REACTOR_IPP diff --git a/include/asio/include/asio/detail/impl/epoll_reactor.hpp b/include/asio/include/asio/detail/impl/epoll_reactor.hpp new file mode 100644 index 0000000..42d52a7 --- /dev/null +++ b/include/asio/include/asio/detail/impl/epoll_reactor.hpp @@ -0,0 +1,89 @@ +// +// detail/impl/epoll_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP +#define ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#if defined(ASIO_HAS_EPOLL) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +void epoll_reactor::add_timer_queue(timer_queue& queue) +{ + do_add_timer_queue(queue); +} + +template +void epoll_reactor::remove_timer_queue(timer_queue& queue) +{ + do_remove_timer_queue(queue); +} + +template +void epoll_reactor::schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op) +{ + mutex::scoped_lock lock(mutex_); + + if (shutdown_) + { + scheduler_.post_immediate_completion(op, false); + return; + } + + bool earliest = queue.enqueue_timer(time, timer, op); + scheduler_.work_started(); + if (earliest) + update_timeout(); +} + +template +std::size_t epoll_reactor::cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled) +{ + mutex::scoped_lock lock(mutex_); + op_queue ops; + std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); + lock.unlock(); + scheduler_.post_deferred_completions(ops); + return n; +} + +template +void epoll_reactor::move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source) +{ + mutex::scoped_lock lock(mutex_); + op_queue ops; + queue.cancel_timer(target, ops); + queue.move_timer(target, source); + lock.unlock(); + scheduler_.post_deferred_completions(ops); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_EPOLL) + +#endif // ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP diff --git a/include/asio/include/asio/detail/impl/epoll_reactor.ipp b/include/asio/include/asio/detail/impl/epoll_reactor.ipp new file mode 100644 index 0000000..528968d --- /dev/null +++ b/include/asio/include/asio/detail/impl/epoll_reactor.ipp @@ -0,0 +1,787 @@ +// +// detail/impl/epoll_reactor.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_EPOLL_REACTOR_IPP +#define ASIO_DETAIL_IMPL_EPOLL_REACTOR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_EPOLL) + +#include +#include +#include "asio/detail/epoll_reactor.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#if defined(ASIO_HAS_TIMERFD) +# include +#endif // defined(ASIO_HAS_TIMERFD) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +epoll_reactor::epoll_reactor(asio::execution_context& ctx) + : execution_context_service_base(ctx), + scheduler_(use_service(ctx)), + mutex_(ASIO_CONCURRENCY_HINT_IS_LOCKING( + REACTOR_REGISTRATION, scheduler_.concurrency_hint())), + interrupter_(), + epoll_fd_(do_epoll_create()), + timer_fd_(do_timerfd_create()), + shutdown_(false), + registered_descriptors_mutex_(mutex_.enabled()) +{ + // Add the interrupter's descriptor to epoll. + epoll_event ev = { 0, { 0 } }; + ev.events = EPOLLIN | EPOLLERR | EPOLLET; + ev.data.ptr = &interrupter_; + epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, interrupter_.read_descriptor(), &ev); + interrupter_.interrupt(); + + // Add the timer descriptor to epoll. + if (timer_fd_ != -1) + { + ev.events = EPOLLIN | EPOLLERR; + ev.data.ptr = &timer_fd_; + epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, timer_fd_, &ev); + } +} + +epoll_reactor::~epoll_reactor() +{ + if (epoll_fd_ != -1) + close(epoll_fd_); + if (timer_fd_ != -1) + close(timer_fd_); +} + +void epoll_reactor::shutdown() +{ + mutex::scoped_lock lock(mutex_); + shutdown_ = true; + lock.unlock(); + + op_queue ops; + + while (descriptor_state* state = registered_descriptors_.first()) + { + for (int i = 0; i < max_ops; ++i) + ops.push(state->op_queue_[i]); + state->shutdown_ = true; + registered_descriptors_.free(state); + } + + timer_queues_.get_all_timers(ops); + + scheduler_.abandon_operations(ops); +} + +void epoll_reactor::notify_fork( + asio::execution_context::fork_event fork_ev) +{ + if (fork_ev == asio::execution_context::fork_child) + { + if (epoll_fd_ != -1) + ::close(epoll_fd_); + epoll_fd_ = -1; + epoll_fd_ = do_epoll_create(); + + if (timer_fd_ != -1) + ::close(timer_fd_); + timer_fd_ = -1; + timer_fd_ = do_timerfd_create(); + + interrupter_.recreate(); + + // Add the interrupter's descriptor to epoll. + epoll_event ev = { 0, { 0 } }; + ev.events = EPOLLIN | EPOLLERR | EPOLLET; + ev.data.ptr = &interrupter_; + epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, interrupter_.read_descriptor(), &ev); + interrupter_.interrupt(); + + // Add the timer descriptor to epoll. + if (timer_fd_ != -1) + { + ev.events = EPOLLIN | EPOLLERR; + ev.data.ptr = &timer_fd_; + epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, timer_fd_, &ev); + } + + update_timeout(); + + // Re-register all descriptors with epoll. + mutex::scoped_lock descriptors_lock(registered_descriptors_mutex_); + for (descriptor_state* state = registered_descriptors_.first(); + state != 0; state = state->next_) + { + ev.events = state->registered_events_; + ev.data.ptr = state; + int result = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, state->descriptor_, &ev); + if (result != 0) + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "epoll re-registration"); + } + } + } +} + +void epoll_reactor::init_task() +{ + scheduler_.init_task(); +} + +int epoll_reactor::register_descriptor(socket_type descriptor, + epoll_reactor::per_descriptor_data& descriptor_data) +{ + descriptor_data = allocate_descriptor_state(); + + ASIO_HANDLER_REACTOR_REGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + { + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + descriptor_data->reactor_ = this; + descriptor_data->descriptor_ = descriptor; + descriptor_data->shutdown_ = false; + for (int i = 0; i < max_ops; ++i) + descriptor_data->try_speculative_[i] = true; + } + + epoll_event ev = { 0, { 0 } }; + ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLPRI | EPOLLET; + descriptor_data->registered_events_ = ev.events; + ev.data.ptr = descriptor_data; + int result = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, descriptor, &ev); + if (result != 0) + { + if (errno == EPERM) + { + // This file descriptor type is not supported by epoll. However, if it is + // a regular file then operations on it will not block. We will allow + // this descriptor to be used and fail later if an operation on it would + // otherwise require a trip through the reactor. + descriptor_data->registered_events_ = 0; + return 0; + } + return errno; + } + + return 0; +} + +int epoll_reactor::register_internal_descriptor( + int op_type, socket_type descriptor, + epoll_reactor::per_descriptor_data& descriptor_data, reactor_op* op) +{ + descriptor_data = allocate_descriptor_state(); + + ASIO_HANDLER_REACTOR_REGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + { + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + descriptor_data->reactor_ = this; + descriptor_data->descriptor_ = descriptor; + descriptor_data->shutdown_ = false; + descriptor_data->op_queue_[op_type].push(op); + for (int i = 0; i < max_ops; ++i) + descriptor_data->try_speculative_[i] = true; + } + + epoll_event ev = { 0, { 0 } }; + ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLPRI | EPOLLET; + descriptor_data->registered_events_ = ev.events; + ev.data.ptr = descriptor_data; + int result = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, descriptor, &ev); + if (result != 0) + return errno; + + return 0; +} + +void epoll_reactor::move_descriptor(socket_type, + epoll_reactor::per_descriptor_data& target_descriptor_data, + epoll_reactor::per_descriptor_data& source_descriptor_data) +{ + target_descriptor_data = source_descriptor_data; + source_descriptor_data = 0; +} + +void epoll_reactor::start_op(int op_type, socket_type descriptor, + epoll_reactor::per_descriptor_data& descriptor_data, reactor_op* op, + bool is_continuation, bool allow_speculative) +{ + if (!descriptor_data) + { + op->ec_ = asio::error::bad_descriptor; + post_immediate_completion(op, is_continuation); + return; + } + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + if (descriptor_data->shutdown_) + { + post_immediate_completion(op, is_continuation); + return; + } + + if (descriptor_data->op_queue_[op_type].empty()) + { + if (allow_speculative + && (op_type != read_op + || descriptor_data->op_queue_[except_op].empty())) + { + if (descriptor_data->try_speculative_[op_type]) + { + if (reactor_op::status status = op->perform()) + { + if (status == reactor_op::done_and_exhausted) + if (descriptor_data->registered_events_ != 0) + descriptor_data->try_speculative_[op_type] = false; + descriptor_lock.unlock(); + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + } + + if (descriptor_data->registered_events_ == 0) + { + op->ec_ = asio::error::operation_not_supported; + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + if (op_type == write_op) + { + if ((descriptor_data->registered_events_ & EPOLLOUT) == 0) + { + epoll_event ev = { 0, { 0 } }; + ev.events = descriptor_data->registered_events_ | EPOLLOUT; + ev.data.ptr = descriptor_data; + if (epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, descriptor, &ev) == 0) + { + descriptor_data->registered_events_ |= ev.events; + } + else + { + op->ec_ = asio::error_code(errno, + asio::error::get_system_category()); + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + } + } + } + else if (descriptor_data->registered_events_ == 0) + { + op->ec_ = asio::error::operation_not_supported; + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + else + { + if (op_type == write_op) + { + descriptor_data->registered_events_ |= EPOLLOUT; + } + + epoll_event ev = { 0, { 0 } }; + ev.events = descriptor_data->registered_events_; + ev.data.ptr = descriptor_data; + epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, descriptor, &ev); + } + } + + descriptor_data->op_queue_[op_type].push(op); + scheduler_.work_started(); +} + +void epoll_reactor::cancel_ops(socket_type, + epoll_reactor::per_descriptor_data& descriptor_data) +{ + if (!descriptor_data) + return; + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + op_queue ops; + for (int i = 0; i < max_ops; ++i) + { + while (reactor_op* op = descriptor_data->op_queue_[i].front()) + { + op->ec_ = asio::error::operation_aborted; + descriptor_data->op_queue_[i].pop(); + ops.push(op); + } + } + + descriptor_lock.unlock(); + + scheduler_.post_deferred_completions(ops); +} + +void epoll_reactor::deregister_descriptor(socket_type descriptor, + epoll_reactor::per_descriptor_data& descriptor_data, bool closing) +{ + if (!descriptor_data) + return; + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + if (!descriptor_data->shutdown_) + { + if (closing) + { + // The descriptor will be automatically removed from the epoll set when + // it is closed. + } + else if (descriptor_data->registered_events_ != 0) + { + epoll_event ev = { 0, { 0 } }; + epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, descriptor, &ev); + } + + op_queue ops; + for (int i = 0; i < max_ops; ++i) + { + while (reactor_op* op = descriptor_data->op_queue_[i].front()) + { + op->ec_ = asio::error::operation_aborted; + descriptor_data->op_queue_[i].pop(); + ops.push(op); + } + } + + descriptor_data->descriptor_ = -1; + descriptor_data->shutdown_ = true; + + descriptor_lock.unlock(); + + ASIO_HANDLER_REACTOR_DEREGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + scheduler_.post_deferred_completions(ops); + + // Leave descriptor_data set so that it will be freed by the subsequent + // call to cleanup_descriptor_data. + } + else + { + // We are shutting down, so prevent cleanup_descriptor_data from freeing + // the descriptor_data object and let the destructor free it instead. + descriptor_data = 0; + } +} + +void epoll_reactor::deregister_internal_descriptor(socket_type descriptor, + epoll_reactor::per_descriptor_data& descriptor_data) +{ + if (!descriptor_data) + return; + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + if (!descriptor_data->shutdown_) + { + epoll_event ev = { 0, { 0 } }; + epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, descriptor, &ev); + + op_queue ops; + for (int i = 0; i < max_ops; ++i) + ops.push(descriptor_data->op_queue_[i]); + + descriptor_data->descriptor_ = -1; + descriptor_data->shutdown_ = true; + + descriptor_lock.unlock(); + + ASIO_HANDLER_REACTOR_DEREGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + // Leave descriptor_data set so that it will be freed by the subsequent + // call to cleanup_descriptor_data. + } + else + { + // We are shutting down, so prevent cleanup_descriptor_data from freeing + // the descriptor_data object and let the destructor free it instead. + descriptor_data = 0; + } +} + +void epoll_reactor::cleanup_descriptor_data( + per_descriptor_data& descriptor_data) +{ + if (descriptor_data) + { + free_descriptor_state(descriptor_data); + descriptor_data = 0; + } +} + +void epoll_reactor::run(long usec, op_queue& ops) +{ + // This code relies on the fact that the scheduler queues the reactor task + // behind all descriptor operations generated by this function. This means, + // that by the time we reach this point, any previously returned descriptor + // operations have already been dequeued. Therefore it is now safe for us to + // reuse and return them for the scheduler to queue again. + + // Calculate timeout. Check the timer queues only if timerfd is not in use. + int timeout; + if (usec == 0) + timeout = 0; + else + { + timeout = (usec < 0) ? -1 : ((usec - 1) / 1000 + 1); + if (timer_fd_ == -1) + { + mutex::scoped_lock lock(mutex_); + timeout = get_timeout(timeout); + } + } + + // Block on the epoll descriptor. + epoll_event events[128]; + int num_events = epoll_wait(epoll_fd_, events, 128, timeout); + +#if defined(ASIO_ENABLE_HANDLER_TRACKING) + // Trace the waiting events. + for (int i = 0; i < num_events; ++i) + { + void* ptr = events[i].data.ptr; + if (ptr == &interrupter_) + { + // Ignore. + } +# if defined(ASIO_HAS_TIMERFD) + else if (ptr == &timer_fd_) + { + // Ignore. + } +# endif // defined(ASIO_HAS_TIMERFD) + else + { + unsigned event_mask = 0; + if ((events[i].events & EPOLLIN) != 0) + event_mask |= ASIO_HANDLER_REACTOR_READ_EVENT; + if ((events[i].events & EPOLLOUT)) + event_mask |= ASIO_HANDLER_REACTOR_WRITE_EVENT; + if ((events[i].events & (EPOLLERR | EPOLLHUP)) != 0) + event_mask |= ASIO_HANDLER_REACTOR_ERROR_EVENT; + ASIO_HANDLER_REACTOR_EVENTS((context(), + reinterpret_cast(ptr), event_mask)); + } + } +#endif // defined(ASIO_ENABLE_HANDLER_TRACKING) + +#if defined(ASIO_HAS_TIMERFD) + bool check_timers = (timer_fd_ == -1); +#else // defined(ASIO_HAS_TIMERFD) + bool check_timers = true; +#endif // defined(ASIO_HAS_TIMERFD) + + // Dispatch the waiting events. + for (int i = 0; i < num_events; ++i) + { + void* ptr = events[i].data.ptr; + if (ptr == &interrupter_) + { + // No need to reset the interrupter since we're leaving the descriptor + // in a ready-to-read state and relying on edge-triggered notifications + // to make it so that we only get woken up when the descriptor's epoll + // registration is updated. + +#if defined(ASIO_HAS_TIMERFD) + if (timer_fd_ == -1) + check_timers = true; +#else // defined(ASIO_HAS_TIMERFD) + check_timers = true; +#endif // defined(ASIO_HAS_TIMERFD) + } +#if defined(ASIO_HAS_TIMERFD) + else if (ptr == &timer_fd_) + { + check_timers = true; + } +#endif // defined(ASIO_HAS_TIMERFD) + else + { + // The descriptor operation doesn't count as work in and of itself, so we + // don't call work_started() here. This still allows the scheduler to + // stop if the only remaining operations are descriptor operations. + descriptor_state* descriptor_data = static_cast(ptr); + if (!ops.is_enqueued(descriptor_data)) + { + descriptor_data->set_ready_events(events[i].events); + ops.push(descriptor_data); + } + else + { + descriptor_data->add_ready_events(events[i].events); + } + } + } + + if (check_timers) + { + mutex::scoped_lock common_lock(mutex_); + timer_queues_.get_ready_timers(ops); + +#if defined(ASIO_HAS_TIMERFD) + if (timer_fd_ != -1) + { + itimerspec new_timeout; + itimerspec old_timeout; + int flags = get_timeout(new_timeout); + timerfd_settime(timer_fd_, flags, &new_timeout, &old_timeout); + } +#endif // defined(ASIO_HAS_TIMERFD) + } +} + +void epoll_reactor::interrupt() +{ + epoll_event ev = { 0, { 0 } }; + ev.events = EPOLLIN | EPOLLERR | EPOLLET; + ev.data.ptr = &interrupter_; + epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, interrupter_.read_descriptor(), &ev); +} + +int epoll_reactor::do_epoll_create() +{ +#if defined(EPOLL_CLOEXEC) + int fd = epoll_create1(EPOLL_CLOEXEC); +#else // defined(EPOLL_CLOEXEC) + int fd = -1; + errno = EINVAL; +#endif // defined(EPOLL_CLOEXEC) + + if (fd == -1 && (errno == EINVAL || errno == ENOSYS)) + { + fd = epoll_create(epoll_size); + if (fd != -1) + ::fcntl(fd, F_SETFD, FD_CLOEXEC); + } + + if (fd == -1) + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "epoll"); + } + + return fd; +} + +int epoll_reactor::do_timerfd_create() +{ +#if defined(ASIO_HAS_TIMERFD) +# if defined(TFD_CLOEXEC) + int fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); +# else // defined(TFD_CLOEXEC) + int fd = -1; + errno = EINVAL; +# endif // defined(TFD_CLOEXEC) + + if (fd == -1 && errno == EINVAL) + { + fd = timerfd_create(CLOCK_MONOTONIC, 0); + if (fd != -1) + ::fcntl(fd, F_SETFD, FD_CLOEXEC); + } + + return fd; +#else // defined(ASIO_HAS_TIMERFD) + return -1; +#endif // defined(ASIO_HAS_TIMERFD) +} + +epoll_reactor::descriptor_state* epoll_reactor::allocate_descriptor_state() +{ + mutex::scoped_lock descriptors_lock(registered_descriptors_mutex_); + return registered_descriptors_.alloc(ASIO_CONCURRENCY_HINT_IS_LOCKING( + REACTOR_IO, scheduler_.concurrency_hint())); +} + +void epoll_reactor::free_descriptor_state(epoll_reactor::descriptor_state* s) +{ + mutex::scoped_lock descriptors_lock(registered_descriptors_mutex_); + registered_descriptors_.free(s); +} + +void epoll_reactor::do_add_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.insert(&queue); +} + +void epoll_reactor::do_remove_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.erase(&queue); +} + +void epoll_reactor::update_timeout() +{ +#if defined(ASIO_HAS_TIMERFD) + if (timer_fd_ != -1) + { + itimerspec new_timeout; + itimerspec old_timeout; + int flags = get_timeout(new_timeout); + timerfd_settime(timer_fd_, flags, &new_timeout, &old_timeout); + return; + } +#endif // defined(ASIO_HAS_TIMERFD) + interrupt(); +} + +int epoll_reactor::get_timeout(int msec) +{ + // By default we will wait no longer than 5 minutes. This will ensure that + // any changes to the system clock are detected after no longer than this. + const int max_msec = 5 * 60 * 1000; + return timer_queues_.wait_duration_msec( + (msec < 0 || max_msec < msec) ? max_msec : msec); +} + +#if defined(ASIO_HAS_TIMERFD) +int epoll_reactor::get_timeout(itimerspec& ts) +{ + ts.it_interval.tv_sec = 0; + ts.it_interval.tv_nsec = 0; + + long usec = timer_queues_.wait_duration_usec(5 * 60 * 1000 * 1000); + ts.it_value.tv_sec = usec / 1000000; + ts.it_value.tv_nsec = usec ? (usec % 1000000) * 1000 : 1; + + return usec ? 0 : TFD_TIMER_ABSTIME; +} +#endif // defined(ASIO_HAS_TIMERFD) + +struct epoll_reactor::perform_io_cleanup_on_block_exit +{ + explicit perform_io_cleanup_on_block_exit(epoll_reactor* r) + : reactor_(r), first_op_(0) + { + } + + ~perform_io_cleanup_on_block_exit() + { + if (first_op_) + { + // Post the remaining completed operations for invocation. + if (!ops_.empty()) + reactor_->scheduler_.post_deferred_completions(ops_); + + // A user-initiated operation has completed, but there's no need to + // explicitly call work_finished() here. Instead, we'll take advantage of + // the fact that the scheduler will call work_finished() once we return. + } + else + { + // No user-initiated operations have completed, so we need to compensate + // for the work_finished() call that the scheduler will make once this + // operation returns. + reactor_->scheduler_.compensating_work_started(); + } + } + + epoll_reactor* reactor_; + op_queue ops_; + operation* first_op_; +}; + +epoll_reactor::descriptor_state::descriptor_state(bool locking) + : operation(&epoll_reactor::descriptor_state::do_complete), + mutex_(locking) +{ +} + +operation* epoll_reactor::descriptor_state::perform_io(uint32_t events) +{ + mutex_.lock(); + perform_io_cleanup_on_block_exit io_cleanup(reactor_); + mutex::scoped_lock descriptor_lock(mutex_, mutex::scoped_lock::adopt_lock); + + // Exception operations must be processed first to ensure that any + // out-of-band data is read before normal data. + static const int flag[max_ops] = { EPOLLIN, EPOLLOUT, EPOLLPRI }; + for (int j = max_ops - 1; j >= 0; --j) + { + if (events & (flag[j] | EPOLLERR | EPOLLHUP)) + { + try_speculative_[j] = true; + while (reactor_op* op = op_queue_[j].front()) + { + if (reactor_op::status status = op->perform()) + { + op_queue_[j].pop(); + io_cleanup.ops_.push(op); + if (status == reactor_op::done_and_exhausted) + { + try_speculative_[j] = false; + break; + } + } + else + break; + } + } + } + + // The first operation will be returned for completion now. The others will + // be posted for later by the io_cleanup object's destructor. + io_cleanup.first_op_ = io_cleanup.ops_.front(); + io_cleanup.ops_.pop(); + return io_cleanup.first_op_; +} + +void epoll_reactor::descriptor_state::do_complete( + void* owner, operation* base, + const asio::error_code& ec, std::size_t bytes_transferred) +{ + if (owner) + { + descriptor_state* descriptor_data = static_cast(base); + uint32_t events = static_cast(bytes_transferred); + if (operation* op = descriptor_data->perform_io(events)) + { + op->complete(owner, ec, 0); + } + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_EPOLL) + +#endif // ASIO_DETAIL_IMPL_EPOLL_REACTOR_IPP diff --git a/include/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp b/include/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp new file mode 100644 index 0000000..6f9fdb9 --- /dev/null +++ b/include/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp @@ -0,0 +1,169 @@ +// +// detail/impl/eventfd_select_interrupter.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_EVENTFD_SELECT_INTERRUPTER_IPP +#define ASIO_DETAIL_IMPL_EVENTFD_SELECT_INTERRUPTER_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_EVENTFD) + +#include +#include +#include +#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 +# include +#else // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 +# include +#endif // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 +#include "asio/detail/cstdint.hpp" +#include "asio/detail/eventfd_select_interrupter.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +eventfd_select_interrupter::eventfd_select_interrupter() +{ + open_descriptors(); +} + +void eventfd_select_interrupter::open_descriptors() +{ +#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 + write_descriptor_ = read_descriptor_ = syscall(__NR_eventfd, 0); + if (read_descriptor_ != -1) + { + ::fcntl(read_descriptor_, F_SETFL, O_NONBLOCK); + ::fcntl(read_descriptor_, F_SETFD, FD_CLOEXEC); + } +#else // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 +# if defined(EFD_CLOEXEC) && defined(EFD_NONBLOCK) + write_descriptor_ = read_descriptor_ = + ::eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK); +# else // defined(EFD_CLOEXEC) && defined(EFD_NONBLOCK) + errno = EINVAL; + write_descriptor_ = read_descriptor_ = -1; +# endif // defined(EFD_CLOEXEC) && defined(EFD_NONBLOCK) + if (read_descriptor_ == -1 && errno == EINVAL) + { + write_descriptor_ = read_descriptor_ = ::eventfd(0, 0); + if (read_descriptor_ != -1) + { + ::fcntl(read_descriptor_, F_SETFL, O_NONBLOCK); + ::fcntl(read_descriptor_, F_SETFD, FD_CLOEXEC); + } + } +#endif // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 + + if (read_descriptor_ == -1) + { + int pipe_fds[2]; + if (pipe(pipe_fds) == 0) + { + read_descriptor_ = pipe_fds[0]; + ::fcntl(read_descriptor_, F_SETFL, O_NONBLOCK); + ::fcntl(read_descriptor_, F_SETFD, FD_CLOEXEC); + write_descriptor_ = pipe_fds[1]; + ::fcntl(write_descriptor_, F_SETFL, O_NONBLOCK); + ::fcntl(write_descriptor_, F_SETFD, FD_CLOEXEC); + } + else + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "eventfd_select_interrupter"); + } + } +} + +eventfd_select_interrupter::~eventfd_select_interrupter() +{ + close_descriptors(); +} + +void eventfd_select_interrupter::close_descriptors() +{ + if (write_descriptor_ != -1 && write_descriptor_ != read_descriptor_) + ::close(write_descriptor_); + if (read_descriptor_ != -1) + ::close(read_descriptor_); +} + +void eventfd_select_interrupter::recreate() +{ + close_descriptors(); + + write_descriptor_ = -1; + read_descriptor_ = -1; + + open_descriptors(); +} + +void eventfd_select_interrupter::interrupt() +{ + uint64_t counter(1UL); + int result = ::write(write_descriptor_, &counter, sizeof(uint64_t)); + (void)result; +} + +bool eventfd_select_interrupter::reset() +{ + if (write_descriptor_ == read_descriptor_) + { + for (;;) + { + // Only perform one read. The kernel maintains an atomic counter. + uint64_t counter(0); + errno = 0; + int bytes_read = ::read(read_descriptor_, &counter, sizeof(uint64_t)); + if (bytes_read < 0 && errno == EINTR) + continue; + return true; + } + } + else + { + for (;;) + { + // Clear all data from the pipe. + char data[1024]; + int bytes_read = ::read(read_descriptor_, data, sizeof(data)); + if (bytes_read == sizeof(data)) + continue; + if (bytes_read > 0) + return true; + if (bytes_read == 0) + return false; + if (errno == EINTR) + continue; + if (errno == EWOULDBLOCK || errno == EAGAIN) + return true; + return false; + } + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_EVENTFD) + +#endif // ASIO_DETAIL_IMPL_EVENTFD_SELECT_INTERRUPTER_IPP diff --git a/include/asio/include/asio/detail/impl/handler_tracking.ipp b/include/asio/include/asio/detail/impl/handler_tracking.ipp new file mode 100644 index 0000000..14f64ab --- /dev/null +++ b/include/asio/include/asio/detail/impl/handler_tracking.ipp @@ -0,0 +1,396 @@ +// +// detail/impl/handler_tracking.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_HANDLER_TRACKING_IPP +#define ASIO_DETAIL_IMPL_HANDLER_TRACKING_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_CUSTOM_HANDLER_TRACKING) + +// The handler tracking implementation is provided by the user-specified header. + +#elif defined(ASIO_ENABLE_HANDLER_TRACKING) + +#include +#include +#include "asio/detail/handler_tracking.hpp" + +#if defined(ASIO_HAS_BOOST_DATE_TIME) +# include "asio/time_traits.hpp" +#elif defined(ASIO_HAS_CHRONO) +# include "asio/detail/chrono.hpp" +# include "asio/detail/chrono_time_traits.hpp" +# include "asio/wait_traits.hpp" +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + +#if defined(ASIO_WINDOWS_RUNTIME) +# include "asio/detail/socket_types.hpp" +#elif !defined(ASIO_WINDOWS) +# include +#endif // !defined(ASIO_WINDOWS) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct handler_tracking_timestamp +{ + uint64_t seconds; + uint64_t microseconds; + + handler_tracking_timestamp() + { +#if defined(ASIO_HAS_BOOST_DATE_TIME) + boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1)); + boost::posix_time::time_duration now = + boost::posix_time::microsec_clock::universal_time() - epoch; +#elif defined(ASIO_HAS_CHRONO) + typedef chrono_time_traits > traits_helper; + traits_helper::posix_time_duration now( + chrono::system_clock::now().time_since_epoch()); +#endif + seconds = static_cast(now.total_seconds()); + microseconds = static_cast(now.total_microseconds() % 1000000); + } +}; + +struct handler_tracking::tracking_state +{ + static_mutex mutex_; + uint64_t next_id_; + tss_ptr* current_completion_; + tss_ptr* current_location_; +}; + +handler_tracking::tracking_state* handler_tracking::get_state() +{ + static tracking_state state = { ASIO_STATIC_MUTEX_INIT, 1, 0, 0 }; + return &state; +} + +void handler_tracking::init() +{ + static tracking_state* state = get_state(); + + state->mutex_.init(); + + static_mutex::scoped_lock lock(state->mutex_); + if (state->current_completion_ == 0) + state->current_completion_ = new tss_ptr; + if (state->current_location_ == 0) + state->current_location_ = new tss_ptr; +} + +handler_tracking::location::location( + const char* file, int line, const char* func) + : file_(file), + line_(line), + func_(func), + next_(*get_state()->current_location_) +{ + if (file_) + *get_state()->current_location_ = this; +} + +handler_tracking::location::~location() +{ + if (file_) + *get_state()->current_location_ = next_; +} + +void handler_tracking::creation(execution_context&, + handler_tracking::tracked_handler& h, + const char* object_type, void* object, + uintmax_t /*native_handle*/, const char* op_name) +{ + static tracking_state* state = get_state(); + + static_mutex::scoped_lock lock(state->mutex_); + h.id_ = state->next_id_++; + lock.unlock(); + + handler_tracking_timestamp timestamp; + + uint64_t current_id = 0; + if (completion* current_completion = *state->current_completion_) + current_id = current_completion->id_; + + for (location* current_location = *state->current_location_; + current_location; current_location = current_location->next_) + { + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|%I64u^%I64u|%s%s%.80s%s(%.80s:%d)\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|%llu^%llu|%s%s%.80s%s(%.80s:%d)\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + current_id, h.id_, + current_location == *state->current_location_ ? "in " : "called from ", + current_location->func_ ? "'" : "", + current_location->func_ ? current_location->func_ : "", + current_location->func_ ? "' " : "", + current_location->file_, current_location->line_); + } + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|%I64u*%I64u|%.20s@%p.%.50s\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|%llu*%llu|%.20s@%p.%.50s\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + current_id, h.id_, object_type, object, op_name); +} + +handler_tracking::completion::completion( + const handler_tracking::tracked_handler& h) + : id_(h.id_), + invoked_(false), + next_(*get_state()->current_completion_) +{ + *get_state()->current_completion_ = this; +} + +handler_tracking::completion::~completion() +{ + if (id_) + { + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|%c%I64u|\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|%c%llu|\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + invoked_ ? '!' : '~', id_); + } + + *get_state()->current_completion_ = next_; +} + +void handler_tracking::completion::invocation_begin() +{ + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|>%I64u|\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|>%llu|\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, id_); + + invoked_ = true; +} + +void handler_tracking::completion::invocation_begin( + const asio::error_code& ec) +{ + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|>%llu|ec=%.20s:%d\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + id_, ec.category().name(), ec.value()); + + invoked_ = true; +} + +void handler_tracking::completion::invocation_begin( + const asio::error_code& ec, std::size_t bytes_transferred) +{ + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,bytes_transferred=%I64u\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,bytes_transferred=%llu\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + id_, ec.category().name(), ec.value(), + static_cast(bytes_transferred)); + + invoked_ = true; +} + +void handler_tracking::completion::invocation_begin( + const asio::error_code& ec, int signal_number) +{ + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,signal_number=%d\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,signal_number=%d\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + id_, ec.category().name(), ec.value(), signal_number); + + invoked_ = true; +} + +void handler_tracking::completion::invocation_begin( + const asio::error_code& ec, const char* arg) +{ + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,%.50s\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,%.50s\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + id_, ec.category().name(), ec.value(), arg); + + invoked_ = true; +} + +void handler_tracking::completion::invocation_end() +{ + if (id_) + { + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|<%I64u|\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|<%llu|\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, id_); + + id_ = 0; + } +} + +void handler_tracking::operation(execution_context&, + const char* object_type, void* object, + uintmax_t /*native_handle*/, const char* op_name) +{ + static tracking_state* state = get_state(); + + handler_tracking_timestamp timestamp; + + unsigned long long current_id = 0; + if (completion* current_completion = *state->current_completion_) + current_id = current_completion->id_; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|%I64u|%.20s@%p.%.50s\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|%llu|%.20s@%p.%.50s\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + current_id, object_type, object, op_name); +} + +void handler_tracking::reactor_registration(execution_context& /*context*/, + uintmax_t /*native_handle*/, uintmax_t /*registration*/) +{ +} + +void handler_tracking::reactor_deregistration(execution_context& /*context*/, + uintmax_t /*native_handle*/, uintmax_t /*registration*/) +{ +} + +void handler_tracking::reactor_events(execution_context& /*context*/, + uintmax_t /*native_handle*/, unsigned /*events*/) +{ +} + +void handler_tracking::reactor_operation( + const tracked_handler& h, const char* op_name, + const asio::error_code& ec) +{ + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|.%I64u|%s,ec=%.20s:%d\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|.%llu|%s,ec=%.20s:%d\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + h.id_, op_name, ec.category().name(), ec.value()); +} + +void handler_tracking::reactor_operation( + const tracked_handler& h, const char* op_name, + const asio::error_code& ec, std::size_t bytes_transferred) +{ + handler_tracking_timestamp timestamp; + + write_line( +#if defined(ASIO_WINDOWS) + "@asio|%I64u.%06I64u|.%I64u|%s,ec=%.20s:%d,bytes_transferred=%I64u\n", +#else // defined(ASIO_WINDOWS) + "@asio|%llu.%06llu|.%llu|%s,ec=%.20s:%d,bytes_transferred=%llu\n", +#endif // defined(ASIO_WINDOWS) + timestamp.seconds, timestamp.microseconds, + h.id_, op_name, ec.category().name(), ec.value(), + static_cast(bytes_transferred)); +} + +void handler_tracking::write_line(const char* format, ...) +{ + using namespace std; // For sprintf (or equivalent). + + va_list args; + va_start(args, format); + + char line[256] = ""; +#if defined(ASIO_HAS_SECURE_RTL) + int length = vsprintf_s(line, sizeof(line), format, args); +#else // defined(ASIO_HAS_SECURE_RTL) + int length = vsprintf(line, format, args); +#endif // defined(ASIO_HAS_SECURE_RTL) + + va_end(args); + +#if defined(ASIO_WINDOWS_RUNTIME) + wchar_t wline[256] = L""; + mbstowcs_s(0, wline, sizeof(wline) / sizeof(wchar_t), line, length); + ::OutputDebugStringW(wline); +#elif defined(ASIO_WINDOWS) + HANDLE stderr_handle = ::GetStdHandle(STD_ERROR_HANDLE); + DWORD bytes_written = 0; + ::WriteFile(stderr_handle, line, length, &bytes_written, 0); +#else // defined(ASIO_WINDOWS) + ::write(STDERR_FILENO, line, length); +#endif // defined(ASIO_WINDOWS) +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_ENABLE_HANDLER_TRACKING) + +#endif // ASIO_DETAIL_IMPL_HANDLER_TRACKING_IPP diff --git a/include/asio/include/asio/detail/impl/kqueue_reactor.hpp b/include/asio/include/asio/detail/impl/kqueue_reactor.hpp new file mode 100644 index 0000000..6897dc2 --- /dev/null +++ b/include/asio/include/asio/detail/impl/kqueue_reactor.hpp @@ -0,0 +1,93 @@ +// +// detail/impl/kqueue_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_KQUEUE_REACTOR_HPP +#define ASIO_DETAIL_IMPL_KQUEUE_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_KQUEUE) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +void kqueue_reactor::add_timer_queue(timer_queue& queue) +{ + do_add_timer_queue(queue); +} + +// Remove a timer queue from the reactor. +template +void kqueue_reactor::remove_timer_queue(timer_queue& queue) +{ + do_remove_timer_queue(queue); +} + +template +void kqueue_reactor::schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op) +{ + mutex::scoped_lock lock(mutex_); + + if (shutdown_) + { + scheduler_.post_immediate_completion(op, false); + return; + } + + bool earliest = queue.enqueue_timer(time, timer, op); + scheduler_.work_started(); + if (earliest) + interrupt(); +} + +template +std::size_t kqueue_reactor::cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled) +{ + mutex::scoped_lock lock(mutex_); + op_queue ops; + std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); + lock.unlock(); + scheduler_.post_deferred_completions(ops); + return n; +} + +template +void kqueue_reactor::move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source) +{ + mutex::scoped_lock lock(mutex_); + op_queue ops; + queue.cancel_timer(target, ops); + queue.move_timer(target, source); + lock.unlock(); + scheduler_.post_deferred_completions(ops); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_KQUEUE) + +#endif // ASIO_DETAIL_IMPL_KQUEUE_REACTOR_HPP diff --git a/include/asio/include/asio/detail/impl/kqueue_reactor.ipp b/include/asio/include/asio/detail/impl/kqueue_reactor.ipp new file mode 100644 index 0000000..74de091 --- /dev/null +++ b/include/asio/include/asio/detail/impl/kqueue_reactor.ipp @@ -0,0 +1,570 @@ +// +// detail/impl/kqueue_reactor.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_KQUEUE_REACTOR_IPP +#define ASIO_DETAIL_IMPL_KQUEUE_REACTOR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_KQUEUE) + +#include "asio/detail/kqueue_reactor.hpp" +#include "asio/detail/scheduler.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#if defined(__NetBSD__) +# include +#endif + +#include "asio/detail/push_options.hpp" + +#if defined(__NetBSD__) && __NetBSD_Version__ < 999001500 +# define ASIO_KQUEUE_EV_SET(ev, ident, filt, flags, fflags, data, udata) \ + EV_SET(ev, ident, filt, flags, fflags, data, \ + reinterpret_cast(static_cast(udata))) +#else +# define ASIO_KQUEUE_EV_SET(ev, ident, filt, flags, fflags, data, udata) \ + EV_SET(ev, ident, filt, flags, fflags, data, udata) +#endif + +namespace asio { +namespace detail { + +kqueue_reactor::kqueue_reactor(asio::execution_context& ctx) + : execution_context_service_base(ctx), + scheduler_(use_service(ctx)), + mutex_(ASIO_CONCURRENCY_HINT_IS_LOCKING( + REACTOR_REGISTRATION, scheduler_.concurrency_hint())), + kqueue_fd_(do_kqueue_create()), + interrupter_(), + shutdown_(false), + registered_descriptors_mutex_(mutex_.enabled()) +{ + struct kevent events[1]; + ASIO_KQUEUE_EV_SET(&events[0], interrupter_.read_descriptor(), + EVFILT_READ, EV_ADD, 0, 0, &interrupter_); + if (::kevent(kqueue_fd_, events, 1, 0, 0, 0) == -1) + { + asio::error_code error(errno, + asio::error::get_system_category()); + asio::detail::throw_error(error); + } +} + +kqueue_reactor::~kqueue_reactor() +{ + close(kqueue_fd_); +} + +void kqueue_reactor::shutdown() +{ + mutex::scoped_lock lock(mutex_); + shutdown_ = true; + lock.unlock(); + + op_queue ops; + + while (descriptor_state* state = registered_descriptors_.first()) + { + for (int i = 0; i < max_ops; ++i) + ops.push(state->op_queue_[i]); + state->shutdown_ = true; + registered_descriptors_.free(state); + } + + timer_queues_.get_all_timers(ops); + + scheduler_.abandon_operations(ops); +} + +void kqueue_reactor::notify_fork( + asio::execution_context::fork_event fork_ev) +{ + if (fork_ev == asio::execution_context::fork_child) + { + // The kqueue descriptor is automatically closed in the child. + kqueue_fd_ = -1; + kqueue_fd_ = do_kqueue_create(); + + interrupter_.recreate(); + + struct kevent events[2]; + ASIO_KQUEUE_EV_SET(&events[0], interrupter_.read_descriptor(), + EVFILT_READ, EV_ADD, 0, 0, &interrupter_); + if (::kevent(kqueue_fd_, events, 1, 0, 0, 0) == -1) + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "kqueue interrupter registration"); + } + + // Re-register all descriptors with kqueue. + mutex::scoped_lock descriptors_lock(registered_descriptors_mutex_); + for (descriptor_state* state = registered_descriptors_.first(); + state != 0; state = state->next_) + { + if (state->num_kevents_ > 0) + { + ASIO_KQUEUE_EV_SET(&events[0], state->descriptor_, + EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, state); + ASIO_KQUEUE_EV_SET(&events[1], state->descriptor_, + EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, state); + if (::kevent(kqueue_fd_, events, state->num_kevents_, 0, 0, 0) == -1) + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "kqueue re-registration"); + } + } + } + } +} + +void kqueue_reactor::init_task() +{ + scheduler_.init_task(); +} + +int kqueue_reactor::register_descriptor(socket_type descriptor, + kqueue_reactor::per_descriptor_data& descriptor_data) +{ + descriptor_data = allocate_descriptor_state(); + + ASIO_HANDLER_REACTOR_REGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + mutex::scoped_lock lock(descriptor_data->mutex_); + + descriptor_data->descriptor_ = descriptor; + descriptor_data->num_kevents_ = 0; + descriptor_data->shutdown_ = false; + + return 0; +} + +int kqueue_reactor::register_internal_descriptor( + int op_type, socket_type descriptor, + kqueue_reactor::per_descriptor_data& descriptor_data, reactor_op* op) +{ + descriptor_data = allocate_descriptor_state(); + + ASIO_HANDLER_REACTOR_REGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + mutex::scoped_lock lock(descriptor_data->mutex_); + + descriptor_data->descriptor_ = descriptor; + descriptor_data->num_kevents_ = 1; + descriptor_data->shutdown_ = false; + descriptor_data->op_queue_[op_type].push(op); + + struct kevent events[1]; + ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ, + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); + if (::kevent(kqueue_fd_, events, 1, 0, 0, 0) == -1) + return errno; + + return 0; +} + +void kqueue_reactor::move_descriptor(socket_type, + kqueue_reactor::per_descriptor_data& target_descriptor_data, + kqueue_reactor::per_descriptor_data& source_descriptor_data) +{ + target_descriptor_data = source_descriptor_data; + source_descriptor_data = 0; +} + +void kqueue_reactor::start_op(int op_type, socket_type descriptor, + kqueue_reactor::per_descriptor_data& descriptor_data, reactor_op* op, + bool is_continuation, bool allow_speculative) +{ + if (!descriptor_data) + { + op->ec_ = asio::error::bad_descriptor; + post_immediate_completion(op, is_continuation); + return; + } + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + if (descriptor_data->shutdown_) + { + post_immediate_completion(op, is_continuation); + return; + } + + if (descriptor_data->op_queue_[op_type].empty()) + { + static const int num_kevents[max_ops] = { 1, 2, 1 }; + + if (allow_speculative + && (op_type != read_op + || descriptor_data->op_queue_[except_op].empty())) + { + if (op->perform()) + { + descriptor_lock.unlock(); + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + if (descriptor_data->num_kevents_ < num_kevents[op_type]) + { + struct kevent events[2]; + ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ, + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); + ASIO_KQUEUE_EV_SET(&events[1], descriptor, EVFILT_WRITE, + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); + if (::kevent(kqueue_fd_, events, num_kevents[op_type], 0, 0, 0) != -1) + { + descriptor_data->num_kevents_ = num_kevents[op_type]; + } + else + { + op->ec_ = asio::error_code(errno, + asio::error::get_system_category()); + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + } + } + else + { + if (descriptor_data->num_kevents_ < num_kevents[op_type]) + descriptor_data->num_kevents_ = num_kevents[op_type]; + + struct kevent events[2]; + ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ, + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); + ASIO_KQUEUE_EV_SET(&events[1], descriptor, EVFILT_WRITE, + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); + ::kevent(kqueue_fd_, events, descriptor_data->num_kevents_, 0, 0, 0); + } + } + + descriptor_data->op_queue_[op_type].push(op); + scheduler_.work_started(); +} + +void kqueue_reactor::cancel_ops(socket_type, + kqueue_reactor::per_descriptor_data& descriptor_data) +{ + if (!descriptor_data) + return; + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + op_queue ops; + for (int i = 0; i < max_ops; ++i) + { + while (reactor_op* op = descriptor_data->op_queue_[i].front()) + { + op->ec_ = asio::error::operation_aborted; + descriptor_data->op_queue_[i].pop(); + ops.push(op); + } + } + + descriptor_lock.unlock(); + + scheduler_.post_deferred_completions(ops); +} + +void kqueue_reactor::deregister_descriptor(socket_type descriptor, + kqueue_reactor::per_descriptor_data& descriptor_data, bool closing) +{ + if (!descriptor_data) + return; + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + if (!descriptor_data->shutdown_) + { + if (closing) + { + // The descriptor will be automatically removed from the kqueue when it + // is closed. + } + else + { + struct kevent events[2]; + ASIO_KQUEUE_EV_SET(&events[0], descriptor, + EVFILT_READ, EV_DELETE, 0, 0, 0); + ASIO_KQUEUE_EV_SET(&events[1], descriptor, + EVFILT_WRITE, EV_DELETE, 0, 0, 0); + ::kevent(kqueue_fd_, events, descriptor_data->num_kevents_, 0, 0, 0); + } + + op_queue ops; + for (int i = 0; i < max_ops; ++i) + { + while (reactor_op* op = descriptor_data->op_queue_[i].front()) + { + op->ec_ = asio::error::operation_aborted; + descriptor_data->op_queue_[i].pop(); + ops.push(op); + } + } + + descriptor_data->descriptor_ = -1; + descriptor_data->shutdown_ = true; + + descriptor_lock.unlock(); + + ASIO_HANDLER_REACTOR_DEREGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + scheduler_.post_deferred_completions(ops); + + // Leave descriptor_data set so that it will be freed by the subsequent + // call to cleanup_descriptor_data. + } + else + { + // We are shutting down, so prevent cleanup_descriptor_data from freeing + // the descriptor_data object and let the destructor free it instead. + descriptor_data = 0; + } +} + +void kqueue_reactor::deregister_internal_descriptor(socket_type descriptor, + kqueue_reactor::per_descriptor_data& descriptor_data) +{ + if (!descriptor_data) + return; + + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + if (!descriptor_data->shutdown_) + { + struct kevent events[2]; + ASIO_KQUEUE_EV_SET(&events[0], descriptor, + EVFILT_READ, EV_DELETE, 0, 0, 0); + ASIO_KQUEUE_EV_SET(&events[1], descriptor, + EVFILT_WRITE, EV_DELETE, 0, 0, 0); + ::kevent(kqueue_fd_, events, descriptor_data->num_kevents_, 0, 0, 0); + + op_queue ops; + for (int i = 0; i < max_ops; ++i) + ops.push(descriptor_data->op_queue_[i]); + + descriptor_data->descriptor_ = -1; + descriptor_data->shutdown_ = true; + + descriptor_lock.unlock(); + + ASIO_HANDLER_REACTOR_DEREGISTRATION(( + context(), static_cast(descriptor), + reinterpret_cast(descriptor_data))); + + // Leave descriptor_data set so that it will be freed by the subsequent + // call to cleanup_descriptor_data. + } + else + { + // We are shutting down, so prevent cleanup_descriptor_data from freeing + // the descriptor_data object and let the destructor free it instead. + descriptor_data = 0; + } +} + +void kqueue_reactor::cleanup_descriptor_data( + per_descriptor_data& descriptor_data) +{ + if (descriptor_data) + { + free_descriptor_state(descriptor_data); + descriptor_data = 0; + } +} + +void kqueue_reactor::run(long usec, op_queue& ops) +{ + mutex::scoped_lock lock(mutex_); + + // Determine how long to block while waiting for events. + timespec timeout_buf = { 0, 0 }; + timespec* timeout = usec ? get_timeout(usec, timeout_buf) : &timeout_buf; + + lock.unlock(); + + // Block on the kqueue descriptor. + struct kevent events[128]; + int num_events = kevent(kqueue_fd_, 0, 0, events, 128, timeout); + +#if defined(ASIO_ENABLE_HANDLER_TRACKING) + // Trace the waiting events. + for (int i = 0; i < num_events; ++i) + { + void* ptr = reinterpret_cast(events[i].udata); + if (ptr != &interrupter_) + { + unsigned event_mask = 0; + switch (events[i].filter) + { + case EVFILT_READ: + event_mask |= ASIO_HANDLER_REACTOR_READ_EVENT; + break; + case EVFILT_WRITE: + event_mask |= ASIO_HANDLER_REACTOR_WRITE_EVENT; + break; + } + if ((events[i].flags & (EV_ERROR | EV_OOBAND)) != 0) + event_mask |= ASIO_HANDLER_REACTOR_ERROR_EVENT; + ASIO_HANDLER_REACTOR_EVENTS((context(), + reinterpret_cast(ptr), event_mask)); + } + } +#endif // defined(ASIO_ENABLE_HANDLER_TRACKING) + + // Dispatch the waiting events. + for (int i = 0; i < num_events; ++i) + { + void* ptr = reinterpret_cast(events[i].udata); + if (ptr == &interrupter_) + { + interrupter_.reset(); + } + else + { + descriptor_state* descriptor_data = static_cast(ptr); + mutex::scoped_lock descriptor_lock(descriptor_data->mutex_); + + if (events[i].filter == EVFILT_WRITE + && descriptor_data->num_kevents_ == 2 + && descriptor_data->op_queue_[write_op].empty()) + { + // Some descriptor types, like serial ports, don't seem to support + // EV_CLEAR with EVFILT_WRITE. Since we have no pending write + // operations we'll remove the EVFILT_WRITE registration here so that + // we don't end up in a tight spin. + struct kevent delete_events[1]; + ASIO_KQUEUE_EV_SET(&delete_events[0], + descriptor_data->descriptor_, EVFILT_WRITE, EV_DELETE, 0, 0, 0); + ::kevent(kqueue_fd_, delete_events, 1, 0, 0, 0); + descriptor_data->num_kevents_ = 1; + } + + // Exception operations must be processed first to ensure that any + // out-of-band data is read before normal data. +#if defined(__NetBSD__) + static const unsigned int filter[max_ops] = +#else + static const int filter[max_ops] = +#endif + { EVFILT_READ, EVFILT_WRITE, EVFILT_READ }; + for (int j = max_ops - 1; j >= 0; --j) + { + if (events[i].filter == filter[j]) + { + if (j != except_op || events[i].flags & EV_OOBAND) + { + while (reactor_op* op = descriptor_data->op_queue_[j].front()) + { + if (events[i].flags & EV_ERROR) + { + op->ec_ = asio::error_code( + static_cast(events[i].data), + asio::error::get_system_category()); + descriptor_data->op_queue_[j].pop(); + ops.push(op); + } + if (op->perform()) + { + descriptor_data->op_queue_[j].pop(); + ops.push(op); + } + else + break; + } + } + } + } + } + } + + lock.lock(); + timer_queues_.get_ready_timers(ops); +} + +void kqueue_reactor::interrupt() +{ + interrupter_.interrupt(); +} + +int kqueue_reactor::do_kqueue_create() +{ + int fd = ::kqueue(); + if (fd == -1) + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "kqueue"); + } + return fd; +} + +kqueue_reactor::descriptor_state* kqueue_reactor::allocate_descriptor_state() +{ + mutex::scoped_lock descriptors_lock(registered_descriptors_mutex_); + return registered_descriptors_.alloc(ASIO_CONCURRENCY_HINT_IS_LOCKING( + REACTOR_IO, scheduler_.concurrency_hint())); +} + +void kqueue_reactor::free_descriptor_state(kqueue_reactor::descriptor_state* s) +{ + mutex::scoped_lock descriptors_lock(registered_descriptors_mutex_); + registered_descriptors_.free(s); +} + +void kqueue_reactor::do_add_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.insert(&queue); +} + +void kqueue_reactor::do_remove_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.erase(&queue); +} + +timespec* kqueue_reactor::get_timeout(long usec, timespec& ts) +{ + // By default we will wait no longer than 5 minutes. This will ensure that + // any changes to the system clock are detected after no longer than this. + const long max_usec = 5 * 60 * 1000 * 1000; + usec = timer_queues_.wait_duration_usec( + (usec < 0 || max_usec < usec) ? max_usec : usec); + ts.tv_sec = usec / 1000000; + ts.tv_nsec = (usec % 1000000) * 1000; + return &ts; +} + +} // namespace detail +} // namespace asio + +#undef ASIO_KQUEUE_EV_SET + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_KQUEUE) + +#endif // ASIO_DETAIL_IMPL_KQUEUE_REACTOR_IPP diff --git a/include/asio/include/asio/detail/impl/null_event.ipp b/include/asio/include/asio/detail/impl/null_event.ipp new file mode 100644 index 0000000..3f47e59 --- /dev/null +++ b/include/asio/include/asio/detail/impl/null_event.ipp @@ -0,0 +1,74 @@ +// +// detail/impl/null_event.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_NULL_EVENT_IPP +#define ASIO_DETAIL_IMPL_NULL_EVENT_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) +# include +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# include "asio/detail/socket_types.hpp" +#else +# include +# if defined(__hpux) +# include +# endif +# if !defined(__hpux) || defined(__SELECT) +# include +# endif +#endif + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +void null_event::do_wait() +{ +#if defined(ASIO_WINDOWS_RUNTIME) + std::this_thread::sleep_until((std::chrono::steady_clock::time_point::max)()); +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ::Sleep(INFINITE); +#else + ::pause(); +#endif +} + +void null_event::do_wait_for_usec(long usec) +{ +#if defined(ASIO_WINDOWS_RUNTIME) + std::this_thread::sleep_for(std::chrono::microseconds(usec)); +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ::Sleep(usec / 1000); +#elif defined(__hpux) && defined(__SELECT) + timespec ts; + ts.tv_sec = usec / 1000000; + ts.tv_nsec = (usec % 1000000) * 1000; + ::pselect(0, 0, 0, 0, &ts, 0); +#else + timeval tv; + tv.tv_sec = usec / 1000000; + tv.tv_usec = usec % 1000000; + ::select(0, 0, 0, 0, &tv); +#endif +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_NULL_EVENT_IPP diff --git a/include/asio/include/asio/detail/impl/pipe_select_interrupter.ipp b/include/asio/include/asio/detail/impl/pipe_select_interrupter.ipp new file mode 100644 index 0000000..ddbbe61 --- /dev/null +++ b/include/asio/include/asio/detail/impl/pipe_select_interrupter.ipp @@ -0,0 +1,129 @@ +// +// detail/impl/pipe_select_interrupter.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_PIPE_SELECT_INTERRUPTER_IPP +#define ASIO_DETAIL_IMPL_PIPE_SELECT_INTERRUPTER_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS_RUNTIME) +#if !defined(ASIO_WINDOWS) +#if !defined(__CYGWIN__) +#if !defined(__SYMBIAN32__) +#if !defined(ASIO_HAS_EVENTFD) + +#include +#include +#include +#include +#include "asio/detail/pipe_select_interrupter.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +pipe_select_interrupter::pipe_select_interrupter() +{ + open_descriptors(); +} + +void pipe_select_interrupter::open_descriptors() +{ + int pipe_fds[2]; + if (pipe(pipe_fds) == 0) + { + read_descriptor_ = pipe_fds[0]; + ::fcntl(read_descriptor_, F_SETFL, O_NONBLOCK); + write_descriptor_ = pipe_fds[1]; + ::fcntl(write_descriptor_, F_SETFL, O_NONBLOCK); + +#if defined(FD_CLOEXEC) + ::fcntl(read_descriptor_, F_SETFD, FD_CLOEXEC); + ::fcntl(write_descriptor_, F_SETFD, FD_CLOEXEC); +#endif // defined(FD_CLOEXEC) + } + else + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "pipe_select_interrupter"); + } +} + +pipe_select_interrupter::~pipe_select_interrupter() +{ + close_descriptors(); +} + +void pipe_select_interrupter::close_descriptors() +{ + if (read_descriptor_ != -1) + ::close(read_descriptor_); + if (write_descriptor_ != -1) + ::close(write_descriptor_); +} + +void pipe_select_interrupter::recreate() +{ + close_descriptors(); + + write_descriptor_ = -1; + read_descriptor_ = -1; + + open_descriptors(); +} + +void pipe_select_interrupter::interrupt() +{ + char byte = 0; + signed_size_type result = ::write(write_descriptor_, &byte, 1); + (void)result; +} + +bool pipe_select_interrupter::reset() +{ + for (;;) + { + char data[1024]; + signed_size_type bytes_read = ::read(read_descriptor_, data, sizeof(data)); + if (bytes_read == sizeof(data)) + continue; + if (bytes_read > 0) + return true; + if (bytes_read == 0) + return false; + if (errno == EINTR) + continue; + if (errno == EWOULDBLOCK || errno == EAGAIN) + return true; + return false; + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_EVENTFD) +#endif // !defined(__SYMBIAN32__) +#endif // !defined(__CYGWIN__) +#endif // !defined(ASIO_WINDOWS) +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_IMPL_PIPE_SELECT_INTERRUPTER_IPP diff --git a/include/asio/include/asio/detail/impl/posix_event.ipp b/include/asio/include/asio/detail/impl/posix_event.ipp new file mode 100644 index 0000000..6d2b5e0 --- /dev/null +++ b/include/asio/include/asio/detail/impl/posix_event.ipp @@ -0,0 +1,59 @@ +// +// detail/impl/posix_event.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_POSIX_EVENT_IPP +#define ASIO_DETAIL_IMPL_POSIX_EVENT_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include "asio/detail/posix_event.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +posix_event::posix_event() + : state_(0) +{ +#if (defined(__MACH__) && defined(__APPLE__)) \ + || (defined(__ANDROID__) && (__ANDROID_API__ < 21)) + int error = ::pthread_cond_init(&cond_, 0); +#else // (defined(__MACH__) && defined(__APPLE__)) + // || (defined(__ANDROID__) && (__ANDROID_API__ < 21)) + ::pthread_condattr_t attr; + ::pthread_condattr_init(&attr); + int error = ::pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); + if (error == 0) + error = ::pthread_cond_init(&cond_, &attr); +#endif // (defined(__MACH__) && defined(__APPLE__)) + // || (defined(__ANDROID__) && (__ANDROID_API__ < 21)) + + asio::error_code ec(error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "event"); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_IMPL_POSIX_EVENT_IPP diff --git a/include/asio/include/asio/detail/impl/posix_mutex.ipp b/include/asio/include/asio/detail/impl/posix_mutex.ipp new file mode 100644 index 0000000..03161d1 --- /dev/null +++ b/include/asio/include/asio/detail/impl/posix_mutex.ipp @@ -0,0 +1,46 @@ +// +// detail/impl/posix_mutex.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP +#define ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include "asio/detail/posix_mutex.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +posix_mutex::posix_mutex() +{ + int error = ::pthread_mutex_init(&mutex_, 0); + asio::error_code ec(error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "mutex"); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP diff --git a/include/asio/include/asio/detail/impl/posix_thread.ipp b/include/asio/include/asio/detail/impl/posix_thread.ipp new file mode 100644 index 0000000..e401766 --- /dev/null +++ b/include/asio/include/asio/detail/impl/posix_thread.ipp @@ -0,0 +1,84 @@ +// +// detail/impl/posix_thread.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_POSIX_THREAD_IPP +#define ASIO_DETAIL_IMPL_POSIX_THREAD_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include "asio/detail/posix_thread.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +posix_thread::~posix_thread() +{ + if (!joined_) + ::pthread_detach(thread_); +} + +void posix_thread::join() +{ + if (!joined_) + { + ::pthread_join(thread_, 0); + joined_ = true; + } +} + +std::size_t posix_thread::hardware_concurrency() +{ +#if defined(_SC_NPROCESSORS_ONLN) + long result = sysconf(_SC_NPROCESSORS_ONLN); + if (result > 0) + return result; +#endif // defined(_SC_NPROCESSORS_ONLN) + return 0; +} + +void posix_thread::start_thread(func_base* arg) +{ + int error = ::pthread_create(&thread_, 0, + asio_detail_posix_thread_function, arg); + if (error != 0) + { + delete arg; + asio::error_code ec(error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "thread"); + } +} + +void* asio_detail_posix_thread_function(void* arg) +{ + posix_thread::auto_func_base_ptr func = { + static_cast(arg) }; + func.ptr->run(); + return 0; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_IMPL_POSIX_THREAD_IPP diff --git a/include/asio/include/asio/detail/impl/posix_tss_ptr.ipp b/include/asio/include/asio/detail/impl/posix_tss_ptr.ipp new file mode 100644 index 0000000..f3284de --- /dev/null +++ b/include/asio/include/asio/detail/impl/posix_tss_ptr.ipp @@ -0,0 +1,46 @@ +// +// detail/impl/posix_tss_ptr.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP +#define ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include "asio/detail/posix_tss_ptr.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +void posix_tss_ptr_create(pthread_key_t& key) +{ + int error = ::pthread_key_create(&key, 0); + asio::error_code ec(error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "tss"); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP diff --git a/include/asio/include/asio/detail/impl/reactive_descriptor_service.ipp b/include/asio/include/asio/detail/impl/reactive_descriptor_service.ipp new file mode 100644 index 0000000..1fe8657 --- /dev/null +++ b/include/asio/include/asio/detail/impl/reactive_descriptor_service.ipp @@ -0,0 +1,223 @@ +// +// detail/impl/reactive_descriptor_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_REACTIVE_DESCRIPTOR_SERVICE_IPP +#define ASIO_DETAIL_IMPL_REACTIVE_DESCRIPTOR_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + +#include "asio/error.hpp" +#include "asio/detail/reactive_descriptor_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +reactive_descriptor_service::reactive_descriptor_service( + execution_context& context) + : execution_context_service_base(context), + reactor_(asio::use_service(context)) +{ + reactor_.init_task(); +} + +void reactive_descriptor_service::shutdown() +{ +} + +void reactive_descriptor_service::construct( + reactive_descriptor_service::implementation_type& impl) +{ + impl.descriptor_ = -1; + impl.state_ = 0; +} + +void reactive_descriptor_service::move_construct( + reactive_descriptor_service::implementation_type& impl, + reactive_descriptor_service::implementation_type& other_impl) + ASIO_NOEXCEPT +{ + impl.descriptor_ = other_impl.descriptor_; + other_impl.descriptor_ = -1; + + impl.state_ = other_impl.state_; + other_impl.state_ = 0; + + reactor_.move_descriptor(impl.descriptor_, + impl.reactor_data_, other_impl.reactor_data_); +} + +void reactive_descriptor_service::move_assign( + reactive_descriptor_service::implementation_type& impl, + reactive_descriptor_service& other_service, + reactive_descriptor_service::implementation_type& other_impl) +{ + destroy(impl); + + impl.descriptor_ = other_impl.descriptor_; + other_impl.descriptor_ = -1; + + impl.state_ = other_impl.state_; + other_impl.state_ = 0; + + other_service.reactor_.move_descriptor(impl.descriptor_, + impl.reactor_data_, other_impl.reactor_data_); +} + +void reactive_descriptor_service::destroy( + reactive_descriptor_service::implementation_type& impl) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((reactor_.context(), + "descriptor", &impl, impl.descriptor_, "close")); + + reactor_.deregister_descriptor(impl.descriptor_, impl.reactor_data_, + (impl.state_ & descriptor_ops::possible_dup) == 0); + + asio::error_code ignored_ec; + descriptor_ops::close(impl.descriptor_, impl.state_, ignored_ec); + + reactor_.cleanup_descriptor_data(impl.reactor_data_); + } +} + +asio::error_code reactive_descriptor_service::assign( + reactive_descriptor_service::implementation_type& impl, + const native_handle_type& native_descriptor, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + if (int err = reactor_.register_descriptor( + native_descriptor, impl.reactor_data_)) + { + ec = asio::error_code(err, + asio::error::get_system_category()); + return ec; + } + + impl.descriptor_ = native_descriptor; + impl.state_ = descriptor_ops::possible_dup; + ec = asio::error_code(); + return ec; +} + +asio::error_code reactive_descriptor_service::close( + reactive_descriptor_service::implementation_type& impl, + asio::error_code& ec) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((reactor_.context(), + "descriptor", &impl, impl.descriptor_, "close")); + + reactor_.deregister_descriptor(impl.descriptor_, impl.reactor_data_, + (impl.state_ & descriptor_ops::possible_dup) == 0); + + descriptor_ops::close(impl.descriptor_, impl.state_, ec); + + reactor_.cleanup_descriptor_data(impl.reactor_data_); + } + else + { + ec = asio::error_code(); + } + + // The descriptor is closed by the OS even if close() returns an error. + // + // (Actually, POSIX says the state of the descriptor is unspecified. On + // Linux the descriptor is apparently closed anyway; e.g. see + // http://lkml.org/lkml/2005/9/10/129 + // We'll just have to assume that other OSes follow the same behaviour.) + construct(impl); + + return ec; +} + +reactive_descriptor_service::native_handle_type +reactive_descriptor_service::release( + reactive_descriptor_service::implementation_type& impl) +{ + native_handle_type descriptor = impl.descriptor_; + + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((reactor_.context(), + "descriptor", &impl, impl.descriptor_, "release")); + + reactor_.deregister_descriptor(impl.descriptor_, impl.reactor_data_, false); + reactor_.cleanup_descriptor_data(impl.reactor_data_); + construct(impl); + } + + return descriptor; +} + +asio::error_code reactive_descriptor_service::cancel( + reactive_descriptor_service::implementation_type& impl, + asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return ec; + } + + ASIO_HANDLER_OPERATION((reactor_.context(), + "descriptor", &impl, impl.descriptor_, "cancel")); + + reactor_.cancel_ops(impl.descriptor_, impl.reactor_data_); + ec = asio::error_code(); + return ec; +} + +void reactive_descriptor_service::start_op( + reactive_descriptor_service::implementation_type& impl, + int op_type, reactor_op* op, bool is_continuation, + bool is_non_blocking, bool noop) +{ + if (!noop) + { + if ((impl.state_ & descriptor_ops::non_blocking) || + descriptor_ops::set_internal_non_blocking( + impl.descriptor_, impl.state_, true, op->ec_)) + { + reactor_.start_op(op_type, impl.descriptor_, + impl.reactor_data_, op, is_continuation, is_non_blocking); + return; + } + } + + reactor_.post_immediate_completion(op, is_continuation); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + +#endif // ASIO_DETAIL_IMPL_REACTIVE_DESCRIPTOR_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/reactive_serial_port_service.ipp b/include/asio/include/asio/detail/impl/reactive_serial_port_service.ipp new file mode 100644 index 0000000..2966082 --- /dev/null +++ b/include/asio/include/asio/detail/impl/reactive_serial_port_service.ipp @@ -0,0 +1,149 @@ +// +// detail/impl/reactive_serial_port_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP +#define ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_SERIAL_PORT) +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#include +#include "asio/detail/reactive_serial_port_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +reactive_serial_port_service::reactive_serial_port_service( + execution_context& context) + : execution_context_service_base(context), + descriptor_service_(context) +{ +} + +void reactive_serial_port_service::shutdown() +{ + descriptor_service_.shutdown(); +} + +asio::error_code reactive_serial_port_service::open( + reactive_serial_port_service::implementation_type& impl, + const std::string& device, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + descriptor_ops::state_type state = 0; + int fd = descriptor_ops::open(device.c_str(), + O_RDWR | O_NONBLOCK | O_NOCTTY, ec); + if (fd < 0) + return ec; + + int s = descriptor_ops::fcntl(fd, F_GETFL, ec); + if (s >= 0) + s = descriptor_ops::fcntl(fd, F_SETFL, s | O_NONBLOCK, ec); + if (s < 0) + { + asio::error_code ignored_ec; + descriptor_ops::close(fd, state, ignored_ec); + return ec; + } + + // Set up default serial port options. + termios ios; + s = ::tcgetattr(fd, &ios); + descriptor_ops::get_last_error(ec, s < 0); + if (s >= 0) + { +#if defined(_BSD_SOURCE) || defined(_DEFAULT_SOURCE) + ::cfmakeraw(&ios); +#else + ios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK + | ISTRIP | INLCR | IGNCR | ICRNL | IXON); + ios.c_oflag &= ~OPOST; + ios.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + ios.c_cflag &= ~(CSIZE | PARENB); + ios.c_cflag |= CS8; +#endif + ios.c_iflag |= IGNPAR; + ios.c_cflag |= CREAD | CLOCAL; + s = ::tcsetattr(fd, TCSANOW, &ios); + descriptor_ops::get_last_error(ec, s < 0); + } + if (s < 0) + { + asio::error_code ignored_ec; + descriptor_ops::close(fd, state, ignored_ec); + return ec; + } + + // We're done. Take ownership of the serial port descriptor. + if (descriptor_service_.assign(impl, fd, ec)) + { + asio::error_code ignored_ec; + descriptor_ops::close(fd, state, ignored_ec); + } + + return ec; +} + +asio::error_code reactive_serial_port_service::do_set_option( + reactive_serial_port_service::implementation_type& impl, + reactive_serial_port_service::store_function_type store, + const void* option, asio::error_code& ec) +{ + termios ios; + int s = ::tcgetattr(descriptor_service_.native_handle(impl), &ios); + descriptor_ops::get_last_error(ec, s < 0); + if (s < 0) + return ec; + + if (store(option, ios, ec)) + return ec; + + s = ::tcsetattr(descriptor_service_.native_handle(impl), TCSANOW, &ios); + descriptor_ops::get_last_error(ec, s < 0); + return ec; +} + +asio::error_code reactive_serial_port_service::do_get_option( + const reactive_serial_port_service::implementation_type& impl, + reactive_serial_port_service::load_function_type load, + void* option, asio::error_code& ec) const +{ + termios ios; + int s = ::tcgetattr(descriptor_service_.native_handle(impl), &ios); + descriptor_ops::get_last_error(ec, s < 0); + if (s < 0) + return ec; + + return load(option, ios, ec); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) +#endif // defined(ASIO_HAS_SERIAL_PORT) + +#endif // ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/reactive_socket_service_base.ipp b/include/asio/include/asio/detail/impl/reactive_socket_service_base.ipp new file mode 100644 index 0000000..6c01c5e --- /dev/null +++ b/include/asio/include/asio/detail/impl/reactive_socket_service_base.ipp @@ -0,0 +1,300 @@ +// +// detail/reactive_socket_service_base.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_IPP +#define ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_IOCP) \ + && !defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/reactive_socket_service_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +reactive_socket_service_base::reactive_socket_service_base( + execution_context& context) + : reactor_(use_service(context)) +{ + reactor_.init_task(); +} + +void reactive_socket_service_base::base_shutdown() +{ +} + +void reactive_socket_service_base::construct( + reactive_socket_service_base::base_implementation_type& impl) +{ + impl.socket_ = invalid_socket; + impl.state_ = 0; +} + +void reactive_socket_service_base::base_move_construct( + reactive_socket_service_base::base_implementation_type& impl, + reactive_socket_service_base::base_implementation_type& other_impl) + ASIO_NOEXCEPT +{ + impl.socket_ = other_impl.socket_; + other_impl.socket_ = invalid_socket; + + impl.state_ = other_impl.state_; + other_impl.state_ = 0; + + reactor_.move_descriptor(impl.socket_, + impl.reactor_data_, other_impl.reactor_data_); +} + +void reactive_socket_service_base::base_move_assign( + reactive_socket_service_base::base_implementation_type& impl, + reactive_socket_service_base& other_service, + reactive_socket_service_base::base_implementation_type& other_impl) +{ + destroy(impl); + + impl.socket_ = other_impl.socket_; + other_impl.socket_ = invalid_socket; + + impl.state_ = other_impl.state_; + other_impl.state_ = 0; + + other_service.reactor_.move_descriptor(impl.socket_, + impl.reactor_data_, other_impl.reactor_data_); +} + +void reactive_socket_service_base::destroy( + reactive_socket_service_base::base_implementation_type& impl) +{ + if (impl.socket_ != invalid_socket) + { + ASIO_HANDLER_OPERATION((reactor_.context(), + "socket", &impl, impl.socket_, "close")); + + reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, + (impl.state_ & socket_ops::possible_dup) == 0); + + asio::error_code ignored_ec; + socket_ops::close(impl.socket_, impl.state_, true, ignored_ec); + + reactor_.cleanup_descriptor_data(impl.reactor_data_); + } +} + +asio::error_code reactive_socket_service_base::close( + reactive_socket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((reactor_.context(), + "socket", &impl, impl.socket_, "close")); + + reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, + (impl.state_ & socket_ops::possible_dup) == 0); + + socket_ops::close(impl.socket_, impl.state_, false, ec); + + reactor_.cleanup_descriptor_data(impl.reactor_data_); + } + else + { + ec = asio::error_code(); + } + + // The descriptor is closed by the OS even if close() returns an error. + // + // (Actually, POSIX says the state of the descriptor is unspecified. On + // Linux the descriptor is apparently closed anyway; e.g. see + // http://lkml.org/lkml/2005/9/10/129 + // We'll just have to assume that other OSes follow the same behaviour. The + // known exception is when Windows's closesocket() function fails with + // WSAEWOULDBLOCK, but this case is handled inside socket_ops::close(). + construct(impl); + + return ec; +} + +socket_type reactive_socket_service_base::release( + reactive_socket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return invalid_socket; + } + + ASIO_HANDLER_OPERATION((reactor_.context(), + "socket", &impl, impl.socket_, "release")); + + reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, false); + reactor_.cleanup_descriptor_data(impl.reactor_data_); + socket_type sock = impl.socket_; + construct(impl); + ec = asio::error_code(); + return sock; +} + +asio::error_code reactive_socket_service_base::cancel( + reactive_socket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return ec; + } + + ASIO_HANDLER_OPERATION((reactor_.context(), + "socket", &impl, impl.socket_, "cancel")); + + reactor_.cancel_ops(impl.socket_, impl.reactor_data_); + ec = asio::error_code(); + return ec; +} + +asio::error_code reactive_socket_service_base::do_open( + reactive_socket_service_base::base_implementation_type& impl, + int af, int type, int protocol, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + socket_holder sock(socket_ops::socket(af, type, protocol, ec)); + if (sock.get() == invalid_socket) + return ec; + + if (int err = reactor_.register_descriptor(sock.get(), impl.reactor_data_)) + { + ec = asio::error_code(err, + asio::error::get_system_category()); + return ec; + } + + impl.socket_ = sock.release(); + switch (type) + { + case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; + case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; + default: impl.state_ = 0; break; + } + ec = asio::error_code(); + return ec; +} + +asio::error_code reactive_socket_service_base::do_assign( + reactive_socket_service_base::base_implementation_type& impl, int type, + const reactive_socket_service_base::native_handle_type& native_socket, + asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + if (int err = reactor_.register_descriptor( + native_socket, impl.reactor_data_)) + { + ec = asio::error_code(err, + asio::error::get_system_category()); + return ec; + } + + impl.socket_ = native_socket; + switch (type) + { + case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; + case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; + default: impl.state_ = 0; break; + } + impl.state_ |= socket_ops::possible_dup; + ec = asio::error_code(); + return ec; +} + +void reactive_socket_service_base::start_op( + reactive_socket_service_base::base_implementation_type& impl, + int op_type, reactor_op* op, bool is_continuation, + bool is_non_blocking, bool noop) +{ + if (!noop) + { + if ((impl.state_ & socket_ops::non_blocking) + || socket_ops::set_internal_non_blocking( + impl.socket_, impl.state_, true, op->ec_)) + { + reactor_.start_op(op_type, impl.socket_, + impl.reactor_data_, op, is_continuation, is_non_blocking); + return; + } + } + + reactor_.post_immediate_completion(op, is_continuation); +} + +void reactive_socket_service_base::start_accept_op( + reactive_socket_service_base::base_implementation_type& impl, + reactor_op* op, bool is_continuation, bool peer_is_open) +{ + if (!peer_is_open) + start_op(impl, reactor::read_op, op, is_continuation, true, false); + else + { + op->ec_ = asio::error::already_open; + reactor_.post_immediate_completion(op, is_continuation); + } +} + +void reactive_socket_service_base::start_connect_op( + reactive_socket_service_base::base_implementation_type& impl, + reactor_op* op, bool is_continuation, + const socket_addr_type* addr, size_t addrlen) +{ + if ((impl.state_ & socket_ops::non_blocking) + || socket_ops::set_internal_non_blocking( + impl.socket_, impl.state_, true, op->ec_)) + { + if (socket_ops::connect(impl.socket_, addr, addrlen, op->ec_) != 0) + { + if (op->ec_ == asio::error::in_progress + || op->ec_ == asio::error::would_block) + { + op->ec_ = asio::error_code(); + reactor_.start_op(reactor::connect_op, impl.socket_, + impl.reactor_data_, op, is_continuation, false); + return; + } + } + } + + reactor_.post_immediate_completion(op, is_continuation); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_IOCP) + // && !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_IPP diff --git a/include/asio/include/asio/detail/impl/resolver_service_base.ipp b/include/asio/include/asio/detail/impl/resolver_service_base.ipp new file mode 100644 index 0000000..a86588f --- /dev/null +++ b/include/asio/include/asio/detail/impl/resolver_service_base.ipp @@ -0,0 +1,158 @@ +// +// detail/impl/resolver_service_base.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_RESOLVER_SERVICE_BASE_IPP +#define ASIO_DETAIL_IMPL_RESOLVER_SERVICE_BASE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/resolver_service_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class resolver_service_base::work_scheduler_runner +{ +public: + work_scheduler_runner(scheduler_impl& work_scheduler) + : work_scheduler_(work_scheduler) + { + } + + void operator()() + { + asio::error_code ec; + work_scheduler_.run(ec); + } + +private: + scheduler_impl& work_scheduler_; +}; + +resolver_service_base::resolver_service_base(execution_context& context) + : scheduler_(asio::use_service(context)), + work_scheduler_(new scheduler_impl(context, -1, false)), + work_thread_(0) +{ + work_scheduler_->work_started(); +} + +resolver_service_base::~resolver_service_base() +{ + base_shutdown(); +} + +void resolver_service_base::base_shutdown() +{ + if (work_scheduler_.get()) + { + work_scheduler_->work_finished(); + work_scheduler_->stop(); + if (work_thread_.get()) + { + work_thread_->join(); + work_thread_.reset(); + } + work_scheduler_.reset(); + } +} + +void resolver_service_base::base_notify_fork( + execution_context::fork_event fork_ev) +{ + if (work_thread_.get()) + { + if (fork_ev == execution_context::fork_prepare) + { + work_scheduler_->stop(); + work_thread_->join(); + work_thread_.reset(); + } + } + else if (fork_ev != execution_context::fork_prepare) + { + work_scheduler_->restart(); + } +} + +void resolver_service_base::construct( + resolver_service_base::implementation_type& impl) +{ + impl.reset(static_cast(0), socket_ops::noop_deleter()); +} + +void resolver_service_base::destroy( + resolver_service_base::implementation_type& impl) +{ + ASIO_HANDLER_OPERATION((scheduler_.context(), + "resolver", &impl, 0, "cancel")); + + impl.reset(); +} + +void resolver_service_base::move_construct(implementation_type& impl, + implementation_type& other_impl) +{ + impl = ASIO_MOVE_CAST(implementation_type)(other_impl); +} + +void resolver_service_base::move_assign(implementation_type& impl, + resolver_service_base&, implementation_type& other_impl) +{ + destroy(impl); + impl = ASIO_MOVE_CAST(implementation_type)(other_impl); +} + +void resolver_service_base::cancel( + resolver_service_base::implementation_type& impl) +{ + ASIO_HANDLER_OPERATION((scheduler_.context(), + "resolver", &impl, 0, "cancel")); + + impl.reset(static_cast(0), socket_ops::noop_deleter()); +} + +void resolver_service_base::start_resolve_op(resolve_op* op) +{ + if (ASIO_CONCURRENCY_HINT_IS_LOCKING(SCHEDULER, + scheduler_.concurrency_hint())) + { + start_work_thread(); + scheduler_.work_started(); + work_scheduler_->post_immediate_completion(op, false); + } + else + { + op->ec_ = asio::error::operation_not_supported; + scheduler_.post_immediate_completion(op, false); + } +} + +void resolver_service_base::start_work_thread() +{ + asio::detail::mutex::scoped_lock lock(mutex_); + if (!work_thread_.get()) + { + work_thread_.reset(new asio::detail::thread( + work_scheduler_runner(*work_scheduler_))); + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_RESOLVER_SERVICE_BASE_IPP diff --git a/include/asio/include/asio/detail/impl/scheduler.ipp b/include/asio/include/asio/detail/impl/scheduler.ipp new file mode 100644 index 0000000..707eee9 --- /dev/null +++ b/include/asio/include/asio/detail/impl/scheduler.ipp @@ -0,0 +1,654 @@ +// +// detail/impl/scheduler.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_SCHEDULER_IPP +#define ASIO_DETAIL_IMPL_SCHEDULER_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/detail/concurrency_hint.hpp" +#include "asio/detail/event.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/reactor.hpp" +#include "asio/detail/scheduler.hpp" +#include "asio/detail/scheduler_thread_info.hpp" +#include "asio/detail/signal_blocker.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class scheduler::thread_function +{ +public: + explicit thread_function(scheduler* s) + : this_(s) + { + } + + void operator()() + { + asio::error_code ec; + this_->run(ec); + } + +private: + scheduler* this_; +}; + +struct scheduler::task_cleanup +{ + ~task_cleanup() + { + if (this_thread_->private_outstanding_work > 0) + { + asio::detail::increment( + scheduler_->outstanding_work_, + this_thread_->private_outstanding_work); + } + this_thread_->private_outstanding_work = 0; + + // Enqueue the completed operations and reinsert the task at the end of + // the operation queue. + lock_->lock(); + scheduler_->task_interrupted_ = true; + scheduler_->op_queue_.push(this_thread_->private_op_queue); + scheduler_->op_queue_.push(&scheduler_->task_operation_); + } + + scheduler* scheduler_; + mutex::scoped_lock* lock_; + thread_info* this_thread_; +}; + +struct scheduler::work_cleanup +{ + ~work_cleanup() + { + if (this_thread_->private_outstanding_work > 1) + { + asio::detail::increment( + scheduler_->outstanding_work_, + this_thread_->private_outstanding_work - 1); + } + else if (this_thread_->private_outstanding_work < 1) + { + scheduler_->work_finished(); + } + this_thread_->private_outstanding_work = 0; + +#if defined(ASIO_HAS_THREADS) + if (!this_thread_->private_op_queue.empty()) + { + lock_->lock(); + scheduler_->op_queue_.push(this_thread_->private_op_queue); + } +#endif // defined(ASIO_HAS_THREADS) + } + + scheduler* scheduler_; + mutex::scoped_lock* lock_; + thread_info* this_thread_; +}; + +scheduler::scheduler(asio::execution_context& ctx, + int concurrency_hint, bool own_thread) + : asio::detail::execution_context_service_base(ctx), + one_thread_(concurrency_hint == 1 + || !ASIO_CONCURRENCY_HINT_IS_LOCKING( + SCHEDULER, concurrency_hint) + || !ASIO_CONCURRENCY_HINT_IS_LOCKING( + REACTOR_IO, concurrency_hint)), + mutex_(ASIO_CONCURRENCY_HINT_IS_LOCKING( + SCHEDULER, concurrency_hint)), + task_(0), + task_interrupted_(true), + outstanding_work_(0), + stopped_(false), + shutdown_(false), + concurrency_hint_(concurrency_hint), + thread_(0) +{ + ASIO_HANDLER_TRACKING_INIT; + + if (own_thread) + { + ++outstanding_work_; + asio::detail::signal_blocker sb; + thread_ = new asio::detail::thread(thread_function(this)); + } +} + +scheduler::~scheduler() +{ + if (thread_) + { + mutex::scoped_lock lock(mutex_); + shutdown_ = true; + stop_all_threads(lock); + lock.unlock(); + thread_->join(); + delete thread_; + } +} + +void scheduler::shutdown() +{ + mutex::scoped_lock lock(mutex_); + shutdown_ = true; + if (thread_) + stop_all_threads(lock); + lock.unlock(); + + // Join thread to ensure task operation is returned to queue. + if (thread_) + { + thread_->join(); + delete thread_; + thread_ = 0; + } + + // Destroy handler objects. + while (!op_queue_.empty()) + { + operation* o = op_queue_.front(); + op_queue_.pop(); + if (o != &task_operation_) + o->destroy(); + } + + // Reset to initial state. + task_ = 0; +} + +void scheduler::init_task() +{ + mutex::scoped_lock lock(mutex_); + if (!shutdown_ && !task_) + { + task_ = &use_service(this->context()); + op_queue_.push(&task_operation_); + wake_one_thread_and_unlock(lock); + } +} + +std::size_t scheduler::run(asio::error_code& ec) +{ + ec = asio::error_code(); + if (outstanding_work_ == 0) + { + stop(); + return 0; + } + + thread_info this_thread; + this_thread.private_outstanding_work = 0; + thread_call_stack::context ctx(this, this_thread); + + mutex::scoped_lock lock(mutex_); + + std::size_t n = 0; + for (; do_run_one(lock, this_thread, ec); lock.lock()) + if (n != (std::numeric_limits::max)()) + ++n; + return n; +} + +std::size_t scheduler::run_one(asio::error_code& ec) +{ + ec = asio::error_code(); + if (outstanding_work_ == 0) + { + stop(); + return 0; + } + + thread_info this_thread; + this_thread.private_outstanding_work = 0; + thread_call_stack::context ctx(this, this_thread); + + mutex::scoped_lock lock(mutex_); + + return do_run_one(lock, this_thread, ec); +} + +std::size_t scheduler::wait_one(long usec, asio::error_code& ec) +{ + ec = asio::error_code(); + if (outstanding_work_ == 0) + { + stop(); + return 0; + } + + thread_info this_thread; + this_thread.private_outstanding_work = 0; + thread_call_stack::context ctx(this, this_thread); + + mutex::scoped_lock lock(mutex_); + + return do_wait_one(lock, this_thread, usec, ec); +} + +std::size_t scheduler::poll(asio::error_code& ec) +{ + ec = asio::error_code(); + if (outstanding_work_ == 0) + { + stop(); + return 0; + } + + thread_info this_thread; + this_thread.private_outstanding_work = 0; + thread_call_stack::context ctx(this, this_thread); + + mutex::scoped_lock lock(mutex_); + +#if defined(ASIO_HAS_THREADS) + // We want to support nested calls to poll() and poll_one(), so any handlers + // that are already on a thread-private queue need to be put on to the main + // queue now. + if (one_thread_) + if (thread_info* outer_info = static_cast(ctx.next_by_key())) + op_queue_.push(outer_info->private_op_queue); +#endif // defined(ASIO_HAS_THREADS) + + std::size_t n = 0; + for (; do_poll_one(lock, this_thread, ec); lock.lock()) + if (n != (std::numeric_limits::max)()) + ++n; + return n; +} + +std::size_t scheduler::poll_one(asio::error_code& ec) +{ + ec = asio::error_code(); + if (outstanding_work_ == 0) + { + stop(); + return 0; + } + + thread_info this_thread; + this_thread.private_outstanding_work = 0; + thread_call_stack::context ctx(this, this_thread); + + mutex::scoped_lock lock(mutex_); + +#if defined(ASIO_HAS_THREADS) + // We want to support nested calls to poll() and poll_one(), so any handlers + // that are already on a thread-private queue need to be put on to the main + // queue now. + if (one_thread_) + if (thread_info* outer_info = static_cast(ctx.next_by_key())) + op_queue_.push(outer_info->private_op_queue); +#endif // defined(ASIO_HAS_THREADS) + + return do_poll_one(lock, this_thread, ec); +} + +void scheduler::stop() +{ + mutex::scoped_lock lock(mutex_); + stop_all_threads(lock); +} + +bool scheduler::stopped() const +{ + mutex::scoped_lock lock(mutex_); + return stopped_; +} + +void scheduler::restart() +{ + mutex::scoped_lock lock(mutex_); + stopped_ = false; +} + +void scheduler::compensating_work_started() +{ + thread_info_base* this_thread = thread_call_stack::contains(this); + ++static_cast(this_thread)->private_outstanding_work; +} + +void scheduler::capture_current_exception() +{ + if (thread_info_base* this_thread = thread_call_stack::contains(this)) + this_thread->capture_current_exception(); +} + +void scheduler::post_immediate_completion( + scheduler::operation* op, bool is_continuation) +{ +#if defined(ASIO_HAS_THREADS) + if (one_thread_ || is_continuation) + { + if (thread_info_base* this_thread = thread_call_stack::contains(this)) + { + ++static_cast(this_thread)->private_outstanding_work; + static_cast(this_thread)->private_op_queue.push(op); + return; + } + } +#else // defined(ASIO_HAS_THREADS) + (void)is_continuation; +#endif // defined(ASIO_HAS_THREADS) + + work_started(); + mutex::scoped_lock lock(mutex_); + op_queue_.push(op); + wake_one_thread_and_unlock(lock); +} + +void scheduler::post_immediate_completions(std::size_t n, + op_queue& ops, bool is_continuation) +{ +#if defined(ASIO_HAS_THREADS) + if (one_thread_ || is_continuation) + { + if (thread_info_base* this_thread = thread_call_stack::contains(this)) + { + static_cast(this_thread)->private_outstanding_work + += static_cast(n); + static_cast(this_thread)->private_op_queue.push(ops); + return; + } + } +#else // defined(ASIO_HAS_THREADS) + (void)is_continuation; +#endif // defined(ASIO_HAS_THREADS) + + increment(outstanding_work_, static_cast(n)); + mutex::scoped_lock lock(mutex_); + op_queue_.push(ops); + wake_one_thread_and_unlock(lock); +} + +void scheduler::post_deferred_completion(scheduler::operation* op) +{ +#if defined(ASIO_HAS_THREADS) + if (one_thread_) + { + if (thread_info_base* this_thread = thread_call_stack::contains(this)) + { + static_cast(this_thread)->private_op_queue.push(op); + return; + } + } +#endif // defined(ASIO_HAS_THREADS) + + mutex::scoped_lock lock(mutex_); + op_queue_.push(op); + wake_one_thread_and_unlock(lock); +} + +void scheduler::post_deferred_completions( + op_queue& ops) +{ + if (!ops.empty()) + { +#if defined(ASIO_HAS_THREADS) + if (one_thread_) + { + if (thread_info_base* this_thread = thread_call_stack::contains(this)) + { + static_cast(this_thread)->private_op_queue.push(ops); + return; + } + } +#endif // defined(ASIO_HAS_THREADS) + + mutex::scoped_lock lock(mutex_); + op_queue_.push(ops); + wake_one_thread_and_unlock(lock); + } +} + +void scheduler::do_dispatch( + scheduler::operation* op) +{ + work_started(); + mutex::scoped_lock lock(mutex_); + op_queue_.push(op); + wake_one_thread_and_unlock(lock); +} + +void scheduler::abandon_operations( + op_queue& ops) +{ + op_queue ops2; + ops2.push(ops); +} + +std::size_t scheduler::do_run_one(mutex::scoped_lock& lock, + scheduler::thread_info& this_thread, + const asio::error_code& ec) +{ + while (!stopped_) + { + if (!op_queue_.empty()) + { + // Prepare to execute first handler from queue. + operation* o = op_queue_.front(); + op_queue_.pop(); + bool more_handlers = (!op_queue_.empty()); + + if (o == &task_operation_) + { + task_interrupted_ = more_handlers; + + if (more_handlers && !one_thread_) + wakeup_event_.unlock_and_signal_one(lock); + else + lock.unlock(); + + task_cleanup on_exit = { this, &lock, &this_thread }; + (void)on_exit; + + // Run the task. May throw an exception. Only block if the operation + // queue is empty and we're not polling, otherwise we want to return + // as soon as possible. + task_->run(more_handlers ? 0 : -1, this_thread.private_op_queue); + } + else + { + std::size_t task_result = o->task_result_; + + if (more_handlers && !one_thread_) + wake_one_thread_and_unlock(lock); + else + lock.unlock(); + + // Ensure the count of outstanding work is decremented on block exit. + work_cleanup on_exit = { this, &lock, &this_thread }; + (void)on_exit; + + // Complete the operation. May throw an exception. Deletes the object. + o->complete(this, ec, task_result); + this_thread.rethrow_pending_exception(); + + return 1; + } + } + else + { + wakeup_event_.clear(lock); + wakeup_event_.wait(lock); + } + } + + return 0; +} + +std::size_t scheduler::do_wait_one(mutex::scoped_lock& lock, + scheduler::thread_info& this_thread, long usec, + const asio::error_code& ec) +{ + if (stopped_) + return 0; + + operation* o = op_queue_.front(); + if (o == 0) + { + wakeup_event_.clear(lock); + wakeup_event_.wait_for_usec(lock, usec); + usec = 0; // Wait at most once. + o = op_queue_.front(); + } + + if (o == &task_operation_) + { + op_queue_.pop(); + bool more_handlers = (!op_queue_.empty()); + + task_interrupted_ = more_handlers; + + if (more_handlers && !one_thread_) + wakeup_event_.unlock_and_signal_one(lock); + else + lock.unlock(); + + { + task_cleanup on_exit = { this, &lock, &this_thread }; + (void)on_exit; + + // Run the task. May throw an exception. Only block if the operation + // queue is empty and we're not polling, otherwise we want to return + // as soon as possible. + task_->run(more_handlers ? 0 : usec, this_thread.private_op_queue); + } + + o = op_queue_.front(); + if (o == &task_operation_) + { + if (!one_thread_) + wakeup_event_.maybe_unlock_and_signal_one(lock); + return 0; + } + } + + if (o == 0) + return 0; + + op_queue_.pop(); + bool more_handlers = (!op_queue_.empty()); + + std::size_t task_result = o->task_result_; + + if (more_handlers && !one_thread_) + wake_one_thread_and_unlock(lock); + else + lock.unlock(); + + // Ensure the count of outstanding work is decremented on block exit. + work_cleanup on_exit = { this, &lock, &this_thread }; + (void)on_exit; + + // Complete the operation. May throw an exception. Deletes the object. + o->complete(this, ec, task_result); + this_thread.rethrow_pending_exception(); + + return 1; +} + +std::size_t scheduler::do_poll_one(mutex::scoped_lock& lock, + scheduler::thread_info& this_thread, + const asio::error_code& ec) +{ + if (stopped_) + return 0; + + operation* o = op_queue_.front(); + if (o == &task_operation_) + { + op_queue_.pop(); + lock.unlock(); + + { + task_cleanup c = { this, &lock, &this_thread }; + (void)c; + + // Run the task. May throw an exception. Only block if the operation + // queue is empty and we're not polling, otherwise we want to return + // as soon as possible. + task_->run(0, this_thread.private_op_queue); + } + + o = op_queue_.front(); + if (o == &task_operation_) + { + wakeup_event_.maybe_unlock_and_signal_one(lock); + return 0; + } + } + + if (o == 0) + return 0; + + op_queue_.pop(); + bool more_handlers = (!op_queue_.empty()); + + std::size_t task_result = o->task_result_; + + if (more_handlers && !one_thread_) + wake_one_thread_and_unlock(lock); + else + lock.unlock(); + + // Ensure the count of outstanding work is decremented on block exit. + work_cleanup on_exit = { this, &lock, &this_thread }; + (void)on_exit; + + // Complete the operation. May throw an exception. Deletes the object. + o->complete(this, ec, task_result); + this_thread.rethrow_pending_exception(); + + return 1; +} + +void scheduler::stop_all_threads( + mutex::scoped_lock& lock) +{ + stopped_ = true; + wakeup_event_.signal_all(lock); + + if (!task_interrupted_ && task_) + { + task_interrupted_ = true; + task_->interrupt(); + } +} + +void scheduler::wake_one_thread_and_unlock( + mutex::scoped_lock& lock) +{ + if (!wakeup_event_.maybe_unlock_and_signal_one(lock)) + { + if (!task_interrupted_ && task_) + { + task_interrupted_ = true; + task_->interrupt(); + } + lock.unlock(); + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_SCHEDULER_IPP diff --git a/include/asio/include/asio/detail/impl/select_reactor.hpp b/include/asio/include/asio/detail/impl/select_reactor.hpp new file mode 100644 index 0000000..dd4418f --- /dev/null +++ b/include/asio/include/asio/detail/impl/select_reactor.hpp @@ -0,0 +1,100 @@ +// +// detail/impl/select_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_SELECT_REACTOR_HPP +#define ASIO_DETAIL_IMPL_SELECT_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) \ + || (!defined(ASIO_HAS_DEV_POLL) \ + && !defined(ASIO_HAS_EPOLL) \ + && !defined(ASIO_HAS_KQUEUE) \ + && !defined(ASIO_WINDOWS_RUNTIME)) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +void select_reactor::add_timer_queue(timer_queue& queue) +{ + do_add_timer_queue(queue); +} + +// Remove a timer queue from the reactor. +template +void select_reactor::remove_timer_queue(timer_queue& queue) +{ + do_remove_timer_queue(queue); +} + +template +void select_reactor::schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + if (shutdown_) + { + scheduler_.post_immediate_completion(op, false); + return; + } + + bool earliest = queue.enqueue_timer(time, timer, op); + scheduler_.work_started(); + if (earliest) + interrupter_.interrupt(); +} + +template +std::size_t select_reactor::cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + op_queue ops; + std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); + lock.unlock(); + scheduler_.post_deferred_completions(ops); + return n; +} + +template +void select_reactor::move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + op_queue ops; + queue.cancel_timer(target, ops); + queue.move_timer(target, source); + lock.unlock(); + scheduler_.post_deferred_completions(ops); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + // || (!defined(ASIO_HAS_DEV_POLL) + // && !defined(ASIO_HAS_EPOLL) + // && !defined(ASIO_HAS_KQUEUE) + // && !defined(ASIO_WINDOWS_RUNTIME)) + +#endif // ASIO_DETAIL_IMPL_SELECT_REACTOR_HPP diff --git a/include/asio/include/asio/detail/impl/select_reactor.ipp b/include/asio/include/asio/detail/impl/select_reactor.ipp new file mode 100644 index 0000000..1e321a0 --- /dev/null +++ b/include/asio/include/asio/detail/impl/select_reactor.ipp @@ -0,0 +1,338 @@ +// +// detail/impl/select_reactor.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_SELECT_REACTOR_IPP +#define ASIO_DETAIL_IMPL_SELECT_REACTOR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) \ + || (!defined(ASIO_HAS_DEV_POLL) \ + && !defined(ASIO_HAS_EPOLL) \ + && !defined(ASIO_HAS_KQUEUE) \ + && !defined(ASIO_WINDOWS_RUNTIME)) + +#include "asio/detail/fd_set_adapter.hpp" +#include "asio/detail/select_reactor.hpp" +#include "asio/detail/signal_blocker.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_IOCP) +class select_reactor::thread_function +{ +public: + explicit thread_function(select_reactor* r) + : this_(r) + { + } + + void operator()() + { + this_->run_thread(); + } + +private: + select_reactor* this_; +}; +#endif // defined(ASIO_HAS_IOCP) + +select_reactor::select_reactor(asio::execution_context& ctx) + : execution_context_service_base(ctx), + scheduler_(use_service(ctx)), + mutex_(), + interrupter_(), +#if defined(ASIO_HAS_IOCP) + stop_thread_(false), + thread_(0), +#endif // defined(ASIO_HAS_IOCP) + shutdown_(false) +{ +#if defined(ASIO_HAS_IOCP) + asio::detail::signal_blocker sb; + thread_ = new asio::detail::thread(thread_function(this)); +#endif // defined(ASIO_HAS_IOCP) +} + +select_reactor::~select_reactor() +{ + shutdown(); +} + +void select_reactor::shutdown() +{ + asio::detail::mutex::scoped_lock lock(mutex_); + shutdown_ = true; +#if defined(ASIO_HAS_IOCP) + stop_thread_ = true; + if (thread_) + interrupter_.interrupt(); +#endif // defined(ASIO_HAS_IOCP) + lock.unlock(); + +#if defined(ASIO_HAS_IOCP) + if (thread_) + { + thread_->join(); + delete thread_; + thread_ = 0; + } +#endif // defined(ASIO_HAS_IOCP) + + op_queue ops; + + for (int i = 0; i < max_ops; ++i) + op_queue_[i].get_all_operations(ops); + + timer_queues_.get_all_timers(ops); + + scheduler_.abandon_operations(ops); +} + +void select_reactor::notify_fork( + asio::execution_context::fork_event fork_ev) +{ + if (fork_ev == asio::execution_context::fork_child) + interrupter_.recreate(); +} + +void select_reactor::init_task() +{ + scheduler_.init_task(); +} + +int select_reactor::register_descriptor(socket_type, + select_reactor::per_descriptor_data&) +{ + return 0; +} + +int select_reactor::register_internal_descriptor( + int op_type, socket_type descriptor, + select_reactor::per_descriptor_data&, reactor_op* op) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + op_queue_[op_type].enqueue_operation(descriptor, op); + interrupter_.interrupt(); + + return 0; +} + +void select_reactor::move_descriptor(socket_type, + select_reactor::per_descriptor_data&, + select_reactor::per_descriptor_data&) +{ +} + +void select_reactor::start_op(int op_type, socket_type descriptor, + select_reactor::per_descriptor_data&, reactor_op* op, + bool is_continuation, bool) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + if (shutdown_) + { + post_immediate_completion(op, is_continuation); + return; + } + + bool first = op_queue_[op_type].enqueue_operation(descriptor, op); + scheduler_.work_started(); + if (first) + interrupter_.interrupt(); +} + +void select_reactor::cancel_ops(socket_type descriptor, + select_reactor::per_descriptor_data&) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + cancel_ops_unlocked(descriptor, asio::error::operation_aborted); +} + +void select_reactor::deregister_descriptor(socket_type descriptor, + select_reactor::per_descriptor_data&, bool) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + cancel_ops_unlocked(descriptor, asio::error::operation_aborted); +} + +void select_reactor::deregister_internal_descriptor( + socket_type descriptor, select_reactor::per_descriptor_data&) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + op_queue ops; + for (int i = 0; i < max_ops; ++i) + op_queue_[i].cancel_operations(descriptor, ops); +} + +void select_reactor::cleanup_descriptor_data( + select_reactor::per_descriptor_data&) +{ +} + +void select_reactor::run(long usec, op_queue& ops) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + +#if defined(ASIO_HAS_IOCP) + // Check if the thread is supposed to stop. + if (stop_thread_) + return; +#endif // defined(ASIO_HAS_IOCP) + + // Set up the descriptor sets. + for (int i = 0; i < max_select_ops; ++i) + fd_sets_[i].reset(); + fd_sets_[read_op].set(interrupter_.read_descriptor()); + socket_type max_fd = 0; + bool have_work_to_do = !timer_queues_.all_empty(); + for (int i = 0; i < max_select_ops; ++i) + { + have_work_to_do = have_work_to_do || !op_queue_[i].empty(); + fd_sets_[i].set(op_queue_[i], ops); + if (fd_sets_[i].max_descriptor() > max_fd) + max_fd = fd_sets_[i].max_descriptor(); + } + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Connection operations on Windows use both except and write fd_sets. + have_work_to_do = have_work_to_do || !op_queue_[connect_op].empty(); + fd_sets_[write_op].set(op_queue_[connect_op], ops); + if (fd_sets_[write_op].max_descriptor() > max_fd) + max_fd = fd_sets_[write_op].max_descriptor(); + fd_sets_[except_op].set(op_queue_[connect_op], ops); + if (fd_sets_[except_op].max_descriptor() > max_fd) + max_fd = fd_sets_[except_op].max_descriptor(); +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + + // We can return immediately if there's no work to do and the reactor is + // not supposed to block. + if (!usec && !have_work_to_do) + return; + + // Determine how long to block while waiting for events. + timeval tv_buf = { 0, 0 }; + timeval* tv = usec ? get_timeout(usec, tv_buf) : &tv_buf; + + lock.unlock(); + + // Block on the select call until descriptors become ready. + asio::error_code ec; + int retval = socket_ops::select(static_cast(max_fd + 1), + fd_sets_[read_op], fd_sets_[write_op], fd_sets_[except_op], tv, ec); + + // Reset the interrupter. + if (retval > 0 && fd_sets_[read_op].is_set(interrupter_.read_descriptor())) + { + if (!interrupter_.reset()) + { + lock.lock(); + interrupter_.recreate(); + } + --retval; + } + + lock.lock(); + + // Dispatch all ready operations. + if (retval > 0) + { +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Connection operations on Windows use both except and write fd_sets. + fd_sets_[except_op].perform(op_queue_[connect_op], ops); + fd_sets_[write_op].perform(op_queue_[connect_op], ops); +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + + // Exception operations must be processed first to ensure that any + // out-of-band data is read before normal data. + for (int i = max_select_ops - 1; i >= 0; --i) + fd_sets_[i].perform(op_queue_[i], ops); + } + timer_queues_.get_ready_timers(ops); +} + +void select_reactor::interrupt() +{ + interrupter_.interrupt(); +} + +#if defined(ASIO_HAS_IOCP) +void select_reactor::run_thread() +{ + asio::detail::mutex::scoped_lock lock(mutex_); + while (!stop_thread_) + { + lock.unlock(); + op_queue ops; + run(true, ops); + scheduler_.post_deferred_completions(ops); + lock.lock(); + } +} +#endif // defined(ASIO_HAS_IOCP) + +void select_reactor::do_add_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.insert(&queue); +} + +void select_reactor::do_remove_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.erase(&queue); +} + +timeval* select_reactor::get_timeout(long usec, timeval& tv) +{ + // By default we will wait no longer than 5 minutes. This will ensure that + // any changes to the system clock are detected after no longer than this. + const long max_usec = 5 * 60 * 1000 * 1000; + usec = timer_queues_.wait_duration_usec( + (usec < 0 || max_usec < usec) ? max_usec : usec); + tv.tv_sec = usec / 1000000; + tv.tv_usec = usec % 1000000; + return &tv; +} + +void select_reactor::cancel_ops_unlocked(socket_type descriptor, + const asio::error_code& ec) +{ + bool need_interrupt = false; + op_queue ops; + for (int i = 0; i < max_ops; ++i) + need_interrupt = op_queue_[i].cancel_operations( + descriptor, ops, ec) || need_interrupt; + scheduler_.post_deferred_completions(ops); + if (need_interrupt) + interrupter_.interrupt(); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + // || (!defined(ASIO_HAS_DEV_POLL) + // && !defined(ASIO_HAS_EPOLL) + // && !defined(ASIO_HAS_KQUEUE)) + // && !defined(ASIO_WINDOWS_RUNTIME)) + +#endif // ASIO_DETAIL_IMPL_SELECT_REACTOR_IPP diff --git a/include/asio/include/asio/detail/impl/service_registry.hpp b/include/asio/include/asio/detail/impl/service_registry.hpp new file mode 100644 index 0000000..ca73d2f --- /dev/null +++ b/include/asio/include/asio/detail/impl/service_registry.hpp @@ -0,0 +1,94 @@ +// +// detail/impl/service_registry.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP +#define ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +Service& service_registry::use_service() +{ + execution_context::service::key key; + init_key(key, 0); + factory_type factory = &service_registry::create; + return *static_cast(do_use_service(key, factory, &owner_)); +} + +template +Service& service_registry::use_service(io_context& owner) +{ + execution_context::service::key key; + init_key(key, 0); + factory_type factory = &service_registry::create; + return *static_cast(do_use_service(key, factory, &owner)); +} + +template +void service_registry::add_service(Service* new_service) +{ + execution_context::service::key key; + init_key(key, 0); + return do_add_service(key, new_service); +} + +template +bool service_registry::has_service() const +{ + execution_context::service::key key; + init_key(key, 0); + return do_has_service(key); +} + +template +inline void service_registry::init_key( + execution_context::service::key& key, ...) +{ + init_key_from_id(key, Service::id); +} + +#if !defined(ASIO_NO_TYPEID) +template +void service_registry::init_key(execution_context::service::key& key, + typename enable_if< + is_base_of::value>::type*) +{ + key.type_info_ = &typeid(typeid_wrapper); + key.id_ = 0; +} + +template +void service_registry::init_key_from_id(execution_context::service::key& key, + const service_id& /*id*/) +{ + key.type_info_ = &typeid(typeid_wrapper); + key.id_ = 0; +} +#endif // !defined(ASIO_NO_TYPEID) + +template +execution_context::service* service_registry::create(void* owner) +{ + return new Service(*static_cast(owner)); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP diff --git a/include/asio/include/asio/detail/impl/service_registry.ipp b/include/asio/include/asio/detail/impl/service_registry.ipp new file mode 100644 index 0000000..e9a14fe --- /dev/null +++ b/include/asio/include/asio/detail/impl/service_registry.ipp @@ -0,0 +1,197 @@ +// +// detail/impl/service_registry.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_SERVICE_REGISTRY_IPP +#define ASIO_DETAIL_IMPL_SERVICE_REGISTRY_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/service_registry.hpp" +#include "asio/detail/throw_exception.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +service_registry::service_registry(execution_context& owner) + : owner_(owner), + first_service_(0) +{ +} + +service_registry::~service_registry() +{ +} + +void service_registry::shutdown_services() +{ + execution_context::service* service = first_service_; + while (service) + { + service->shutdown(); + service = service->next_; + } +} + +void service_registry::destroy_services() +{ + while (first_service_) + { + execution_context::service* next_service = first_service_->next_; + destroy(first_service_); + first_service_ = next_service; + } +} + +void service_registry::notify_fork(execution_context::fork_event fork_ev) +{ + // Make a copy of all of the services while holding the lock. We don't want + // to hold the lock while calling into each service, as it may try to call + // back into this class. + std::vector services; + { + asio::detail::mutex::scoped_lock lock(mutex_); + execution_context::service* service = first_service_; + while (service) + { + services.push_back(service); + service = service->next_; + } + } + + // If processing the fork_prepare event, we want to go in reverse order of + // service registration, which happens to be the existing order of the + // services in the vector. For the other events we want to go in the other + // direction. + std::size_t num_services = services.size(); + if (fork_ev == execution_context::fork_prepare) + for (std::size_t i = 0; i < num_services; ++i) + services[i]->notify_fork(fork_ev); + else + for (std::size_t i = num_services; i > 0; --i) + services[i - 1]->notify_fork(fork_ev); +} + +void service_registry::init_key_from_id(execution_context::service::key& key, + const execution_context::id& id) +{ + key.type_info_ = 0; + key.id_ = &id; +} + +bool service_registry::keys_match( + const execution_context::service::key& key1, + const execution_context::service::key& key2) +{ + if (key1.id_ && key2.id_) + if (key1.id_ == key2.id_) + return true; + if (key1.type_info_ && key2.type_info_) + if (*key1.type_info_ == *key2.type_info_) + return true; + return false; +} + +void service_registry::destroy(execution_context::service* service) +{ + delete service; +} + +execution_context::service* service_registry::do_use_service( + const execution_context::service::key& key, + factory_type factory, void* owner) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + // First see if there is an existing service object with the given key. + execution_context::service* service = first_service_; + while (service) + { + if (keys_match(service->key_, key)) + return service; + service = service->next_; + } + + // Create a new service object. The service registry's mutex is not locked + // at this time to allow for nested calls into this function from the new + // service's constructor. + lock.unlock(); + auto_service_ptr new_service = { factory(owner) }; + new_service.ptr_->key_ = key; + lock.lock(); + + // Check that nobody else created another service object of the same type + // while the lock was released. + service = first_service_; + while (service) + { + if (keys_match(service->key_, key)) + return service; + service = service->next_; + } + + // Service was successfully initialised, pass ownership to registry. + new_service.ptr_->next_ = first_service_; + first_service_ = new_service.ptr_; + new_service.ptr_ = 0; + return first_service_; +} + +void service_registry::do_add_service( + const execution_context::service::key& key, + execution_context::service* new_service) +{ + if (&owner_ != &new_service->context()) + asio::detail::throw_exception(invalid_service_owner()); + + asio::detail::mutex::scoped_lock lock(mutex_); + + // Check if there is an existing service object with the given key. + execution_context::service* service = first_service_; + while (service) + { + if (keys_match(service->key_, key)) + asio::detail::throw_exception(service_already_exists()); + service = service->next_; + } + + // Take ownership of the service object. + new_service->key_ = key; + new_service->next_ = first_service_; + first_service_ = new_service; +} + +bool service_registry::do_has_service( + const execution_context::service::key& key) const +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + execution_context::service* service = first_service_; + while (service) + { + if (keys_match(service->key_, key)) + return true; + service = service->next_; + } + + return false; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_SERVICE_REGISTRY_IPP diff --git a/include/asio/include/asio/detail/impl/signal_set_service.ipp b/include/asio/include/asio/detail/impl/signal_set_service.ipp new file mode 100644 index 0000000..b99060c --- /dev/null +++ b/include/asio/include/asio/detail/impl/signal_set_service.ipp @@ -0,0 +1,668 @@ +// +// detail/impl/signal_set_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_SIGNAL_SET_SERVICE_IPP +#define ASIO_DETAIL_IMPL_SIGNAL_SET_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include +#include +#include "asio/detail/reactor.hpp" +#include "asio/detail/signal_blocker.hpp" +#include "asio/detail/signal_set_service.hpp" +#include "asio/detail/static_mutex.hpp" +#include "asio/detail/throw_exception.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct signal_state +{ + // Mutex used for protecting global state. + static_mutex mutex_; + + // The read end of the pipe used for signal notifications. + int read_descriptor_; + + // The write end of the pipe used for signal notifications. + int write_descriptor_; + + // Whether the signal state has been prepared for a fork. + bool fork_prepared_; + + // The head of a linked list of all signal_set_service instances. + class signal_set_service* service_list_; + + // A count of the number of objects that are registered for each signal. + std::size_t registration_count_[max_signal_number]; +}; + +signal_state* get_signal_state() +{ + static signal_state state = { + ASIO_STATIC_MUTEX_INIT, -1, -1, false, 0, { 0 } }; + return &state; +} + +void asio_signal_handler(int signal_number) +{ +#if defined(ASIO_WINDOWS) \ + || defined(ASIO_WINDOWS_RUNTIME) \ + || defined(__CYGWIN__) + signal_set_service::deliver_signal(signal_number); +#else // defined(ASIO_WINDOWS) + // || defined(ASIO_WINDOWS_RUNTIME) + // || defined(__CYGWIN__) + int saved_errno = errno; + signal_state* state = get_signal_state(); + signed_size_type result = ::write(state->write_descriptor_, + &signal_number, sizeof(signal_number)); + (void)result; + errno = saved_errno; +#endif // defined(ASIO_WINDOWS) + // || defined(ASIO_WINDOWS_RUNTIME) + // || defined(__CYGWIN__) + +#if defined(ASIO_HAS_SIGNAL) && !defined(ASIO_HAS_SIGACTION) + ::signal(signal_number, asio_signal_handler); +#endif // defined(ASIO_HAS_SIGNAL) && !defined(ASIO_HAS_SIGACTION) +} + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) +class signal_set_service::pipe_read_op : public reactor_op +{ +public: + pipe_read_op() + : reactor_op(asio::error_code(), + &pipe_read_op::do_perform, pipe_read_op::do_complete) + { + } + + static status do_perform(reactor_op*) + { + signal_state* state = get_signal_state(); + + int fd = state->read_descriptor_; + int signal_number = 0; + while (::read(fd, &signal_number, sizeof(int)) == sizeof(int)) + if (signal_number >= 0 && signal_number < max_signal_number) + signal_set_service::deliver_signal(signal_number); + + return not_done; + } + + static void do_complete(void* /*owner*/, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + pipe_read_op* o(static_cast(base)); + delete o; + } +}; +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + +signal_set_service::signal_set_service(execution_context& context) + : execution_context_service_base(context), + scheduler_(asio::use_service(context)), +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + reactor_(asio::use_service(context)), +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + next_(0), + prev_(0) +{ + get_signal_state()->mutex_.init(); + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + reactor_.init_task(); +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + + for (int i = 0; i < max_signal_number; ++i) + registrations_[i] = 0; + + add_service(this); +} + +signal_set_service::~signal_set_service() +{ + remove_service(this); +} + +void signal_set_service::shutdown() +{ + remove_service(this); + + op_queue ops; + + for (int i = 0; i < max_signal_number; ++i) + { + registration* reg = registrations_[i]; + while (reg) + { + ops.push(*reg->queue_); + reg = reg->next_in_table_; + } + } + + scheduler_.abandon_operations(ops); +} + +void signal_set_service::notify_fork(execution_context::fork_event fork_ev) +{ +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + switch (fork_ev) + { + case execution_context::fork_prepare: + { + int read_descriptor = state->read_descriptor_; + state->fork_prepared_ = true; + lock.unlock(); + reactor_.deregister_internal_descriptor(read_descriptor, reactor_data_); + reactor_.cleanup_descriptor_data(reactor_data_); + } + break; + case execution_context::fork_parent: + if (state->fork_prepared_) + { + int read_descriptor = state->read_descriptor_; + state->fork_prepared_ = false; + lock.unlock(); + reactor_.register_internal_descriptor(reactor::read_op, + read_descriptor, reactor_data_, new pipe_read_op); + } + break; + case execution_context::fork_child: + if (state->fork_prepared_) + { + asio::detail::signal_blocker blocker; + close_descriptors(); + open_descriptors(); + int read_descriptor = state->read_descriptor_; + state->fork_prepared_ = false; + lock.unlock(); + reactor_.register_internal_descriptor(reactor::read_op, + read_descriptor, reactor_data_, new pipe_read_op); + } + break; + default: + break; + } +#else // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + (void)fork_ev; +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +} + +void signal_set_service::construct( + signal_set_service::implementation_type& impl) +{ + impl.signals_ = 0; +} + +void signal_set_service::destroy( + signal_set_service::implementation_type& impl) +{ + asio::error_code ignored_ec; + clear(impl, ignored_ec); + cancel(impl, ignored_ec); +} + +asio::error_code signal_set_service::add( + signal_set_service::implementation_type& impl, + int signal_number, asio::error_code& ec) +{ + // Check that the signal number is valid. + if (signal_number < 0 || signal_number >= max_signal_number) + { + ec = asio::error::invalid_argument; + return ec; + } + + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + // Find the appropriate place to insert the registration. + registration** insertion_point = &impl.signals_; + registration* next = impl.signals_; + while (next && next->signal_number_ < signal_number) + { + insertion_point = &next->next_in_set_; + next = next->next_in_set_; + } + + // Only do something if the signal is not already registered. + if (next == 0 || next->signal_number_ != signal_number) + { + registration* new_registration = new registration; + +#if defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION) + // Register for the signal if we're the first. + if (state->registration_count_[signal_number] == 0) + { +# if defined(ASIO_HAS_SIGACTION) + using namespace std; // For memset. + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = asio_signal_handler; + sigfillset(&sa.sa_mask); + if (::sigaction(signal_number, &sa, 0) == -1) +# else // defined(ASIO_HAS_SIGACTION) + if (::signal(signal_number, asio_signal_handler) == SIG_ERR) +# endif // defined(ASIO_HAS_SIGACTION) + { +# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ec = asio::error::invalid_argument; +# else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ec = asio::error_code(errno, + asio::error::get_system_category()); +# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + delete new_registration; + return ec; + } + } +#endif // defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION) + + // Record the new registration in the set. + new_registration->signal_number_ = signal_number; + new_registration->queue_ = &impl.queue_; + new_registration->next_in_set_ = next; + *insertion_point = new_registration; + + // Insert registration into the registration table. + new_registration->next_in_table_ = registrations_[signal_number]; + if (registrations_[signal_number]) + registrations_[signal_number]->prev_in_table_ = new_registration; + registrations_[signal_number] = new_registration; + + ++state->registration_count_[signal_number]; + } + + ec = asio::error_code(); + return ec; +} + +asio::error_code signal_set_service::remove( + signal_set_service::implementation_type& impl, + int signal_number, asio::error_code& ec) +{ + // Check that the signal number is valid. + if (signal_number < 0 || signal_number >= max_signal_number) + { + ec = asio::error::invalid_argument; + return ec; + } + + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + // Find the signal number in the list of registrations. + registration** deletion_point = &impl.signals_; + registration* reg = impl.signals_; + while (reg && reg->signal_number_ < signal_number) + { + deletion_point = ®->next_in_set_; + reg = reg->next_in_set_; + } + + if (reg != 0 && reg->signal_number_ == signal_number) + { +#if defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION) + // Set signal handler back to the default if we're the last. + if (state->registration_count_[signal_number] == 1) + { +# if defined(ASIO_HAS_SIGACTION) + using namespace std; // For memset. + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = SIG_DFL; + if (::sigaction(signal_number, &sa, 0) == -1) +# else // defined(ASIO_HAS_SIGACTION) + if (::signal(signal_number, SIG_DFL) == SIG_ERR) +# endif // defined(ASIO_HAS_SIGACTION) + { +# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ec = asio::error::invalid_argument; +# else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ec = asio::error_code(errno, + asio::error::get_system_category()); +# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + return ec; + } + } +#endif // defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION) + + // Remove the registration from the set. + *deletion_point = reg->next_in_set_; + + // Remove the registration from the registration table. + if (registrations_[signal_number] == reg) + registrations_[signal_number] = reg->next_in_table_; + if (reg->prev_in_table_) + reg->prev_in_table_->next_in_table_ = reg->next_in_table_; + if (reg->next_in_table_) + reg->next_in_table_->prev_in_table_ = reg->prev_in_table_; + + --state->registration_count_[signal_number]; + + delete reg; + } + + ec = asio::error_code(); + return ec; +} + +asio::error_code signal_set_service::clear( + signal_set_service::implementation_type& impl, + asio::error_code& ec) +{ + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + while (registration* reg = impl.signals_) + { +#if defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION) + // Set signal handler back to the default if we're the last. + if (state->registration_count_[reg->signal_number_] == 1) + { +# if defined(ASIO_HAS_SIGACTION) + using namespace std; // For memset. + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = SIG_DFL; + if (::sigaction(reg->signal_number_, &sa, 0) == -1) +# else // defined(ASIO_HAS_SIGACTION) + if (::signal(reg->signal_number_, SIG_DFL) == SIG_ERR) +# endif // defined(ASIO_HAS_SIGACTION) + { +# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ec = asio::error::invalid_argument; +# else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ec = asio::error_code(errno, + asio::error::get_system_category()); +# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + return ec; + } + } +#endif // defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION) + + // Remove the registration from the registration table. + if (registrations_[reg->signal_number_] == reg) + registrations_[reg->signal_number_] = reg->next_in_table_; + if (reg->prev_in_table_) + reg->prev_in_table_->next_in_table_ = reg->next_in_table_; + if (reg->next_in_table_) + reg->next_in_table_->prev_in_table_ = reg->prev_in_table_; + + --state->registration_count_[reg->signal_number_]; + + impl.signals_ = reg->next_in_set_; + delete reg; + } + + ec = asio::error_code(); + return ec; +} + +asio::error_code signal_set_service::cancel( + signal_set_service::implementation_type& impl, + asio::error_code& ec) +{ + ASIO_HANDLER_OPERATION((scheduler_.context(), + "signal_set", &impl, 0, "cancel")); + + op_queue ops; + { + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + while (signal_op* op = impl.queue_.front()) + { + op->ec_ = asio::error::operation_aborted; + impl.queue_.pop(); + ops.push(op); + } + } + + scheduler_.post_deferred_completions(ops); + + ec = asio::error_code(); + return ec; +} + +void signal_set_service::deliver_signal(int signal_number) +{ + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + signal_set_service* service = state->service_list_; + while (service) + { + op_queue ops; + + registration* reg = service->registrations_[signal_number]; + while (reg) + { + if (reg->queue_->empty()) + { + ++reg->undelivered_; + } + else + { + while (signal_op* op = reg->queue_->front()) + { + op->signal_number_ = signal_number; + reg->queue_->pop(); + ops.push(op); + } + } + + reg = reg->next_in_table_; + } + + service->scheduler_.post_deferred_completions(ops); + + service = service->next_; + } +} + +void signal_set_service::add_service(signal_set_service* service) +{ + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + // If this is the first service to be created, open a new pipe. + if (state->service_list_ == 0) + open_descriptors(); +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + + // If a scheduler_ object is thread-unsafe then it must be the only + // scheduler used to create signal_set objects. + if (state->service_list_ != 0) + { + if (!ASIO_CONCURRENCY_HINT_IS_LOCKING(SCHEDULER, + service->scheduler_.concurrency_hint()) + || !ASIO_CONCURRENCY_HINT_IS_LOCKING(SCHEDULER, + state->service_list_->scheduler_.concurrency_hint())) + { + std::logic_error ex( + "Thread-unsafe execution context objects require " + "exclusive access to signal handling."); + asio::detail::throw_exception(ex); + } + } + + // Insert service into linked list of all services. + service->next_ = state->service_list_; + service->prev_ = 0; + if (state->service_list_) + state->service_list_->prev_ = service; + state->service_list_ = service; + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + // Register for pipe readiness notifications. + int read_descriptor = state->read_descriptor_; + lock.unlock(); + service->reactor_.register_internal_descriptor(reactor::read_op, + read_descriptor, service->reactor_data_, new pipe_read_op); +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +} + +void signal_set_service::remove_service(signal_set_service* service) +{ + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + if (service->next_ || service->prev_ || state->service_list_ == service) + { +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + // Disable the pipe readiness notifications. + int read_descriptor = state->read_descriptor_; + lock.unlock(); + service->reactor_.deregister_internal_descriptor( + read_descriptor, service->reactor_data_); + service->reactor_.cleanup_descriptor_data(service->reactor_data_); + lock.lock(); +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + + // Remove service from linked list of all services. + if (state->service_list_ == service) + state->service_list_ = service->next_; + if (service->prev_) + service->prev_->next_ = service->next_; + if (service->next_) + service->next_->prev_= service->prev_; + service->next_ = 0; + service->prev_ = 0; + +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + // If this is the last service to be removed, close the pipe. + if (state->service_list_ == 0) + close_descriptors(); +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + } +} + +void signal_set_service::open_descriptors() +{ +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + signal_state* state = get_signal_state(); + + int pipe_fds[2]; + if (::pipe(pipe_fds) == 0) + { + state->read_descriptor_ = pipe_fds[0]; + ::fcntl(state->read_descriptor_, F_SETFL, O_NONBLOCK); + + state->write_descriptor_ = pipe_fds[1]; + ::fcntl(state->write_descriptor_, F_SETFL, O_NONBLOCK); + +#if defined(FD_CLOEXEC) + ::fcntl(state->read_descriptor_, F_SETFD, FD_CLOEXEC); + ::fcntl(state->write_descriptor_, F_SETFD, FD_CLOEXEC); +#endif // defined(FD_CLOEXEC) + } + else + { + asio::error_code ec(errno, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "signal_set_service pipe"); + } +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +} + +void signal_set_service::close_descriptors() +{ +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + signal_state* state = get_signal_state(); + + if (state->read_descriptor_ != -1) + ::close(state->read_descriptor_); + state->read_descriptor_ = -1; + + if (state->write_descriptor_ != -1) + ::close(state->write_descriptor_); + state->write_descriptor_ = -1; +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) +} + +void signal_set_service::start_wait_op( + signal_set_service::implementation_type& impl, signal_op* op) +{ + scheduler_.work_started(); + + signal_state* state = get_signal_state(); + static_mutex::scoped_lock lock(state->mutex_); + + registration* reg = impl.signals_; + while (reg) + { + if (reg->undelivered_ > 0) + { + --reg->undelivered_; + op->signal_number_ = reg->signal_number_; + scheduler_.post_deferred_completion(op); + return; + } + + reg = reg->next_in_set_; + } + + impl.queue_.push(op); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_SIGNAL_SET_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/socket_ops.ipp b/include/asio/include/asio/detail/impl/socket_ops.ipp new file mode 100644 index 0000000..4bf06ee --- /dev/null +++ b/include/asio/include/asio/detail/impl/socket_ops.ipp @@ -0,0 +1,3962 @@ +// +// detail/impl/socket_ops.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOCKET_OPS_IPP +#define ASIO_DETAIL_SOCKET_OPS_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include +#include +#include +#include +#include +#include +#include "asio/detail/assert.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) +# include +# include +# include +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) \ + || defined(__MACH__) && defined(__APPLE__) +# if defined(ASIO_HAS_PTHREADS) +# include +# endif // defined(ASIO_HAS_PTHREADS) +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // || defined(__MACH__) && defined(__APPLE__) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { +namespace socket_ops { + +#if !defined(ASIO_WINDOWS_RUNTIME) + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +struct msghdr { int msg_namelen; }; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#if defined(__hpux) +// HP-UX doesn't declare these functions extern "C", so they are declared again +// here to avoid linker errors about undefined symbols. +extern "C" char* if_indextoname(unsigned int, char*); +extern "C" unsigned int if_nametoindex(const char*); +#endif // defined(__hpux) + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +inline void clear_last_error() +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + WSASetLastError(0); +#else + errno = 0; +#endif +} + +#if !defined(ASIO_WINDOWS_RUNTIME) + +inline void get_last_error( + asio::error_code& ec, bool is_error_condition) +{ + if (!is_error_condition) + { + ec.assign(0, ec.category()); + } + else + { +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ec = asio::error_code(WSAGetLastError(), + asio::error::get_system_category()); +#else + ec = asio::error_code(errno, + asio::error::get_system_category()); +#endif + } +} + +template +inline socket_type call_accept(SockLenType msghdr::*, + socket_type s, socket_addr_type* addr, std::size_t* addrlen) +{ + SockLenType tmp_addrlen = addrlen ? (SockLenType)*addrlen : 0; + socket_type result = ::accept(s, addr, addrlen ? &tmp_addrlen : 0); + if (addrlen) + *addrlen = (std::size_t)tmp_addrlen; + return result; +} + +socket_type accept(socket_type s, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return invalid_socket; + } + + socket_type new_s = call_accept(&msghdr::msg_namelen, s, addr, addrlen); + get_last_error(ec, new_s == invalid_socket); + if (new_s == invalid_socket) + return new_s; + +#if defined(__MACH__) && defined(__APPLE__) || defined(__FreeBSD__) + int optval = 1; + int result = ::setsockopt(new_s, SOL_SOCKET, + SO_NOSIGPIPE, &optval, sizeof(optval)); + get_last_error(ec, result != 0); + if (result != 0) + { + ::close(new_s); + return invalid_socket; + } +#endif + + ec.assign(0, ec.category()); + return new_s; +} + +socket_type sync_accept(socket_type s, state_type state, + socket_addr_type* addr, std::size_t* addrlen, asio::error_code& ec) +{ + // Accept a socket. + for (;;) + { + // Try to complete the operation without blocking. + socket_type new_socket = socket_ops::accept(s, addr, addrlen, ec); + + // Check if operation succeeded. + if (new_socket != invalid_socket) + return new_socket; + + // Operation failed. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + { + if (state & user_set_non_blocking) + return invalid_socket; + // Fall through to retry operation. + } + else if (ec == asio::error::connection_aborted) + { + if (state & enable_connection_aborted) + return invalid_socket; + // Fall through to retry operation. + } +#if defined(EPROTO) + else if (ec.value() == EPROTO) + { + if (state & enable_connection_aborted) + return invalid_socket; + // Fall through to retry operation. + } +#endif // defined(EPROTO) + else + return invalid_socket; + + // Wait for socket to become ready. + if (socket_ops::poll_read(s, 0, -1, ec) < 0) + return invalid_socket; + } +} + +#if defined(ASIO_HAS_IOCP) + +void complete_iocp_accept(socket_type s, + void* output_buffer, DWORD address_length, + socket_addr_type* addr, std::size_t* addrlen, + socket_type new_socket, asio::error_code& ec) +{ + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_aborted; + + if (!ec) + { + // Get the address of the peer. + if (addr && addrlen) + { + LPSOCKADDR local_addr = 0; + int local_addr_length = 0; + LPSOCKADDR remote_addr = 0; + int remote_addr_length = 0; + GetAcceptExSockaddrs(output_buffer, 0, address_length, + address_length, &local_addr, &local_addr_length, + &remote_addr, &remote_addr_length); + if (static_cast(remote_addr_length) > *addrlen) + { + ec = asio::error::invalid_argument; + } + else + { + using namespace std; // For memcpy. + memcpy(addr, remote_addr, remote_addr_length); + *addrlen = static_cast(remote_addr_length); + } + } + + // Need to set the SO_UPDATE_ACCEPT_CONTEXT option so that getsockname + // and getpeername will work on the accepted socket. + SOCKET update_ctx_param = s; + socket_ops::state_type state = 0; + socket_ops::setsockopt(new_socket, state, + SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, + &update_ctx_param, sizeof(SOCKET), ec); + } +} + +#else // defined(ASIO_HAS_IOCP) + +bool non_blocking_accept(socket_type s, + state_type state, socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec, socket_type& new_socket) +{ + for (;;) + { + // Accept the waiting connection. + new_socket = socket_ops::accept(s, addr, addrlen, ec); + + // Check if operation succeeded. + if (new_socket != invalid_socket) + return true; + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Operation failed. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + { + // Fall through to retry operation. + } + else if (ec == asio::error::connection_aborted) + { + if (state & enable_connection_aborted) + return true; + // Fall through to retry operation. + } +#if defined(EPROTO) + else if (ec.value() == EPROTO) + { + if (state & enable_connection_aborted) + return true; + // Fall through to retry operation. + } +#endif // defined(EPROTO) + else + return true; + + return false; + } +} + +#endif // defined(ASIO_HAS_IOCP) + +template +inline int call_bind(SockLenType msghdr::*, + socket_type s, const socket_addr_type* addr, std::size_t addrlen) +{ + return ::bind(s, addr, (SockLenType)addrlen); +} + +int bind(socket_type s, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + + int result = call_bind(&msghdr::msg_namelen, s, addr, addrlen); + get_last_error(ec, result != 0); + return result; +} + +int close(socket_type s, state_type& state, + bool destruction, asio::error_code& ec) +{ + int result = 0; + if (s != invalid_socket) + { + // We don't want the destructor to block, so set the socket to linger in + // the background. If the user doesn't like this behaviour then they need + // to explicitly close the socket. + if (destruction && (state & user_set_linger)) + { + ::linger opt; + opt.l_onoff = 0; + opt.l_linger = 0; + asio::error_code ignored_ec; + socket_ops::setsockopt(s, state, SOL_SOCKET, + SO_LINGER, &opt, sizeof(opt), ignored_ec); + } + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + result = ::closesocket(s); +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + result = ::close(s); +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + get_last_error(ec, result != 0); + + if (result != 0 + && (ec == asio::error::would_block + || ec == asio::error::try_again)) + { + // According to UNIX Network Programming Vol. 1, it is possible for + // close() to fail with EWOULDBLOCK under certain circumstances. What + // isn't clear is the state of the descriptor after this error. The one + // current OS where this behaviour is seen, Windows, says that the socket + // remains open. Therefore we'll put the descriptor back into blocking + // mode and have another attempt at closing it. +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ioctl_arg_type arg = 0; + ::ioctlsocket(s, FIONBIO, &arg); +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + int flags = ::fcntl(s, F_GETFL, 0); + if (flags >= 0) + ::fcntl(s, F_SETFL, flags & ~O_NONBLOCK); +# else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + ioctl_arg_type arg = 0; + ::ioctl(s, FIONBIO, &arg); +# endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + state &= ~non_blocking; + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + result = ::closesocket(s); +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + result = ::close(s); +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + get_last_error(ec, result != 0); + } + } + + return result; +} + +bool set_user_non_blocking(socket_type s, + state_type& state, bool value, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return false; + } + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ioctl_arg_type arg = (value ? 1 : 0); + int result = ::ioctlsocket(s, FIONBIO, &arg); + get_last_error(ec, result < 0); +#elif defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + int result = ::fcntl(s, F_GETFL, 0); + get_last_error(ec, result < 0); + if (result >= 0) + { + int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK)); + result = ::fcntl(s, F_SETFL, flag); + get_last_error(ec, result < 0); + } +#else + ioctl_arg_type arg = (value ? 1 : 0); + int result = ::ioctl(s, FIONBIO, &arg); + get_last_error(ec, result < 0); +#endif + + if (result >= 0) + { + if (value) + state |= user_set_non_blocking; + else + { + // Clearing the user-set non-blocking mode always overrides any + // internally-set non-blocking flag. Any subsequent asynchronous + // operations will need to re-enable non-blocking I/O. + state &= ~(user_set_non_blocking | internal_non_blocking); + } + return true; + } + + return false; +} + +bool set_internal_non_blocking(socket_type s, + state_type& state, bool value, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return false; + } + + if (!value && (state & user_set_non_blocking)) + { + // It does not make sense to clear the internal non-blocking flag if the + // user still wants non-blocking behaviour. Return an error and let the + // caller figure out whether to update the user-set non-blocking flag. + ec = asio::error::invalid_argument; + return false; + } + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + ioctl_arg_type arg = (value ? 1 : 0); + int result = ::ioctlsocket(s, FIONBIO, &arg); + get_last_error(ec, result < 0); +#elif defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__) + int result = ::fcntl(s, F_GETFL, 0); + get_last_error(ec, result < 0); + if (result >= 0) + { + int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK)); + result = ::fcntl(s, F_SETFL, flag); + get_last_error(ec, result < 0); + } +#else + ioctl_arg_type arg = (value ? 1 : 0); + int result = ::ioctl(s, FIONBIO, &arg); + get_last_error(ec, result < 0); +#endif + + if (result >= 0) + { + if (value) + state |= internal_non_blocking; + else + state &= ~internal_non_blocking; + return true; + } + + return false; +} + +int shutdown(socket_type s, int what, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + + int result = ::shutdown(s, what); + get_last_error(ec, result != 0); + return result; +} + +template +inline int call_connect(SockLenType msghdr::*, + socket_type s, const socket_addr_type* addr, std::size_t addrlen) +{ + return ::connect(s, addr, (SockLenType)addrlen); +} + +int connect(socket_type s, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + + int result = call_connect(&msghdr::msg_namelen, s, addr, addrlen); + get_last_error(ec, result != 0); +#if defined(__linux__) + if (result != 0 && ec == asio::error::try_again) + ec = asio::error::no_buffer_space; +#endif // defined(__linux__) + return result; +} + +void sync_connect(socket_type s, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec) +{ + // Perform the connect operation. + socket_ops::connect(s, addr, addrlen, ec); + if (ec != asio::error::in_progress + && ec != asio::error::would_block) + { + // The connect operation finished immediately. + return; + } + + // Wait for socket to become ready. + if (socket_ops::poll_connect(s, -1, ec) < 0) + return; + + // Get the error code from the connect operation. + int connect_error = 0; + size_t connect_error_len = sizeof(connect_error); + if (socket_ops::getsockopt(s, 0, SOL_SOCKET, SO_ERROR, + &connect_error, &connect_error_len, ec) == socket_error_retval) + return; + + // Return the result of the connect operation. + ec = asio::error_code(connect_error, + asio::error::get_system_category()); +} + +#if defined(ASIO_HAS_IOCP) + +void complete_iocp_connect(socket_type s, asio::error_code& ec) +{ + // Map non-portable errors to their portable counterparts. + switch (ec.value()) + { + case ERROR_CONNECTION_REFUSED: + ec = asio::error::connection_refused; + break; + case ERROR_NETWORK_UNREACHABLE: + ec = asio::error::network_unreachable; + break; + case ERROR_HOST_UNREACHABLE: + ec = asio::error::host_unreachable; + break; + case ERROR_SEM_TIMEOUT: + ec = asio::error::timed_out; + break; + default: + break; + } + + if (!ec) + { + // Need to set the SO_UPDATE_CONNECT_CONTEXT option so that getsockname + // and getpeername will work on the connected socket. + socket_ops::state_type state = 0; + const int so_update_connect_context = 0x7010; + socket_ops::setsockopt(s, state, SOL_SOCKET, + so_update_connect_context, 0, 0, ec); + } +} + +#endif // defined(ASIO_HAS_IOCP) + +bool non_blocking_connect(socket_type s, asio::error_code& ec) +{ + // Check if the connect operation has finished. This is required since we may + // get spurious readiness notifications from the reactor. +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + fd_set write_fds; + FD_ZERO(&write_fds); + FD_SET(s, &write_fds); + fd_set except_fds; + FD_ZERO(&except_fds); + FD_SET(s, &except_fds); + timeval zero_timeout; + zero_timeout.tv_sec = 0; + zero_timeout.tv_usec = 0; + int ready = ::select(s + 1, 0, &write_fds, &except_fds, &zero_timeout); +#else // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + pollfd fds; + fds.fd = s; + fds.events = POLLOUT; + fds.revents = 0; + int ready = ::poll(&fds, 1, 0); +#endif // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + if (ready == 0) + { + // The asynchronous connect operation is still in progress. + return false; + } + + // Get the error code from the connect operation. + int connect_error = 0; + size_t connect_error_len = sizeof(connect_error); + if (socket_ops::getsockopt(s, 0, SOL_SOCKET, SO_ERROR, + &connect_error, &connect_error_len, ec) == 0) + { + if (connect_error) + { + ec = asio::error_code(connect_error, + asio::error::get_system_category()); + } + else + ec.assign(0, ec.category()); + } + + return true; +} + +int socketpair(int af, int type, int protocol, + socket_type sv[2], asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + (void)(af); + (void)(type); + (void)(protocol); + (void)(sv); + ec = asio::error::operation_not_supported; + return socket_error_retval; +#else + int result = ::socketpair(af, type, protocol, sv); + get_last_error(ec, result != 0); + return result; +#endif +} + +bool sockatmark(socket_type s, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return false; + } + +#if defined(SIOCATMARK) + ioctl_arg_type value = 0; +# if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + int result = ::ioctlsocket(s, SIOCATMARK, &value); +# else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + int result = ::ioctl(s, SIOCATMARK, &value); +# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + get_last_error(ec, result < 0); +# if defined(ENOTTY) + if (ec.value() == ENOTTY) + ec = asio::error::not_socket; +# endif // defined(ENOTTY) +#else // defined(SIOCATMARK) + int value = ::sockatmark(s); + get_last_error(ec, result < 0); +#endif // defined(SIOCATMARK) + + return ec ? false : value != 0; +} + +size_t available(socket_type s, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + ioctl_arg_type value = 0; +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + int result = ::ioctlsocket(s, FIONREAD, &value); +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + int result = ::ioctl(s, FIONREAD, &value); +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + get_last_error(ec, result < 0); +#if defined(ENOTTY) + if (ec.value() == ENOTTY) + ec = asio::error::not_socket; +#endif // defined(ENOTTY) + + return ec ? static_cast(0) : static_cast(value); +} + +int listen(socket_type s, int backlog, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + + int result = ::listen(s, backlog); + get_last_error(ec, result != 0); + return result; +} + +inline void init_buf_iov_base(void*& base, void* addr) +{ + base = addr; +} + +template +inline void init_buf_iov_base(T& base, void* addr) +{ + base = static_cast(addr); +} + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +typedef WSABUF buf; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +typedef iovec buf; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +void init_buf(buf& b, void* data, size_t size) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + b.buf = static_cast(data); + b.len = static_cast(size); +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + init_buf_iov_base(b.iov_base, data); + b.iov_len = size; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +void init_buf(buf& b, const void* data, size_t size) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + b.buf = static_cast(const_cast(data)); + b.len = static_cast(size); +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + init_buf_iov_base(b.iov_base, const_cast(data)); + b.iov_len = size; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +inline void init_msghdr_msg_name(void*& name, socket_addr_type* addr) +{ + name = addr; +} + +inline void init_msghdr_msg_name(void*& name, const socket_addr_type* addr) +{ + name = const_cast(addr); +} + +template +inline void init_msghdr_msg_name(T& name, socket_addr_type* addr) +{ + name = reinterpret_cast(addr); +} + +template +inline void init_msghdr_msg_name(T& name, const socket_addr_type* addr) +{ + name = reinterpret_cast(const_cast(addr)); +} + +signed_size_type recv(socket_type s, buf* bufs, size_t count, + int flags, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Receive some data. + DWORD recv_buf_count = static_cast(count); + DWORD bytes_transferred = 0; + DWORD recv_flags = flags; + int result = ::WSARecv(s, bufs, recv_buf_count, + &bytes_transferred, &recv_flags, 0, 0); + get_last_error(ec, true); + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) + result = 0; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + msghdr msg = msghdr(); + msg.msg_iov = bufs; + msg.msg_iovlen = static_cast(count); + signed_size_type result = ::recvmsg(s, &msg, flags); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +signed_size_type recv1(socket_type s, void* data, size_t size, + int flags, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Receive some data. + WSABUF buf; + buf.buf = const_cast(static_cast(data)); + buf.len = static_cast(size); + DWORD bytes_transferred = 0; + DWORD recv_flags = flags; + int result = ::WSARecv(s, &buf, 1, + &bytes_transferred, &recv_flags, 0, 0); + get_last_error(ec, true); + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) + result = 0; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + signed_size_type result = ::recv(s, static_cast(data), size, flags); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +size_t sync_recv(socket_type s, state_type state, buf* bufs, + size_t count, int flags, bool all_empty, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to read 0 bytes on a stream is a no-op. + if (all_empty && (state & stream_oriented)) + { + ec.assign(0, ec.category()); + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::recv(s, bufs, count, flags, ec); + + // Check for EOF. + if ((state & stream_oriented) && bytes == 0) + { + ec = asio::error::eof; + return 0; + } + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_read(s, 0, -1, ec) < 0) + return 0; + } +} + +size_t sync_recv1(socket_type s, state_type state, void* data, + size_t size, int flags, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to read 0 bytes on a stream is a no-op. + if (size == 0 && (state & stream_oriented)) + { + ec.assign(0, ec.category()); + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::recv1(s, data, size, flags, ec); + + // Check for EOF. + if ((state & stream_oriented) && bytes == 0) + { + ec = asio::error::eof; + return 0; + } + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_read(s, 0, -1, ec) < 0) + return 0; + } +} + +#if defined(ASIO_HAS_IOCP) + +void complete_iocp_recv(state_type state, + const weak_cancel_token_type& cancel_token, bool all_empty, + asio::error_code& ec, size_t bytes_transferred) +{ + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_NETNAME_DELETED) + { + if (cancel_token.expired()) + ec = asio::error::operation_aborted; + else + ec = asio::error::connection_reset; + } + else if (ec.value() == ERROR_PORT_UNREACHABLE) + { + ec = asio::error::connection_refused; + } + else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) + { + ec.assign(0, ec.category()); + } + + // Check for connection closed. + else if (!ec && bytes_transferred == 0 + && (state & stream_oriented) != 0 + && !all_empty) + { + ec = asio::error::eof; + } +} + +#else // defined(ASIO_HAS_IOCP) + +bool non_blocking_recv(socket_type s, + buf* bufs, size_t count, int flags, bool is_stream, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Read some data. + signed_size_type bytes = socket_ops::recv(s, bufs, count, flags, ec); + + // Check for end of stream. + if (is_stream && bytes == 0) + { + ec = asio::error::eof; + return true; + } + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +bool non_blocking_recv1(socket_type s, + void* data, size_t size, int flags, bool is_stream, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Read some data. + signed_size_type bytes = socket_ops::recv1(s, data, size, flags, ec); + + // Check for end of stream. + if (is_stream && bytes == 0) + { + ec = asio::error::eof; + return true; + } + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +#endif // defined(ASIO_HAS_IOCP) + +signed_size_type recvfrom(socket_type s, buf* bufs, size_t count, + int flags, socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Receive some data. + DWORD recv_buf_count = static_cast(count); + DWORD bytes_transferred = 0; + DWORD recv_flags = flags; + int tmp_addrlen = (int)*addrlen; + int result = ::WSARecvFrom(s, bufs, recv_buf_count, + &bytes_transferred, &recv_flags, addr, &tmp_addrlen, 0, 0); + get_last_error(ec, true); + *addrlen = (std::size_t)tmp_addrlen; + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) + result = 0; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + msghdr msg = msghdr(); + init_msghdr_msg_name(msg.msg_name, addr); + msg.msg_namelen = static_cast(*addrlen); + msg.msg_iov = bufs; + msg.msg_iovlen = static_cast(count); + signed_size_type result = ::recvmsg(s, &msg, flags); + get_last_error(ec, result < 0); + *addrlen = msg.msg_namelen; + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +template +inline signed_size_type call_recvfrom(SockLenType msghdr::*, + socket_type s, void* data, size_t size, int flags, + socket_addr_type* addr, std::size_t* addrlen) +{ + SockLenType tmp_addrlen = addrlen ? (SockLenType)*addrlen : 0; + signed_size_type result = ::recvfrom(s, static_cast(data), + size, flags, addr, addrlen ? &tmp_addrlen : 0); + if (addrlen) + *addrlen = (std::size_t)tmp_addrlen; + return result; +} + +signed_size_type recvfrom1(socket_type s, void* data, size_t size, + int flags, socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Receive some data. + WSABUF buf; + buf.buf = static_cast(data); + buf.len = static_cast(size); + DWORD bytes_transferred = 0; + DWORD recv_flags = flags; + int tmp_addrlen = (int)*addrlen; + int result = ::WSARecvFrom(s, &buf, 1, &bytes_transferred, + &recv_flags, addr, &tmp_addrlen, 0, 0); + get_last_error(ec, true); + *addrlen = (std::size_t)tmp_addrlen; + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) + result = 0; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + signed_size_type result = call_recvfrom(&msghdr::msg_namelen, + s, data, size, flags, addr, addrlen); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +size_t sync_recvfrom(socket_type s, state_type state, buf* bufs, + size_t count, int flags, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::recvfrom( + s, bufs, count, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_read(s, 0, -1, ec) < 0) + return 0; + } +} + +size_t sync_recvfrom1(socket_type s, state_type state, void* data, + size_t size, int flags, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::recvfrom1( + s, data, size, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_read(s, 0, -1, ec) < 0) + return 0; + } +} + +#if defined(ASIO_HAS_IOCP) + +void complete_iocp_recvfrom( + const weak_cancel_token_type& cancel_token, + asio::error_code& ec) +{ + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_NETNAME_DELETED) + { + if (cancel_token.expired()) + ec = asio::error::operation_aborted; + else + ec = asio::error::connection_reset; + } + else if (ec.value() == ERROR_PORT_UNREACHABLE) + { + ec = asio::error::connection_refused; + } + else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) + { + ec.assign(0, ec.category()); + } +} + +#else // defined(ASIO_HAS_IOCP) + +bool non_blocking_recvfrom(socket_type s, + buf* bufs, size_t count, int flags, + socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Read some data. + signed_size_type bytes = socket_ops::recvfrom( + s, bufs, count, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +bool non_blocking_recvfrom1(socket_type s, + void* data, size_t size, int flags, + socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Read some data. + signed_size_type bytes = socket_ops::recvfrom1( + s, data, size, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +#endif // defined(ASIO_HAS_IOCP) + +signed_size_type recvmsg(socket_type s, buf* bufs, size_t count, + int in_flags, int& out_flags, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + out_flags = 0; + return socket_ops::recv(s, bufs, count, in_flags, ec); +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + msghdr msg = msghdr(); + msg.msg_iov = bufs; + msg.msg_iovlen = static_cast(count); + signed_size_type result = ::recvmsg(s, &msg, in_flags); + get_last_error(ec, result < 0); + if (result >= 0) + out_flags = msg.msg_flags; + else + out_flags = 0; + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +size_t sync_recvmsg(socket_type s, state_type state, + buf* bufs, size_t count, int in_flags, int& out_flags, + asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::recvmsg( + s, bufs, count, in_flags, out_flags, ec); + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_read(s, 0, -1, ec) < 0) + return 0; + } +} + +#if defined(ASIO_HAS_IOCP) + +void complete_iocp_recvmsg( + const weak_cancel_token_type& cancel_token, + asio::error_code& ec) +{ + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_NETNAME_DELETED) + { + if (cancel_token.expired()) + ec = asio::error::operation_aborted; + else + ec = asio::error::connection_reset; + } + else if (ec.value() == ERROR_PORT_UNREACHABLE) + { + ec = asio::error::connection_refused; + } + else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) + { + ec.assign(0, ec.category()); + } +} + +#else // defined(ASIO_HAS_IOCP) + +bool non_blocking_recvmsg(socket_type s, + buf* bufs, size_t count, int in_flags, int& out_flags, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Read some data. + signed_size_type bytes = socket_ops::recvmsg( + s, bufs, count, in_flags, out_flags, ec); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +#endif // defined(ASIO_HAS_IOCP) + +signed_size_type send(socket_type s, const buf* bufs, size_t count, + int flags, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Send the data. + DWORD send_buf_count = static_cast(count); + DWORD bytes_transferred = 0; + DWORD send_flags = flags; + int result = ::WSASend(s, const_cast(bufs), + send_buf_count, &bytes_transferred, send_flags, 0, 0); + get_last_error(ec, true); + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + msghdr msg = msghdr(); + msg.msg_iov = const_cast(bufs); + msg.msg_iovlen = static_cast(count); +#if defined(__linux__) + flags |= MSG_NOSIGNAL; +#endif // defined(__linux__) + signed_size_type result = ::sendmsg(s, &msg, flags); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +signed_size_type send1(socket_type s, const void* data, size_t size, + int flags, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Send the data. + WSABUF buf; + buf.buf = const_cast(static_cast(data)); + buf.len = static_cast(size); + DWORD bytes_transferred = 0; + DWORD send_flags = flags; + int result = ::WSASend(s, &buf, 1, + &bytes_transferred, send_flags, 0, 0); + get_last_error(ec, true); + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +#if defined(__linux__) + flags |= MSG_NOSIGNAL; +#endif // defined(__linux__) + signed_size_type result = ::send(s, + static_cast(data), size, flags); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +size_t sync_send(socket_type s, state_type state, const buf* bufs, + size_t count, int flags, bool all_empty, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to write 0 bytes to a stream is a no-op. + if (all_empty && (state & stream_oriented)) + { + ec.assign(0, ec.category()); + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::send(s, bufs, count, flags, ec); + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_write(s, 0, -1, ec) < 0) + return 0; + } +} + +size_t sync_send1(socket_type s, state_type state, const void* data, + size_t size, int flags, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to write 0 bytes to a stream is a no-op. + if (size == 0 && (state & stream_oriented)) + { + ec.assign(0, ec.category()); + return 0; + } + + // Read some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::send1(s, data, size, flags, ec); + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_write(s, 0, -1, ec) < 0) + return 0; + } +} + +#if defined(ASIO_HAS_IOCP) + +void complete_iocp_send( + const weak_cancel_token_type& cancel_token, + asio::error_code& ec) +{ + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_NETNAME_DELETED) + { + if (cancel_token.expired()) + ec = asio::error::operation_aborted; + else + ec = asio::error::connection_reset; + } + else if (ec.value() == ERROR_PORT_UNREACHABLE) + { + ec = asio::error::connection_refused; + } +} + +#else // defined(ASIO_HAS_IOCP) + +bool non_blocking_send(socket_type s, + const buf* bufs, size_t count, int flags, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Write some data. + signed_size_type bytes = socket_ops::send(s, bufs, count, flags, ec); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +bool non_blocking_send1(socket_type s, + const void* data, size_t size, int flags, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Write some data. + signed_size_type bytes = socket_ops::send1(s, data, size, flags, ec); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +#endif // defined(ASIO_HAS_IOCP) + +signed_size_type sendto(socket_type s, const buf* bufs, size_t count, + int flags, const socket_addr_type* addr, std::size_t addrlen, + asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Send the data. + DWORD send_buf_count = static_cast(count); + DWORD bytes_transferred = 0; + int result = ::WSASendTo(s, const_cast(bufs), + send_buf_count, &bytes_transferred, flags, addr, + static_cast(addrlen), 0, 0); + get_last_error(ec, true); + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + msghdr msg = msghdr(); + init_msghdr_msg_name(msg.msg_name, addr); + msg.msg_namelen = static_cast(addrlen); + msg.msg_iov = const_cast(bufs); + msg.msg_iovlen = static_cast(count); +#if defined(__linux__) + flags |= MSG_NOSIGNAL; +#endif // defined(__linux__) + signed_size_type result = ::sendmsg(s, &msg, flags); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +template +inline signed_size_type call_sendto(SockLenType msghdr::*, + socket_type s, const void* data, size_t size, int flags, + const socket_addr_type* addr, std::size_t addrlen) +{ + return ::sendto(s, static_cast(const_cast(data)), + size, flags, addr, (SockLenType)addrlen); +} + +signed_size_type sendto1(socket_type s, const void* data, size_t size, + int flags, const socket_addr_type* addr, std::size_t addrlen, + asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + // Send the data. + WSABUF buf; + buf.buf = const_cast(static_cast(data)); + buf.len = static_cast(size); + DWORD bytes_transferred = 0; + int result = ::WSASendTo(s, &buf, 1, &bytes_transferred, + flags, addr, static_cast(addrlen), 0, 0); + get_last_error(ec, true); + if (ec.value() == ERROR_NETNAME_DELETED) + ec = asio::error::connection_reset; + else if (ec.value() == ERROR_PORT_UNREACHABLE) + ec = asio::error::connection_refused; + if (result != 0) + return socket_error_retval; + ec.assign(0, ec.category()); + return bytes_transferred; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +#if defined(__linux__) + flags |= MSG_NOSIGNAL; +#endif // defined(__linux__) + signed_size_type result = call_sendto(&msghdr::msg_namelen, + s, data, size, flags, addr, addrlen); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +size_t sync_sendto(socket_type s, state_type state, const buf* bufs, + size_t count, int flags, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // Write some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::sendto( + s, bufs, count, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_write(s, 0, -1, ec) < 0) + return 0; + } +} + +size_t sync_sendto1(socket_type s, state_type state, const void* data, + size_t size, int flags, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // Write some data. + for (;;) + { + // Try to complete the operation without blocking. + signed_size_type bytes = socket_ops::sendto1( + s, data, size, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + return bytes; + + // Operation failed. + if ((state & user_set_non_blocking) + || (ec != asio::error::would_block + && ec != asio::error::try_again)) + return 0; + + // Wait for socket to become ready. + if (socket_ops::poll_write(s, 0, -1, ec) < 0) + return 0; + } +} + +#if !defined(ASIO_HAS_IOCP) + +bool non_blocking_sendto(socket_type s, + const buf* bufs, size_t count, int flags, + const socket_addr_type* addr, std::size_t addrlen, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Write some data. + signed_size_type bytes = socket_ops::sendto( + s, bufs, count, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +bool non_blocking_sendto1(socket_type s, + const void* data, size_t size, int flags, + const socket_addr_type* addr, std::size_t addrlen, + asio::error_code& ec, size_t& bytes_transferred) +{ + for (;;) + { + // Write some data. + signed_size_type bytes = socket_ops::sendto1( + s, data, size, flags, addr, addrlen, ec); + + // Check if operation succeeded. + if (bytes >= 0) + { + bytes_transferred = bytes; + return true; + } + + // Retry operation if interrupted by signal. + if (ec == asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return false; + + // Operation failed. + bytes_transferred = 0; + return true; + } +} + +#endif // !defined(ASIO_HAS_IOCP) + +socket_type socket(int af, int type, int protocol, + asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + socket_type s = ::WSASocketW(af, type, protocol, 0, 0, WSA_FLAG_OVERLAPPED); + get_last_error(ec, s == invalid_socket); + if (s == invalid_socket) + return s; + + if (af == ASIO_OS_DEF(AF_INET6)) + { + // Try to enable the POSIX default behaviour of having IPV6_V6ONLY set to + // false. This will only succeed on Windows Vista and later versions of + // Windows, where a dual-stack IPv4/v6 implementation is available. + DWORD optval = 0; + ::setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, + reinterpret_cast(&optval), sizeof(optval)); + } + + return s; +#elif defined(__MACH__) && defined(__APPLE__) || defined(__FreeBSD__) + socket_type s = ::socket(af, type, protocol); + get_last_error(ec, s < 0); + + int optval = 1; + int result = ::setsockopt(s, SOL_SOCKET, + SO_NOSIGPIPE, &optval, sizeof(optval)); + get_last_error(ec, result != 0); + if (result != 0) + { + ::close(s); + return invalid_socket; + } + + return s; +#else + int s = ::socket(af, type, protocol); + get_last_error(ec, s < 0); + return s; +#endif +} + +template +inline int call_setsockopt(SockLenType msghdr::*, + socket_type s, int level, int optname, + const void* optval, std::size_t optlen) +{ + return ::setsockopt(s, level, optname, + (const char*)optval, (SockLenType)optlen); +} + +int setsockopt(socket_type s, state_type& state, int level, int optname, + const void* optval, std::size_t optlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + + if (level == custom_socket_option_level && optname == always_fail_option) + { + ec = asio::error::invalid_argument; + return socket_error_retval; + } + + if (level == custom_socket_option_level + && optname == enable_connection_aborted_option) + { + if (optlen != sizeof(int)) + { + ec = asio::error::invalid_argument; + return socket_error_retval; + } + + if (*static_cast(optval)) + state |= enable_connection_aborted; + else + state &= ~enable_connection_aborted; + ec.assign(0, ec.category()); + return 0; + } + + if (level == SOL_SOCKET && optname == SO_LINGER) + state |= user_set_linger; + +#if defined(__BORLANDC__) + // Mysteriously, using the getsockopt and setsockopt functions directly with + // Borland C++ results in incorrect values being set and read. The bug can be + // worked around by using function addresses resolved with GetProcAddress. + if (HMODULE winsock_module = ::GetModuleHandleA("ws2_32")) + { + typedef int (WSAAPI *sso_t)(SOCKET, int, int, const char*, int); + if (sso_t sso = (sso_t)::GetProcAddress(winsock_module, "setsockopt")) + { + int result = sso(s, level, optname, + reinterpret_cast(optval), + static_cast(optlen)); + get_last_error(ec, result != 0); + return result; + } + } + ec = asio::error::fault; + return socket_error_retval; +#else // defined(__BORLANDC__) + int result = call_setsockopt(&msghdr::msg_namelen, + s, level, optname, optval, optlen); + get_last_error(ec, result != 0); + if (result == 0) + { +#if defined(__MACH__) && defined(__APPLE__) \ + || defined(__NetBSD__) || defined(__FreeBSD__) \ + || defined(__OpenBSD__) || defined(__QNX__) + // To implement portable behaviour for SO_REUSEADDR with UDP sockets we + // need to also set SO_REUSEPORT on BSD-based platforms. + if ((state & datagram_oriented) + && level == SOL_SOCKET && optname == SO_REUSEADDR) + { + call_setsockopt(&msghdr::msg_namelen, s, + SOL_SOCKET, SO_REUSEPORT, optval, optlen); + } +#endif + } + + return result; +#endif // defined(__BORLANDC__) +} + +template +inline int call_getsockopt(SockLenType msghdr::*, + socket_type s, int level, int optname, + void* optval, std::size_t* optlen) +{ + SockLenType tmp_optlen = (SockLenType)*optlen; + int result = ::getsockopt(s, level, optname, (char*)optval, &tmp_optlen); + *optlen = (std::size_t)tmp_optlen; + return result; +} + +int getsockopt(socket_type s, state_type state, int level, int optname, + void* optval, size_t* optlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + + if (level == custom_socket_option_level && optname == always_fail_option) + { + ec = asio::error::invalid_argument; + return socket_error_retval; + } + + if (level == custom_socket_option_level + && optname == enable_connection_aborted_option) + { + if (*optlen != sizeof(int)) + { + ec = asio::error::invalid_argument; + return socket_error_retval; + } + + *static_cast(optval) = (state & enable_connection_aborted) ? 1 : 0; + ec.assign(0, ec.category()); + return 0; + } + +#if defined(__BORLANDC__) + // Mysteriously, using the getsockopt and setsockopt functions directly with + // Borland C++ results in incorrect values being set and read. The bug can be + // worked around by using function addresses resolved with GetProcAddress. + if (HMODULE winsock_module = ::GetModuleHandleA("ws2_32")) + { + typedef int (WSAAPI *gso_t)(SOCKET, int, int, char*, int*); + if (gso_t gso = (gso_t)::GetProcAddress(winsock_module, "getsockopt")) + { + int tmp_optlen = static_cast(*optlen); + int result = gso(s, level, optname, + reinterpret_cast(optval), &tmp_optlen); + get_last_error(ec, result != 0); + *optlen = static_cast(tmp_optlen); + if (result != 0 && level == IPPROTO_IPV6 && optname == IPV6_V6ONLY + && ec.value() == WSAENOPROTOOPT && *optlen == sizeof(DWORD)) + { + // Dual-stack IPv4/v6 sockets, and the IPV6_V6ONLY socket option, are + // only supported on Windows Vista and later. To simplify program logic + // we will fake success of getting this option and specify that the + // value is non-zero (i.e. true). This corresponds to the behavior of + // IPv6 sockets on Windows platforms pre-Vista. + *static_cast(optval) = 1; + ec.assign(0, ec.category()); + } + return result; + } + } + ec = asio::error::fault; + return socket_error_retval; +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) + int result = call_getsockopt(&msghdr::msg_namelen, + s, level, optname, optval, optlen); + get_last_error(ec, result != 0); + if (result != 0 && level == IPPROTO_IPV6 && optname == IPV6_V6ONLY + && ec.value() == WSAENOPROTOOPT && *optlen == sizeof(DWORD)) + { + // Dual-stack IPv4/v6 sockets, and the IPV6_V6ONLY socket option, are only + // supported on Windows Vista and later. To simplify program logic we will + // fake success of getting this option and specify that the value is + // non-zero (i.e. true). This corresponds to the behavior of IPv6 sockets + // on Windows platforms pre-Vista. + *static_cast(optval) = 1; + ec.assign(0, ec.category()); + } + return result; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + int result = call_getsockopt(&msghdr::msg_namelen, + s, level, optname, optval, optlen); + get_last_error(ec, result != 0); +#if defined(__linux__) + if (result == 0 && level == SOL_SOCKET && *optlen == sizeof(int) + && (optname == SO_SNDBUF || optname == SO_RCVBUF)) + { + // On Linux, setting SO_SNDBUF or SO_RCVBUF to N actually causes the kernel + // to set the buffer size to N*2. Linux puts additional stuff into the + // buffers so that only about half is actually available to the application. + // The retrieved value is divided by 2 here to make it appear as though the + // correct value has been set. + *static_cast(optval) /= 2; + } +#endif // defined(__linux__) + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +template +inline int call_getpeername(SockLenType msghdr::*, + socket_type s, socket_addr_type* addr, std::size_t* addrlen) +{ + SockLenType tmp_addrlen = (SockLenType)*addrlen; + int result = ::getpeername(s, addr, &tmp_addrlen); + *addrlen = (std::size_t)tmp_addrlen; + return result; +} + +int getpeername(socket_type s, socket_addr_type* addr, + std::size_t* addrlen, bool cached, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + +#if defined(ASIO_WINDOWS) && !defined(ASIO_WINDOWS_APP) \ + || defined(__CYGWIN__) + if (cached) + { + // Check if socket is still connected. + DWORD connect_time = 0; + size_t connect_time_len = sizeof(connect_time); + if (socket_ops::getsockopt(s, 0, SOL_SOCKET, SO_CONNECT_TIME, + &connect_time, &connect_time_len, ec) == socket_error_retval) + { + return socket_error_retval; + } + if (connect_time == 0xFFFFFFFF) + { + ec = asio::error::not_connected; + return socket_error_retval; + } + + // The cached value is still valid. + ec.assign(0, ec.category()); + return 0; + } +#else // defined(ASIO_WINDOWS) && !defined(ASIO_WINDOWS_APP) + // || defined(__CYGWIN__) + (void)cached; +#endif // defined(ASIO_WINDOWS) && !defined(ASIO_WINDOWS_APP) + // || defined(__CYGWIN__) + + int result = call_getpeername(&msghdr::msg_namelen, s, addr, addrlen); + get_last_error(ec, result != 0); + return result; +} + +template +inline int call_getsockname(SockLenType msghdr::*, + socket_type s, socket_addr_type* addr, std::size_t* addrlen) +{ + SockLenType tmp_addrlen = (SockLenType)*addrlen; + int result = ::getsockname(s, addr, &tmp_addrlen); + *addrlen = (std::size_t)tmp_addrlen; + return result; +} + +int getsockname(socket_type s, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + + int result = call_getsockname(&msghdr::msg_namelen, s, addr, addrlen); + get_last_error(ec, result != 0); + return result; +} + +int ioctl(socket_type s, state_type& state, int cmd, + ioctl_arg_type* arg, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + int result = ::ioctlsocket(s, cmd, arg); +#elif defined(__MACH__) && defined(__APPLE__) \ + || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + int result = ::ioctl(s, static_cast(cmd), arg); +#else + int result = ::ioctl(s, cmd, arg); +#endif + get_last_error(ec, result < 0); + if (result >= 0) + { + // When updating the non-blocking mode we always perform the ioctl syscall, + // even if the flags would otherwise indicate that the socket is already in + // the correct state. This ensures that the underlying socket is put into + // the state that has been requested by the user. If the ioctl syscall was + // successful then we need to update the flags to match. + if (cmd == static_cast(FIONBIO)) + { + if (*arg) + { + state |= user_set_non_blocking; + } + else + { + // Clearing the non-blocking mode always overrides any internally-set + // non-blocking flag. Any subsequent asynchronous operations will need + // to re-enable non-blocking I/O. + state &= ~(user_set_non_blocking | internal_non_blocking); + } + } + } + + return result; +} + +int select(int nfds, fd_set* readfds, fd_set* writefds, + fd_set* exceptfds, timeval* timeout, asio::error_code& ec) +{ +#if defined(__EMSCRIPTEN__) + exceptfds = 0; +#endif // defined(__EMSCRIPTEN__) +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + if (!readfds && !writefds && !exceptfds && timeout) + { + DWORD milliseconds = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; + if (milliseconds == 0) + milliseconds = 1; // Force context switch. + ::Sleep(milliseconds); + ec.assign(0, ec.category()); + return 0; + } + + // The select() call allows timeout values measured in microseconds, but the + // system clock (as wrapped by boost::posix_time::microsec_clock) typically + // has a resolution of 10 milliseconds. This can lead to a spinning select + // reactor, meaning increased CPU usage, when waiting for the earliest + // scheduled timeout if it's less than 10 milliseconds away. To avoid a tight + // spin we'll use a minimum timeout of 1 millisecond. + if (timeout && timeout->tv_sec == 0 + && timeout->tv_usec > 0 && timeout->tv_usec < 1000) + timeout->tv_usec = 1000; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#if defined(__hpux) && defined(__SELECT) + timespec ts; + ts.tv_sec = timeout ? timeout->tv_sec : 0; + ts.tv_nsec = timeout ? timeout->tv_usec * 1000 : 0; + int result = ::pselect(nfds, readfds, + writefds, exceptfds, timeout ? &ts : 0, 0); +#else + int result = ::select(nfds, readfds, writefds, exceptfds, timeout); +#endif + get_last_error(ec, result < 0); + return result; +} + +int poll_read(socket_type s, state_type state, + int msec, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + fd_set fds; + FD_ZERO(&fds); + FD_SET(s, &fds); + timeval timeout_obj; + timeval* timeout; + if (state & user_set_non_blocking) + { + timeout_obj.tv_sec = 0; + timeout_obj.tv_usec = 0; + timeout = &timeout_obj; + } + else if (msec >= 0) + { + timeout_obj.tv_sec = msec / 1000; + timeout_obj.tv_usec = (msec % 1000) * 1000; + timeout = &timeout_obj; + } + else + timeout = 0; + int result = ::select(s + 1, &fds, 0, 0, timeout); + get_last_error(ec, result < 0); +#else // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + pollfd fds; + fds.fd = s; + fds.events = POLLIN; + fds.revents = 0; + int timeout = (state & user_set_non_blocking) ? 0 : msec; + int result = ::poll(&fds, 1, timeout); + get_last_error(ec, result < 0); +#endif // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + if (result == 0) + if (state & user_set_non_blocking) + ec = asio::error::would_block; + return result; +} + +int poll_write(socket_type s, state_type state, + int msec, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + fd_set fds; + FD_ZERO(&fds); + FD_SET(s, &fds); + timeval timeout_obj; + timeval* timeout; + if (state & user_set_non_blocking) + { + timeout_obj.tv_sec = 0; + timeout_obj.tv_usec = 0; + timeout = &timeout_obj; + } + else if (msec >= 0) + { + timeout_obj.tv_sec = msec / 1000; + timeout_obj.tv_usec = (msec % 1000) * 1000; + timeout = &timeout_obj; + } + else + timeout = 0; + int result = ::select(s + 1, 0, &fds, 0, timeout); + get_last_error(ec, result < 0); +#else // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + pollfd fds; + fds.fd = s; + fds.events = POLLOUT; + fds.revents = 0; + int timeout = (state & user_set_non_blocking) ? 0 : msec; + int result = ::poll(&fds, 1, timeout); + get_last_error(ec, result < 0); +#endif // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + if (result == 0) + if (state & user_set_non_blocking) + ec = asio::error::would_block; + return result; +} + +int poll_error(socket_type s, state_type state, + int msec, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + fd_set fds; + FD_ZERO(&fds); + FD_SET(s, &fds); + timeval timeout_obj; + timeval* timeout; + if (state & user_set_non_blocking) + { + timeout_obj.tv_sec = 0; + timeout_obj.tv_usec = 0; + timeout = &timeout_obj; + } + else if (msec >= 0) + { + timeout_obj.tv_sec = msec / 1000; + timeout_obj.tv_usec = (msec % 1000) * 1000; + timeout = &timeout_obj; + } + else + timeout = 0; + int result = ::select(s + 1, 0, 0, &fds, timeout); + get_last_error(ec, result < 0); +#else // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + pollfd fds; + fds.fd = s; + fds.events = POLLPRI | POLLERR | POLLHUP; + fds.revents = 0; + int timeout = (state & user_set_non_blocking) ? 0 : msec; + int result = ::poll(&fds, 1, timeout); + get_last_error(ec, result < 0); +#endif // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + if (result == 0) + if (state & user_set_non_blocking) + ec = asio::error::would_block; + return result; +} + +int poll_connect(socket_type s, int msec, asio::error_code& ec) +{ + if (s == invalid_socket) + { + ec = asio::error::bad_descriptor; + return socket_error_retval; + } + +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + fd_set write_fds; + FD_ZERO(&write_fds); + FD_SET(s, &write_fds); + fd_set except_fds; + FD_ZERO(&except_fds); + FD_SET(s, &except_fds); + timeval timeout_obj; + timeval* timeout; + if (msec >= 0) + { + timeout_obj.tv_sec = msec / 1000; + timeout_obj.tv_usec = (msec % 1000) * 1000; + timeout = &timeout_obj; + } + else + timeout = 0; + int result = ::select(s + 1, 0, &write_fds, &except_fds, timeout); + get_last_error(ec, result < 0); + return result; +#else // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + pollfd fds; + fds.fd = s; + fds.events = POLLOUT; + fds.revents = 0; + int result = ::poll(&fds, 1, msec); + get_last_error(ec, result < 0); + return result; +#endif // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) +} + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +const char* inet_ntop(int af, const void* src, char* dest, size_t length, + unsigned long scope_id, asio::error_code& ec) +{ + clear_last_error(); +#if defined(ASIO_WINDOWS_RUNTIME) + using namespace std; // For sprintf. + const unsigned char* bytes = static_cast(src); + if (af == ASIO_OS_DEF(AF_INET)) + { + sprintf_s(dest, length, "%u.%u.%u.%u", + bytes[0], bytes[1], bytes[2], bytes[3]); + return dest; + } + else if (af == ASIO_OS_DEF(AF_INET6)) + { + size_t n = 0, b = 0, z = 0; + while (n < length && b < 16) + { + if (bytes[b] == 0 && bytes[b + 1] == 0 && z == 0) + { + do b += 2; while (b < 16 && bytes[b] == 0 && bytes[b + 1] == 0); + n += sprintf_s(dest + n, length - n, ":%s", b < 16 ? "" : ":"), ++z; + } + else + { + n += sprintf_s(dest + n, length - n, "%s%x", b ? ":" : "", + (static_cast(bytes[b]) << 8) | bytes[b + 1]); + b += 2; + } + } + if (scope_id) + n += sprintf_s(dest + n, length - n, "%%%lu", scope_id); + return dest; + } + else + { + ec = asio::error::address_family_not_supported; + return 0; + } +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) + using namespace std; // For memcpy. + + if (af != ASIO_OS_DEF(AF_INET) && af != ASIO_OS_DEF(AF_INET6)) + { + ec = asio::error::address_family_not_supported; + return 0; + } + + union + { + socket_addr_type base; + sockaddr_storage_type storage; + sockaddr_in4_type v4; + sockaddr_in6_type v6; + } address; + DWORD address_length; + if (af == ASIO_OS_DEF(AF_INET)) + { + address_length = sizeof(sockaddr_in4_type); + address.v4.sin_family = ASIO_OS_DEF(AF_INET); + address.v4.sin_port = 0; + memcpy(&address.v4.sin_addr, src, sizeof(in4_addr_type)); + } + else // AF_INET6 + { + address_length = sizeof(sockaddr_in6_type); + address.v6.sin6_family = ASIO_OS_DEF(AF_INET6); + address.v6.sin6_port = 0; + address.v6.sin6_flowinfo = 0; + address.v6.sin6_scope_id = scope_id; + memcpy(&address.v6.sin6_addr, src, sizeof(in6_addr_type)); + } + + DWORD string_length = static_cast(length); +#if defined(BOOST_NO_ANSI_APIS) || (defined(_MSC_VER) && (_MSC_VER >= 1800)) + LPWSTR string_buffer = (LPWSTR)_alloca(length * sizeof(WCHAR)); + int result = ::WSAAddressToStringW(&address.base, + address_length, 0, string_buffer, &string_length); + get_last_error(ec, true); + ::WideCharToMultiByte(CP_ACP, 0, string_buffer, -1, + dest, static_cast(length), 0, 0); +#else + int result = ::WSAAddressToStringA(&address.base, + address_length, 0, dest, &string_length); + get_last_error(ec, true); +#endif + + // Windows may set error code on success. + if (result != socket_error_retval) + ec.assign(0, ec.category()); + + // Windows may not set an error code on failure. + else if (result == socket_error_retval && !ec) + ec = asio::error::invalid_argument; + + return result == socket_error_retval ? 0 : dest; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + const char* result = ::inet_ntop(af, src, dest, static_cast(length)); + get_last_error(ec, true); + if (result == 0 && !ec) + ec = asio::error::invalid_argument; + if (result != 0 && af == ASIO_OS_DEF(AF_INET6) && scope_id != 0) + { + using namespace std; // For strcat and sprintf. + char if_name[(IF_NAMESIZE > 21 ? IF_NAMESIZE : 21) + 1] = "%"; + const in6_addr_type* ipv6_address = static_cast(src); + bool is_link_local = ((ipv6_address->s6_addr[0] == 0xfe) + && ((ipv6_address->s6_addr[1] & 0xc0) == 0x80)); + bool is_multicast_link_local = ((ipv6_address->s6_addr[0] == 0xff) + && ((ipv6_address->s6_addr[1] & 0x0f) == 0x02)); + if ((!is_link_local && !is_multicast_link_local) + || if_indextoname(static_cast(scope_id), if_name + 1) == 0) + sprintf(if_name + 1, "%lu", scope_id); + strcat(dest, if_name); + } + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +int inet_pton(int af, const char* src, void* dest, + unsigned long* scope_id, asio::error_code& ec) +{ + clear_last_error(); +#if defined(ASIO_WINDOWS_RUNTIME) + using namespace std; // For sscanf. + unsigned char* bytes = static_cast(dest); + if (af == ASIO_OS_DEF(AF_INET)) + { + unsigned int b0, b1, b2, b3; + if (sscanf_s(src, "%u.%u.%u.%u", &b0, &b1, &b2, &b3) != 4) + { + ec = asio::error::invalid_argument; + return -1; + } + if (b0 > 255 || b1 > 255 || b2 > 255 || b3 > 255) + { + ec = asio::error::invalid_argument; + return -1; + } + bytes[0] = static_cast(b0); + bytes[1] = static_cast(b1); + bytes[2] = static_cast(b2); + bytes[3] = static_cast(b3); + ec.assign(), ec.category()); + return 1; + } + else if (af == ASIO_OS_DEF(AF_INET6)) + { + unsigned char* bytes = static_cast(dest); + std::memset(bytes, 0, 16); + unsigned char back_bytes[16] = { 0 }; + int num_front_bytes = 0, num_back_bytes = 0; + const char* p = src; + + enum { fword, fcolon, bword, scope, done } state = fword; + unsigned long current_word = 0; + while (state != done) + { + if (current_word > 0xFFFF) + { + ec = asio::error::invalid_argument; + return -1; + } + + switch (state) + { + case fword: + if (*p >= '0' && *p <= '9') + current_word = current_word * 16 + *p++ - '0'; + else if (*p >= 'a' && *p <= 'f') + current_word = current_word * 16 + *p++ - 'a' + 10; + else if (*p >= 'A' && *p <= 'F') + current_word = current_word * 16 + *p++ - 'A' + 10; + else + { + if (num_front_bytes == 16) + { + ec = asio::error::invalid_argument; + return -1; + } + + bytes[num_front_bytes++] = (current_word >> 8) & 0xFF; + bytes[num_front_bytes++] = current_word & 0xFF; + current_word = 0; + + if (*p == ':') + state = fcolon, ++p; + else if (*p == '%') + state = scope, ++p; + else if (*p == 0) + state = done; + else + { + ec = asio::error::invalid_argument; + return -1; + } + } + break; + + case fcolon: + if (*p == ':') + state = bword, ++p; + else + state = fword; + break; + + case bword: + if (*p >= '0' && *p <= '9') + current_word = current_word * 16 + *p++ - '0'; + else if (*p >= 'a' && *p <= 'f') + current_word = current_word * 16 + *p++ - 'a' + 10; + else if (*p >= 'A' && *p <= 'F') + current_word = current_word * 16 + *p++ - 'A' + 10; + else + { + if (num_front_bytes + num_back_bytes == 16) + { + ec = asio::error::invalid_argument; + return -1; + } + + back_bytes[num_back_bytes++] = (current_word >> 8) & 0xFF; + back_bytes[num_back_bytes++] = current_word & 0xFF; + current_word = 0; + + if (*p == ':') + state = bword, ++p; + else if (*p == '%') + state = scope, ++p; + else if (*p == 0) + state = done; + else + { + ec = asio::error::invalid_argument; + return -1; + } + } + break; + + case scope: + if (*p >= '0' && *p <= '9') + current_word = current_word * 10 + *p++ - '0'; + else if (*p == 0) + *scope_id = current_word, state = done; + else + { + ec = asio::error::invalid_argument; + return -1; + } + break; + + default: + break; + } + } + + for (int i = 0; i < num_back_bytes; ++i) + bytes[16 - num_back_bytes + i] = back_bytes[i]; + + ec.assign(0, ec.category()); + return 1; + } + else + { + ec = asio::error::address_family_not_supported; + return -1; + } +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) + using namespace std; // For memcpy and strcmp. + + if (af != ASIO_OS_DEF(AF_INET) && af != ASIO_OS_DEF(AF_INET6)) + { + ec = asio::error::address_family_not_supported; + return -1; + } + + union + { + socket_addr_type base; + sockaddr_storage_type storage; + sockaddr_in4_type v4; + sockaddr_in6_type v6; + } address; + int address_length = sizeof(sockaddr_storage_type); +#if defined(BOOST_NO_ANSI_APIS) || (defined(_MSC_VER) && (_MSC_VER >= 1800)) + int num_wide_chars = static_cast(strlen(src)) + 1; + LPWSTR wide_buffer = (LPWSTR)_alloca(num_wide_chars * sizeof(WCHAR)); + ::MultiByteToWideChar(CP_ACP, 0, src, -1, wide_buffer, num_wide_chars); + int result = ::WSAStringToAddressW(wide_buffer, + af, 0, &address.base, &address_length); + get_last_error(ec, true); +#else + int result = ::WSAStringToAddressA(const_cast(src), + af, 0, &address.base, &address_length); + get_last_error(ec, true); +#endif + + if (af == ASIO_OS_DEF(AF_INET)) + { + if (result != socket_error_retval) + { + memcpy(dest, &address.v4.sin_addr, sizeof(in4_addr_type)); + ec.assign(0, ec.category()); + } + else if (strcmp(src, "255.255.255.255") == 0) + { + static_cast(dest)->s_addr = INADDR_NONE; + ec.assign(0, ec.category()); + } + } + else // AF_INET6 + { + if (result != socket_error_retval) + { + memcpy(dest, &address.v6.sin6_addr, sizeof(in6_addr_type)); + if (scope_id) + *scope_id = address.v6.sin6_scope_id; + ec.assign(0, ec.category()); + } + } + + // Windows may not set an error code on failure. + if (result == socket_error_retval && !ec) + ec = asio::error::invalid_argument; + + if (result != socket_error_retval) + ec.assign(0, ec.category()); + + return result == socket_error_retval ? -1 : 1; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + using namespace std; // For strchr, memcpy and atoi. + + // On some platforms, inet_pton fails if an address string contains a scope + // id. Detect and remove the scope id before passing the string to inet_pton. + const bool is_v6 = (af == ASIO_OS_DEF(AF_INET6)); + const char* if_name = is_v6 ? strchr(src, '%') : 0; + char src_buf[max_addr_v6_str_len + 1]; + const char* src_ptr = src; + if (if_name != 0) + { + if (if_name - src > max_addr_v6_str_len) + { + ec = asio::error::invalid_argument; + return 0; + } + memcpy(src_buf, src, if_name - src); + src_buf[if_name - src] = 0; + src_ptr = src_buf; + } + + int result = ::inet_pton(af, src_ptr, dest); + get_last_error(ec, true); + if (result <= 0 && !ec) + ec = asio::error::invalid_argument; + if (result > 0 && is_v6 && scope_id) + { + using namespace std; // For strchr and atoi. + *scope_id = 0; + if (if_name != 0) + { + in6_addr_type* ipv6_address = static_cast(dest); + bool is_link_local = ((ipv6_address->s6_addr[0] == 0xfe) + && ((ipv6_address->s6_addr[1] & 0xc0) == 0x80)); + bool is_multicast_link_local = ((ipv6_address->s6_addr[0] == 0xff) + && ((ipv6_address->s6_addr[1] & 0x0f) == 0x02)); + if (is_link_local || is_multicast_link_local) + *scope_id = if_nametoindex(if_name + 1); + if (*scope_id == 0) + *scope_id = atoi(if_name + 1); + } + } + return result; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +} + +int gethostname(char* name, int namelen, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS_RUNTIME) + try + { + using namespace Windows::Foundation::Collections; + using namespace Windows::Networking; + using namespace Windows::Networking::Connectivity; + IVectorView^ hostnames = NetworkInformation::GetHostNames(); + for (unsigned i = 0; i < hostnames->Size; ++i) + { + HostName^ hostname = hostnames->GetAt(i); + if (hostname->Type == HostNameType::DomainName) + { + std::wstring_convert> converter; + std::string raw_name = converter.to_bytes(hostname->RawName->Data()); + if (namelen > 0 && raw_name.size() < static_cast(namelen)) + { + strcpy_s(name, namelen, raw_name.c_str()); + return 0; + } + } + } + return -1; + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + return -1; + } +#else // defined(ASIO_WINDOWS_RUNTIME) + int result = ::gethostname(name, namelen); + get_last_error(ec, result != 0); + return result; +#endif // defined(ASIO_WINDOWS_RUNTIME) +} + +#if !defined(ASIO_WINDOWS_RUNTIME) + +#if !defined(ASIO_HAS_GETADDRINFO) + +// The following functions are only needed for emulation of getaddrinfo and +// getnameinfo. + +inline asio::error_code translate_netdb_error(int error) +{ + switch (error) + { + case 0: + return asio::error_code(); + case HOST_NOT_FOUND: + return asio::error::host_not_found; + case TRY_AGAIN: + return asio::error::host_not_found_try_again; + case NO_RECOVERY: + return asio::error::no_recovery; + case NO_DATA: + return asio::error::no_data; + default: + ASIO_ASSERT(false); + return asio::error::invalid_argument; + } +} + +inline hostent* gethostbyaddr(const char* addr, int length, int af, + hostent* result, char* buffer, int buflength, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + (void)(buffer); + (void)(buflength); + hostent* retval = ::gethostbyaddr(addr, length, af); + get_last_error(ec, !retval); + if (!retval) + return 0; + *result = *retval; + return retval; +#elif defined(__sun) || defined(__QNX__) + int error = 0; + hostent* retval = ::gethostbyaddr_r(addr, length, + af, result, buffer, buflength, &error); + get_last_error(ec, !retval); + if (error) + ec = translate_netdb_error(error); + return retval; +#elif defined(__MACH__) && defined(__APPLE__) + (void)(buffer); + (void)(buflength); + int error = 0; + hostent* retval = ::getipnodebyaddr(addr, length, af, &error); + get_last_error(ec, !retval); + if (error) + ec = translate_netdb_error(error); + if (!retval) + return 0; + *result = *retval; + return retval; +#else + hostent* retval = 0; + int error = 0; + clear_last_error(); + ::gethostbyaddr_r(addr, length, af, result, + buffer, buflength, &retval, &error); + get_last_error(ec, true); + if (error) + ec = translate_netdb_error(error); + return retval; +#endif +} + +inline hostent* gethostbyname(const char* name, int af, struct hostent* result, + char* buffer, int buflength, int ai_flags, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + (void)(buffer); + (void)(buflength); + (void)(ai_flags); + if (af != ASIO_OS_DEF(AF_INET)) + { + ec = asio::error::address_family_not_supported; + return 0; + } + hostent* retval = ::gethostbyname(name); + get_last_error(ec, !retval); + if (!retval) + return 0; + *result = *retval; + return result; +#elif defined(__sun) || defined(__QNX__) + (void)(ai_flags); + if (af != ASIO_OS_DEF(AF_INET)) + { + ec = asio::error::address_family_not_supported; + return 0; + } + int error = 0; + hostent* retval = ::gethostbyname_r(name, result, buffer, buflength, &error); + get_last_error(ec, !retval); + if (error) + ec = translate_netdb_error(error); + return retval; +#elif defined(__MACH__) && defined(__APPLE__) + (void)(buffer); + (void)(buflength); + int error = 0; + hostent* retval = ::getipnodebyname(name, af, ai_flags, &error); + get_last_error(ec, !retval); + if (error) + ec = translate_netdb_error(error); + if (!retval) + return 0; + *result = *retval; + return retval; +#else + (void)(ai_flags); + if (af != ASIO_OS_DEF(AF_INET)) + { + ec = asio::error::address_family_not_supported; + return 0; + } + hostent* retval = 0; + int error = 0; + clear_last_error(); + ::gethostbyname_r(name, result, buffer, buflength, &retval, &error); + get_last_error(ec, true); + if (error) + ec = translate_netdb_error(error); + return retval; +#endif +} + +inline void freehostent(hostent* h) +{ +#if defined(__MACH__) && defined(__APPLE__) + if (h) + ::freehostent(h); +#else + (void)(h); +#endif +} + +// Emulation of getaddrinfo based on implementation in: +// Stevens, W. R., UNIX Network Programming Vol. 1, 2nd Ed., Prentice-Hall 1998. + +struct gai_search +{ + const char* host; + int family; +}; + +inline int gai_nsearch(const char* host, + const addrinfo_type* hints, gai_search (&search)[2]) +{ + int search_count = 0; + if (host == 0 || host[0] == '\0') + { + if (hints->ai_flags & AI_PASSIVE) + { + // No host and AI_PASSIVE implies wildcard bind. + switch (hints->ai_family) + { + case ASIO_OS_DEF(AF_INET): + search[search_count].host = "0.0.0.0"; + search[search_count].family = ASIO_OS_DEF(AF_INET); + ++search_count; + break; + case ASIO_OS_DEF(AF_INET6): + search[search_count].host = "0::0"; + search[search_count].family = ASIO_OS_DEF(AF_INET6); + ++search_count; + break; + case ASIO_OS_DEF(AF_UNSPEC): + search[search_count].host = "0::0"; + search[search_count].family = ASIO_OS_DEF(AF_INET6); + ++search_count; + search[search_count].host = "0.0.0.0"; + search[search_count].family = ASIO_OS_DEF(AF_INET); + ++search_count; + break; + default: + break; + } + } + else + { + // No host and not AI_PASSIVE means connect to local host. + switch (hints->ai_family) + { + case ASIO_OS_DEF(AF_INET): + search[search_count].host = "localhost"; + search[search_count].family = ASIO_OS_DEF(AF_INET); + ++search_count; + break; + case ASIO_OS_DEF(AF_INET6): + search[search_count].host = "localhost"; + search[search_count].family = ASIO_OS_DEF(AF_INET6); + ++search_count; + break; + case ASIO_OS_DEF(AF_UNSPEC): + search[search_count].host = "localhost"; + search[search_count].family = ASIO_OS_DEF(AF_INET6); + ++search_count; + search[search_count].host = "localhost"; + search[search_count].family = ASIO_OS_DEF(AF_INET); + ++search_count; + break; + default: + break; + } + } + } + else + { + // Host is specified. + switch (hints->ai_family) + { + case ASIO_OS_DEF(AF_INET): + search[search_count].host = host; + search[search_count].family = ASIO_OS_DEF(AF_INET); + ++search_count; + break; + case ASIO_OS_DEF(AF_INET6): + search[search_count].host = host; + search[search_count].family = ASIO_OS_DEF(AF_INET6); + ++search_count; + break; + case ASIO_OS_DEF(AF_UNSPEC): + search[search_count].host = host; + search[search_count].family = ASIO_OS_DEF(AF_INET6); + ++search_count; + search[search_count].host = host; + search[search_count].family = ASIO_OS_DEF(AF_INET); + ++search_count; + break; + default: + break; + } + } + return search_count; +} + +template +inline T* gai_alloc(std::size_t size = sizeof(T)) +{ + using namespace std; + T* p = static_cast(::operator new(size, std::nothrow)); + if (p) + memset(p, 0, size); + return p; +} + +inline void gai_free(void* p) +{ + ::operator delete(p); +} + +inline void gai_strcpy(char* target, const char* source, std::size_t max_size) +{ + using namespace std; +#if defined(ASIO_HAS_SECURE_RTL) + strcpy_s(target, max_size, source); +#else // defined(ASIO_HAS_SECURE_RTL) + *target = 0; + if (max_size > 0) + strncat(target, source, max_size - 1); +#endif // defined(ASIO_HAS_SECURE_RTL) +} + +enum { gai_clone_flag = 1 << 30 }; + +inline int gai_aistruct(addrinfo_type*** next, const addrinfo_type* hints, + const void* addr, int family) +{ + using namespace std; + + addrinfo_type* ai = gai_alloc(); + if (ai == 0) + return EAI_MEMORY; + + ai->ai_next = 0; + **next = ai; + *next = &ai->ai_next; + + ai->ai_canonname = 0; + ai->ai_socktype = hints->ai_socktype; + if (ai->ai_socktype == 0) + ai->ai_flags |= gai_clone_flag; + ai->ai_protocol = hints->ai_protocol; + ai->ai_family = family; + + switch (ai->ai_family) + { + case ASIO_OS_DEF(AF_INET): + { + sockaddr_in4_type* sinptr = gai_alloc(); + if (sinptr == 0) + return EAI_MEMORY; + sinptr->sin_family = ASIO_OS_DEF(AF_INET); + memcpy(&sinptr->sin_addr, addr, sizeof(in4_addr_type)); + ai->ai_addr = reinterpret_cast(sinptr); + ai->ai_addrlen = sizeof(sockaddr_in4_type); + break; + } + case ASIO_OS_DEF(AF_INET6): + { + sockaddr_in6_type* sin6ptr = gai_alloc(); + if (sin6ptr == 0) + return EAI_MEMORY; + sin6ptr->sin6_family = ASIO_OS_DEF(AF_INET6); + memcpy(&sin6ptr->sin6_addr, addr, sizeof(in6_addr_type)); + ai->ai_addr = reinterpret_cast(sin6ptr); + ai->ai_addrlen = sizeof(sockaddr_in6_type); + break; + } + default: + break; + } + + return 0; +} + +inline addrinfo_type* gai_clone(addrinfo_type* ai) +{ + using namespace std; + + addrinfo_type* new_ai = gai_alloc(); + if (new_ai == 0) + return new_ai; + + new_ai->ai_next = ai->ai_next; + ai->ai_next = new_ai; + + new_ai->ai_flags = 0; + new_ai->ai_family = ai->ai_family; + new_ai->ai_socktype = ai->ai_socktype; + new_ai->ai_protocol = ai->ai_protocol; + new_ai->ai_canonname = 0; + new_ai->ai_addrlen = ai->ai_addrlen; + new_ai->ai_addr = gai_alloc(ai->ai_addrlen); + memcpy(new_ai->ai_addr, ai->ai_addr, ai->ai_addrlen); + + return new_ai; +} + +inline int gai_port(addrinfo_type* aihead, int port, int socktype) +{ + int num_found = 0; + + for (addrinfo_type* ai = aihead; ai; ai = ai->ai_next) + { + if (ai->ai_flags & gai_clone_flag) + { + if (ai->ai_socktype != 0) + { + ai = gai_clone(ai); + if (ai == 0) + return -1; + // ai now points to newly cloned entry. + } + } + else if (ai->ai_socktype != socktype) + { + // Ignore if mismatch on socket type. + continue; + } + + ai->ai_socktype = socktype; + + switch (ai->ai_family) + { + case ASIO_OS_DEF(AF_INET): + { + sockaddr_in4_type* sinptr = + reinterpret_cast(ai->ai_addr); + sinptr->sin_port = port; + ++num_found; + break; + } + case ASIO_OS_DEF(AF_INET6): + { + sockaddr_in6_type* sin6ptr = + reinterpret_cast(ai->ai_addr); + sin6ptr->sin6_port = port; + ++num_found; + break; + } + default: + break; + } + } + + return num_found; +} + +inline int gai_serv(addrinfo_type* aihead, + const addrinfo_type* hints, const char* serv) +{ + using namespace std; + + int num_found = 0; + + if ( +#if defined(AI_NUMERICSERV) + (hints->ai_flags & AI_NUMERICSERV) || +#endif + isdigit(static_cast(serv[0]))) + { + int port = htons(atoi(serv)); + if (hints->ai_socktype) + { + // Caller specifies socket type. + int rc = gai_port(aihead, port, hints->ai_socktype); + if (rc < 0) + return EAI_MEMORY; + num_found += rc; + } + else + { + // Caller does not specify socket type. + int rc = gai_port(aihead, port, SOCK_STREAM); + if (rc < 0) + return EAI_MEMORY; + num_found += rc; + rc = gai_port(aihead, port, SOCK_DGRAM); + if (rc < 0) + return EAI_MEMORY; + num_found += rc; + } + } + else + { + // Try service name with TCP first, then UDP. + if (hints->ai_socktype == 0 || hints->ai_socktype == SOCK_STREAM) + { + servent* sptr = getservbyname(serv, "tcp"); + if (sptr != 0) + { + int rc = gai_port(aihead, sptr->s_port, SOCK_STREAM); + if (rc < 0) + return EAI_MEMORY; + num_found += rc; + } + } + if (hints->ai_socktype == 0 || hints->ai_socktype == SOCK_DGRAM) + { + servent* sptr = getservbyname(serv, "udp"); + if (sptr != 0) + { + int rc = gai_port(aihead, sptr->s_port, SOCK_DGRAM); + if (rc < 0) + return EAI_MEMORY; + num_found += rc; + } + } + } + + if (num_found == 0) + { + if (hints->ai_socktype == 0) + { + // All calls to getservbyname() failed. + return EAI_NONAME; + } + else + { + // Service not supported for socket type. + return EAI_SERVICE; + } + } + + return 0; +} + +inline int gai_echeck(const char* host, const char* service, + int flags, int family, int socktype, int protocol) +{ + (void)(flags); + (void)(protocol); + + // Host or service must be specified. + if (host == 0 || host[0] == '\0') + if (service == 0 || service[0] == '\0') + return EAI_NONAME; + + // Check combination of family and socket type. + switch (family) + { + case ASIO_OS_DEF(AF_UNSPEC): + break; + case ASIO_OS_DEF(AF_INET): + case ASIO_OS_DEF(AF_INET6): + if (service != 0 && service[0] != '\0') + if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM) + return EAI_SOCKTYPE; + break; + default: + return EAI_FAMILY; + } + + return 0; +} + +inline void freeaddrinfo_emulation(addrinfo_type* aihead) +{ + addrinfo_type* ai = aihead; + while (ai) + { + gai_free(ai->ai_addr); + gai_free(ai->ai_canonname); + addrinfo_type* ainext = ai->ai_next; + gai_free(ai); + ai = ainext; + } +} + +inline int getaddrinfo_emulation(const char* host, const char* service, + const addrinfo_type* hintsp, addrinfo_type** result) +{ + // Set up linked list of addrinfo structures. + addrinfo_type* aihead = 0; + addrinfo_type** ainext = &aihead; + char* canon = 0; + + // Supply default hints if not specified by caller. + addrinfo_type hints = addrinfo_type(); + hints.ai_family = ASIO_OS_DEF(AF_UNSPEC); + if (hintsp) + hints = *hintsp; + + // If the resolution is not specifically for AF_INET6, remove the AI_V4MAPPED + // and AI_ALL flags. +#if defined(AI_V4MAPPED) + if (hints.ai_family != ASIO_OS_DEF(AF_INET6)) + hints.ai_flags &= ~AI_V4MAPPED; +#endif +#if defined(AI_ALL) + if (hints.ai_family != ASIO_OS_DEF(AF_INET6)) + hints.ai_flags &= ~AI_ALL; +#endif + + // Basic error checking. + int rc = gai_echeck(host, service, hints.ai_flags, hints.ai_family, + hints.ai_socktype, hints.ai_protocol); + if (rc != 0) + { + freeaddrinfo_emulation(aihead); + return rc; + } + + gai_search search[2]; + int search_count = gai_nsearch(host, &hints, search); + for (gai_search* sptr = search; sptr < search + search_count; ++sptr) + { + // Check for IPv4 dotted decimal string. + in4_addr_type inaddr; + asio::error_code ec; + if (socket_ops::inet_pton(ASIO_OS_DEF(AF_INET), + sptr->host, &inaddr, 0, ec) == 1) + { + if (hints.ai_family != ASIO_OS_DEF(AF_UNSPEC) + && hints.ai_family != ASIO_OS_DEF(AF_INET)) + { + freeaddrinfo_emulation(aihead); + gai_free(canon); + return EAI_FAMILY; + } + if (sptr->family == ASIO_OS_DEF(AF_INET)) + { + rc = gai_aistruct(&ainext, &hints, &inaddr, ASIO_OS_DEF(AF_INET)); + if (rc != 0) + { + freeaddrinfo_emulation(aihead); + gai_free(canon); + return rc; + } + } + continue; + } + + // Check for IPv6 hex string. + in6_addr_type in6addr; + if (socket_ops::inet_pton(ASIO_OS_DEF(AF_INET6), + sptr->host, &in6addr, 0, ec) == 1) + { + if (hints.ai_family != ASIO_OS_DEF(AF_UNSPEC) + && hints.ai_family != ASIO_OS_DEF(AF_INET6)) + { + freeaddrinfo_emulation(aihead); + gai_free(canon); + return EAI_FAMILY; + } + if (sptr->family == ASIO_OS_DEF(AF_INET6)) + { + rc = gai_aistruct(&ainext, &hints, &in6addr, + ASIO_OS_DEF(AF_INET6)); + if (rc != 0) + { + freeaddrinfo_emulation(aihead); + gai_free(canon); + return rc; + } + } + continue; + } + + // Look up hostname. + hostent hent; + char hbuf[8192] = ""; + hostent* hptr = socket_ops::gethostbyname(sptr->host, + sptr->family, &hent, hbuf, sizeof(hbuf), hints.ai_flags, ec); + if (hptr == 0) + { + if (search_count == 2) + { + // Failure is OK if there are multiple searches. + continue; + } + freeaddrinfo_emulation(aihead); + gai_free(canon); + if (ec == asio::error::host_not_found) + return EAI_NONAME; + if (ec == asio::error::host_not_found_try_again) + return EAI_AGAIN; + if (ec == asio::error::no_recovery) + return EAI_FAIL; + if (ec == asio::error::no_data) + return EAI_NONAME; + return EAI_NONAME; + } + + // Check for address family mismatch if one was specified. + if (hints.ai_family != ASIO_OS_DEF(AF_UNSPEC) + && hints.ai_family != hptr->h_addrtype) + { + freeaddrinfo_emulation(aihead); + gai_free(canon); + socket_ops::freehostent(hptr); + return EAI_FAMILY; + } + + // Save canonical name first time. + if (host != 0 && host[0] != '\0' && hptr->h_name && hptr->h_name[0] + && (hints.ai_flags & AI_CANONNAME) && canon == 0) + { + std::size_t canon_len = strlen(hptr->h_name) + 1; + canon = gai_alloc(canon_len); + if (canon == 0) + { + freeaddrinfo_emulation(aihead); + socket_ops::freehostent(hptr); + return EAI_MEMORY; + } + gai_strcpy(canon, hptr->h_name, canon_len); + } + + // Create an addrinfo structure for each returned address. + for (char** ap = hptr->h_addr_list; *ap; ++ap) + { + rc = gai_aistruct(&ainext, &hints, *ap, hptr->h_addrtype); + if (rc != 0) + { + freeaddrinfo_emulation(aihead); + gai_free(canon); + socket_ops::freehostent(hptr); + return EAI_FAMILY; + } + } + + socket_ops::freehostent(hptr); + } + + // Check if we found anything. + if (aihead == 0) + { + gai_free(canon); + return EAI_NONAME; + } + + // Return canonical name in first entry. + if (host != 0 && host[0] != '\0' && (hints.ai_flags & AI_CANONNAME)) + { + if (canon) + { + aihead->ai_canonname = canon; + canon = 0; + } + else + { + std::size_t canonname_len = strlen(search[0].host) + 1; + aihead->ai_canonname = gai_alloc(canonname_len); + if (aihead->ai_canonname == 0) + { + freeaddrinfo_emulation(aihead); + return EAI_MEMORY; + } + gai_strcpy(aihead->ai_canonname, search[0].host, canonname_len); + } + } + gai_free(canon); + + // Process the service name. + if (service != 0 && service[0] != '\0') + { + rc = gai_serv(aihead, &hints, service); + if (rc != 0) + { + freeaddrinfo_emulation(aihead); + return rc; + } + } + + // Return result to caller. + *result = aihead; + return 0; +} + +inline asio::error_code getnameinfo_emulation( + const socket_addr_type* sa, std::size_t salen, char* host, + std::size_t hostlen, char* serv, std::size_t servlen, int flags, + asio::error_code& ec) +{ + using namespace std; + + const char* addr; + size_t addr_len; + unsigned short port; + switch (sa->sa_family) + { + case ASIO_OS_DEF(AF_INET): + if (salen != sizeof(sockaddr_in4_type)) + { + return ec = asio::error::invalid_argument; + } + addr = reinterpret_cast( + &reinterpret_cast(sa)->sin_addr); + addr_len = sizeof(in4_addr_type); + port = reinterpret_cast(sa)->sin_port; + break; + case ASIO_OS_DEF(AF_INET6): + if (salen != sizeof(sockaddr_in6_type)) + { + return ec = asio::error::invalid_argument; + } + addr = reinterpret_cast( + &reinterpret_cast(sa)->sin6_addr); + addr_len = sizeof(in6_addr_type); + port = reinterpret_cast(sa)->sin6_port; + break; + default: + return ec = asio::error::address_family_not_supported; + } + + if (host && hostlen > 0) + { + if (flags & NI_NUMERICHOST) + { + if (socket_ops::inet_ntop(sa->sa_family, addr, host, hostlen, 0, ec) == 0) + { + return ec; + } + } + else + { + hostent hent; + char hbuf[8192] = ""; + hostent* hptr = socket_ops::gethostbyaddr(addr, + static_cast(addr_len), sa->sa_family, + &hent, hbuf, sizeof(hbuf), ec); + if (hptr && hptr->h_name && hptr->h_name[0] != '\0') + { + if (flags & NI_NOFQDN) + { + char* dot = strchr(hptr->h_name, '.'); + if (dot) + { + *dot = 0; + } + } + gai_strcpy(host, hptr->h_name, hostlen); + socket_ops::freehostent(hptr); + } + else + { + socket_ops::freehostent(hptr); + if (flags & NI_NAMEREQD) + { + return ec = asio::error::host_not_found; + } + if (socket_ops::inet_ntop(sa->sa_family, + addr, host, hostlen, 0, ec) == 0) + { + return ec; + } + } + } + } + + if (serv && servlen > 0) + { + if (flags & NI_NUMERICSERV) + { + if (servlen < 6) + { + return ec = asio::error::no_buffer_space; + } +#if defined(ASIO_HAS_SECURE_RTL) + sprintf_s(serv, servlen, "%u", ntohs(port)); +#else // defined(ASIO_HAS_SECURE_RTL) + sprintf(serv, "%u", ntohs(port)); +#endif // defined(ASIO_HAS_SECURE_RTL) + } + else + { +#if defined(ASIO_HAS_PTHREADS) + static ::pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; + ::pthread_mutex_lock(&mutex); +#endif // defined(ASIO_HAS_PTHREADS) + servent* sptr = ::getservbyport(port, (flags & NI_DGRAM) ? "udp" : 0); + if (sptr && sptr->s_name && sptr->s_name[0] != '\0') + { + gai_strcpy(serv, sptr->s_name, servlen); + } + else + { + if (servlen < 6) + { + return ec = asio::error::no_buffer_space; + } +#if defined(ASIO_HAS_SECURE_RTL) + sprintf_s(serv, servlen, "%u", ntohs(port)); +#else // defined(ASIO_HAS_SECURE_RTL) + sprintf(serv, "%u", ntohs(port)); +#endif // defined(ASIO_HAS_SECURE_RTL) + } +#if defined(ASIO_HAS_PTHREADS) + ::pthread_mutex_unlock(&mutex); +#endif // defined(ASIO_HAS_PTHREADS) + } + } + + ec.assign(0, ec.category()); + return ec; +} + +#endif // !defined(ASIO_HAS_GETADDRINFO) + +inline asio::error_code translate_addrinfo_error(int error) +{ + switch (error) + { + case 0: + return asio::error_code(); + case EAI_AGAIN: + return asio::error::host_not_found_try_again; + case EAI_BADFLAGS: + return asio::error::invalid_argument; + case EAI_FAIL: + return asio::error::no_recovery; + case EAI_FAMILY: + return asio::error::address_family_not_supported; + case EAI_MEMORY: + return asio::error::no_memory; + case EAI_NONAME: +#if defined(EAI_ADDRFAMILY) + case EAI_ADDRFAMILY: +#endif +#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) + case EAI_NODATA: +#endif + return asio::error::host_not_found; + case EAI_SERVICE: + return asio::error::service_not_found; + case EAI_SOCKTYPE: + return asio::error::socket_type_not_supported; + default: // Possibly the non-portable EAI_SYSTEM. +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + return asio::error_code( + WSAGetLastError(), asio::error::get_system_category()); +#else + return asio::error_code( + errno, asio::error::get_system_category()); +#endif + } +} + +asio::error_code getaddrinfo(const char* host, + const char* service, const addrinfo_type& hints, + addrinfo_type** result, asio::error_code& ec) +{ + host = (host && *host) ? host : 0; + service = (service && *service) ? service : 0; + clear_last_error(); +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if defined(ASIO_HAS_GETADDRINFO) + // Building for Windows XP, Windows Server 2003, or later. + int error = ::getaddrinfo(host, service, &hints, result); + return ec = translate_addrinfo_error(error); +# else + // Building for Windows 2000 or earlier. + typedef int (WSAAPI *gai_t)(const char*, + const char*, const addrinfo_type*, addrinfo_type**); + if (HMODULE winsock_module = ::GetModuleHandleA("ws2_32")) + { + if (gai_t gai = (gai_t)::GetProcAddress(winsock_module, "getaddrinfo")) + { + int error = gai(host, service, &hints, result); + return ec = translate_addrinfo_error(error); + } + } + int error = getaddrinfo_emulation(host, service, &hints, result); + return ec = translate_addrinfo_error(error); +# endif +#elif !defined(ASIO_HAS_GETADDRINFO) + int error = getaddrinfo_emulation(host, service, &hints, result); + return ec = translate_addrinfo_error(error); +#else + int error = ::getaddrinfo(host, service, &hints, result); +#if defined(__MACH__) && defined(__APPLE__) + using namespace std; // For isdigit and atoi. + if (error == 0 && service && isdigit(static_cast(service[0]))) + { + u_short_type port = host_to_network_short(atoi(service)); + for (addrinfo_type* ai = *result; ai; ai = ai->ai_next) + { + switch (ai->ai_family) + { + case ASIO_OS_DEF(AF_INET): + { + sockaddr_in4_type* sinptr = + reinterpret_cast(ai->ai_addr); + if (sinptr->sin_port == 0) + sinptr->sin_port = port; + break; + } + case ASIO_OS_DEF(AF_INET6): + { + sockaddr_in6_type* sin6ptr = + reinterpret_cast(ai->ai_addr); + if (sin6ptr->sin6_port == 0) + sin6ptr->sin6_port = port; + break; + } + default: + break; + } + } + } +#endif + return ec = translate_addrinfo_error(error); +#endif +} + +asio::error_code background_getaddrinfo( + const weak_cancel_token_type& cancel_token, const char* host, + const char* service, const addrinfo_type& hints, + addrinfo_type** result, asio::error_code& ec) +{ + if (cancel_token.expired()) + ec = asio::error::operation_aborted; + else + socket_ops::getaddrinfo(host, service, hints, result, ec); + return ec; +} + +void freeaddrinfo(addrinfo_type* ai) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if defined(ASIO_HAS_GETADDRINFO) + // Building for Windows XP, Windows Server 2003, or later. + ::freeaddrinfo(ai); +# else + // Building for Windows 2000 or earlier. + typedef int (WSAAPI *fai_t)(addrinfo_type*); + if (HMODULE winsock_module = ::GetModuleHandleA("ws2_32")) + { + if (fai_t fai = (fai_t)::GetProcAddress(winsock_module, "freeaddrinfo")) + { + fai(ai); + return; + } + } + freeaddrinfo_emulation(ai); +# endif +#elif !defined(ASIO_HAS_GETADDRINFO) + freeaddrinfo_emulation(ai); +#else + ::freeaddrinfo(ai); +#endif +} + +asio::error_code getnameinfo(const socket_addr_type* addr, + std::size_t addrlen, char* host, std::size_t hostlen, + char* serv, std::size_t servlen, int flags, asio::error_code& ec) +{ +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if defined(ASIO_HAS_GETADDRINFO) + // Building for Windows XP, Windows Server 2003, or later. + clear_last_error(); + int error = ::getnameinfo(addr, static_cast(addrlen), + host, static_cast(hostlen), + serv, static_cast(servlen), flags); + return ec = translate_addrinfo_error(error); +# else + // Building for Windows 2000 or earlier. + typedef int (WSAAPI *gni_t)(const socket_addr_type*, + int, char*, DWORD, char*, DWORD, int); + if (HMODULE winsock_module = ::GetModuleHandleA("ws2_32")) + { + if (gni_t gni = (gni_t)::GetProcAddress(winsock_module, "getnameinfo")) + { + clear_last_error(); + int error = gni(addr, static_cast(addrlen), + host, static_cast(hostlen), + serv, static_cast(servlen), flags); + return ec = translate_addrinfo_error(error); + } + } + clear_last_error(); + return getnameinfo_emulation(addr, addrlen, + host, hostlen, serv, servlen, flags, ec); +# endif +#elif !defined(ASIO_HAS_GETADDRINFO) + using namespace std; // For memcpy. + sockaddr_storage_type tmp_addr; + memcpy(&tmp_addr, addr, addrlen); + addr = reinterpret_cast(&tmp_addr); + clear_last_error(); + return getnameinfo_emulation(addr, addrlen, + host, hostlen, serv, servlen, flags, ec); +#else + clear_last_error(); + int error = ::getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags); + return ec = translate_addrinfo_error(error); +#endif +} + +asio::error_code sync_getnameinfo( + const socket_addr_type* addr, std::size_t addrlen, + char* host, std::size_t hostlen, char* serv, + std::size_t servlen, int sock_type, asio::error_code& ec) +{ + // First try resolving with the service name. If that fails try resolving + // but allow the service to be returned as a number. + int flags = (sock_type == SOCK_DGRAM) ? NI_DGRAM : 0; + socket_ops::getnameinfo(addr, addrlen, host, + hostlen, serv, servlen, flags, ec); + if (ec) + { + socket_ops::getnameinfo(addr, addrlen, host, hostlen, + serv, servlen, flags | NI_NUMERICSERV, ec); + } + + return ec; +} + +asio::error_code background_getnameinfo( + const weak_cancel_token_type& cancel_token, + const socket_addr_type* addr, std::size_t addrlen, + char* host, std::size_t hostlen, char* serv, + std::size_t servlen, int sock_type, asio::error_code& ec) +{ + if (cancel_token.expired()) + { + ec = asio::error::operation_aborted; + } + else + { + // First try resolving with the service name. If that fails try resolving + // but allow the service to be returned as a number. + int flags = (sock_type == SOCK_DGRAM) ? NI_DGRAM : 0; + socket_ops::getnameinfo(addr, addrlen, host, + hostlen, serv, servlen, flags, ec); + if (ec) + { + socket_ops::getnameinfo(addr, addrlen, host, hostlen, + serv, servlen, flags | NI_NUMERICSERV, ec); + } + } + + return ec; +} + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +u_long_type network_to_host_long(u_long_type value) +{ +#if defined(ASIO_WINDOWS_RUNTIME) + unsigned char* value_p = reinterpret_cast(&value); + u_long_type result = (static_cast(value_p[0]) << 24) + | (static_cast(value_p[1]) << 16) + | (static_cast(value_p[2]) << 8) + | static_cast(value_p[3]); + return result; +#else // defined(ASIO_WINDOWS_RUNTIME) + return ntohl(value); +#endif // defined(ASIO_WINDOWS_RUNTIME) +} + +u_long_type host_to_network_long(u_long_type value) +{ +#if defined(ASIO_WINDOWS_RUNTIME) + u_long_type result; + unsigned char* result_p = reinterpret_cast(&result); + result_p[0] = static_cast((value >> 24) & 0xFF); + result_p[1] = static_cast((value >> 16) & 0xFF); + result_p[2] = static_cast((value >> 8) & 0xFF); + result_p[3] = static_cast(value & 0xFF); + return result; +#else // defined(ASIO_WINDOWS_RUNTIME) + return htonl(value); +#endif // defined(ASIO_WINDOWS_RUNTIME) +} + +u_short_type network_to_host_short(u_short_type value) +{ +#if defined(ASIO_WINDOWS_RUNTIME) + unsigned char* value_p = reinterpret_cast(&value); + u_short_type result = (static_cast(value_p[0]) << 8) + | static_cast(value_p[1]); + return result; +#else // defined(ASIO_WINDOWS_RUNTIME) + return ntohs(value); +#endif // defined(ASIO_WINDOWS_RUNTIME) +} + +u_short_type host_to_network_short(u_short_type value) +{ +#if defined(ASIO_WINDOWS_RUNTIME) + u_short_type result; + unsigned char* result_p = reinterpret_cast(&result); + result_p[0] = static_cast((value >> 8) & 0xFF); + result_p[1] = static_cast(value & 0xFF); + return result; +#else // defined(ASIO_WINDOWS_RUNTIME) + return htons(value); +#endif // defined(ASIO_WINDOWS_RUNTIME) +} + +} // namespace socket_ops +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SOCKET_OPS_IPP diff --git a/include/asio/include/asio/detail/impl/socket_select_interrupter.ipp b/include/asio/include/asio/detail/impl/socket_select_interrupter.ipp new file mode 100644 index 0000000..69a6c06 --- /dev/null +++ b/include/asio/include/asio/detail/impl/socket_select_interrupter.ipp @@ -0,0 +1,185 @@ +// +// detail/impl/socket_select_interrupter.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_SOCKET_SELECT_INTERRUPTER_IPP +#define ASIO_DETAIL_IMPL_SOCKET_SELECT_INTERRUPTER_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS_RUNTIME) + +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + +#include +#include "asio/detail/socket_holder.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/socket_select_interrupter.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +socket_select_interrupter::socket_select_interrupter() +{ + open_descriptors(); +} + +void socket_select_interrupter::open_descriptors() +{ + asio::error_code ec; + socket_holder acceptor(socket_ops::socket( + AF_INET, SOCK_STREAM, IPPROTO_TCP, ec)); + if (acceptor.get() == invalid_socket) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + int opt = 1; + socket_ops::state_type acceptor_state = 0; + socket_ops::setsockopt(acceptor.get(), acceptor_state, + SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt), ec); + + using namespace std; // For memset. + sockaddr_in4_type addr; + std::size_t addr_len = sizeof(addr); + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = socket_ops::host_to_network_long(INADDR_LOOPBACK); + addr.sin_port = 0; + if (socket_ops::bind(acceptor.get(), (const socket_addr_type*)&addr, + addr_len, ec) == socket_error_retval) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + if (socket_ops::getsockname(acceptor.get(), (socket_addr_type*)&addr, + &addr_len, ec) == socket_error_retval) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + // Some broken firewalls on Windows will intermittently cause getsockname to + // return 0.0.0.0 when the socket is actually bound to 127.0.0.1. We + // explicitly specify the target address here to work around this problem. + if (addr.sin_addr.s_addr == socket_ops::host_to_network_long(INADDR_ANY)) + addr.sin_addr.s_addr = socket_ops::host_to_network_long(INADDR_LOOPBACK); + + if (socket_ops::listen(acceptor.get(), + SOMAXCONN, ec) == socket_error_retval) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + socket_holder client(socket_ops::socket( + AF_INET, SOCK_STREAM, IPPROTO_TCP, ec)); + if (client.get() == invalid_socket) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + if (socket_ops::connect(client.get(), (const socket_addr_type*)&addr, + addr_len, ec) == socket_error_retval) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + socket_holder server(socket_ops::accept(acceptor.get(), 0, 0, ec)); + if (server.get() == invalid_socket) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + ioctl_arg_type non_blocking = 1; + socket_ops::state_type client_state = 0; + if (socket_ops::ioctl(client.get(), client_state, + FIONBIO, &non_blocking, ec)) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + opt = 1; + socket_ops::setsockopt(client.get(), client_state, + IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt), ec); + + non_blocking = 1; + socket_ops::state_type server_state = 0; + if (socket_ops::ioctl(server.get(), server_state, + FIONBIO, &non_blocking, ec)) + asio::detail::throw_error(ec, "socket_select_interrupter"); + + opt = 1; + socket_ops::setsockopt(server.get(), server_state, + IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt), ec); + + read_descriptor_ = server.release(); + write_descriptor_ = client.release(); +} + +socket_select_interrupter::~socket_select_interrupter() +{ + close_descriptors(); +} + +void socket_select_interrupter::close_descriptors() +{ + asio::error_code ec; + socket_ops::state_type state = socket_ops::internal_non_blocking; + if (read_descriptor_ != invalid_socket) + socket_ops::close(read_descriptor_, state, true, ec); + if (write_descriptor_ != invalid_socket) + socket_ops::close(write_descriptor_, state, true, ec); +} + +void socket_select_interrupter::recreate() +{ + close_descriptors(); + + write_descriptor_ = invalid_socket; + read_descriptor_ = invalid_socket; + + open_descriptors(); +} + +void socket_select_interrupter::interrupt() +{ + char byte = 0; + socket_ops::buf b; + socket_ops::init_buf(b, &byte, 1); + asio::error_code ec; + socket_ops::send(write_descriptor_, &b, 1, 0, ec); +} + +bool socket_select_interrupter::reset() +{ + char data[1024]; + socket_ops::buf b; + socket_ops::init_buf(b, data, sizeof(data)); + asio::error_code ec; + for (;;) + { + int bytes_read = socket_ops::recv(read_descriptor_, &b, 1, 0, ec); + if (bytes_read == sizeof(data)) + continue; + if (bytes_read > 0) + return true; + if (bytes_read == 0) + return false; + if (ec == asio::error::would_block + || ec == asio::error::try_again) + return true; + return false; + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_IMPL_SOCKET_SELECT_INTERRUPTER_IPP diff --git a/include/asio/include/asio/detail/impl/strand_executor_service.hpp b/include/asio/include/asio/detail/impl/strand_executor_service.hpp new file mode 100644 index 0000000..8fe1454 --- /dev/null +++ b/include/asio/include/asio/detail/impl/strand_executor_service.hpp @@ -0,0 +1,385 @@ +// +// detail/impl/strand_executor_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_HPP +#define ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/call_stack.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/recycling_allocator.hpp" +#include "asio/executor_work_guard.hpp" +#include "asio/defer.hpp" +#include "asio/dispatch.hpp" +#include "asio/post.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class strand_executor_service::allocator_binder +{ +public: + typedef Allocator allocator_type; + + allocator_binder(ASIO_MOVE_ARG(F) f, const Allocator& a) + : f_(ASIO_MOVE_CAST(F)(f)), + allocator_(a) + { + } + + allocator_binder(const allocator_binder& other) + : f_(other.f_), + allocator_(other.allocator_) + { + } + +#if defined(ASIO_HAS_MOVE) + allocator_binder(allocator_binder&& other) + : f_(ASIO_MOVE_CAST(F)(other.f_)), + allocator_(ASIO_MOVE_CAST(allocator_type)(other.allocator_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + allocator_type get_allocator() const ASIO_NOEXCEPT + { + return allocator_; + } + + void operator()() + { + f_(); + } + +private: + F f_; + allocator_type allocator_; +}; + +template +class strand_executor_service::invoker::value + >::type> +{ +public: + invoker(const implementation_type& impl, Executor& ex) + : impl_(impl), + executor_(asio::prefer(ex, execution::outstanding_work.tracked)) + { + } + + invoker(const invoker& other) + : impl_(other.impl_), + executor_(other.executor_) + { + } + +#if defined(ASIO_HAS_MOVE) + invoker(invoker&& other) + : impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_)), + executor_(ASIO_MOVE_CAST(executor_type)(other.executor_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + struct on_invoker_exit + { + invoker* this_; + + ~on_invoker_exit() + { + this_->impl_->mutex_->lock(); + this_->impl_->ready_queue_.push(this_->impl_->waiting_queue_); + bool more_handlers = this_->impl_->locked_ = + !this_->impl_->ready_queue_.empty(); + this_->impl_->mutex_->unlock(); + + if (more_handlers) + { + recycling_allocator allocator; + execution::execute( + asio::prefer( + asio::require(this_->executor_, + execution::blocking.never), + execution::allocator(allocator)), + ASIO_MOVE_CAST(invoker)(*this_)); + } + } + }; + + void operator()() + { + // Indicate that this strand is executing on the current thread. + call_stack::context ctx(impl_.get()); + + // Ensure the next handler, if any, is scheduled on block exit. + on_invoker_exit on_exit = { this }; + (void)on_exit; + + // Run all ready handlers. No lock is required since the ready queue is + // accessed only within the strand. + asio::error_code ec; + while (scheduler_operation* o = impl_->ready_queue_.front()) + { + impl_->ready_queue_.pop(); + o->complete(impl_.get(), ec, 0); + } + } + +private: + typedef typename decay< + typename prefer_result< + Executor, + execution::outstanding_work_t::tracked_t + >::type + >::type executor_type; + + implementation_type impl_; + executor_type executor_; +}; + +#if !defined(ASIO_NO_TS_EXECUTORS) + +template +class strand_executor_service::invoker::value + >::type> +{ +public: + invoker(const implementation_type& impl, Executor& ex) + : impl_(impl), + work_(ex) + { + } + + invoker(const invoker& other) + : impl_(other.impl_), + work_(other.work_) + { + } + +#if defined(ASIO_HAS_MOVE) + invoker(invoker&& other) + : impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_)), + work_(ASIO_MOVE_CAST(executor_work_guard)(other.work_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + struct on_invoker_exit + { + invoker* this_; + + ~on_invoker_exit() + { + this_->impl_->mutex_->lock(); + this_->impl_->ready_queue_.push(this_->impl_->waiting_queue_); + bool more_handlers = this_->impl_->locked_ = + !this_->impl_->ready_queue_.empty(); + this_->impl_->mutex_->unlock(); + + if (more_handlers) + { + Executor ex(this_->work_.get_executor()); + recycling_allocator allocator; + ex.post(ASIO_MOVE_CAST(invoker)(*this_), allocator); + } + } + }; + + void operator()() + { + // Indicate that this strand is executing on the current thread. + call_stack::context ctx(impl_.get()); + + // Ensure the next handler, if any, is scheduled on block exit. + on_invoker_exit on_exit = { this }; + (void)on_exit; + + // Run all ready handlers. No lock is required since the ready queue is + // accessed only within the strand. + asio::error_code ec; + while (scheduler_operation* o = impl_->ready_queue_.front()) + { + impl_->ready_queue_.pop(); + o->complete(impl_.get(), ec, 0); + } + } + +private: + implementation_type impl_; + executor_work_guard work_; +}; + +#endif // !defined(ASIO_NO_TS_EXECUTORS) + +template +inline void strand_executor_service::execute(const implementation_type& impl, + Executor& ex, ASIO_MOVE_ARG(Function) function, + typename enable_if< + can_query >::value + >::type*) +{ + return strand_executor_service::do_execute(impl, ex, + ASIO_MOVE_CAST(Function)(function), + asio::query(ex, execution::allocator)); +} + +template +inline void strand_executor_service::execute(const implementation_type& impl, + Executor& ex, ASIO_MOVE_ARG(Function) function, + typename enable_if< + !can_query >::value + >::type*) +{ + return strand_executor_service::do_execute(impl, ex, + ASIO_MOVE_CAST(Function)(function), + std::allocator()); +} + +template +void strand_executor_service::do_execute(const implementation_type& impl, + Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a) +{ + typedef typename decay::type function_type; + + // If the executor is not never-blocking, and we are already in the strand, + // then the function can run immediately. + if (asio::query(ex, execution::blocking) != execution::blocking.never + && call_stack::contains(impl.get())) + { + // Make a local, non-const copy of the function. + function_type tmp(ASIO_MOVE_CAST(Function)(function)); + + fenced_block b(fenced_block::full); + asio_handler_invoke_helpers::invoke(tmp, tmp); + return; + } + + // Allocate and construct an operation to wrap the function. + typedef executor_op op; + typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; + p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a); + + ASIO_HANDLER_CREATION((impl->service_->context(), *p.p, + "strand_executor", impl.get(), 0, "execute")); + + // Add the function to the strand and schedule the strand if required. + bool first = enqueue(impl, p.p); + p.v = p.p = 0; + if (first) + { + execution::execute(ex, invoker(impl, ex)); + } +} + +template +void strand_executor_service::dispatch(const implementation_type& impl, + Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a) +{ + typedef typename decay::type function_type; + + // If we are already in the strand then the function can run immediately. + if (call_stack::contains(impl.get())) + { + // Make a local, non-const copy of the function. + function_type tmp(ASIO_MOVE_CAST(Function)(function)); + + fenced_block b(fenced_block::full); + asio_handler_invoke_helpers::invoke(tmp, tmp); + return; + } + + // Allocate and construct an operation to wrap the function. + typedef executor_op op; + typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; + p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a); + + ASIO_HANDLER_CREATION((impl->service_->context(), *p.p, + "strand_executor", impl.get(), 0, "dispatch")); + + // Add the function to the strand and schedule the strand if required. + bool first = enqueue(impl, p.p); + p.v = p.p = 0; + if (first) + { + asio::dispatch(ex, + allocator_binder, Allocator>( + invoker(impl, ex), a)); + } +} + +// Request invocation of the given function and return immediately. +template +void strand_executor_service::post(const implementation_type& impl, + Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a) +{ + typedef typename decay::type function_type; + + // Allocate and construct an operation to wrap the function. + typedef executor_op op; + typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; + p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a); + + ASIO_HANDLER_CREATION((impl->service_->context(), *p.p, + "strand_executor", impl.get(), 0, "post")); + + // Add the function to the strand and schedule the strand if required. + bool first = enqueue(impl, p.p); + p.v = p.p = 0; + if (first) + { + asio::post(ex, + allocator_binder, Allocator>( + invoker(impl, ex), a)); + } +} + +// Request invocation of the given function and return immediately. +template +void strand_executor_service::defer(const implementation_type& impl, + Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a) +{ + typedef typename decay::type function_type; + + // Allocate and construct an operation to wrap the function. + typedef executor_op op; + typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; + p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a); + + ASIO_HANDLER_CREATION((impl->service_->context(), *p.p, + "strand_executor", impl.get(), 0, "defer")); + + // Add the function to the strand and schedule the strand if required. + bool first = enqueue(impl, p.p); + p.v = p.p = 0; + if (first) + { + asio::defer(ex, + allocator_binder, Allocator>( + invoker(impl, ex), a)); + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_HPP diff --git a/include/asio/include/asio/detail/impl/strand_executor_service.ipp b/include/asio/include/asio/detail/impl/strand_executor_service.ipp new file mode 100644 index 0000000..dfe64df --- /dev/null +++ b/include/asio/include/asio/detail/impl/strand_executor_service.ipp @@ -0,0 +1,134 @@ +// +// detail/impl/strand_executor_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_IPP +#define ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/strand_executor_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +strand_executor_service::strand_executor_service(execution_context& ctx) + : execution_context_service_base(ctx), + mutex_(), + salt_(0), + impl_list_(0) +{ +} + +void strand_executor_service::shutdown() +{ + op_queue ops; + + asio::detail::mutex::scoped_lock lock(mutex_); + + strand_impl* impl = impl_list_; + while (impl) + { + impl->mutex_->lock(); + impl->shutdown_ = true; + ops.push(impl->waiting_queue_); + ops.push(impl->ready_queue_); + impl->mutex_->unlock(); + impl = impl->next_; + } +} + +strand_executor_service::implementation_type +strand_executor_service::create_implementation() +{ + implementation_type new_impl(new strand_impl); + new_impl->locked_ = false; + new_impl->shutdown_ = false; + + asio::detail::mutex::scoped_lock lock(mutex_); + + // Select a mutex from the pool of shared mutexes. + std::size_t salt = salt_++; + std::size_t mutex_index = reinterpret_cast(new_impl.get()); + mutex_index += (reinterpret_cast(new_impl.get()) >> 3); + mutex_index ^= salt + 0x9e3779b9 + (mutex_index << 6) + (mutex_index >> 2); + mutex_index = mutex_index % num_mutexes; + if (!mutexes_[mutex_index].get()) + mutexes_[mutex_index].reset(new mutex); + new_impl->mutex_ = mutexes_[mutex_index].get(); + + // Insert implementation into linked list of all implementations. + new_impl->next_ = impl_list_; + new_impl->prev_ = 0; + if (impl_list_) + impl_list_->prev_ = new_impl.get(); + impl_list_ = new_impl.get(); + new_impl->service_ = this; + + return new_impl; +} + +strand_executor_service::strand_impl::~strand_impl() +{ + asio::detail::mutex::scoped_lock lock(service_->mutex_); + + // Remove implementation from linked list of all implementations. + if (service_->impl_list_ == this) + service_->impl_list_ = next_; + if (prev_) + prev_->next_ = next_; + if (next_) + next_->prev_= prev_; +} + +bool strand_executor_service::enqueue(const implementation_type& impl, + scheduler_operation* op) +{ + impl->mutex_->lock(); + if (impl->shutdown_) + { + impl->mutex_->unlock(); + op->destroy(); + return false; + } + else if (impl->locked_) + { + // Some other function already holds the strand lock. Enqueue for later. + impl->waiting_queue_.push(op); + impl->mutex_->unlock(); + return false; + } + else + { + // The function is acquiring the strand lock and so is responsible for + // scheduling the strand. + impl->locked_ = true; + impl->mutex_->unlock(); + impl->ready_queue_.push(op); + return true; + } +} + +bool strand_executor_service::running_in_this_thread( + const implementation_type& impl) +{ + return !!call_stack::contains(impl.get()); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/strand_service.hpp b/include/asio/include/asio/detail/impl/strand_service.hpp new file mode 100644 index 0000000..a9696de --- /dev/null +++ b/include/asio/include/asio/detail/impl/strand_service.hpp @@ -0,0 +1,117 @@ +// +// detail/impl/strand_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_STRAND_SERVICE_HPP +#define ASIO_DETAIL_IMPL_STRAND_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/call_stack.hpp" +#include "asio/detail/completion_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/memory.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +inline strand_service::strand_impl::strand_impl() + : operation(&strand_service::do_complete), + locked_(false) +{ +} + +struct strand_service::on_dispatch_exit +{ + io_context_impl* io_context_impl_; + strand_impl* impl_; + + ~on_dispatch_exit() + { + impl_->mutex_.lock(); + impl_->ready_queue_.push(impl_->waiting_queue_); + bool more_handlers = impl_->locked_ = !impl_->ready_queue_.empty(); + impl_->mutex_.unlock(); + + if (more_handlers) + io_context_impl_->post_immediate_completion(impl_, false); + } +}; + +template +void strand_service::dispatch(strand_service::implementation_type& impl, + Handler& handler) +{ + // If we are already in the strand then the handler can run immediately. + if (call_stack::contains(impl)) + { + fenced_block b(fenced_block::full); + asio_handler_invoke_helpers::invoke(handler, handler); + return; + } + + // Allocate and construct an operation to wrap the handler. + typedef completion_handler op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(handler, io_context_.get_executor()); + + ASIO_HANDLER_CREATION((this->context(), + *p.p, "strand", impl, 0, "dispatch")); + + bool dispatch_immediately = do_dispatch(impl, p.p); + operation* o = p.p; + p.v = p.p = 0; + + if (dispatch_immediately) + { + // Indicate that this strand is executing on the current thread. + call_stack::context ctx(impl); + + // Ensure the next handler, if any, is scheduled on block exit. + on_dispatch_exit on_exit = { &io_context_impl_, impl }; + (void)on_exit; + + op::do_complete(&io_context_impl_, o, asio::error_code(), 0); + } +} + +// Request the io_context to invoke the given handler and return immediately. +template +void strand_service::post(strand_service::implementation_type& impl, + Handler& handler) +{ + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef completion_handler op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(handler, io_context_.get_executor()); + + ASIO_HANDLER_CREATION((this->context(), + *p.p, "strand", impl, 0, "post")); + + do_post(impl, p.p, is_continuation); + p.v = p.p = 0; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_STRAND_SERVICE_HPP diff --git a/include/asio/include/asio/detail/impl/strand_service.ipp b/include/asio/include/asio/detail/impl/strand_service.ipp new file mode 100644 index 0000000..6bd87fa --- /dev/null +++ b/include/asio/include/asio/detail/impl/strand_service.ipp @@ -0,0 +1,178 @@ +// +// detail/impl/strand_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_STRAND_SERVICE_IPP +#define ASIO_DETAIL_IMPL_STRAND_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/call_stack.hpp" +#include "asio/detail/strand_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct strand_service::on_do_complete_exit +{ + io_context_impl* owner_; + strand_impl* impl_; + + ~on_do_complete_exit() + { + impl_->mutex_.lock(); + impl_->ready_queue_.push(impl_->waiting_queue_); + bool more_handlers = impl_->locked_ = !impl_->ready_queue_.empty(); + impl_->mutex_.unlock(); + + if (more_handlers) + owner_->post_immediate_completion(impl_, true); + } +}; + +strand_service::strand_service(asio::io_context& io_context) + : asio::detail::service_base(io_context), + io_context_(io_context), + io_context_impl_(asio::use_service(io_context)), + mutex_(), + salt_(0) +{ +} + +void strand_service::shutdown() +{ + op_queue ops; + + asio::detail::mutex::scoped_lock lock(mutex_); + + for (std::size_t i = 0; i < num_implementations; ++i) + { + if (strand_impl* impl = implementations_[i].get()) + { + ops.push(impl->waiting_queue_); + ops.push(impl->ready_queue_); + } + } +} + +void strand_service::construct(strand_service::implementation_type& impl) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + std::size_t salt = salt_++; +#if defined(ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION) + std::size_t index = salt; +#else // defined(ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION) + std::size_t index = reinterpret_cast(&impl); + index += (reinterpret_cast(&impl) >> 3); + index ^= salt + 0x9e3779b9 + (index << 6) + (index >> 2); +#endif // defined(ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION) + index = index % num_implementations; + + if (!implementations_[index].get()) + implementations_[index].reset(new strand_impl); + impl = implementations_[index].get(); +} + +bool strand_service::running_in_this_thread( + const implementation_type& impl) const +{ + return call_stack::contains(impl) != 0; +} + +bool strand_service::do_dispatch(implementation_type& impl, operation* op) +{ + // If we are running inside the io_context, and no other handler already + // holds the strand lock, then the handler can run immediately. + bool can_dispatch = io_context_impl_.can_dispatch(); + impl->mutex_.lock(); + if (can_dispatch && !impl->locked_) + { + // Immediate invocation is allowed. + impl->locked_ = true; + impl->mutex_.unlock(); + return true; + } + + if (impl->locked_) + { + // Some other handler already holds the strand lock. Enqueue for later. + impl->waiting_queue_.push(op); + impl->mutex_.unlock(); + } + else + { + // The handler is acquiring the strand lock and so is responsible for + // scheduling the strand. + impl->locked_ = true; + impl->mutex_.unlock(); + impl->ready_queue_.push(op); + io_context_impl_.post_immediate_completion(impl, false); + } + + return false; +} + +void strand_service::do_post(implementation_type& impl, + operation* op, bool is_continuation) +{ + impl->mutex_.lock(); + if (impl->locked_) + { + // Some other handler already holds the strand lock. Enqueue for later. + impl->waiting_queue_.push(op); + impl->mutex_.unlock(); + } + else + { + // The handler is acquiring the strand lock and so is responsible for + // scheduling the strand. + impl->locked_ = true; + impl->mutex_.unlock(); + impl->ready_queue_.push(op); + io_context_impl_.post_immediate_completion(impl, is_continuation); + } +} + +void strand_service::do_complete(void* owner, operation* base, + const asio::error_code& ec, std::size_t /*bytes_transferred*/) +{ + if (owner) + { + strand_impl* impl = static_cast(base); + + // Indicate that this strand is executing on the current thread. + call_stack::context ctx(impl); + + // Ensure the next handler, if any, is scheduled on block exit. + on_do_complete_exit on_exit; + on_exit.owner_ = static_cast(owner); + on_exit.impl_ = impl; + + // Run all ready handlers. No lock is required since the ready queue is + // accessed only within the strand. + while (operation* o = impl->ready_queue_.front()) + { + impl->ready_queue_.pop(); + o->complete(owner, ec, 0); + } + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_STRAND_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/throw_error.ipp b/include/asio/include/asio/detail/impl/throw_error.ipp new file mode 100644 index 0000000..57d301a --- /dev/null +++ b/include/asio/include/asio/detail/impl/throw_error.ipp @@ -0,0 +1,60 @@ +// +// detail/impl/throw_error.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_THROW_ERROR_IPP +#define ASIO_DETAIL_IMPL_THROW_ERROR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/throw_exception.hpp" +#include "asio/system_error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +void do_throw_error(const asio::error_code& err) +{ + asio::system_error e(err); + asio::detail::throw_exception(e); +} + +void do_throw_error(const asio::error_code& err, const char* location) +{ + // boostify: non-boost code starts here +#if defined(ASIO_MSVC) && defined(ASIO_HAS_STD_SYSTEM_ERROR) + // Microsoft's implementation of std::system_error is non-conformant in that + // it ignores the error code's message when a "what" string is supplied. We'll + // work around this by explicitly formatting the "what" string. + std::string what_msg = location; + what_msg += ": "; + what_msg += err.message(); + asio::system_error e(err, what_msg); + asio::detail::throw_exception(e); +#else // defined(ASIO_MSVC) && defined(ASIO_HAS_STD_SYSTEM_ERROR) + // boostify: non-boost code ends here + asio::system_error e(err, location); + asio::detail::throw_exception(e); + // boostify: non-boost code starts here +#endif // defined(ASIO_MSVC) && defined(ASIO_HAS_STD_SYSTEM_ERROR) + // boostify: non-boost code ends here +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_THROW_ERROR_IPP diff --git a/include/asio/include/asio/detail/impl/timer_queue_ptime.ipp b/include/asio/include/asio/detail/impl/timer_queue_ptime.ipp new file mode 100644 index 0000000..b246d48 --- /dev/null +++ b/include/asio/include/asio/detail/impl/timer_queue_ptime.ipp @@ -0,0 +1,91 @@ +// +// detail/impl/timer_queue_ptime.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP +#define ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_DATE_TIME) + +#include "asio/detail/timer_queue_ptime.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +timer_queue >::timer_queue() +{ +} + +timer_queue >::~timer_queue() +{ +} + +bool timer_queue >::enqueue_timer( + const time_type& time, per_timer_data& timer, wait_op* op) +{ + return impl_.enqueue_timer(time, timer, op); +} + +bool timer_queue >::empty() const +{ + return impl_.empty(); +} + +long timer_queue >::wait_duration_msec( + long max_duration) const +{ + return impl_.wait_duration_msec(max_duration); +} + +long timer_queue >::wait_duration_usec( + long max_duration) const +{ + return impl_.wait_duration_usec(max_duration); +} + +void timer_queue >::get_ready_timers( + op_queue& ops) +{ + impl_.get_ready_timers(ops); +} + +void timer_queue >::get_all_timers( + op_queue& ops) +{ + impl_.get_all_timers(ops); +} + +std::size_t timer_queue >::cancel_timer( + per_timer_data& timer, op_queue& ops, std::size_t max_cancelled) +{ + return impl_.cancel_timer(timer, ops, max_cancelled); +} + +void timer_queue >::move_timer( + per_timer_data& target, per_timer_data& source) +{ + impl_.move_timer(target, source); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + +#endif // ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP diff --git a/include/asio/include/asio/detail/impl/timer_queue_set.ipp b/include/asio/include/asio/detail/impl/timer_queue_set.ipp new file mode 100644 index 0000000..38b950b --- /dev/null +++ b/include/asio/include/asio/detail/impl/timer_queue_set.ipp @@ -0,0 +1,101 @@ +// +// detail/impl/timer_queue_set.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_TIMER_QUEUE_SET_IPP +#define ASIO_DETAIL_IMPL_TIMER_QUEUE_SET_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/timer_queue_set.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +timer_queue_set::timer_queue_set() + : first_(0) +{ +} + +void timer_queue_set::insert(timer_queue_base* q) +{ + q->next_ = first_; + first_ = q; +} + +void timer_queue_set::erase(timer_queue_base* q) +{ + if (first_) + { + if (q == first_) + { + first_ = q->next_; + q->next_ = 0; + return; + } + + for (timer_queue_base* p = first_; p->next_; p = p->next_) + { + if (p->next_ == q) + { + p->next_ = q->next_; + q->next_ = 0; + return; + } + } + } +} + +bool timer_queue_set::all_empty() const +{ + for (timer_queue_base* p = first_; p; p = p->next_) + if (!p->empty()) + return false; + return true; +} + +long timer_queue_set::wait_duration_msec(long max_duration) const +{ + long min_duration = max_duration; + for (timer_queue_base* p = first_; p; p = p->next_) + min_duration = p->wait_duration_msec(min_duration); + return min_duration; +} + +long timer_queue_set::wait_duration_usec(long max_duration) const +{ + long min_duration = max_duration; + for (timer_queue_base* p = first_; p; p = p->next_) + min_duration = p->wait_duration_usec(min_duration); + return min_duration; +} + +void timer_queue_set::get_ready_timers(op_queue& ops) +{ + for (timer_queue_base* p = first_; p; p = p->next_) + p->get_ready_timers(ops); +} + +void timer_queue_set::get_all_timers(op_queue& ops) +{ + for (timer_queue_base* p = first_; p; p = p->next_) + p->get_all_timers(ops); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IMPL_TIMER_QUEUE_SET_IPP diff --git a/include/asio/include/asio/detail/impl/win_event.ipp b/include/asio/include/asio/detail/impl/win_event.ipp new file mode 100644 index 0000000..62dec0a --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_event.ipp @@ -0,0 +1,76 @@ +// +// detail/win_event.ipp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_EVENT_IPP +#define ASIO_DETAIL_IMPL_WIN_EVENT_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include "asio/detail/throw_error.hpp" +#include "asio/detail/win_event.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +win_event::win_event() + : state_(0) +{ +#if defined(ASIO_WINDOWS_APP) + events_[0] = ::CreateEventExW(0, 0, + CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS); +#else // defined(ASIO_WINDOWS_APP) + events_[0] = ::CreateEventW(0, true, false, 0); +#endif // defined(ASIO_WINDOWS_APP) + if (!events_[0]) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "event"); + } + +#if defined(ASIO_WINDOWS_APP) + events_[1] = ::CreateEventExW(0, 0, 0, EVENT_ALL_ACCESS); +#else // defined(ASIO_WINDOWS_APP) + events_[1] = ::CreateEventW(0, false, false, 0); +#endif // defined(ASIO_WINDOWS_APP) + if (!events_[1]) + { + DWORD last_error = ::GetLastError(); + ::CloseHandle(events_[0]); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "event"); + } +} + +win_event::~win_event() +{ + ::CloseHandle(events_[0]); + ::CloseHandle(events_[1]); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_IMPL_WIN_EVENT_IPP diff --git a/include/asio/include/asio/detail/impl/win_iocp_handle_service.ipp b/include/asio/include/asio/detail/impl/win_iocp_handle_service.ipp new file mode 100644 index 0000000..31f2948 --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_iocp_handle_service.ipp @@ -0,0 +1,525 @@ +// +// detail/impl/win_iocp_handle_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_IOCP_HANDLE_SERVICE_IPP +#define ASIO_DETAIL_IMPL_WIN_IOCP_HANDLE_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/win_iocp_handle_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_iocp_handle_service::overlapped_wrapper + : public OVERLAPPED +{ +public: + explicit overlapped_wrapper(asio::error_code& ec) + { + Internal = 0; + InternalHigh = 0; + Offset = 0; + OffsetHigh = 0; + + // Create a non-signalled manual-reset event, for GetOverlappedResult. + hEvent = ::CreateEventW(0, TRUE, FALSE, 0); + if (hEvent) + { + // As documented in GetQueuedCompletionStatus, setting the low order + // bit of this event prevents our synchronous writes from being treated + // as completion port events. + DWORD_PTR tmp = reinterpret_cast(hEvent); + hEvent = reinterpret_cast(tmp | 1); + } + else + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + } + + ~overlapped_wrapper() + { + if (hEvent) + { + ::CloseHandle(hEvent); + } + } +}; + +win_iocp_handle_service::win_iocp_handle_service(execution_context& context) + : execution_context_service_base(context), + iocp_service_(asio::use_service(context)), + mutex_(), + impl_list_(0) +{ +} + +void win_iocp_handle_service::shutdown() +{ + // Close all implementations, causing all operations to complete. + asio::detail::mutex::scoped_lock lock(mutex_); + implementation_type* impl = impl_list_; + while (impl) + { + close_for_destruction(*impl); + impl = impl->next_; + } +} + +void win_iocp_handle_service::construct( + win_iocp_handle_service::implementation_type& impl) +{ + impl.handle_ = INVALID_HANDLE_VALUE; + impl.safe_cancellation_thread_id_ = 0; + + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; +} + +void win_iocp_handle_service::move_construct( + win_iocp_handle_service::implementation_type& impl, + win_iocp_handle_service::implementation_type& other_impl) +{ + impl.handle_ = other_impl.handle_; + other_impl.handle_ = INVALID_HANDLE_VALUE; + + impl.safe_cancellation_thread_id_ = other_impl.safe_cancellation_thread_id_; + other_impl.safe_cancellation_thread_id_ = 0; + + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; +} + +void win_iocp_handle_service::move_assign( + win_iocp_handle_service::implementation_type& impl, + win_iocp_handle_service& other_service, + win_iocp_handle_service::implementation_type& other_impl) +{ + close_for_destruction(impl); + + if (this != &other_service) + { + // Remove implementation from linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; + } + + impl.handle_ = other_impl.handle_; + other_impl.handle_ = INVALID_HANDLE_VALUE; + + impl.safe_cancellation_thread_id_ = other_impl.safe_cancellation_thread_id_; + other_impl.safe_cancellation_thread_id_ = 0; + + if (this != &other_service) + { + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(other_service.mutex_); + impl.next_ = other_service.impl_list_; + impl.prev_ = 0; + if (other_service.impl_list_) + other_service.impl_list_->prev_ = &impl; + other_service.impl_list_ = &impl; + } +} + +void win_iocp_handle_service::destroy( + win_iocp_handle_service::implementation_type& impl) +{ + close_for_destruction(impl); + + // Remove implementation from linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; +} + +asio::error_code win_iocp_handle_service::assign( + win_iocp_handle_service::implementation_type& impl, + const native_handle_type& handle, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + if (iocp_service_.register_handle(handle, ec)) + return ec; + + impl.handle_ = handle; + ec = asio::error_code(); + return ec; +} + +asio::error_code win_iocp_handle_service::close( + win_iocp_handle_service::implementation_type& impl, + asio::error_code& ec) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((iocp_service_.context(), "handle", + &impl, reinterpret_cast(impl.handle_), "close")); + + if (!::CloseHandle(impl.handle_)) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + else + { + ec = asio::error_code(); + } + + impl.handle_ = INVALID_HANDLE_VALUE; + impl.safe_cancellation_thread_id_ = 0; + } + else + { + ec = asio::error_code(); + } + + return ec; +} + +asio::error_code win_iocp_handle_service::cancel( + win_iocp_handle_service::implementation_type& impl, + asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return ec; + } + + ASIO_HANDLER_OPERATION((iocp_service_.context(), "handle", + &impl, reinterpret_cast(impl.handle_), "cancel")); + + if (FARPROC cancel_io_ex_ptr = ::GetProcAddress( + ::GetModuleHandleA("KERNEL32"), "CancelIoEx")) + { + // The version of Windows supports cancellation from any thread. + typedef BOOL (WINAPI* cancel_io_ex_t)(HANDLE, LPOVERLAPPED); + cancel_io_ex_t cancel_io_ex = reinterpret_cast( + reinterpret_cast(cancel_io_ex_ptr)); + if (!cancel_io_ex(impl.handle_, 0)) + { + DWORD last_error = ::GetLastError(); + if (last_error == ERROR_NOT_FOUND) + { + // ERROR_NOT_FOUND means that there were no operations to be + // cancelled. We swallow this error to match the behaviour on other + // platforms. + ec = asio::error_code(); + } + else + { + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + } + else + { + ec = asio::error_code(); + } + } + else if (impl.safe_cancellation_thread_id_ == 0) + { + // No operations have been started, so there's nothing to cancel. + ec = asio::error_code(); + } + else if (impl.safe_cancellation_thread_id_ == ::GetCurrentThreadId()) + { + // Asynchronous operations have been started from the current thread only, + // so it is safe to try to cancel them using CancelIo. + if (!::CancelIo(impl.handle_)) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + else + { + ec = asio::error_code(); + } + } + else + { + // Asynchronous operations have been started from more than one thread, + // so cancellation is not safe. + ec = asio::error::operation_not_supported; + } + + return ec; +} + +size_t win_iocp_handle_service::do_write( + win_iocp_handle_service::implementation_type& impl, uint64_t offset, + const asio::const_buffer& buffer, asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to write 0 bytes on a handle is a no-op. + if (buffer.size() == 0) + { + ec = asio::error_code(); + return 0; + } + + overlapped_wrapper overlapped(ec); + if (ec) + { + return 0; + } + + // Write the data. + overlapped.Offset = offset & 0xFFFFFFFF; + overlapped.OffsetHigh = (offset >> 32) & 0xFFFFFFFF; + BOOL ok = ::WriteFile(impl.handle_, buffer.data(), + static_cast(buffer.size()), 0, &overlapped); + if (!ok) + { + DWORD last_error = ::GetLastError(); + if (last_error != ERROR_IO_PENDING) + { + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return 0; + } + } + + // Wait for the operation to complete. + DWORD bytes_transferred = 0; + ok = ::GetOverlappedResult(impl.handle_, + &overlapped, &bytes_transferred, TRUE); + if (!ok) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return 0; + } + + ec = asio::error_code(); + return bytes_transferred; +} + +void win_iocp_handle_service::start_write_op( + win_iocp_handle_service::implementation_type& impl, uint64_t offset, + const asio::const_buffer& buffer, operation* op) +{ + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + if (!is_open(impl)) + { + iocp_service_.on_completion(op, asio::error::bad_descriptor); + } + else if (buffer.size() == 0) + { + // A request to write 0 bytes on a handle is a no-op. + iocp_service_.on_completion(op); + } + else + { + DWORD bytes_transferred = 0; + op->Offset = offset & 0xFFFFFFFF; + op->OffsetHigh = (offset >> 32) & 0xFFFFFFFF; + BOOL ok = ::WriteFile(impl.handle_, buffer.data(), + static_cast(buffer.size()), + &bytes_transferred, op); + DWORD last_error = ::GetLastError(); + if (!ok && last_error != ERROR_IO_PENDING + && last_error != ERROR_MORE_DATA) + { + iocp_service_.on_completion(op, last_error, bytes_transferred); + } + else + { + iocp_service_.on_pending(op); + } + } +} + +size_t win_iocp_handle_service::do_read( + win_iocp_handle_service::implementation_type& impl, uint64_t offset, + const asio::mutable_buffer& buffer, asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return 0; + } + + // A request to read 0 bytes on a stream handle is a no-op. + if (buffer.size() == 0) + { + ec = asio::error_code(); + return 0; + } + + overlapped_wrapper overlapped(ec); + if (ec) + { + return 0; + } + + // Read some data. + overlapped.Offset = offset & 0xFFFFFFFF; + overlapped.OffsetHigh = (offset >> 32) & 0xFFFFFFFF; + BOOL ok = ::ReadFile(impl.handle_, buffer.data(), + static_cast(buffer.size()), 0, &overlapped); + if (!ok) + { + DWORD last_error = ::GetLastError(); + if (last_error != ERROR_IO_PENDING && last_error != ERROR_MORE_DATA) + { + if (last_error == ERROR_HANDLE_EOF) + { + ec = asio::error::eof; + } + else + { + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + return 0; + } + } + + // Wait for the operation to complete. + DWORD bytes_transferred = 0; + ok = ::GetOverlappedResult(impl.handle_, + &overlapped, &bytes_transferred, TRUE); + if (!ok) + { + DWORD last_error = ::GetLastError(); + if (last_error == ERROR_HANDLE_EOF) + { + ec = asio::error::eof; + } + else + { + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + return (last_error == ERROR_MORE_DATA) ? bytes_transferred : 0; + } + + ec = asio::error_code(); + return bytes_transferred; +} + +void win_iocp_handle_service::start_read_op( + win_iocp_handle_service::implementation_type& impl, uint64_t offset, + const asio::mutable_buffer& buffer, operation* op) +{ + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + if (!is_open(impl)) + { + iocp_service_.on_completion(op, asio::error::bad_descriptor); + } + else if (buffer.size() == 0) + { + // A request to read 0 bytes on a handle is a no-op. + iocp_service_.on_completion(op); + } + else + { + DWORD bytes_transferred = 0; + op->Offset = offset & 0xFFFFFFFF; + op->OffsetHigh = (offset >> 32) & 0xFFFFFFFF; + BOOL ok = ::ReadFile(impl.handle_, buffer.data(), + static_cast(buffer.size()), + &bytes_transferred, op); + DWORD last_error = ::GetLastError(); + if (!ok && last_error != ERROR_IO_PENDING + && last_error != ERROR_MORE_DATA) + { + iocp_service_.on_completion(op, last_error, bytes_transferred); + } + else + { + iocp_service_.on_pending(op); + } + } +} + +void win_iocp_handle_service::update_cancellation_thread_id( + win_iocp_handle_service::implementation_type& impl) +{ + if (impl.safe_cancellation_thread_id_ == 0) + impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId(); + else if (impl.safe_cancellation_thread_id_ != ::GetCurrentThreadId()) + impl.safe_cancellation_thread_id_ = ~DWORD(0); +} + +void win_iocp_handle_service::close_for_destruction(implementation_type& impl) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((iocp_service_.context(), "handle", + &impl, reinterpret_cast(impl.handle_), "close")); + + ::CloseHandle(impl.handle_); + impl.handle_ = INVALID_HANDLE_VALUE; + impl.safe_cancellation_thread_id_ = 0; + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_IMPL_WIN_IOCP_HANDLE_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/win_iocp_io_context.hpp b/include/asio/include/asio/detail/impl/win_iocp_io_context.hpp new file mode 100644 index 0000000..07cf0cf --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_iocp_io_context.hpp @@ -0,0 +1,103 @@ +// +// detail/impl/win_iocp_io_context.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_HPP +#define ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/completion_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/memory.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +void win_iocp_io_context::add_timer_queue( + timer_queue& queue) +{ + do_add_timer_queue(queue); +} + +template +void win_iocp_io_context::remove_timer_queue( + timer_queue& queue) +{ + do_remove_timer_queue(queue); +} + +template +void win_iocp_io_context::schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op) +{ + // If the service has been shut down we silently discard the timer. + if (::InterlockedExchangeAdd(&shutdown_, 0) != 0) + { + post_immediate_completion(op, false); + return; + } + + mutex::scoped_lock lock(dispatch_mutex_); + + bool earliest = queue.enqueue_timer(time, timer, op); + work_started(); + if (earliest) + update_timeout(); +} + +template +std::size_t win_iocp_io_context::cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled) +{ + // If the service has been shut down we silently ignore the cancellation. + if (::InterlockedExchangeAdd(&shutdown_, 0) != 0) + return 0; + + mutex::scoped_lock lock(dispatch_mutex_); + op_queue ops; + std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); + post_deferred_completions(ops); + return n; +} + +template +void win_iocp_io_context::move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& to, + typename timer_queue::per_timer_data& from) +{ + asio::detail::mutex::scoped_lock lock(dispatch_mutex_); + op_queue ops; + queue.cancel_timer(to, ops); + queue.move_timer(to, from); + lock.unlock(); + post_deferred_completions(ops); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_HPP diff --git a/include/asio/include/asio/detail/impl/win_iocp_io_context.ipp b/include/asio/include/asio/detail/impl/win_iocp_io_context.ipp new file mode 100644 index 0000000..e7d8d7c --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_iocp_io_context.ipp @@ -0,0 +1,603 @@ +// +// detail/impl/win_iocp_io_context.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_IPP +#define ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/error.hpp" +#include "asio/detail/cstdint.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/thread.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/win_iocp_io_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct win_iocp_io_context::thread_function +{ + explicit thread_function(win_iocp_io_context* s) + : this_(s) + { + } + + void operator()() + { + asio::error_code ec; + this_->run(ec); + } + + win_iocp_io_context* this_; +}; + +struct win_iocp_io_context::work_finished_on_block_exit +{ + ~work_finished_on_block_exit() + { + io_context_->work_finished(); + } + + win_iocp_io_context* io_context_; +}; + +struct win_iocp_io_context::timer_thread_function +{ + void operator()() + { + while (::InterlockedExchangeAdd(&io_context_->shutdown_, 0) == 0) + { + if (::WaitForSingleObject(io_context_->waitable_timer_.handle, + INFINITE) == WAIT_OBJECT_0) + { + ::InterlockedExchange(&io_context_->dispatch_required_, 1); + ::PostQueuedCompletionStatus(io_context_->iocp_.handle, + 0, wake_for_dispatch, 0); + } + } + } + + win_iocp_io_context* io_context_; +}; + +win_iocp_io_context::win_iocp_io_context( + asio::execution_context& ctx, int concurrency_hint, bool own_thread) + : execution_context_service_base(ctx), + iocp_(), + outstanding_work_(0), + stopped_(0), + stop_event_posted_(0), + shutdown_(0), + gqcs_timeout_(get_gqcs_timeout()), + dispatch_required_(0), + concurrency_hint_(concurrency_hint) +{ + ASIO_HANDLER_TRACKING_INIT; + + iocp_.handle = ::CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, + static_cast(concurrency_hint >= 0 ? concurrency_hint : DWORD(~0))); + if (!iocp_.handle) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "iocp"); + } + + if (own_thread) + { + ::InterlockedIncrement(&outstanding_work_); + thread_.reset(new asio::detail::thread(thread_function(this))); + } +} + +win_iocp_io_context::~win_iocp_io_context() +{ + if (thread_.get()) + { + stop(); + thread_->join(); + thread_.reset(); + } +} + +void win_iocp_io_context::shutdown() +{ + ::InterlockedExchange(&shutdown_, 1); + + if (timer_thread_.get()) + { + LARGE_INTEGER timeout; + timeout.QuadPart = 1; + ::SetWaitableTimer(waitable_timer_.handle, &timeout, 1, 0, 0, FALSE); + } + + if (thread_.get()) + { + stop(); + thread_->join(); + thread_.reset(); + ::InterlockedDecrement(&outstanding_work_); + } + + while (::InterlockedExchangeAdd(&outstanding_work_, 0) > 0) + { + op_queue ops; + timer_queues_.get_all_timers(ops); + ops.push(completed_ops_); + if (!ops.empty()) + { + while (win_iocp_operation* op = ops.front()) + { + ops.pop(); + ::InterlockedDecrement(&outstanding_work_); + op->destroy(); + } + } + else + { + DWORD bytes_transferred = 0; + dword_ptr_t completion_key = 0; + LPOVERLAPPED overlapped = 0; + ::GetQueuedCompletionStatus(iocp_.handle, &bytes_transferred, + &completion_key, &overlapped, gqcs_timeout_); + if (overlapped) + { + ::InterlockedDecrement(&outstanding_work_); + static_cast(overlapped)->destroy(); + } + } + } + + if (timer_thread_.get()) + timer_thread_->join(); +} + +asio::error_code win_iocp_io_context::register_handle( + HANDLE handle, asio::error_code& ec) +{ + if (::CreateIoCompletionPort(handle, iocp_.handle, 0, 0) == 0) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + else + { + ec = asio::error_code(); + } + return ec; +} + +size_t win_iocp_io_context::run(asio::error_code& ec) +{ + if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0) + { + stop(); + ec = asio::error_code(); + return 0; + } + + win_iocp_thread_info this_thread; + thread_call_stack::context ctx(this, this_thread); + + size_t n = 0; + while (do_one(INFINITE, this_thread, ec)) + if (n != (std::numeric_limits::max)()) + ++n; + return n; +} + +size_t win_iocp_io_context::run_one(asio::error_code& ec) +{ + if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0) + { + stop(); + ec = asio::error_code(); + return 0; + } + + win_iocp_thread_info this_thread; + thread_call_stack::context ctx(this, this_thread); + + return do_one(INFINITE, this_thread, ec); +} + +size_t win_iocp_io_context::wait_one(long usec, asio::error_code& ec) +{ + if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0) + { + stop(); + ec = asio::error_code(); + return 0; + } + + win_iocp_thread_info this_thread; + thread_call_stack::context ctx(this, this_thread); + + return do_one(usec < 0 ? INFINITE : ((usec - 1) / 1000 + 1), this_thread, ec); +} + +size_t win_iocp_io_context::poll(asio::error_code& ec) +{ + if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0) + { + stop(); + ec = asio::error_code(); + return 0; + } + + win_iocp_thread_info this_thread; + thread_call_stack::context ctx(this, this_thread); + + size_t n = 0; + while (do_one(0, this_thread, ec)) + if (n != (std::numeric_limits::max)()) + ++n; + return n; +} + +size_t win_iocp_io_context::poll_one(asio::error_code& ec) +{ + if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0) + { + stop(); + ec = asio::error_code(); + return 0; + } + + win_iocp_thread_info this_thread; + thread_call_stack::context ctx(this, this_thread); + + return do_one(0, this_thread, ec); +} + +void win_iocp_io_context::stop() +{ + if (::InterlockedExchange(&stopped_, 1) == 0) + { + if (::InterlockedExchange(&stop_event_posted_, 1) == 0) + { + if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, 0)) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "pqcs"); + } + } + } +} + +void win_iocp_io_context::capture_current_exception() +{ + if (thread_info_base* this_thread = thread_call_stack::contains(this)) + this_thread->capture_current_exception(); +} + +void win_iocp_io_context::post_deferred_completion(win_iocp_operation* op) +{ + // Flag the operation as ready. + op->ready_ = 1; + + // Enqueue the operation on the I/O completion port. + if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, op)) + { + // Out of resources. Put on completed queue instead. + mutex::scoped_lock lock(dispatch_mutex_); + completed_ops_.push(op); + ::InterlockedExchange(&dispatch_required_, 1); + } +} + +void win_iocp_io_context::post_deferred_completions( + op_queue& ops) +{ + while (win_iocp_operation* op = ops.front()) + { + ops.pop(); + + // Flag the operation as ready. + op->ready_ = 1; + + // Enqueue the operation on the I/O completion port. + if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, op)) + { + // Out of resources. Put on completed queue instead. + mutex::scoped_lock lock(dispatch_mutex_); + completed_ops_.push(op); + completed_ops_.push(ops); + ::InterlockedExchange(&dispatch_required_, 1); + } + } +} + +void win_iocp_io_context::abandon_operations( + op_queue& ops) +{ + while (win_iocp_operation* op = ops.front()) + { + ops.pop(); + ::InterlockedDecrement(&outstanding_work_); + op->destroy(); + } +} + +void win_iocp_io_context::on_pending(win_iocp_operation* op) +{ + if (::InterlockedCompareExchange(&op->ready_, 1, 0) == 1) + { + // Enqueue the operation on the I/O completion port. + if (!::PostQueuedCompletionStatus(iocp_.handle, + 0, overlapped_contains_result, op)) + { + // Out of resources. Put on completed queue instead. + mutex::scoped_lock lock(dispatch_mutex_); + completed_ops_.push(op); + ::InterlockedExchange(&dispatch_required_, 1); + } + } +} + +void win_iocp_io_context::on_completion(win_iocp_operation* op, + DWORD last_error, DWORD bytes_transferred) +{ + // Flag that the operation is ready for invocation. + op->ready_ = 1; + + // Store results in the OVERLAPPED structure. + op->Internal = reinterpret_cast( + &asio::error::get_system_category()); + op->Offset = last_error; + op->OffsetHigh = bytes_transferred; + + // Enqueue the operation on the I/O completion port. + if (!::PostQueuedCompletionStatus(iocp_.handle, + 0, overlapped_contains_result, op)) + { + // Out of resources. Put on completed queue instead. + mutex::scoped_lock lock(dispatch_mutex_); + completed_ops_.push(op); + ::InterlockedExchange(&dispatch_required_, 1); + } +} + +void win_iocp_io_context::on_completion(win_iocp_operation* op, + const asio::error_code& ec, DWORD bytes_transferred) +{ + // Flag that the operation is ready for invocation. + op->ready_ = 1; + + // Store results in the OVERLAPPED structure. + op->Internal = reinterpret_cast(&ec.category()); + op->Offset = ec.value(); + op->OffsetHigh = bytes_transferred; + + // Enqueue the operation on the I/O completion port. + if (!::PostQueuedCompletionStatus(iocp_.handle, + 0, overlapped_contains_result, op)) + { + // Out of resources. Put on completed queue instead. + mutex::scoped_lock lock(dispatch_mutex_); + completed_ops_.push(op); + ::InterlockedExchange(&dispatch_required_, 1); + } +} + +size_t win_iocp_io_context::do_one(DWORD msec, + win_iocp_thread_info& this_thread, asio::error_code& ec) +{ + for (;;) + { + // Try to acquire responsibility for dispatching timers and completed ops. + if (::InterlockedCompareExchange(&dispatch_required_, 0, 1) == 1) + { + mutex::scoped_lock lock(dispatch_mutex_); + + // Dispatch pending timers and operations. + op_queue ops; + ops.push(completed_ops_); + timer_queues_.get_ready_timers(ops); + post_deferred_completions(ops); + update_timeout(); + } + + // Get the next operation from the queue. + DWORD bytes_transferred = 0; + dword_ptr_t completion_key = 0; + LPOVERLAPPED overlapped = 0; + ::SetLastError(0); + BOOL ok = ::GetQueuedCompletionStatus(iocp_.handle, + &bytes_transferred, &completion_key, &overlapped, + msec < gqcs_timeout_ ? msec : gqcs_timeout_); + DWORD last_error = ::GetLastError(); + + if (overlapped) + { + win_iocp_operation* op = static_cast(overlapped); + asio::error_code result_ec(last_error, + asio::error::get_system_category()); + + // We may have been passed the last_error and bytes_transferred in the + // OVERLAPPED structure itself. + if (completion_key == overlapped_contains_result) + { + result_ec = asio::error_code(static_cast(op->Offset), + *reinterpret_cast(op->Internal)); + bytes_transferred = op->OffsetHigh; + } + + // Otherwise ensure any result has been saved into the OVERLAPPED + // structure. + else + { + op->Internal = reinterpret_cast(&result_ec.category()); + op->Offset = result_ec.value(); + op->OffsetHigh = bytes_transferred; + } + + // Dispatch the operation only if ready. The operation may not be ready + // if the initiating function (e.g. a call to WSARecv) has not yet + // returned. This is because the initiating function still wants access + // to the operation's OVERLAPPED structure. + if (::InterlockedCompareExchange(&op->ready_, 1, 0) == 1) + { + // Ensure the count of outstanding work is decremented on block exit. + work_finished_on_block_exit on_exit = { this }; + (void)on_exit; + + op->complete(this, result_ec, bytes_transferred); + this_thread.rethrow_pending_exception(); + ec = asio::error_code(); + return 1; + } + } + else if (!ok) + { + if (last_error != WAIT_TIMEOUT) + { + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return 0; + } + + // If we're waiting indefinitely we need to keep going until we get a + // real handler. + if (msec == INFINITE) + continue; + + ec = asio::error_code(); + return 0; + } + else if (completion_key == wake_for_dispatch) + { + // We have been woken up to try to acquire responsibility for dispatching + // timers and completed operations. + } + else + { + // Indicate that there is no longer an in-flight stop event. + ::InterlockedExchange(&stop_event_posted_, 0); + + // The stopped_ flag is always checked to ensure that any leftover + // stop events from a previous run invocation are ignored. + if (::InterlockedExchangeAdd(&stopped_, 0) != 0) + { + // Wake up next thread that is blocked on GetQueuedCompletionStatus. + if (::InterlockedExchange(&stop_event_posted_, 1) == 0) + { + if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, 0)) + { + last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return 0; + } + } + + ec = asio::error_code(); + return 0; + } + } + } +} + +DWORD win_iocp_io_context::get_gqcs_timeout() +{ + OSVERSIONINFOEX osvi; + ZeroMemory(&osvi, sizeof(osvi)); + osvi.dwOSVersionInfoSize = sizeof(osvi); + osvi.dwMajorVersion = 6ul; + + const uint64_t condition_mask = ::VerSetConditionMask( + 0, VER_MAJORVERSION, VER_GREATER_EQUAL); + + if (!!::VerifyVersionInfo(&osvi, VER_MAJORVERSION, condition_mask)) + return INFINITE; + + return default_gqcs_timeout; +} + +void win_iocp_io_context::do_add_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(dispatch_mutex_); + + timer_queues_.insert(&queue); + + if (!waitable_timer_.handle) + { + waitable_timer_.handle = ::CreateWaitableTimer(0, FALSE, 0); + if (waitable_timer_.handle == 0) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "timer"); + } + + LARGE_INTEGER timeout; + timeout.QuadPart = -max_timeout_usec; + timeout.QuadPart *= 10; + ::SetWaitableTimer(waitable_timer_.handle, + &timeout, max_timeout_msec, 0, 0, FALSE); + } + + if (!timer_thread_.get()) + { + timer_thread_function thread_function = { this }; + timer_thread_.reset(new thread(thread_function, 65536)); + } +} + +void win_iocp_io_context::do_remove_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(dispatch_mutex_); + + timer_queues_.erase(&queue); +} + +void win_iocp_io_context::update_timeout() +{ + if (timer_thread_.get()) + { + // There's no point updating the waitable timer if the new timeout period + // exceeds the maximum timeout. In that case, we might as well wait for the + // existing period of the timer to expire. + long timeout_usec = timer_queues_.wait_duration_usec(max_timeout_usec); + if (timeout_usec < max_timeout_usec) + { + LARGE_INTEGER timeout; + timeout.QuadPart = -timeout_usec; + timeout.QuadPart *= 10; + ::SetWaitableTimer(waitable_timer_.handle, + &timeout, max_timeout_msec, 0, 0, FALSE); + } + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_IMPL_WIN_IOCP_IO_CONTEXT_IPP diff --git a/include/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp b/include/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp new file mode 100644 index 0000000..7a4bc5a --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp @@ -0,0 +1,192 @@ +// +// detail/impl/win_iocp_serial_port_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_IOCP_SERIAL_PORT_SERVICE_IPP +#define ASIO_DETAIL_IMPL_WIN_IOCP_SERIAL_PORT_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) + +#include +#include "asio/detail/win_iocp_serial_port_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +win_iocp_serial_port_service::win_iocp_serial_port_service( + execution_context& context) + : execution_context_service_base(context), + handle_service_(context) +{ +} + +void win_iocp_serial_port_service::shutdown() +{ +} + +asio::error_code win_iocp_serial_port_service::open( + win_iocp_serial_port_service::implementation_type& impl, + const std::string& device, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + // For convenience, add a leading \\.\ sequence if not already present. + std::string name = (device[0] == '\\') ? device : "\\\\.\\" + device; + + // Open a handle to the serial port. + ::HANDLE handle = ::CreateFileA(name.c_str(), + GENERIC_READ | GENERIC_WRITE, 0, 0, + OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); + if (handle == INVALID_HANDLE_VALUE) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return ec; + } + + // Determine the initial serial port parameters. + using namespace std; // For memset. + ::DCB dcb; + memset(&dcb, 0, sizeof(DCB)); + dcb.DCBlength = sizeof(DCB); + if (!::GetCommState(handle, &dcb)) + { + DWORD last_error = ::GetLastError(); + ::CloseHandle(handle); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return ec; + } + + // Set some default serial port parameters. This implementation does not + // support changing all of these, so they might as well be in a known state. + dcb.fBinary = TRUE; // Win32 only supports binary mode. + dcb.fNull = FALSE; // Do not ignore NULL characters. + dcb.fAbortOnError = FALSE; // Ignore serial framing errors. + dcb.BaudRate = CBR_9600; // 9600 baud by default + dcb.ByteSize = 8; // 8 bit bytes + dcb.fOutxCtsFlow = FALSE; // No flow control + dcb.fOutxDsrFlow = FALSE; + dcb.fDtrControl = DTR_CONTROL_DISABLE; + dcb.fDsrSensitivity = FALSE; + dcb.fOutX = FALSE; + dcb.fInX = FALSE; + dcb.fRtsControl = RTS_CONTROL_DISABLE; + dcb.fParity = FALSE; // No parity + dcb.Parity = NOPARITY; + dcb.StopBits = ONESTOPBIT; // One stop bit + if (!::SetCommState(handle, &dcb)) + { + DWORD last_error = ::GetLastError(); + ::CloseHandle(handle); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return ec; + } + + // Set up timeouts so that the serial port will behave similarly to a + // network socket. Reads wait for at least one byte, then return with + // whatever they have. Writes return once everything is out the door. + ::COMMTIMEOUTS timeouts; + timeouts.ReadIntervalTimeout = 1; + timeouts.ReadTotalTimeoutMultiplier = 0; + timeouts.ReadTotalTimeoutConstant = 0; + timeouts.WriteTotalTimeoutMultiplier = 0; + timeouts.WriteTotalTimeoutConstant = 0; + if (!::SetCommTimeouts(handle, &timeouts)) + { + DWORD last_error = ::GetLastError(); + ::CloseHandle(handle); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return ec; + } + + // We're done. Take ownership of the serial port handle. + if (handle_service_.assign(impl, handle, ec)) + ::CloseHandle(handle); + return ec; +} + +asio::error_code win_iocp_serial_port_service::do_set_option( + win_iocp_serial_port_service::implementation_type& impl, + win_iocp_serial_port_service::store_function_type store, + const void* option, asio::error_code& ec) +{ + using namespace std; // For memcpy. + + ::DCB dcb; + memset(&dcb, 0, sizeof(DCB)); + dcb.DCBlength = sizeof(DCB); + if (!::GetCommState(handle_service_.native_handle(impl), &dcb)) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return ec; + } + + if (store(option, dcb, ec)) + return ec; + + if (!::SetCommState(handle_service_.native_handle(impl), &dcb)) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return ec; + } + + ec = asio::error_code(); + return ec; +} + +asio::error_code win_iocp_serial_port_service::do_get_option( + const win_iocp_serial_port_service::implementation_type& impl, + win_iocp_serial_port_service::load_function_type load, + void* option, asio::error_code& ec) const +{ + using namespace std; // For memset. + + ::DCB dcb; + memset(&dcb, 0, sizeof(DCB)); + dcb.DCBlength = sizeof(DCB); + if (!::GetCommState(handle_service_.native_handle(impl), &dcb)) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + return ec; + } + + return load(option, dcb, ec); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) + +#endif // ASIO_DETAIL_IMPL_WIN_IOCP_SERIAL_PORT_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp b/include/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp new file mode 100644 index 0000000..6235ce4 --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp @@ -0,0 +1,801 @@ +// +// detail/impl/win_iocp_socket_service_base.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_IOCP_SOCKET_SERVICE_BASE_IPP +#define ASIO_DETAIL_IMPL_WIN_IOCP_SOCKET_SERVICE_BASE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/win_iocp_socket_service_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +win_iocp_socket_service_base::win_iocp_socket_service_base( + execution_context& context) + : context_(context), + iocp_service_(use_service(context)), + reactor_(0), + connect_ex_(0), + nt_set_info_(0), + mutex_(), + impl_list_(0) +{ +} + +void win_iocp_socket_service_base::base_shutdown() +{ + // Close all implementations, causing all operations to complete. + asio::detail::mutex::scoped_lock lock(mutex_); + base_implementation_type* impl = impl_list_; + while (impl) + { + close_for_destruction(*impl); + impl = impl->next_; + } +} + +void win_iocp_socket_service_base::construct( + win_iocp_socket_service_base::base_implementation_type& impl) +{ + impl.socket_ = invalid_socket; + impl.state_ = 0; + impl.cancel_token_.reset(); +#if defined(ASIO_ENABLE_CANCELIO) + impl.safe_cancellation_thread_id_ = 0; +#endif // defined(ASIO_ENABLE_CANCELIO) + + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; +} + +void win_iocp_socket_service_base::base_move_construct( + win_iocp_socket_service_base::base_implementation_type& impl, + win_iocp_socket_service_base::base_implementation_type& other_impl) + ASIO_NOEXCEPT +{ + impl.socket_ = other_impl.socket_; + other_impl.socket_ = invalid_socket; + + impl.state_ = other_impl.state_; + other_impl.state_ = 0; + + impl.cancel_token_ = other_impl.cancel_token_; + other_impl.cancel_token_.reset(); + +#if defined(ASIO_ENABLE_CANCELIO) + impl.safe_cancellation_thread_id_ = other_impl.safe_cancellation_thread_id_; + other_impl.safe_cancellation_thread_id_ = 0; +#endif // defined(ASIO_ENABLE_CANCELIO) + + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; +} + +void win_iocp_socket_service_base::base_move_assign( + win_iocp_socket_service_base::base_implementation_type& impl, + win_iocp_socket_service_base& other_service, + win_iocp_socket_service_base::base_implementation_type& other_impl) +{ + close_for_destruction(impl); + + if (this != &other_service) + { + // Remove implementation from linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; + } + + impl.socket_ = other_impl.socket_; + other_impl.socket_ = invalid_socket; + + impl.state_ = other_impl.state_; + other_impl.state_ = 0; + + impl.cancel_token_ = other_impl.cancel_token_; + other_impl.cancel_token_.reset(); + +#if defined(ASIO_ENABLE_CANCELIO) + impl.safe_cancellation_thread_id_ = other_impl.safe_cancellation_thread_id_; + other_impl.safe_cancellation_thread_id_ = 0; +#endif // defined(ASIO_ENABLE_CANCELIO) + + if (this != &other_service) + { + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(other_service.mutex_); + impl.next_ = other_service.impl_list_; + impl.prev_ = 0; + if (other_service.impl_list_) + other_service.impl_list_->prev_ = &impl; + other_service.impl_list_ = &impl; + } +} + +void win_iocp_socket_service_base::destroy( + win_iocp_socket_service_base::base_implementation_type& impl) +{ + close_for_destruction(impl); + + // Remove implementation from linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; +} + +asio::error_code win_iocp_socket_service_base::close( + win_iocp_socket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((iocp_service_.context(), + "socket", &impl, impl.socket_, "close")); + + // Check if the reactor was created, in which case we need to close the + // socket on the reactor as well to cancel any operations that might be + // running there. + select_reactor* r = static_cast( + interlocked_compare_exchange_pointer( + reinterpret_cast(&reactor_), 0, 0)); + if (r) + r->deregister_descriptor(impl.socket_, impl.reactor_data_, true); + + socket_ops::close(impl.socket_, impl.state_, false, ec); + + if (r) + r->cleanup_descriptor_data(impl.reactor_data_); + } + else + { + ec = asio::error_code(); + } + + impl.socket_ = invalid_socket; + impl.state_ = 0; + impl.cancel_token_.reset(); +#if defined(ASIO_ENABLE_CANCELIO) + impl.safe_cancellation_thread_id_ = 0; +#endif // defined(ASIO_ENABLE_CANCELIO) + + return ec; +} + +socket_type win_iocp_socket_service_base::release( + win_iocp_socket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + if (!is_open(impl)) + return invalid_socket; + + cancel(impl, ec); + if (ec) + return invalid_socket; + + nt_set_info_fn fn = get_nt_set_info(); + if (fn == 0) + { + ec = asio::error::operation_not_supported; + return invalid_socket; + } + + HANDLE sock_as_handle = reinterpret_cast(impl.socket_); + ULONG_PTR iosb[2] = { 0, 0 }; + void* info[2] = { 0, 0 }; + if (fn(sock_as_handle, iosb, &info, sizeof(info), + 61 /* FileReplaceCompletionInformation */)) + { + ec = asio::error::operation_not_supported; + return invalid_socket; + } + + socket_type tmp = impl.socket_; + impl.socket_ = invalid_socket; + return tmp; +} + +asio::error_code win_iocp_socket_service_base::cancel( + win_iocp_socket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return ec; + } + + ASIO_HANDLER_OPERATION((iocp_service_.context(), + "socket", &impl, impl.socket_, "cancel")); + + if (FARPROC cancel_io_ex_ptr = ::GetProcAddress( + ::GetModuleHandleA("KERNEL32"), "CancelIoEx")) + { + // The version of Windows supports cancellation from any thread. + typedef BOOL (WINAPI* cancel_io_ex_t)(HANDLE, LPOVERLAPPED); + cancel_io_ex_t cancel_io_ex = reinterpret_cast( + reinterpret_cast(cancel_io_ex_ptr)); + socket_type sock = impl.socket_; + HANDLE sock_as_handle = reinterpret_cast(sock); + if (!cancel_io_ex(sock_as_handle, 0)) + { + DWORD last_error = ::GetLastError(); + if (last_error == ERROR_NOT_FOUND) + { + // ERROR_NOT_FOUND means that there were no operations to be + // cancelled. We swallow this error to match the behaviour on other + // platforms. + ec = asio::error_code(); + } + else + { + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + } + else + { + ec = asio::error_code(); + } + } +#if defined(ASIO_ENABLE_CANCELIO) + else if (impl.safe_cancellation_thread_id_ == 0) + { + // No operations have been started, so there's nothing to cancel. + ec = asio::error_code(); + } + else if (impl.safe_cancellation_thread_id_ == ::GetCurrentThreadId()) + { + // Asynchronous operations have been started from the current thread only, + // so it is safe to try to cancel them using CancelIo. + socket_type sock = impl.socket_; + HANDLE sock_as_handle = reinterpret_cast(sock); + if (!::CancelIo(sock_as_handle)) + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + else + { + ec = asio::error_code(); + } + } + else + { + // Asynchronous operations have been started from more than one thread, + // so cancellation is not safe. + ec = asio::error::operation_not_supported; + } +#else // defined(ASIO_ENABLE_CANCELIO) + else + { + // Cancellation is not supported as CancelIo may not be used. + ec = asio::error::operation_not_supported; + } +#endif // defined(ASIO_ENABLE_CANCELIO) + + // Cancel any operations started via the reactor. + if (!ec) + { + select_reactor* r = static_cast( + interlocked_compare_exchange_pointer( + reinterpret_cast(&reactor_), 0, 0)); + if (r) + r->cancel_ops(impl.socket_, impl.reactor_data_); + } + + return ec; +} + +asio::error_code win_iocp_socket_service_base::do_open( + win_iocp_socket_service_base::base_implementation_type& impl, + int family, int type, int protocol, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + socket_holder sock(socket_ops::socket(family, type, protocol, ec)); + if (sock.get() == invalid_socket) + return ec; + + HANDLE sock_as_handle = reinterpret_cast(sock.get()); + if (iocp_service_.register_handle(sock_as_handle, ec)) + return ec; + + impl.socket_ = sock.release(); + switch (type) + { + case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; + case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; + default: impl.state_ = 0; break; + } + impl.cancel_token_.reset(static_cast(0), socket_ops::noop_deleter()); + ec = asio::error_code(); + return ec; +} + +asio::error_code win_iocp_socket_service_base::do_assign( + win_iocp_socket_service_base::base_implementation_type& impl, + int type, socket_type native_socket, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + HANDLE sock_as_handle = reinterpret_cast(native_socket); + if (iocp_service_.register_handle(sock_as_handle, ec)) + return ec; + + impl.socket_ = native_socket; + switch (type) + { + case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; + case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; + default: impl.state_ = 0; break; + } + impl.cancel_token_.reset(static_cast(0), socket_ops::noop_deleter()); + ec = asio::error_code(); + return ec; +} + +void win_iocp_socket_service_base::start_send_op( + win_iocp_socket_service_base::base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, + socket_base::message_flags flags, bool noop, operation* op) +{ + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + if (noop) + iocp_service_.on_completion(op); + else if (!is_open(impl)) + iocp_service_.on_completion(op, asio::error::bad_descriptor); + else + { + DWORD bytes_transferred = 0; + int result = ::WSASend(impl.socket_, buffers, + static_cast(buffer_count), &bytes_transferred, flags, op, 0); + DWORD last_error = ::WSAGetLastError(); + if (last_error == ERROR_PORT_UNREACHABLE) + last_error = WSAECONNREFUSED; + if (result != 0 && last_error != WSA_IO_PENDING) + iocp_service_.on_completion(op, last_error, bytes_transferred); + else + iocp_service_.on_pending(op); + } +} + +void win_iocp_socket_service_base::start_send_to_op( + win_iocp_socket_service_base::base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, + const socket_addr_type* addr, int addrlen, + socket_base::message_flags flags, operation* op) +{ + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + if (!is_open(impl)) + iocp_service_.on_completion(op, asio::error::bad_descriptor); + else + { + DWORD bytes_transferred = 0; + int result = ::WSASendTo(impl.socket_, buffers, + static_cast(buffer_count), + &bytes_transferred, flags, addr, addrlen, op, 0); + DWORD last_error = ::WSAGetLastError(); + if (last_error == ERROR_PORT_UNREACHABLE) + last_error = WSAECONNREFUSED; + if (result != 0 && last_error != WSA_IO_PENDING) + iocp_service_.on_completion(op, last_error, bytes_transferred); + else + iocp_service_.on_pending(op); + } +} + +void win_iocp_socket_service_base::start_receive_op( + win_iocp_socket_service_base::base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, + socket_base::message_flags flags, bool noop, operation* op) +{ + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + if (noop) + iocp_service_.on_completion(op); + else if (!is_open(impl)) + iocp_service_.on_completion(op, asio::error::bad_descriptor); + else + { + DWORD bytes_transferred = 0; + DWORD recv_flags = flags; + int result = ::WSARecv(impl.socket_, buffers, + static_cast(buffer_count), + &bytes_transferred, &recv_flags, op, 0); + DWORD last_error = ::WSAGetLastError(); + if (last_error == ERROR_NETNAME_DELETED) + last_error = WSAECONNRESET; + else if (last_error == ERROR_PORT_UNREACHABLE) + last_error = WSAECONNREFUSED; + if (result != 0 && last_error != WSA_IO_PENDING) + iocp_service_.on_completion(op, last_error, bytes_transferred); + else + iocp_service_.on_pending(op); + } +} + +void win_iocp_socket_service_base::start_null_buffers_receive_op( + win_iocp_socket_service_base::base_implementation_type& impl, + socket_base::message_flags flags, reactor_op* op) +{ + if ((impl.state_ & socket_ops::stream_oriented) != 0) + { + // For stream sockets on Windows, we may issue a 0-byte overlapped + // WSARecv to wait until there is data available on the socket. + ::WSABUF buf = { 0, 0 }; + start_receive_op(impl, &buf, 1, flags, false, op); + } + else + { + start_reactor_op(impl, + (flags & socket_base::message_out_of_band) + ? select_reactor::except_op : select_reactor::read_op, + op); + } +} + +void win_iocp_socket_service_base::start_receive_from_op( + win_iocp_socket_service_base::base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, socket_addr_type* addr, + socket_base::message_flags flags, int* addrlen, operation* op) +{ + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + if (!is_open(impl)) + iocp_service_.on_completion(op, asio::error::bad_descriptor); + else + { + DWORD bytes_transferred = 0; + DWORD recv_flags = flags; + int result = ::WSARecvFrom(impl.socket_, buffers, + static_cast(buffer_count), + &bytes_transferred, &recv_flags, addr, addrlen, op, 0); + DWORD last_error = ::WSAGetLastError(); + if (last_error == ERROR_PORT_UNREACHABLE) + last_error = WSAECONNREFUSED; + if (result != 0 && last_error != WSA_IO_PENDING) + iocp_service_.on_completion(op, last_error, bytes_transferred); + else + iocp_service_.on_pending(op); + } +} + +void win_iocp_socket_service_base::start_accept_op( + win_iocp_socket_service_base::base_implementation_type& impl, + bool peer_is_open, socket_holder& new_socket, int family, int type, + int protocol, void* output_buffer, DWORD address_length, operation* op) +{ + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + if (!is_open(impl)) + iocp_service_.on_completion(op, asio::error::bad_descriptor); + else if (peer_is_open) + iocp_service_.on_completion(op, asio::error::already_open); + else + { + asio::error_code ec; + new_socket.reset(socket_ops::socket(family, type, protocol, ec)); + if (new_socket.get() == invalid_socket) + iocp_service_.on_completion(op, ec); + else + { + DWORD bytes_read = 0; + BOOL result = ::AcceptEx(impl.socket_, new_socket.get(), output_buffer, + 0, address_length, address_length, &bytes_read, op); + DWORD last_error = ::WSAGetLastError(); + if (!result && last_error != WSA_IO_PENDING) + iocp_service_.on_completion(op, last_error); + else + iocp_service_.on_pending(op); + } + } +} + +void win_iocp_socket_service_base::restart_accept_op( + socket_type s, socket_holder& new_socket, int family, int type, + int protocol, void* output_buffer, DWORD address_length, operation* op) +{ + new_socket.reset(); + iocp_service_.work_started(); + + asio::error_code ec; + new_socket.reset(socket_ops::socket(family, type, protocol, ec)); + if (new_socket.get() == invalid_socket) + iocp_service_.on_completion(op, ec); + else + { + DWORD bytes_read = 0; + BOOL result = ::AcceptEx(s, new_socket.get(), output_buffer, + 0, address_length, address_length, &bytes_read, op); + DWORD last_error = ::WSAGetLastError(); + if (!result && last_error != WSA_IO_PENDING) + iocp_service_.on_completion(op, last_error); + else + iocp_service_.on_pending(op); + } +} + +void win_iocp_socket_service_base::start_reactor_op( + win_iocp_socket_service_base::base_implementation_type& impl, + int op_type, reactor_op* op) +{ + select_reactor& r = get_reactor(); + update_cancellation_thread_id(impl); + + if (is_open(impl)) + { + r.start_op(op_type, impl.socket_, impl.reactor_data_, op, false, false); + return; + } + else + op->ec_ = asio::error::bad_descriptor; + + iocp_service_.post_immediate_completion(op, false); +} + +void win_iocp_socket_service_base::start_connect_op( + win_iocp_socket_service_base::base_implementation_type& impl, + int family, int type, const socket_addr_type* addr, + std::size_t addrlen, win_iocp_socket_connect_op_base* op) +{ + // If ConnectEx is available, use that. + if (family == ASIO_OS_DEF(AF_INET) + || family == ASIO_OS_DEF(AF_INET6)) + { + if (connect_ex_fn connect_ex = get_connect_ex(impl, type)) + { + union address_union + { + socket_addr_type base; + sockaddr_in4_type v4; + sockaddr_in6_type v6; + } a; + + using namespace std; // For memset. + memset(&a, 0, sizeof(a)); + a.base.sa_family = family; + + socket_ops::bind(impl.socket_, &a.base, + family == ASIO_OS_DEF(AF_INET) + ? sizeof(a.v4) : sizeof(a.v6), op->ec_); + if (op->ec_ && op->ec_ != asio::error::invalid_argument) + { + iocp_service_.post_immediate_completion(op, false); + return; + } + + op->connect_ex_ = true; + update_cancellation_thread_id(impl); + iocp_service_.work_started(); + + BOOL result = connect_ex(impl.socket_, + addr, static_cast(addrlen), 0, 0, 0, op); + DWORD last_error = ::WSAGetLastError(); + if (!result && last_error != WSA_IO_PENDING) + iocp_service_.on_completion(op, last_error); + else + iocp_service_.on_pending(op); + return; + } + } + + // Otherwise, fall back to a reactor-based implementation. + select_reactor& r = get_reactor(); + update_cancellation_thread_id(impl); + + if ((impl.state_ & socket_ops::non_blocking) != 0 + || socket_ops::set_internal_non_blocking( + impl.socket_, impl.state_, true, op->ec_)) + { + if (socket_ops::connect(impl.socket_, addr, addrlen, op->ec_) != 0) + { + if (op->ec_ == asio::error::in_progress + || op->ec_ == asio::error::would_block) + { + op->ec_ = asio::error_code(); + r.start_op(select_reactor::connect_op, impl.socket_, + impl.reactor_data_, op, false, false); + return; + } + } + } + + r.post_immediate_completion(op, false); +} + +void win_iocp_socket_service_base::close_for_destruction( + win_iocp_socket_service_base::base_implementation_type& impl) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((iocp_service_.context(), + "socket", &impl, impl.socket_, "close")); + + // Check if the reactor was created, in which case we need to close the + // socket on the reactor as well to cancel any operations that might be + // running there. + select_reactor* r = static_cast( + interlocked_compare_exchange_pointer( + reinterpret_cast(&reactor_), 0, 0)); + if (r) + r->deregister_descriptor(impl.socket_, impl.reactor_data_, true); + + asio::error_code ignored_ec; + socket_ops::close(impl.socket_, impl.state_, true, ignored_ec); + + if (r) + r->cleanup_descriptor_data(impl.reactor_data_); + } + + impl.socket_ = invalid_socket; + impl.state_ = 0; + impl.cancel_token_.reset(); +#if defined(ASIO_ENABLE_CANCELIO) + impl.safe_cancellation_thread_id_ = 0; +#endif // defined(ASIO_ENABLE_CANCELIO) +} + +void win_iocp_socket_service_base::update_cancellation_thread_id( + win_iocp_socket_service_base::base_implementation_type& impl) +{ +#if defined(ASIO_ENABLE_CANCELIO) + if (impl.safe_cancellation_thread_id_ == 0) + impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId(); + else if (impl.safe_cancellation_thread_id_ != ::GetCurrentThreadId()) + impl.safe_cancellation_thread_id_ = ~DWORD(0); +#else // defined(ASIO_ENABLE_CANCELIO) + (void)impl; +#endif // defined(ASIO_ENABLE_CANCELIO) +} + +select_reactor& win_iocp_socket_service_base::get_reactor() +{ + select_reactor* r = static_cast( + interlocked_compare_exchange_pointer( + reinterpret_cast(&reactor_), 0, 0)); + if (!r) + { + r = &(use_service(context_)); + interlocked_exchange_pointer(reinterpret_cast(&reactor_), r); + } + return *r; +} + +win_iocp_socket_service_base::connect_ex_fn +win_iocp_socket_service_base::get_connect_ex( + win_iocp_socket_service_base::base_implementation_type& impl, int type) +{ +#if defined(ASIO_DISABLE_CONNECTEX) + (void)impl; + (void)type; + return 0; +#else // defined(ASIO_DISABLE_CONNECTEX) + if (type != ASIO_OS_DEF(SOCK_STREAM) + && type != ASIO_OS_DEF(SOCK_SEQPACKET)) + return 0; + + void* ptr = interlocked_compare_exchange_pointer(&connect_ex_, 0, 0); + if (!ptr) + { + GUID guid = { 0x25a207b9, 0xddf3, 0x4660, + { 0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e } }; + + DWORD bytes = 0; + if (::WSAIoctl(impl.socket_, SIO_GET_EXTENSION_FUNCTION_POINTER, + &guid, sizeof(guid), &ptr, sizeof(ptr), &bytes, 0, 0) != 0) + { + // Set connect_ex_ to a special value to indicate that ConnectEx is + // unavailable. That way we won't bother trying to look it up again. + ptr = this; + } + + interlocked_exchange_pointer(&connect_ex_, ptr); + } + + return reinterpret_cast(ptr == this ? 0 : ptr); +#endif // defined(ASIO_DISABLE_CONNECTEX) +} + +win_iocp_socket_service_base::nt_set_info_fn +win_iocp_socket_service_base::get_nt_set_info() +{ + void* ptr = interlocked_compare_exchange_pointer(&nt_set_info_, 0, 0); + if (!ptr) + { + if (HMODULE h = ::GetModuleHandleA("NTDLL.DLL")) + ptr = reinterpret_cast(GetProcAddress(h, "NtSetInformationFile")); + + // On failure, set nt_set_info_ to a special value to indicate that the + // NtSetInformationFile function is unavailable. That way we won't bother + // trying to look it up again. + interlocked_exchange_pointer(&nt_set_info_, ptr ? ptr : this); + } + + return reinterpret_cast(ptr == this ? 0 : ptr); +} + +void* win_iocp_socket_service_base::interlocked_compare_exchange_pointer( + void** dest, void* exch, void* cmp) +{ +#if defined(_M_IX86) + return reinterpret_cast(InterlockedCompareExchange( + reinterpret_cast(dest), reinterpret_cast(exch), + reinterpret_cast(cmp))); +#else + return InterlockedCompareExchangePointer(dest, exch, cmp); +#endif +} + +void* win_iocp_socket_service_base::interlocked_exchange_pointer( + void** dest, void* val) +{ +#if defined(_M_IX86) + return reinterpret_cast(InterlockedExchange( + reinterpret_cast(dest), reinterpret_cast(val))); +#else + return InterlockedExchangePointer(dest, val); +#endif +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_IMPL_WIN_IOCP_SOCKET_SERVICE_BASE_IPP diff --git a/include/asio/include/asio/detail/impl/win_mutex.ipp b/include/asio/include/asio/detail/impl/win_mutex.ipp new file mode 100644 index 0000000..e5088c6 --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_mutex.ipp @@ -0,0 +1,84 @@ +// +// detail/impl/win_mutex.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_MUTEX_IPP +#define ASIO_DETAIL_IMPL_WIN_MUTEX_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include "asio/detail/throw_error.hpp" +#include "asio/detail/win_mutex.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +win_mutex::win_mutex() +{ + int error = do_init(); + asio::error_code ec(error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "mutex"); +} + +int win_mutex::do_init() +{ +#if defined(__MINGW32__) + // Not sure if MinGW supports structured exception handling, so for now + // we'll just call the Windows API and hope. +# if defined(UNDER_CE) + ::InitializeCriticalSection(&crit_section_); +# elif defined(ASIO_WINDOWS_APP) + if (!::InitializeCriticalSectionEx(&crit_section_, 0, 0)) + return ::GetLastError(); +# else + if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000)) + return ::GetLastError(); +# endif + return 0; +#else + __try + { +# if defined(UNDER_CE) + ::InitializeCriticalSection(&crit_section_); +# elif defined(ASIO_WINDOWS_APP) + if (!::InitializeCriticalSectionEx(&crit_section_, 0, 0)) + return ::GetLastError(); +# else + if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000)) + return ::GetLastError(); +# endif + } + __except(GetExceptionCode() == STATUS_NO_MEMORY + ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + return ERROR_OUTOFMEMORY; + } + + return 0; +#endif +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_IMPL_WIN_MUTEX_IPP diff --git a/include/asio/include/asio/detail/impl/win_object_handle_service.ipp b/include/asio/include/asio/detail/impl/win_object_handle_service.ipp new file mode 100644 index 0000000..0e80edc --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_object_handle_service.ipp @@ -0,0 +1,448 @@ +// +// detail/impl/win_object_handle_service.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2011 Boris Schaeling (boris@highscore.de) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_OBJECT_HANDLE_SERVICE_IPP +#define ASIO_DETAIL_IMPL_WIN_OBJECT_HANDLE_SERVICE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) + +#include "asio/detail/win_object_handle_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +win_object_handle_service::win_object_handle_service(execution_context& context) + : execution_context_service_base(context), + scheduler_(asio::use_service(context)), + mutex_(), + impl_list_(0), + shutdown_(false) +{ +} + +void win_object_handle_service::shutdown() +{ + mutex::scoped_lock lock(mutex_); + + // Setting this flag to true prevents new objects from being registered, and + // new asynchronous wait operations from being started. We only need to worry + // about cleaning up the operations that are currently in progress. + shutdown_ = true; + + op_queue ops; + for (implementation_type* impl = impl_list_; impl; impl = impl->next_) + ops.push(impl->op_queue_); + + lock.unlock(); + + scheduler_.abandon_operations(ops); +} + +void win_object_handle_service::construct( + win_object_handle_service::implementation_type& impl) +{ + impl.handle_ = INVALID_HANDLE_VALUE; + impl.wait_handle_ = INVALID_HANDLE_VALUE; + impl.owner_ = this; + + // Insert implementation into linked list of all implementations. + mutex::scoped_lock lock(mutex_); + if (!shutdown_) + { + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; + } +} + +void win_object_handle_service::move_construct( + win_object_handle_service::implementation_type& impl, + win_object_handle_service::implementation_type& other_impl) +{ + mutex::scoped_lock lock(mutex_); + + // Insert implementation into linked list of all implementations. + if (!shutdown_) + { + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; + } + + impl.handle_ = other_impl.handle_; + other_impl.handle_ = INVALID_HANDLE_VALUE; + impl.wait_handle_ = other_impl.wait_handle_; + other_impl.wait_handle_ = INVALID_HANDLE_VALUE; + impl.op_queue_.push(other_impl.op_queue_); + impl.owner_ = this; + + // We must not hold the lock while calling UnregisterWaitEx. This is because + // the registered callback function might be invoked while we are waiting for + // UnregisterWaitEx to complete. + lock.unlock(); + + if (impl.wait_handle_ != INVALID_HANDLE_VALUE) + ::UnregisterWaitEx(impl.wait_handle_, INVALID_HANDLE_VALUE); + + if (!impl.op_queue_.empty()) + register_wait_callback(impl, lock); +} + +void win_object_handle_service::move_assign( + win_object_handle_service::implementation_type& impl, + win_object_handle_service& other_service, + win_object_handle_service::implementation_type& other_impl) +{ + asio::error_code ignored_ec; + close(impl, ignored_ec); + + mutex::scoped_lock lock(mutex_); + + if (this != &other_service) + { + // Remove implementation from linked list of all implementations. + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; + } + + impl.handle_ = other_impl.handle_; + other_impl.handle_ = INVALID_HANDLE_VALUE; + impl.wait_handle_ = other_impl.wait_handle_; + other_impl.wait_handle_ = INVALID_HANDLE_VALUE; + impl.op_queue_.push(other_impl.op_queue_); + impl.owner_ = this; + + if (this != &other_service) + { + // Insert implementation into linked list of all implementations. + impl.next_ = other_service.impl_list_; + impl.prev_ = 0; + if (other_service.impl_list_) + other_service.impl_list_->prev_ = &impl; + other_service.impl_list_ = &impl; + } + + // We must not hold the lock while calling UnregisterWaitEx. This is because + // the registered callback function might be invoked while we are waiting for + // UnregisterWaitEx to complete. + lock.unlock(); + + if (impl.wait_handle_ != INVALID_HANDLE_VALUE) + ::UnregisterWaitEx(impl.wait_handle_, INVALID_HANDLE_VALUE); + + if (!impl.op_queue_.empty()) + register_wait_callback(impl, lock); +} + +void win_object_handle_service::destroy( + win_object_handle_service::implementation_type& impl) +{ + mutex::scoped_lock lock(mutex_); + + // Remove implementation from linked list of all implementations. + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; + + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((scheduler_.context(), "object_handle", + &impl, reinterpret_cast(impl.wait_handle_), "close")); + + HANDLE wait_handle = impl.wait_handle_; + impl.wait_handle_ = INVALID_HANDLE_VALUE; + + op_queue ops; + while (wait_op* op = impl.op_queue_.front()) + { + op->ec_ = asio::error::operation_aborted; + impl.op_queue_.pop(); + ops.push(op); + } + + // We must not hold the lock while calling UnregisterWaitEx. This is + // because the registered callback function might be invoked while we are + // waiting for UnregisterWaitEx to complete. + lock.unlock(); + + if (wait_handle != INVALID_HANDLE_VALUE) + ::UnregisterWaitEx(wait_handle, INVALID_HANDLE_VALUE); + + ::CloseHandle(impl.handle_); + impl.handle_ = INVALID_HANDLE_VALUE; + + scheduler_.post_deferred_completions(ops); + } +} + +asio::error_code win_object_handle_service::assign( + win_object_handle_service::implementation_type& impl, + const native_handle_type& handle, asio::error_code& ec) +{ + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + impl.handle_ = handle; + ec = asio::error_code(); + return ec; +} + +asio::error_code win_object_handle_service::close( + win_object_handle_service::implementation_type& impl, + asio::error_code& ec) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((scheduler_.context(), "object_handle", + &impl, reinterpret_cast(impl.wait_handle_), "close")); + + mutex::scoped_lock lock(mutex_); + + HANDLE wait_handle = impl.wait_handle_; + impl.wait_handle_ = INVALID_HANDLE_VALUE; + + op_queue completed_ops; + while (wait_op* op = impl.op_queue_.front()) + { + impl.op_queue_.pop(); + op->ec_ = asio::error::operation_aborted; + completed_ops.push(op); + } + + // We must not hold the lock while calling UnregisterWaitEx. This is + // because the registered callback function might be invoked while we are + // waiting for UnregisterWaitEx to complete. + lock.unlock(); + + if (wait_handle != INVALID_HANDLE_VALUE) + ::UnregisterWaitEx(wait_handle, INVALID_HANDLE_VALUE); + + if (::CloseHandle(impl.handle_)) + { + impl.handle_ = INVALID_HANDLE_VALUE; + ec = asio::error_code(); + } + else + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + } + + scheduler_.post_deferred_completions(completed_ops); + } + else + { + ec = asio::error_code(); + } + + return ec; +} + +asio::error_code win_object_handle_service::cancel( + win_object_handle_service::implementation_type& impl, + asio::error_code& ec) +{ + if (is_open(impl)) + { + ASIO_HANDLER_OPERATION((scheduler_.context(), "object_handle", + &impl, reinterpret_cast(impl.wait_handle_), "cancel")); + + mutex::scoped_lock lock(mutex_); + + HANDLE wait_handle = impl.wait_handle_; + impl.wait_handle_ = INVALID_HANDLE_VALUE; + + op_queue completed_ops; + while (wait_op* op = impl.op_queue_.front()) + { + op->ec_ = asio::error::operation_aborted; + impl.op_queue_.pop(); + completed_ops.push(op); + } + + // We must not hold the lock while calling UnregisterWaitEx. This is + // because the registered callback function might be invoked while we are + // waiting for UnregisterWaitEx to complete. + lock.unlock(); + + if (wait_handle != INVALID_HANDLE_VALUE) + ::UnregisterWaitEx(wait_handle, INVALID_HANDLE_VALUE); + + ec = asio::error_code(); + + scheduler_.post_deferred_completions(completed_ops); + } + else + { + ec = asio::error::bad_descriptor; + } + + return ec; +} + +void win_object_handle_service::wait( + win_object_handle_service::implementation_type& impl, + asio::error_code& ec) +{ + switch (::WaitForSingleObject(impl.handle_, INFINITE)) + { + case WAIT_FAILED: + { + DWORD last_error = ::GetLastError(); + ec = asio::error_code(last_error, + asio::error::get_system_category()); + break; + } + case WAIT_OBJECT_0: + case WAIT_ABANDONED: + default: + ec = asio::error_code(); + break; + } +} + +void win_object_handle_service::start_wait_op( + win_object_handle_service::implementation_type& impl, wait_op* op) +{ + scheduler_.work_started(); + + if (is_open(impl)) + { + mutex::scoped_lock lock(mutex_); + + if (!shutdown_) + { + impl.op_queue_.push(op); + + // Only the first operation to be queued gets to register a wait callback. + // Subsequent operations have to wait for the first to finish. + if (impl.op_queue_.front() == op) + register_wait_callback(impl, lock); + } + else + { + lock.unlock(); + scheduler_.post_deferred_completion(op); + } + } + else + { + op->ec_ = asio::error::bad_descriptor; + scheduler_.post_deferred_completion(op); + } +} + +void win_object_handle_service::register_wait_callback( + win_object_handle_service::implementation_type& impl, + mutex::scoped_lock& lock) +{ + lock.lock(); + + if (!RegisterWaitForSingleObject(&impl.wait_handle_, + impl.handle_, &win_object_handle_service::wait_callback, + &impl, INFINITE, WT_EXECUTEONLYONCE)) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + + op_queue completed_ops; + while (wait_op* op = impl.op_queue_.front()) + { + op->ec_ = ec; + impl.op_queue_.pop(); + completed_ops.push(op); + } + + lock.unlock(); + scheduler_.post_deferred_completions(completed_ops); + } +} + +void win_object_handle_service::wait_callback(PVOID param, BOOLEAN) +{ + implementation_type* impl = static_cast(param); + mutex::scoped_lock lock(impl->owner_->mutex_); + + if (impl->wait_handle_ != INVALID_HANDLE_VALUE) + { + ::UnregisterWaitEx(impl->wait_handle_, NULL); + impl->wait_handle_ = INVALID_HANDLE_VALUE; + } + + if (wait_op* op = impl->op_queue_.front()) + { + op_queue completed_ops; + + op->ec_ = asio::error_code(); + impl->op_queue_.pop(); + completed_ops.push(op); + + if (!impl->op_queue_.empty()) + { + if (!RegisterWaitForSingleObject(&impl->wait_handle_, + impl->handle_, &win_object_handle_service::wait_callback, + param, INFINITE, WT_EXECUTEONLYONCE)) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + + while ((op = impl->op_queue_.front()) != 0) + { + op->ec_ = ec; + impl->op_queue_.pop(); + completed_ops.push(op); + } + } + } + + scheduler_impl& sched = impl->owner_->scheduler_; + lock.unlock(); + sched.post_deferred_completions(completed_ops); + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) + +#endif // ASIO_DETAIL_IMPL_WIN_OBJECT_HANDLE_SERVICE_IPP diff --git a/include/asio/include/asio/detail/impl/win_static_mutex.ipp b/include/asio/include/asio/detail/impl/win_static_mutex.ipp new file mode 100644 index 0000000..0b6a6e2 --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_static_mutex.ipp @@ -0,0 +1,136 @@ +// +// detail/impl/win_static_mutex.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_STATIC_MUTEX_IPP +#define ASIO_DETAIL_IMPL_WIN_STATIC_MUTEX_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include +#include "asio/detail/throw_error.hpp" +#include "asio/detail/win_static_mutex.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +void win_static_mutex::init() +{ + int error = do_init(); + asio::error_code ec(error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "static_mutex"); +} + +int win_static_mutex::do_init() +{ + using namespace std; // For sprintf. + wchar_t mutex_name[128]; +#if defined(ASIO_HAS_SECURE_RTL) + swprintf_s( +#else // defined(ASIO_HAS_SECURE_RTL) + _snwprintf( +#endif // defined(ASIO_HAS_SECURE_RTL) + mutex_name, 128, L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p", + static_cast(::GetCurrentProcessId()), this); + +#if defined(ASIO_WINDOWS_APP) + HANDLE mutex = ::CreateMutexExW(0, mutex_name, CREATE_MUTEX_INITIAL_OWNER, 0); +#else // defined(ASIO_WINDOWS_APP) + HANDLE mutex = ::CreateMutexW(0, TRUE, mutex_name); +#endif // defined(ASIO_WINDOWS_APP) + DWORD last_error = ::GetLastError(); + if (mutex == 0) + return ::GetLastError(); + + if (last_error == ERROR_ALREADY_EXISTS) + { +#if defined(ASIO_WINDOWS_APP) + ::WaitForSingleObjectEx(mutex, INFINITE, false); +#else // defined(ASIO_WINDOWS_APP) + ::WaitForSingleObject(mutex, INFINITE); +#endif // defined(ASIO_WINDOWS_APP) + } + + if (initialised_) + { + ::ReleaseMutex(mutex); + ::CloseHandle(mutex); + return 0; + } + +#if defined(__MINGW32__) + // Not sure if MinGW supports structured exception handling, so for now + // we'll just call the Windows API and hope. +# if defined(UNDER_CE) + ::InitializeCriticalSection(&crit_section_); +# else + if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000)) + { + last_error = ::GetLastError(); + ::ReleaseMutex(mutex); + ::CloseHandle(mutex); + return last_error; + } +# endif +#else + __try + { +# if defined(UNDER_CE) + ::InitializeCriticalSection(&crit_section_); +# elif defined(ASIO_WINDOWS_APP) + if (!::InitializeCriticalSectionEx(&crit_section_, 0, 0)) + { + last_error = ::GetLastError(); + ::ReleaseMutex(mutex); + ::CloseHandle(mutex); + return last_error; + } +# else + if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000)) + { + last_error = ::GetLastError(); + ::ReleaseMutex(mutex); + ::CloseHandle(mutex); + return last_error; + } +# endif + } + __except(GetExceptionCode() == STATUS_NO_MEMORY + ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + ::ReleaseMutex(mutex); + ::CloseHandle(mutex); + return ERROR_OUTOFMEMORY; + } +#endif + + initialised_ = true; + ::ReleaseMutex(mutex); + ::CloseHandle(mutex); + return 0; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_IMPL_WIN_STATIC_MUTEX_IPP diff --git a/include/asio/include/asio/detail/impl/win_thread.ipp b/include/asio/include/asio/detail/impl/win_thread.ipp new file mode 100644 index 0000000..d2ef02f --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_thread.ipp @@ -0,0 +1,150 @@ +// +// detail/impl/win_thread.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_THREAD_IPP +#define ASIO_DETAIL_IMPL_WIN_THREAD_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_APP) \ + && !defined(UNDER_CE) + +#include +#include "asio/detail/throw_error.hpp" +#include "asio/detail/win_thread.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +win_thread::~win_thread() +{ + ::CloseHandle(thread_); + + // The exit_event_ handle is deliberately allowed to leak here since it + // is an error for the owner of an internal thread not to join() it. +} + +void win_thread::join() +{ + HANDLE handles[2] = { exit_event_, thread_ }; + ::WaitForMultipleObjects(2, handles, FALSE, INFINITE); + ::CloseHandle(exit_event_); + if (terminate_threads()) + { + ::TerminateThread(thread_, 0); + } + else + { + ::QueueUserAPC(apc_function, thread_, 0); + ::WaitForSingleObject(thread_, INFINITE); + } +} + +std::size_t win_thread::hardware_concurrency() +{ + SYSTEM_INFO system_info; + ::GetSystemInfo(&system_info); + return system_info.dwNumberOfProcessors; +} + +void win_thread::start_thread(func_base* arg, unsigned int stack_size) +{ + ::HANDLE entry_event = 0; + arg->entry_event_ = entry_event = ::CreateEventW(0, true, false, 0); + if (!entry_event) + { + DWORD last_error = ::GetLastError(); + delete arg; + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "thread.entry_event"); + } + + arg->exit_event_ = exit_event_ = ::CreateEventW(0, true, false, 0); + if (!exit_event_) + { + DWORD last_error = ::GetLastError(); + delete arg; + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "thread.exit_event"); + } + + unsigned int thread_id = 0; + thread_ = reinterpret_cast(::_beginthreadex(0, + stack_size, win_thread_function, arg, 0, &thread_id)); + if (!thread_) + { + DWORD last_error = ::GetLastError(); + delete arg; + if (entry_event) + ::CloseHandle(entry_event); + if (exit_event_) + ::CloseHandle(exit_event_); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "thread"); + } + + if (entry_event) + { + ::WaitForSingleObject(entry_event, INFINITE); + ::CloseHandle(entry_event); + } +} + +unsigned int __stdcall win_thread_function(void* arg) +{ + win_thread::auto_func_base_ptr func = { + static_cast(arg) }; + + ::SetEvent(func.ptr->entry_event_); + + func.ptr->run(); + + // Signal that the thread has finished its work, but rather than returning go + // to sleep to put the thread into a well known state. If the thread is being + // joined during global object destruction then it may be killed using + // TerminateThread (to avoid a deadlock in DllMain). Otherwise, the SleepEx + // call will be interrupted using QueueUserAPC and the thread will shut down + // cleanly. + HANDLE exit_event = func.ptr->exit_event_; + delete func.ptr; + func.ptr = 0; + ::SetEvent(exit_event); + ::SleepEx(INFINITE, TRUE); + + return 0; +} + +#if defined(WINVER) && (WINVER < 0x0500) +void __stdcall apc_function(ULONG) {} +#else +void __stdcall apc_function(ULONG_PTR) {} +#endif + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_APP) + // && !defined(UNDER_CE) + +#endif // ASIO_DETAIL_IMPL_WIN_THREAD_IPP diff --git a/include/asio/include/asio/detail/impl/win_tss_ptr.ipp b/include/asio/include/asio/detail/impl/win_tss_ptr.ipp new file mode 100644 index 0000000..e90c628 --- /dev/null +++ b/include/asio/include/asio/detail/impl/win_tss_ptr.ipp @@ -0,0 +1,57 @@ +// +// detail/impl/win_tss_ptr.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP +#define ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include "asio/detail/throw_error.hpp" +#include "asio/detail/win_tss_ptr.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +DWORD win_tss_ptr_create() +{ +#if defined(UNDER_CE) + const DWORD out_of_indexes = 0xFFFFFFFF; +#else + const DWORD out_of_indexes = TLS_OUT_OF_INDEXES; +#endif + + DWORD tss_key = ::TlsAlloc(); + if (tss_key == out_of_indexes) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "tss"); + } + return tss_key; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP diff --git a/include/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp b/include/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp new file mode 100644 index 0000000..66d3f77 --- /dev/null +++ b/include/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp @@ -0,0 +1,626 @@ +// +// detail/impl/winrt_ssocket_service_base.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WINRT_SSOCKET_SERVICE_BASE_IPP +#define ASIO_DETAIL_IMPL_WINRT_SSOCKET_SERVICE_BASE_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include +#include "asio/detail/winrt_ssocket_service_base.hpp" +#include "asio/detail/winrt_async_op.hpp" +#include "asio/detail/winrt_utils.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +winrt_ssocket_service_base::winrt_ssocket_service_base( + execution_context& context) + : scheduler_(use_service(context)), + async_manager_(use_service(context)), + mutex_(), + impl_list_(0) +{ +} + +void winrt_ssocket_service_base::base_shutdown() +{ + // Close all implementations, causing all operations to complete. + asio::detail::mutex::scoped_lock lock(mutex_); + base_implementation_type* impl = impl_list_; + while (impl) + { + asio::error_code ignored_ec; + close(*impl, ignored_ec); + impl = impl->next_; + } +} + +void winrt_ssocket_service_base::construct( + winrt_ssocket_service_base::base_implementation_type& impl) +{ + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; +} + +void winrt_ssocket_service_base::base_move_construct( + winrt_ssocket_service_base::base_implementation_type& impl, + winrt_ssocket_service_base::base_implementation_type& other_impl) + ASIO_NOEXCEPT +{ + impl.socket_ = other_impl.socket_; + other_impl.socket_ = nullptr; + + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + impl.next_ = impl_list_; + impl.prev_ = 0; + if (impl_list_) + impl_list_->prev_ = &impl; + impl_list_ = &impl; +} + +void winrt_ssocket_service_base::base_move_assign( + winrt_ssocket_service_base::base_implementation_type& impl, + winrt_ssocket_service_base& other_service, + winrt_ssocket_service_base::base_implementation_type& other_impl) +{ + asio::error_code ignored_ec; + close(impl, ignored_ec); + + if (this != &other_service) + { + // Remove implementation from linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; + } + + impl.socket_ = other_impl.socket_; + other_impl.socket_ = nullptr; + + if (this != &other_service) + { + // Insert implementation into linked list of all implementations. + asio::detail::mutex::scoped_lock lock(other_service.mutex_); + impl.next_ = other_service.impl_list_; + impl.prev_ = 0; + if (other_service.impl_list_) + other_service.impl_list_->prev_ = &impl; + other_service.impl_list_ = &impl; + } +} + +void winrt_ssocket_service_base::destroy( + winrt_ssocket_service_base::base_implementation_type& impl) +{ + asio::error_code ignored_ec; + close(impl, ignored_ec); + + // Remove implementation from linked list of all implementations. + asio::detail::mutex::scoped_lock lock(mutex_); + if (impl_list_ == &impl) + impl_list_ = impl.next_; + if (impl.prev_) + impl.prev_->next_ = impl.next_; + if (impl.next_) + impl.next_->prev_= impl.prev_; + impl.next_ = 0; + impl.prev_ = 0; +} + +asio::error_code winrt_ssocket_service_base::close( + winrt_ssocket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + delete impl.socket_; + impl.socket_ = nullptr; + ec = asio::error_code(); + return ec; +} + +winrt_ssocket_service_base::native_handle_type +winrt_ssocket_service_base::release( + winrt_ssocket_service_base::base_implementation_type& impl, + asio::error_code& ec) +{ + if (!is_open(impl)) + return nullptr; + + cancel(impl, ec); + if (ec) + return nullptr; + + native_handle_type tmp = impl.socket_; + impl.socket_ = nullptr; + return tmp; +} + +std::size_t winrt_ssocket_service_base::do_get_endpoint( + const base_implementation_type& impl, bool local, + void* addr, std::size_t addr_len, asio::error_code& ec) const +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return addr_len; + } + + try + { + std::string addr_string = winrt_utils::string(local + ? impl.socket_->Information->LocalAddress->CanonicalName + : impl.socket_->Information->RemoteAddress->CanonicalName); + unsigned short port = winrt_utils::integer(local + ? impl.socket_->Information->LocalPort + : impl.socket_->Information->RemotePort); + unsigned long scope = 0; + + switch (reinterpret_cast(addr)->sa_family) + { + case ASIO_OS_DEF(AF_INET): + if (addr_len < sizeof(sockaddr_in4_type)) + { + ec = asio::error::invalid_argument; + return addr_len; + } + else + { + socket_ops::inet_pton(ASIO_OS_DEF(AF_INET), addr_string.c_str(), + &reinterpret_cast(addr)->sin_addr, &scope, ec); + reinterpret_cast(addr)->sin_port + = socket_ops::host_to_network_short(port); + ec = asio::error_code(); + return sizeof(sockaddr_in4_type); + } + case ASIO_OS_DEF(AF_INET6): + if (addr_len < sizeof(sockaddr_in6_type)) + { + ec = asio::error::invalid_argument; + return addr_len; + } + else + { + socket_ops::inet_pton(ASIO_OS_DEF(AF_INET6), addr_string.c_str(), + &reinterpret_cast(addr)->sin6_addr, &scope, ec); + reinterpret_cast(addr)->sin6_port + = socket_ops::host_to_network_short(port); + ec = asio::error_code(); + return sizeof(sockaddr_in6_type); + } + default: + ec = asio::error::address_family_not_supported; + return addr_len; + } + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + return addr_len; + } +} + +asio::error_code winrt_ssocket_service_base::do_set_option( + winrt_ssocket_service_base::base_implementation_type& impl, + int level, int optname, const void* optval, + std::size_t optlen, asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return ec; + } + + try + { + if (level == ASIO_OS_DEF(SOL_SOCKET) + && optname == ASIO_OS_DEF(SO_KEEPALIVE)) + { + if (optlen == sizeof(int)) + { + int value = 0; + std::memcpy(&value, optval, optlen); + impl.socket_->Control->KeepAlive = !!value; + ec = asio::error_code(); + } + else + { + ec = asio::error::invalid_argument; + } + } + else if (level == ASIO_OS_DEF(IPPROTO_TCP) + && optname == ASIO_OS_DEF(TCP_NODELAY)) + { + if (optlen == sizeof(int)) + { + int value = 0; + std::memcpy(&value, optval, optlen); + impl.socket_->Control->NoDelay = !!value; + ec = asio::error_code(); + } + else + { + ec = asio::error::invalid_argument; + } + } + else + { + ec = asio::error::invalid_argument; + } + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + } + + return ec; +} + +void winrt_ssocket_service_base::do_get_option( + const winrt_ssocket_service_base::base_implementation_type& impl, + int level, int optname, void* optval, + std::size_t* optlen, asio::error_code& ec) const +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return; + } + + try + { + if (level == ASIO_OS_DEF(SOL_SOCKET) + && optname == ASIO_OS_DEF(SO_KEEPALIVE)) + { + if (*optlen >= sizeof(int)) + { + int value = impl.socket_->Control->KeepAlive ? 1 : 0; + std::memcpy(optval, &value, sizeof(int)); + *optlen = sizeof(int); + ec = asio::error_code(); + } + else + { + ec = asio::error::invalid_argument; + } + } + else if (level == ASIO_OS_DEF(IPPROTO_TCP) + && optname == ASIO_OS_DEF(TCP_NODELAY)) + { + if (*optlen >= sizeof(int)) + { + int value = impl.socket_->Control->NoDelay ? 1 : 0; + std::memcpy(optval, &value, sizeof(int)); + *optlen = sizeof(int); + ec = asio::error_code(); + } + else + { + ec = asio::error::invalid_argument; + } + } + else + { + ec = asio::error::invalid_argument; + } + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + } +} + +asio::error_code winrt_ssocket_service_base::do_connect( + winrt_ssocket_service_base::base_implementation_type& impl, + const void* addr, asio::error_code& ec) +{ + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return ec; + } + + char addr_string[max_addr_v6_str_len]; + unsigned short port; + switch (reinterpret_cast(addr)->sa_family) + { + case ASIO_OS_DEF(AF_INET): + socket_ops::inet_ntop(ASIO_OS_DEF(AF_INET), + &reinterpret_cast(addr)->sin_addr, + addr_string, sizeof(addr_string), 0, ec); + port = socket_ops::network_to_host_short( + reinterpret_cast(addr)->sin_port); + break; + case ASIO_OS_DEF(AF_INET6): + socket_ops::inet_ntop(ASIO_OS_DEF(AF_INET6), + &reinterpret_cast(addr)->sin6_addr, + addr_string, sizeof(addr_string), 0, ec); + port = socket_ops::network_to_host_short( + reinterpret_cast(addr)->sin6_port); + break; + default: + ec = asio::error::address_family_not_supported; + return ec; + } + + if (!ec) try + { + async_manager_.sync(impl.socket_->ConnectAsync( + ref new Windows::Networking::HostName( + winrt_utils::string(addr_string)), + winrt_utils::string(port)), ec); + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + } + + return ec; +} + +void winrt_ssocket_service_base::start_connect_op( + winrt_ssocket_service_base::base_implementation_type& impl, + const void* addr, winrt_async_op* op, bool is_continuation) +{ + if (!is_open(impl)) + { + op->ec_ = asio::error::bad_descriptor; + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + char addr_string[max_addr_v6_str_len]; + unsigned short port = 0; + switch (reinterpret_cast(addr)->sa_family) + { + case ASIO_OS_DEF(AF_INET): + socket_ops::inet_ntop(ASIO_OS_DEF(AF_INET), + &reinterpret_cast(addr)->sin_addr, + addr_string, sizeof(addr_string), 0, op->ec_); + port = socket_ops::network_to_host_short( + reinterpret_cast(addr)->sin_port); + break; + case ASIO_OS_DEF(AF_INET6): + socket_ops::inet_ntop(ASIO_OS_DEF(AF_INET6), + &reinterpret_cast(addr)->sin6_addr, + addr_string, sizeof(addr_string), 0, op->ec_); + port = socket_ops::network_to_host_short( + reinterpret_cast(addr)->sin6_port); + break; + default: + op->ec_ = asio::error::address_family_not_supported; + break; + } + + if (op->ec_) + { + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + try + { + async_manager_.async(impl.socket_->ConnectAsync( + ref new Windows::Networking::HostName( + winrt_utils::string(addr_string)), + winrt_utils::string(port)), op); + } + catch (Platform::Exception^ e) + { + op->ec_ = asio::error_code( + e->HResult, asio::system_category()); + scheduler_.post_immediate_completion(op, is_continuation); + } +} + +std::size_t winrt_ssocket_service_base::do_send( + winrt_ssocket_service_base::base_implementation_type& impl, + const asio::const_buffer& data, + socket_base::message_flags flags, asio::error_code& ec) +{ + if (flags) + { + ec = asio::error::operation_not_supported; + return 0; + } + + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return 0; + } + + try + { + buffer_sequence_adapter bufs(asio::buffer(data)); + + if (bufs.all_empty()) + { + ec = asio::error_code(); + return 0; + } + + return async_manager_.sync( + impl.socket_->OutputStream->WriteAsync(bufs.buffers()[0]), ec); + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + return 0; + } +} + +void winrt_ssocket_service_base::start_send_op( + winrt_ssocket_service_base::base_implementation_type& impl, + const asio::const_buffer& data, socket_base::message_flags flags, + winrt_async_op* op, bool is_continuation) +{ + if (flags) + { + op->ec_ = asio::error::operation_not_supported; + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + if (!is_open(impl)) + { + op->ec_ = asio::error::bad_descriptor; + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + try + { + buffer_sequence_adapter bufs(asio::buffer(data)); + + if (bufs.all_empty()) + { + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + async_manager_.async( + impl.socket_->OutputStream->WriteAsync(bufs.buffers()[0]), op); + } + catch (Platform::Exception^ e) + { + op->ec_ = asio::error_code(e->HResult, + asio::system_category()); + scheduler_.post_immediate_completion(op, is_continuation); + } +} + +std::size_t winrt_ssocket_service_base::do_receive( + winrt_ssocket_service_base::base_implementation_type& impl, + const asio::mutable_buffer& data, + socket_base::message_flags flags, asio::error_code& ec) +{ + if (flags) + { + ec = asio::error::operation_not_supported; + return 0; + } + + if (!is_open(impl)) + { + ec = asio::error::bad_descriptor; + return 0; + } + + try + { + buffer_sequence_adapter bufs(asio::buffer(data)); + + if (bufs.all_empty()) + { + ec = asio::error_code(); + return 0; + } + + async_manager_.sync( + impl.socket_->InputStream->ReadAsync( + bufs.buffers()[0], bufs.buffers()[0]->Capacity, + Windows::Storage::Streams::InputStreamOptions::Partial), ec); + + std::size_t bytes_transferred = bufs.buffers()[0]->Length; + if (bytes_transferred == 0 && !ec) + { + ec = asio::error::eof; + } + + return bytes_transferred; + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + return 0; + } +} + +void winrt_ssocket_service_base::start_receive_op( + winrt_ssocket_service_base::base_implementation_type& impl, + const asio::mutable_buffer& data, socket_base::message_flags flags, + winrt_async_op* op, + bool is_continuation) +{ + if (flags) + { + op->ec_ = asio::error::operation_not_supported; + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + if (!is_open(impl)) + { + op->ec_ = asio::error::bad_descriptor; + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + try + { + buffer_sequence_adapter bufs(asio::buffer(data)); + + if (bufs.all_empty()) + { + scheduler_.post_immediate_completion(op, is_continuation); + return; + } + + async_manager_.async( + impl.socket_->InputStream->ReadAsync( + bufs.buffers()[0], bufs.buffers()[0]->Capacity, + Windows::Storage::Streams::InputStreamOptions::Partial), op); + } + catch (Platform::Exception^ e) + { + op->ec_ = asio::error_code(e->HResult, + asio::system_category()); + scheduler_.post_immediate_completion(op, is_continuation); + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_IMPL_WINRT_SSOCKET_SERVICE_BASE_IPP diff --git a/include/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp b/include/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp new file mode 100644 index 0000000..17bcc82 --- /dev/null +++ b/include/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp @@ -0,0 +1,92 @@ +// +// detail/impl/winrt_timer_scheduler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_HPP +#define ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +void winrt_timer_scheduler::add_timer_queue(timer_queue& queue) +{ + do_add_timer_queue(queue); +} + +// Remove a timer queue from the reactor. +template +void winrt_timer_scheduler::remove_timer_queue(timer_queue& queue) +{ + do_remove_timer_queue(queue); +} + +template +void winrt_timer_scheduler::schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + + if (shutdown_) + { + scheduler_.post_immediate_completion(op, false); + return; + } + + bool earliest = queue.enqueue_timer(time, timer, op); + scheduler_.work_started(); + if (earliest) + event_.signal(lock); +} + +template +std::size_t winrt_timer_scheduler::cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + op_queue ops; + std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); + lock.unlock(); + scheduler_.post_deferred_completions(ops); + return n; +} + +template +void winrt_timer_scheduler::move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& to, + typename timer_queue::per_timer_data& from) +{ + asio::detail::mutex::scoped_lock lock(mutex_); + op_queue ops; + queue.cancel_timer(to, ops); + queue.move_timer(to, from); + lock.unlock(); + scheduler_.post_deferred_completions(ops); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_HPP diff --git a/include/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp b/include/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp new file mode 100644 index 0000000..9104266 --- /dev/null +++ b/include/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp @@ -0,0 +1,121 @@ +// +// detail/impl/winrt_timer_scheduler.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_IPP +#define ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/winrt_timer_scheduler.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +winrt_timer_scheduler::winrt_timer_scheduler(execution_context& context) + : execution_context_service_base(context), + scheduler_(use_service(context)), + mutex_(), + event_(), + timer_queues_(), + thread_(0), + stop_thread_(false), + shutdown_(false) +{ + thread_ = new asio::detail::thread( + bind_handler(&winrt_timer_scheduler::call_run_thread, this)); +} + +winrt_timer_scheduler::~winrt_timer_scheduler() +{ + shutdown(); +} + +void winrt_timer_scheduler::shutdown() +{ + asio::detail::mutex::scoped_lock lock(mutex_); + shutdown_ = true; + stop_thread_ = true; + event_.signal(lock); + lock.unlock(); + + if (thread_) + { + thread_->join(); + delete thread_; + thread_ = 0; + } + + op_queue ops; + timer_queues_.get_all_timers(ops); + scheduler_.abandon_operations(ops); +} + +void winrt_timer_scheduler::notify_fork(execution_context::fork_event) +{ +} + +void winrt_timer_scheduler::init_task() +{ +} + +void winrt_timer_scheduler::run_thread() +{ + asio::detail::mutex::scoped_lock lock(mutex_); + while (!stop_thread_) + { + const long max_wait_duration = 5 * 60 * 1000000; + long wait_duration = timer_queues_.wait_duration_usec(max_wait_duration); + event_.wait_for_usec(lock, wait_duration); + event_.clear(lock); + op_queue ops; + timer_queues_.get_ready_timers(ops); + if (!ops.empty()) + { + lock.unlock(); + scheduler_.post_deferred_completions(ops); + lock.lock(); + } + } +} + +void winrt_timer_scheduler::call_run_thread(winrt_timer_scheduler* scheduler) +{ + scheduler->run_thread(); +} + +void winrt_timer_scheduler::do_add_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.insert(&queue); +} + +void winrt_timer_scheduler::do_remove_timer_queue(timer_queue_base& queue) +{ + mutex::scoped_lock lock(mutex_); + timer_queues_.erase(&queue); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_IMPL_WINRT_TIMER_SCHEDULER_IPP diff --git a/include/asio/include/asio/detail/impl/winsock_init.ipp b/include/asio/include/asio/detail/impl/winsock_init.ipp new file mode 100644 index 0000000..f594340 --- /dev/null +++ b/include/asio/include/asio/detail/impl/winsock_init.ipp @@ -0,0 +1,82 @@ +// +// detail/impl/winsock_init.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IMPL_WINSOCK_INIT_IPP +#define ASIO_DETAIL_IMPL_WINSOCK_INIT_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#include "asio/detail/socket_types.hpp" +#include "asio/detail/winsock_init.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +void winsock_init_base::startup(data& d, + unsigned char major, unsigned char minor) +{ + if (::InterlockedIncrement(&d.init_count_) == 1) + { + WSADATA wsa_data; + long result = ::WSAStartup(MAKEWORD(major, minor), &wsa_data); + ::InterlockedExchange(&d.result_, result); + } +} + +void winsock_init_base::manual_startup(data& d) +{ + if (::InterlockedIncrement(&d.init_count_) == 1) + { + ::InterlockedExchange(&d.result_, 0); + } +} + +void winsock_init_base::cleanup(data& d) +{ + if (::InterlockedDecrement(&d.init_count_) == 0) + { + ::WSACleanup(); + } +} + +void winsock_init_base::manual_cleanup(data& d) +{ + ::InterlockedDecrement(&d.init_count_); +} + +void winsock_init_base::throw_on_error(data& d) +{ + long result = ::InterlockedExchangeAdd(&d.result_, 0); + if (result != 0) + { + asio::error_code ec(result, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "winsock"); + } +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#endif // ASIO_DETAIL_IMPL_WINSOCK_INIT_IPP diff --git a/include/asio/include/asio/detail/io_control.hpp b/include/asio/include/asio/detail/io_control.hpp new file mode 100644 index 0000000..0e5de4a --- /dev/null +++ b/include/asio/include/asio/detail/io_control.hpp @@ -0,0 +1,84 @@ +// +// detail/io_control.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IO_CONTROL_HPP +#define ASIO_DETAIL_IO_CONTROL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { +namespace io_control { + +// I/O control command for getting number of bytes available. +class bytes_readable +{ +public: + // Default constructor. + bytes_readable() + : value_(0) + { + } + + // Construct with a specific command value. + bytes_readable(std::size_t value) + : value_(static_cast(value)) + { + } + + // Get the name of the IO control command. + int name() const + { + return static_cast(ASIO_OS_DEF(FIONREAD)); + } + + // Set the value of the I/O control command. + void set(std::size_t value) + { + value_ = static_cast(value); + } + + // Get the current value of the I/O control command. + std::size_t get() const + { + return static_cast(value_); + } + + // Get the address of the command data. + detail::ioctl_arg_type* data() + { + return &value_; + } + + // Get the address of the command data. + const detail::ioctl_arg_type* data() const + { + return &value_; + } + +private: + detail::ioctl_arg_type value_; +}; + +} // namespace io_control +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IO_CONTROL_HPP diff --git a/include/asio/include/asio/detail/io_object_impl.hpp b/include/asio/include/asio/detail/io_object_impl.hpp new file mode 100644 index 0000000..9819bed --- /dev/null +++ b/include/asio/include/asio/detail/io_object_impl.hpp @@ -0,0 +1,175 @@ +// +// io_object_impl.hpp +// ~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IO_OBJECT_IMPL_HPP +#define ASIO_DETAIL_IO_OBJECT_IMPL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/context.hpp" +#include "asio/io_context.hpp" +#include "asio/query.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class io_object_impl +{ +public: + // The type of the service that will be used to provide I/O operations. + typedef IoObjectService service_type; + + // The underlying implementation type of I/O object. + typedef typename service_type::implementation_type implementation_type; + + // The type of the executor associated with the object. + typedef Executor executor_type; + + // Construct an I/O object using an executor. + explicit io_object_impl(const executor_type& ex) + : service_(&asio::use_service( + io_object_impl::get_context(ex))), + executor_(ex) + { + service_->construct(implementation_); + } + + // Construct an I/O object using an execution context. + template + explicit io_object_impl(ExecutionContext& context, + typename enable_if::value>::type* = 0) + : service_(&asio::use_service(context)), + executor_(context.get_executor()) + { + service_->construct(implementation_); + } + +#if defined(ASIO_HAS_MOVE) + // Move-construct an I/O object. + io_object_impl(io_object_impl&& other) + : service_(&other.get_service()), + executor_(other.get_executor()) + { + service_->move_construct(implementation_, other.implementation_); + } + + // Perform a converting move-construction of an I/O object. + template + io_object_impl(io_object_impl&& other) + : service_(&asio::use_service( + io_object_impl::get_context(other.get_executor()))), + executor_(other.get_executor()) + { + service_->converting_move_construct(implementation_, + other.get_service(), other.get_implementation()); + } +#endif // defined(ASIO_HAS_MOVE) + + // Destructor. + ~io_object_impl() + { + service_->destroy(implementation_); + } + +#if defined(ASIO_HAS_MOVE) + // Move-assign an I/O object. + io_object_impl& operator=(io_object_impl&& other) + { + if (this != &other) + { + service_->move_assign(implementation_, + *other.service_, other.implementation_); + executor_.~executor_type(); + new (&executor_) executor_type( + std::move(other.executor_)); + service_ = other.service_; + } + return *this; + } +#endif // defined(ASIO_HAS_MOVE) + + // Get the executor associated with the object. + const executor_type& get_executor() ASIO_NOEXCEPT + { + return executor_; + } + + // Get the service associated with the I/O object. + service_type& get_service() + { + return *service_; + } + + // Get the service associated with the I/O object. + const service_type& get_service() const + { + return *service_; + } + + // Get the underlying implementation of the I/O object. + implementation_type& get_implementation() + { + return implementation_; + } + + // Get the underlying implementation of the I/O object. + const implementation_type& get_implementation() const + { + return implementation_; + } + +private: + // Helper function to get an executor's context. + template + static execution_context& get_context(const T& t, + typename enable_if::value>::type* = 0) + { + return asio::query(t, execution::context); + } + + // Helper function to get an executor's context. + template + static execution_context& get_context(const T& t, + typename enable_if::value>::type* = 0) + { + return t.context(); + } + + // Disallow copying and copy assignment. + io_object_impl(const io_object_impl&); + io_object_impl& operator=(const io_object_impl&); + + // The service associated with the I/O object. + service_type* service_; + + // The underlying implementation of the I/O object. + implementation_type implementation_; + + // The associated executor. + executor_type executor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IO_OBJECT_IMPL_HPP diff --git a/include/asio/include/asio/detail/is_buffer_sequence.hpp b/include/asio/include/asio/detail/is_buffer_sequence.hpp new file mode 100644 index 0000000..06e303c --- /dev/null +++ b/include/asio/include/asio/detail/is_buffer_sequence.hpp @@ -0,0 +1,312 @@ +// +// detail/is_buffer_sequence.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IS_BUFFER_SEQUENCE_HPP +#define ASIO_DETAIL_IS_BUFFER_SEQUENCE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +class mutable_buffer; +class const_buffer; + +namespace detail { + +struct buffer_sequence_memfns_base +{ + void begin(); + void end(); + void size(); + void max_size(); + void capacity(); + void data(); + void prepare(); + void commit(); + void consume(); + void grow(); + void shrink(); +}; + +template +struct buffer_sequence_memfns_derived + : T, buffer_sequence_memfns_base +{ +}; + +template +struct buffer_sequence_memfns_check +{ +}; + +#if defined(ASIO_HAS_DECLTYPE) + +template +char buffer_sequence_begin_helper(...); + +template +char (&buffer_sequence_begin_helper(T* t, + typename enable_if::value>::type*))[2]; + +#else // defined(ASIO_HAS_DECLTYPE) + +template +char (&buffer_sequence_begin_helper(...))[2]; + +template +char buffer_sequence_begin_helper(T* t, + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::begin>*); + +#endif // defined(ASIO_HAS_DECLTYPE) + +#if defined(ASIO_HAS_DECLTYPE) + +template +char buffer_sequence_end_helper(...); + +template +char (&buffer_sequence_end_helper(T* t, + typename enable_if::value>::type*))[2]; + +#else // defined(ASIO_HAS_DECLTYPE) + +template +char (&buffer_sequence_end_helper(...))[2]; + +template +char buffer_sequence_end_helper(T* t, + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::end>*); + +#endif // defined(ASIO_HAS_DECLTYPE) + +template +char (&size_memfn_helper(...))[2]; + +template +char size_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::size>*); + +template +char (&max_size_memfn_helper(...))[2]; + +template +char max_size_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::max_size>*); + +template +char (&capacity_memfn_helper(...))[2]; + +template +char capacity_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::capacity>*); + +template +char (&data_memfn_helper(...))[2]; + +template +char data_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::data>*); + +template +char (&prepare_memfn_helper(...))[2]; + +template +char prepare_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::prepare>*); + +template +char (&commit_memfn_helper(...))[2]; + +template +char commit_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::commit>*); + +template +char (&consume_memfn_helper(...))[2]; + +template +char consume_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::consume>*); + +template +char (&grow_memfn_helper(...))[2]; + +template +char grow_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::grow>*); + +template +char (&shrink_memfn_helper(...))[2]; + +template +char shrink_memfn_helper( + buffer_sequence_memfns_check< + void (buffer_sequence_memfns_base::*)(), + &buffer_sequence_memfns_derived::shrink>*); + +template +char (&buffer_sequence_element_type_helper(...))[2]; + +#if defined(ASIO_HAS_DECLTYPE) + +template +char buffer_sequence_element_type_helper(T* t, + typename enable_if::value>::type*); + +#else // defined(ASIO_HAS_DECLTYPE) + +template +char buffer_sequence_element_type_helper( + typename T::const_iterator*, + typename enable_if::value>::type*); + +#endif // defined(ASIO_HAS_DECLTYPE) + +template +char (&const_buffers_type_typedef_helper(...))[2]; + +template +char const_buffers_type_typedef_helper( + typename T::const_buffers_type*); + +template +char (&mutable_buffers_type_typedef_helper(...))[2]; + +template +char mutable_buffers_type_typedef_helper( + typename T::mutable_buffers_type*); + +template +struct is_buffer_sequence_class + : integral_constant(0, 0)) != 1 && + sizeof(buffer_sequence_end_helper(0, 0)) != 1 && + sizeof(buffer_sequence_element_type_helper(0, 0)) == 1> +{ +}; + +template +struct is_buffer_sequence + : conditional::value, + is_buffer_sequence_class, + false_type>::type +{ +}; + +template <> +struct is_buffer_sequence + : true_type +{ +}; + +template <> +struct is_buffer_sequence + : true_type +{ +}; + +template <> +struct is_buffer_sequence + : true_type +{ +}; + +template <> +struct is_buffer_sequence + : false_type +{ +}; + +template +struct is_dynamic_buffer_class_v1 + : integral_constant(0)) != 1 && + sizeof(max_size_memfn_helper(0)) != 1 && + sizeof(capacity_memfn_helper(0)) != 1 && + sizeof(data_memfn_helper(0)) != 1 && + sizeof(consume_memfn_helper(0)) != 1 && + sizeof(prepare_memfn_helper(0)) != 1 && + sizeof(commit_memfn_helper(0)) != 1 && + sizeof(const_buffers_type_typedef_helper(0)) == 1 && + sizeof(mutable_buffers_type_typedef_helper(0)) == 1> +{ +}; + +template +struct is_dynamic_buffer_v1 + : conditional::value, + is_dynamic_buffer_class_v1, + false_type>::type +{ +}; + +template +struct is_dynamic_buffer_class_v2 + : integral_constant(0)) != 1 && + sizeof(max_size_memfn_helper(0)) != 1 && + sizeof(capacity_memfn_helper(0)) != 1 && + sizeof(data_memfn_helper(0)) != 1 && + sizeof(consume_memfn_helper(0)) != 1 && + sizeof(grow_memfn_helper(0)) != 1 && + sizeof(shrink_memfn_helper(0)) != 1 && + sizeof(const_buffers_type_typedef_helper(0)) == 1 && + sizeof(mutable_buffers_type_typedef_helper(0)) == 1> +{ +}; + +template +struct is_dynamic_buffer_v2 + : conditional::value, + is_dynamic_buffer_class_v2, + false_type>::type +{ +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IS_BUFFER_SEQUENCE_HPP diff --git a/include/asio/include/asio/detail/is_executor.hpp b/include/asio/include/asio/detail/is_executor.hpp new file mode 100644 index 0000000..9dbaf95 --- /dev/null +++ b/include/asio/include/asio/detail/is_executor.hpp @@ -0,0 +1,126 @@ +// +// detail/is_executor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_IS_EXECUTOR_HPP +#define ASIO_DETAIL_IS_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct executor_memfns_base +{ + void context(); + void on_work_started(); + void on_work_finished(); + void dispatch(); + void post(); + void defer(); +}; + +template +struct executor_memfns_derived + : T, executor_memfns_base +{ +}; + +template +struct executor_memfns_check +{ +}; + +template +char (&context_memfn_helper(...))[2]; + +template +char context_memfn_helper( + executor_memfns_check< + void (executor_memfns_base::*)(), + &executor_memfns_derived::context>*); + +template +char (&on_work_started_memfn_helper(...))[2]; + +template +char on_work_started_memfn_helper( + executor_memfns_check< + void (executor_memfns_base::*)(), + &executor_memfns_derived::on_work_started>*); + +template +char (&on_work_finished_memfn_helper(...))[2]; + +template +char on_work_finished_memfn_helper( + executor_memfns_check< + void (executor_memfns_base::*)(), + &executor_memfns_derived::on_work_finished>*); + +template +char (&dispatch_memfn_helper(...))[2]; + +template +char dispatch_memfn_helper( + executor_memfns_check< + void (executor_memfns_base::*)(), + &executor_memfns_derived::dispatch>*); + +template +char (&post_memfn_helper(...))[2]; + +template +char post_memfn_helper( + executor_memfns_check< + void (executor_memfns_base::*)(), + &executor_memfns_derived::post>*); + +template +char (&defer_memfn_helper(...))[2]; + +template +char defer_memfn_helper( + executor_memfns_check< + void (executor_memfns_base::*)(), + &executor_memfns_derived::defer>*); + +template +struct is_executor_class + : integral_constant(0)) != 1 && + sizeof(on_work_started_memfn_helper(0)) != 1 && + sizeof(on_work_finished_memfn_helper(0)) != 1 && + sizeof(dispatch_memfn_helper(0)) != 1 && + sizeof(post_memfn_helper(0)) != 1 && + sizeof(defer_memfn_helper(0)) != 1> +{ +}; + +template +struct is_executor + : conditional::value, + is_executor_class, + false_type>::type +{ +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_IS_EXECUTOR_HPP diff --git a/include/asio/include/asio/detail/keyword_tss_ptr.hpp b/include/asio/include/asio/detail/keyword_tss_ptr.hpp new file mode 100644 index 0000000..043dde1 --- /dev/null +++ b/include/asio/include/asio/detail/keyword_tss_ptr.hpp @@ -0,0 +1,70 @@ +// +// detail/keyword_tss_ptr.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_KEYWORD_TSS_PTR_HPP +#define ASIO_DETAIL_KEYWORD_TSS_PTR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class keyword_tss_ptr + : private noncopyable +{ +public: + // Constructor. + keyword_tss_ptr() + { + } + + // Destructor. + ~keyword_tss_ptr() + { + } + + // Get the value. + operator T*() const + { + return value_; + } + + // Set the value. + void operator=(T* value) + { + value_ = value; + } + +private: + static ASIO_THREAD_KEYWORD T* value_; +}; + +template +ASIO_THREAD_KEYWORD T* keyword_tss_ptr::value_; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) + +#endif // ASIO_DETAIL_KEYWORD_TSS_PTR_HPP diff --git a/include/asio/include/asio/detail/kqueue_reactor.hpp b/include/asio/include/asio/detail/kqueue_reactor.hpp new file mode 100644 index 0000000..38ae067 --- /dev/null +++ b/include/asio/include/asio/detail/kqueue_reactor.hpp @@ -0,0 +1,242 @@ +// +// detail/kqueue_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_KQUEUE_REACTOR_HPP +#define ASIO_DETAIL_KQUEUE_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_KQUEUE) + +#include +#include +#include +#include +#include "asio/detail/limits.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/object_pool.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/select_interrupter.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/timer_queue_base.hpp" +#include "asio/detail/timer_queue_set.hpp" +#include "asio/detail/wait_op.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" + +// Older versions of Mac OS X may not define EV_OOBAND. +#if !defined(EV_OOBAND) +# define EV_OOBAND EV_FLAG1 +#endif // !defined(EV_OOBAND) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class scheduler; + +class kqueue_reactor + : public execution_context_service_base +{ +private: + // The mutex type used by this reactor. + typedef conditionally_enabled_mutex mutex; + +public: + enum op_types { read_op = 0, write_op = 1, + connect_op = 1, except_op = 2, max_ops = 3 }; + + // Per-descriptor queues. + struct descriptor_state + { + descriptor_state(bool locking) : mutex_(locking) {} + + friend class kqueue_reactor; + friend class object_pool_access; + + descriptor_state* next_; + descriptor_state* prev_; + + mutex mutex_; + int descriptor_; + int num_kevents_; // 1 == read only, 2 == read and write + op_queue op_queue_[max_ops]; + bool shutdown_; + }; + + // Per-descriptor data. + typedef descriptor_state* per_descriptor_data; + + // Constructor. + ASIO_DECL kqueue_reactor(asio::execution_context& ctx); + + // Destructor. + ASIO_DECL ~kqueue_reactor(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Recreate internal descriptors following a fork. + ASIO_DECL void notify_fork( + asio::execution_context::fork_event fork_ev); + + // Initialise the task. + ASIO_DECL void init_task(); + + // Register a socket with the reactor. Returns 0 on success, system error + // code on failure. + ASIO_DECL int register_descriptor(socket_type descriptor, + per_descriptor_data& descriptor_data); + + // Register a descriptor with an associated single operation. Returns 0 on + // success, system error code on failure. + ASIO_DECL int register_internal_descriptor( + int op_type, socket_type descriptor, + per_descriptor_data& descriptor_data, reactor_op* op); + + // Move descriptor registration from one descriptor_data object to another. + ASIO_DECL void move_descriptor(socket_type descriptor, + per_descriptor_data& target_descriptor_data, + per_descriptor_data& source_descriptor_data); + + // Post a reactor operation for immediate completion. + void post_immediate_completion(reactor_op* op, bool is_continuation) + { + scheduler_.post_immediate_completion(op, is_continuation); + } + + // Start a new operation. The reactor operation will be performed when the + // given descriptor is flagged as ready, or an error has occurred. + ASIO_DECL void start_op(int op_type, socket_type descriptor, + per_descriptor_data& descriptor_data, reactor_op* op, + bool is_continuation, bool allow_speculative); + + // Cancel all operations associated with the given descriptor. The + // handlers associated with the descriptor will be invoked with the + // operation_aborted error. + ASIO_DECL void cancel_ops(socket_type descriptor, + per_descriptor_data& descriptor_data); + + // Cancel any operations that are running against the descriptor and remove + // its registration from the reactor. The reactor resources associated with + // the descriptor must be released by calling cleanup_descriptor_data. + ASIO_DECL void deregister_descriptor(socket_type descriptor, + per_descriptor_data& descriptor_data, bool closing); + + // Remove the descriptor's registration from the reactor. The reactor + // resources associated with the descriptor must be released by calling + // cleanup_descriptor_data. + ASIO_DECL void deregister_internal_descriptor( + socket_type descriptor, per_descriptor_data& descriptor_data); + + // Perform any post-deregistration cleanup tasks associated with the + // descriptor data. + ASIO_DECL void cleanup_descriptor_data( + per_descriptor_data& descriptor_data); + + // Add a new timer queue to the reactor. + template + void add_timer_queue(timer_queue& queue); + + // Remove a timer queue from the reactor. + template + void remove_timer_queue(timer_queue& queue); + + // Schedule a new operation in the given timer queue to expire at the + // specified absolute time. + template + void schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op); + + // Cancel the timer operations associated with the given token. Returns the + // number of operations that have been posted or dispatched. + template + std::size_t cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled = (std::numeric_limits::max)()); + + // Move the timer operations associated with the given timer. + template + void move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source); + + // Run the kqueue loop. + ASIO_DECL void run(long usec, op_queue& ops); + + // Interrupt the kqueue loop. + ASIO_DECL void interrupt(); + +private: + // Create the kqueue file descriptor. Throws an exception if the descriptor + // cannot be created. + ASIO_DECL static int do_kqueue_create(); + + // Allocate a new descriptor state object. + ASIO_DECL descriptor_state* allocate_descriptor_state(); + + // Free an existing descriptor state object. + ASIO_DECL void free_descriptor_state(descriptor_state* s); + + // Helper function to add a new timer queue. + ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); + + // Helper function to remove a timer queue. + ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); + + // Get the timeout value for the kevent call. + ASIO_DECL timespec* get_timeout(long usec, timespec& ts); + + // The scheduler used to post completions. + scheduler& scheduler_; + + // Mutex to protect access to internal data. + mutex mutex_; + + // The kqueue file descriptor. + int kqueue_fd_; + + // The interrupter is used to break a blocking kevent call. + select_interrupter interrupter_; + + // The timer queues. + timer_queue_set timer_queues_; + + // Whether the service has been shut down. + bool shutdown_; + + // Mutex to protect access to the registered descriptors. + mutex registered_descriptors_mutex_; + + // Keep track of all registered descriptors. + object_pool registered_descriptors_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/kqueue_reactor.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/kqueue_reactor.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_KQUEUE) + +#endif // ASIO_DETAIL_KQUEUE_REACTOR_HPP diff --git a/include/asio/include/asio/detail/limits.hpp b/include/asio/include/asio/detail/limits.hpp new file mode 100644 index 0000000..d32470d --- /dev/null +++ b/include/asio/include/asio/detail/limits.hpp @@ -0,0 +1,26 @@ +// +// detail/limits.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_LIMITS_HPP +#define ASIO_DETAIL_LIMITS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_LIMITS) +# include +#else // defined(ASIO_HAS_BOOST_LIMITS) +# include +#endif // defined(ASIO_HAS_BOOST_LIMITS) + +#endif // ASIO_DETAIL_LIMITS_HPP diff --git a/include/asio/include/asio/detail/local_free_on_block_exit.hpp b/include/asio/include/asio/detail/local_free_on_block_exit.hpp new file mode 100644 index 0000000..e6153f0 --- /dev/null +++ b/include/asio/include/asio/detail/local_free_on_block_exit.hpp @@ -0,0 +1,59 @@ +// +// detail/local_free_on_block_exit.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP +#define ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +#if !defined(ASIO_WINDOWS_APP) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class local_free_on_block_exit + : private noncopyable +{ +public: + // Constructor blocks all signals for the calling thread. + explicit local_free_on_block_exit(void* p) + : p_(p) + { + } + + // Destructor restores the previous signal mask. + ~local_free_on_block_exit() + { + ::LocalFree(p_); + } + +private: + void* p_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS_APP) +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#endif // ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP diff --git a/include/asio/include/asio/detail/macos_fenced_block.hpp b/include/asio/include/asio/detail/macos_fenced_block.hpp new file mode 100644 index 0000000..ee15752 --- /dev/null +++ b/include/asio/include/asio/detail/macos_fenced_block.hpp @@ -0,0 +1,62 @@ +// +// detail/macos_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP +#define ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(__MACH__) && defined(__APPLE__) + +#include +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class macos_fenced_block + : private noncopyable +{ +public: + enum half_t { half }; + enum full_t { full }; + + // Constructor for a half fenced block. + explicit macos_fenced_block(half_t) + { + } + + // Constructor for a full fenced block. + explicit macos_fenced_block(full_t) + { + OSMemoryBarrier(); + } + + // Destructor. + ~macos_fenced_block() + { + OSMemoryBarrier(); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(__MACH__) && defined(__APPLE__) + +#endif // ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/memory.hpp b/include/asio/include/asio/detail/memory.hpp new file mode 100644 index 0000000..7c59a5f --- /dev/null +++ b/include/asio/include/asio/detail/memory.hpp @@ -0,0 +1,73 @@ +// +// detail/memory.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_MEMORY_HPP +#define ASIO_DETAIL_MEMORY_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include + +#if !defined(ASIO_HAS_STD_SHARED_PTR) +# include +# include +# include +#endif // !defined(ASIO_HAS_STD_SHARED_PTR) + +#if !defined(ASIO_HAS_STD_ADDRESSOF) +# include +#endif // !defined(ASIO_HAS_STD_ADDRESSOF) + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_STD_SHARED_PTR) +using std::make_shared; +using std::shared_ptr; +using std::weak_ptr; +#else // defined(ASIO_HAS_STD_SHARED_PTR) +using boost::make_shared; +using boost::shared_ptr; +using boost::weak_ptr; +#endif // defined(ASIO_HAS_STD_SHARED_PTR) + +#if defined(ASIO_HAS_STD_ADDRESSOF) +using std::addressof; +#else // defined(ASIO_HAS_STD_ADDRESSOF) +using boost::addressof; +#endif // defined(ASIO_HAS_STD_ADDRESSOF) + +} // namespace detail + +#if defined(ASIO_HAS_CXX11_ALLOCATORS) +using std::allocator_arg_t; +# define ASIO_USES_ALLOCATOR(t) \ + namespace std { \ + template \ + struct uses_allocator : true_type {}; \ + } \ + /**/ +# define ASIO_REBIND_ALLOC(alloc, t) \ + typename std::allocator_traits::template rebind_alloc + /**/ +#else // defined(ASIO_HAS_CXX11_ALLOCATORS) +struct allocator_arg_t {}; +# define ASIO_USES_ALLOCATOR(t) +# define ASIO_REBIND_ALLOC(alloc, t) \ + typename alloc::template rebind::other + /**/ +#endif // defined(ASIO_HAS_CXX11_ALLOCATORS) + +} // namespace asio + +#endif // ASIO_DETAIL_MEMORY_HPP diff --git a/include/asio/include/asio/detail/mutex.hpp b/include/asio/include/asio/detail/mutex.hpp new file mode 100644 index 0000000..8eb4764 --- /dev/null +++ b/include/asio/include/asio/detail/mutex.hpp @@ -0,0 +1,48 @@ +// +// detail/mutex.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_MUTEX_HPP +#define ASIO_DETAIL_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) +# include "asio/detail/null_mutex.hpp" +#elif defined(ASIO_WINDOWS) +# include "asio/detail/win_mutex.hpp" +#elif defined(ASIO_HAS_PTHREADS) +# include "asio/detail/posix_mutex.hpp" +#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) +# include "asio/detail/std_mutex.hpp" +#else +# error Only Windows, POSIX and std::mutex are supported! +#endif + +namespace asio { +namespace detail { + +#if !defined(ASIO_HAS_THREADS) +typedef null_mutex mutex; +#elif defined(ASIO_WINDOWS) +typedef win_mutex mutex; +#elif defined(ASIO_HAS_PTHREADS) +typedef posix_mutex mutex; +#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) +typedef std_mutex mutex; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_MUTEX_HPP diff --git a/include/asio/include/asio/detail/non_const_lvalue.hpp b/include/asio/include/asio/detail/non_const_lvalue.hpp new file mode 100644 index 0000000..9a3979c --- /dev/null +++ b/include/asio/include/asio/detail/non_const_lvalue.hpp @@ -0,0 +1,54 @@ +// +// detail/non_const_lvalue.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NON_CONST_LVALUE_HPP +#define ASIO_DETAIL_NON_CONST_LVALUE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct non_const_lvalue +{ +#if defined(ASIO_HAS_MOVE) + explicit non_const_lvalue(T& t) + : value(static_cast::type>::value, + typename decay::type&, T&&>::type>(t)) + { + } + + typename conditional::type>::value, + typename decay::type&, typename decay::type>::type value; +#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + explicit non_const_lvalue(const typename decay::type& t) + : value(t) + { + } + + typename decay::type value; +#endif // defined(ASIO_HAS_MOVE) +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_NON_CONST_LVALUE_HPP diff --git a/include/asio/include/asio/detail/noncopyable.hpp b/include/asio/include/asio/detail/noncopyable.hpp new file mode 100644 index 0000000..c730cd1 --- /dev/null +++ b/include/asio/include/asio/detail/noncopyable.hpp @@ -0,0 +1,43 @@ +// +// detail/noncopyable.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NONCOPYABLE_HPP +#define ASIO_DETAIL_NONCOPYABLE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class noncopyable +{ +protected: + noncopyable() {} + ~noncopyable() {} +private: + noncopyable(const noncopyable&); + const noncopyable& operator=(const noncopyable&); +}; + +} // namespace detail + +using asio::detail::noncopyable; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_NONCOPYABLE_HPP diff --git a/include/asio/include/asio/detail/null_event.hpp b/include/asio/include/asio/detail/null_event.hpp new file mode 100644 index 0000000..6083f1e --- /dev/null +++ b/include/asio/include/asio/detail/null_event.hpp @@ -0,0 +1,106 @@ +// +// detail/null_event.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_EVENT_HPP +#define ASIO_DETAIL_NULL_EVENT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class null_event + : private noncopyable +{ +public: + // Constructor. + null_event() + { + } + + // Destructor. + ~null_event() + { + } + + // Signal the event. (Retained for backward compatibility.) + template + void signal(Lock&) + { + } + + // Signal all waiters. + template + void signal_all(Lock&) + { + } + + // Unlock the mutex and signal one waiter. + template + void unlock_and_signal_one(Lock&) + { + } + + // Unlock the mutex and signal one waiter who may destroy us. + template + void unlock_and_signal_one_for_destruction(Lock&) + { + } + + // If there's a waiter, unlock the mutex and signal it. + template + bool maybe_unlock_and_signal_one(Lock&) + { + return false; + } + + // Reset the event. + template + void clear(Lock&) + { + } + + // Wait for the event to become signalled. + template + void wait(Lock&) + { + do_wait(); + } + + // Timed wait for the event to become signalled. + template + bool wait_for_usec(Lock&, long usec) + { + do_wait_for_usec(usec); + return true; + } + +private: + ASIO_DECL static void do_wait(); + ASIO_DECL static void do_wait_for_usec(long usec); +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/null_event.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_NULL_EVENT_HPP diff --git a/include/asio/include/asio/detail/null_fenced_block.hpp b/include/asio/include/asio/detail/null_fenced_block.hpp new file mode 100644 index 0000000..a3e58d3 --- /dev/null +++ b/include/asio/include/asio/detail/null_fenced_block.hpp @@ -0,0 +1,47 @@ +// +// detail/null_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_FENCED_BLOCK_HPP +#define ASIO_DETAIL_NULL_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class null_fenced_block + : private noncopyable +{ +public: + enum half_or_full_t { half, full }; + + // Constructor. + explicit null_fenced_block(half_or_full_t) + { + } + + // Destructor. + ~null_fenced_block() + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_NULL_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/null_global.hpp b/include/asio/include/asio/detail/null_global.hpp new file mode 100644 index 0000000..e67f206 --- /dev/null +++ b/include/asio/include/asio/detail/null_global.hpp @@ -0,0 +1,59 @@ +// +// detail/null_global.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_GLOBAL_HPP +#define ASIO_DETAIL_NULL_GLOBAL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct null_global_impl +{ + null_global_impl() + : ptr_(0) + { + } + + // Destructor automatically cleans up the global. + ~null_global_impl() + { + delete ptr_; + } + + static null_global_impl instance_; + T* ptr_; +}; + +template +null_global_impl null_global_impl::instance_; + +template +T& null_global() +{ + if (null_global_impl::instance_.ptr_ == 0) + null_global_impl::instance_.ptr_ = new T; + return *null_global_impl::instance_.ptr_; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_NULL_GLOBAL_HPP diff --git a/include/asio/include/asio/detail/null_mutex.hpp b/include/asio/include/asio/detail/null_mutex.hpp new file mode 100644 index 0000000..25a8ed1 --- /dev/null +++ b/include/asio/include/asio/detail/null_mutex.hpp @@ -0,0 +1,64 @@ +// +// detail/null_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_MUTEX_HPP +#define ASIO_DETAIL_NULL_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class null_mutex + : private noncopyable +{ +public: + typedef asio::detail::scoped_lock scoped_lock; + + // Constructor. + null_mutex() + { + } + + // Destructor. + ~null_mutex() + { + } + + // Lock the mutex. + void lock() + { + } + + // Unlock the mutex. + void unlock() + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_THREADS) + +#endif // ASIO_DETAIL_NULL_MUTEX_HPP diff --git a/include/asio/include/asio/detail/null_reactor.hpp b/include/asio/include/asio/detail/null_reactor.hpp new file mode 100644 index 0000000..7c1da58 --- /dev/null +++ b/include/asio/include/asio/detail/null_reactor.hpp @@ -0,0 +1,68 @@ +// +// detail/null_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_REACTOR_HPP +#define ASIO_DETAIL_NULL_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/scheduler_operation.hpp" +#include "asio/execution_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class null_reactor + : public execution_context_service_base +{ +public: + // Constructor. + null_reactor(asio::execution_context& ctx) + : execution_context_service_base(ctx) + { + } + + // Destructor. + ~null_reactor() + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + } + + // No-op because should never be called. + void run(long /*usec*/, op_queue& /*ops*/) + { + } + + // No-op. + void interrupt() + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_NULL_REACTOR_HPP diff --git a/include/asio/include/asio/detail/null_signal_blocker.hpp b/include/asio/include/asio/detail/null_signal_blocker.hpp new file mode 100644 index 0000000..e9e7b3c --- /dev/null +++ b/include/asio/include/asio/detail/null_signal_blocker.hpp @@ -0,0 +1,69 @@ +// +// detail/null_signal_blocker.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_SIGNAL_BLOCKER_HPP +#define ASIO_DETAIL_NULL_SIGNAL_BLOCKER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) \ + || defined(ASIO_WINDOWS) \ + || defined(ASIO_WINDOWS_RUNTIME) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class null_signal_blocker + : private noncopyable +{ +public: + // Constructor blocks all signals for the calling thread. + null_signal_blocker() + { + } + + // Destructor restores the previous signal mask. + ~null_signal_blocker() + { + } + + // Block all signals for the calling thread. + void block() + { + } + + // Restore the previous signal mask. + void unblock() + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_THREADS) + // || defined(ASIO_WINDOWS) + // || defined(ASIO_WINDOWS_RUNTIME) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + +#endif // ASIO_DETAIL_NULL_SIGNAL_BLOCKER_HPP diff --git a/include/asio/include/asio/detail/null_socket_service.hpp b/include/asio/include/asio/detail/null_socket_service.hpp new file mode 100644 index 0000000..4f6f933 --- /dev/null +++ b/include/asio/include/asio/detail/null_socket_service.hpp @@ -0,0 +1,519 @@ +// +// detail/null_socket_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_SOCKET_SERVICE_HPP +#define ASIO_DETAIL_NULL_SOCKET_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/buffer.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/post.hpp" +#include "asio/socket_base.hpp" +#include "asio/detail/bind_handler.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class null_socket_service : + public execution_context_service_base > +{ +public: + // The protocol type. + typedef Protocol protocol_type; + + // The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + // The native type of a socket. + typedef int native_handle_type; + + // The implementation type of the socket. + struct implementation_type + { + }; + + // Constructor. + null_socket_service(execution_context& context) + : execution_context_service_base >(context) + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + } + + // Construct a new socket implementation. + void construct(implementation_type&) + { + } + + // Move-construct a new socket implementation. + void move_construct(implementation_type&, implementation_type&) + { + } + + // Move-assign from another socket implementation. + void move_assign(implementation_type&, + null_socket_service&, implementation_type&) + { + } + + // Move-construct a new socket implementation from another protocol type. + template + void converting_move_construct(implementation_type&, + null_socket_service&, + typename null_socket_service::implementation_type&) + { + } + + // Destroy a socket implementation. + void destroy(implementation_type&) + { + } + + // Open a new socket implementation. + asio::error_code open(implementation_type&, + const protocol_type&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Assign a native socket to a socket implementation. + asio::error_code assign(implementation_type&, const protocol_type&, + const native_handle_type&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Determine whether the socket is open. + bool is_open(const implementation_type&) const + { + return false; + } + + // Destroy a socket implementation. + asio::error_code close(implementation_type&, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Release ownership of the socket. + native_handle_type release(implementation_type&, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Get the native socket representation. + native_handle_type native_handle(implementation_type&) + { + return 0; + } + + // Cancel all operations associated with the socket. + asio::error_code cancel(implementation_type&, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Determine whether the socket is at the out-of-band data mark. + bool at_mark(const implementation_type&, + asio::error_code& ec) const + { + ec = asio::error::operation_not_supported; + return false; + } + + // Determine the number of bytes available for reading. + std::size_t available(const implementation_type&, + asio::error_code& ec) const + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Place the socket into the state where it will listen for new connections. + asio::error_code listen(implementation_type&, + int, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Perform an IO control command on the socket. + template + asio::error_code io_control(implementation_type&, + IO_Control_Command&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Gets the non-blocking mode of the socket. + bool non_blocking(const implementation_type&) const + { + return false; + } + + // Sets the non-blocking mode of the socket. + asio::error_code non_blocking(implementation_type&, + bool, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Gets the non-blocking mode of the native socket implementation. + bool native_non_blocking(const implementation_type&) const + { + return false; + } + + // Sets the non-blocking mode of the native socket implementation. + asio::error_code native_non_blocking(implementation_type&, + bool, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Disable sends or receives on the socket. + asio::error_code shutdown(implementation_type&, + socket_base::shutdown_type, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Bind the socket to the specified local endpoint. + asio::error_code bind(implementation_type&, + const endpoint_type&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Set a socket option. + template + asio::error_code set_option(implementation_type&, + const Option&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Set a socket option. + template + asio::error_code get_option(const implementation_type&, + Option&, asio::error_code& ec) const + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Get the local endpoint. + endpoint_type local_endpoint(const implementation_type&, + asio::error_code& ec) const + { + ec = asio::error::operation_not_supported; + return endpoint_type(); + } + + // Get the remote endpoint. + endpoint_type remote_endpoint(const implementation_type&, + asio::error_code& ec) const + { + ec = asio::error::operation_not_supported; + return endpoint_type(); + } + + // Send the given data to the peer. + template + std::size_t send(implementation_type&, const ConstBufferSequence&, + socket_base::message_flags, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Wait until data can be sent without blocking. + std::size_t send(implementation_type&, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Start an asynchronous send. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_send(implementation_type&, const ConstBufferSequence&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Start an asynchronous wait until data can be sent without blocking. + template + void async_send(implementation_type&, const null_buffers&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Receive some data from the peer. Returns the number of bytes received. + template + std::size_t receive(implementation_type&, const MutableBufferSequence&, + socket_base::message_flags, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Wait until data can be received without blocking. + std::size_t receive(implementation_type&, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received + // must be valid for the lifetime of the asynchronous operation. + template + void async_receive(implementation_type&, const MutableBufferSequence&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Wait until data can be received without blocking. + template + void async_receive(implementation_type&, const null_buffers&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Receive some data with associated flags. Returns the number of bytes + // received. + template + std::size_t receive_with_flags(implementation_type&, + const MutableBufferSequence&, socket_base::message_flags, + socket_base::message_flags&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Wait until data can be received without blocking. + std::size_t receive_with_flags(implementation_type&, + const null_buffers&, socket_base::message_flags, + socket_base::message_flags&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received + // must be valid for the lifetime of the asynchronous operation. + template + void async_receive_with_flags(implementation_type&, + const MutableBufferSequence&, socket_base::message_flags, + socket_base::message_flags&, Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Wait until data can be received without blocking. + template + void async_receive_with_flags(implementation_type&, const null_buffers&, + socket_base::message_flags, socket_base::message_flags&, + Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Send a datagram to the specified endpoint. Returns the number of bytes + // sent. + template + std::size_t send_to(implementation_type&, const ConstBufferSequence&, + const endpoint_type&, socket_base::message_flags, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Wait until data can be sent without blocking. + std::size_t send_to(implementation_type&, const null_buffers&, + const endpoint_type&, socket_base::message_flags, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Start an asynchronous send. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_send_to(implementation_type&, const ConstBufferSequence&, + const endpoint_type&, socket_base::message_flags, + Handler& handler) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Start an asynchronous wait until data can be sent without blocking. + template + void async_send_to(implementation_type&, const null_buffers&, + const endpoint_type&, socket_base::message_flags, + Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Receive a datagram with the endpoint of the sender. Returns the number of + // bytes received. + template + std::size_t receive_from(implementation_type&, const MutableBufferSequence&, + endpoint_type&, socket_base::message_flags, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Wait until data can be received without blocking. + std::size_t receive_from(implementation_type&, const null_buffers&, + endpoint_type&, socket_base::message_flags, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received and + // the sender_endpoint object must both be valid for the lifetime of the + // asynchronous operation. + template + void async_receive_from(implementation_type&, const MutableBufferSequence&, + endpoint_type&, socket_base::message_flags, Handler& handler, + const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Wait until data can be received without blocking. + template + void async_receive_from(implementation_type&, const null_buffers&, + endpoint_type&, socket_base::message_flags, Handler& handler, + const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, detail::bind_handler( + handler, ec, bytes_transferred)); + } + + // Accept a new connection. + template + asio::error_code accept(implementation_type&, + Socket&, endpoint_type*, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Start an asynchronous accept. The peer and peer_endpoint objects + // must be valid until the accept's handler is invoked. + template + void async_accept(implementation_type&, Socket&, endpoint_type*, + Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + asio::post(io_ex, detail::bind_handler(handler, ec)); + } + + // Connect the socket to the specified endpoint. + asio::error_code connect(implementation_type&, + const endpoint_type&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Start an asynchronous connect. + template + void async_connect(implementation_type&, const endpoint_type&, + Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + asio::post(io_ex, detail::bind_handler(handler, ec)); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_NULL_SOCKET_SERVICE_HPP diff --git a/include/asio/include/asio/detail/null_static_mutex.hpp b/include/asio/include/asio/detail/null_static_mutex.hpp new file mode 100644 index 0000000..495739e --- /dev/null +++ b/include/asio/include/asio/detail/null_static_mutex.hpp @@ -0,0 +1,60 @@ +// +// detail/null_static_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_STATIC_MUTEX_HPP +#define ASIO_DETAIL_NULL_STATIC_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) + +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct null_static_mutex +{ + typedef asio::detail::scoped_lock scoped_lock; + + // Initialise the mutex. + void init() + { + } + + // Lock the mutex. + void lock() + { + } + + // Unlock the mutex. + void unlock() + { + } + + int unused_; +}; + +#define ASIO_NULL_STATIC_MUTEX_INIT { 0 } + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_THREADS) + +#endif // ASIO_DETAIL_NULL_STATIC_MUTEX_HPP diff --git a/include/asio/include/asio/detail/null_thread.hpp b/include/asio/include/asio/detail/null_thread.hpp new file mode 100644 index 0000000..3b3c5b2 --- /dev/null +++ b/include/asio/include/asio/detail/null_thread.hpp @@ -0,0 +1,67 @@ +// +// detail/null_thread.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_THREAD_HPP +#define ASIO_DETAIL_NULL_THREAD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class null_thread + : private noncopyable +{ +public: + // Constructor. + template + null_thread(Function, unsigned int = 0) + { + asio::detail::throw_error( + asio::error::operation_not_supported, "thread"); + } + + // Destructor. + ~null_thread() + { + } + + // Wait for the thread to exit. + void join() + { + } + + // Get number of CPUs. + static std::size_t hardware_concurrency() + { + return 1; + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_THREADS) + +#endif // ASIO_DETAIL_NULL_THREAD_HPP diff --git a/include/asio/include/asio/detail/null_tss_ptr.hpp b/include/asio/include/asio/detail/null_tss_ptr.hpp new file mode 100644 index 0000000..5ac594b --- /dev/null +++ b/include/asio/include/asio/detail/null_tss_ptr.hpp @@ -0,0 +1,68 @@ +// +// detail/null_tss_ptr.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_NULL_TSS_PTR_HPP +#define ASIO_DETAIL_NULL_TSS_PTR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class null_tss_ptr + : private noncopyable +{ +public: + // Constructor. + null_tss_ptr() + : value_(0) + { + } + + // Destructor. + ~null_tss_ptr() + { + } + + // Get the value. + operator T*() const + { + return value_; + } + + // Set the value. + void operator=(T* value) + { + value_ = value; + } + +private: + T* value_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_THREADS) + +#endif // ASIO_DETAIL_NULL_TSS_PTR_HPP diff --git a/include/asio/include/asio/detail/object_pool.hpp b/include/asio/include/asio/detail/object_pool.hpp new file mode 100644 index 0000000..7b7dc29 --- /dev/null +++ b/include/asio/include/asio/detail/object_pool.hpp @@ -0,0 +1,171 @@ +// +// detail/object_pool.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_OBJECT_POOL_HPP +#define ASIO_DETAIL_OBJECT_POOL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class object_pool; + +class object_pool_access +{ +public: + template + static Object* create() + { + return new Object; + } + + template + static Object* create(Arg arg) + { + return new Object(arg); + } + + template + static void destroy(Object* o) + { + delete o; + } + + template + static Object*& next(Object* o) + { + return o->next_; + } + + template + static Object*& prev(Object* o) + { + return o->prev_; + } +}; + +template +class object_pool + : private noncopyable +{ +public: + // Constructor. + object_pool() + : live_list_(0), + free_list_(0) + { + } + + // Destructor destroys all objects. + ~object_pool() + { + destroy_list(live_list_); + destroy_list(free_list_); + } + + // Get the object at the start of the live list. + Object* first() + { + return live_list_; + } + + // Allocate a new object. + Object* alloc() + { + Object* o = free_list_; + if (o) + free_list_ = object_pool_access::next(free_list_); + else + o = object_pool_access::create(); + + object_pool_access::next(o) = live_list_; + object_pool_access::prev(o) = 0; + if (live_list_) + object_pool_access::prev(live_list_) = o; + live_list_ = o; + + return o; + } + + // Allocate a new object with an argument. + template + Object* alloc(Arg arg) + { + Object* o = free_list_; + if (o) + free_list_ = object_pool_access::next(free_list_); + else + o = object_pool_access::create(arg); + + object_pool_access::next(o) = live_list_; + object_pool_access::prev(o) = 0; + if (live_list_) + object_pool_access::prev(live_list_) = o; + live_list_ = o; + + return o; + } + + // Free an object. Moves it to the free list. No destructors are run. + void free(Object* o) + { + if (live_list_ == o) + live_list_ = object_pool_access::next(o); + + if (object_pool_access::prev(o)) + { + object_pool_access::next(object_pool_access::prev(o)) + = object_pool_access::next(o); + } + + if (object_pool_access::next(o)) + { + object_pool_access::prev(object_pool_access::next(o)) + = object_pool_access::prev(o); + } + + object_pool_access::next(o) = free_list_; + object_pool_access::prev(o) = 0; + free_list_ = o; + } + +private: + // Helper function to destroy all elements in a list. + void destroy_list(Object* list) + { + while (list) + { + Object* o = list; + list = object_pool_access::next(o); + object_pool_access::destroy(o); + } + } + + // The list of live objects. + Object* live_list_; + + // The free list. + Object* free_list_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_OBJECT_POOL_HPP diff --git a/include/asio/include/asio/detail/old_win_sdk_compat.hpp b/include/asio/include/asio/detail/old_win_sdk_compat.hpp new file mode 100644 index 0000000..b032871 --- /dev/null +++ b/include/asio/include/asio/detail/old_win_sdk_compat.hpp @@ -0,0 +1,214 @@ +// +// detail/old_win_sdk_compat.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP +#define ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +// Guess whether we are building against on old Platform SDK. +#if !defined(IN6ADDR_ANY_INIT) +#define ASIO_HAS_OLD_WIN_SDK 1 +#endif // !defined(IN6ADDR_ANY_INIT) + +#if defined(ASIO_HAS_OLD_WIN_SDK) + +// Emulation of types that are missing from old Platform SDKs. +// +// N.B. this emulation is also used if building for a Windows 2000 target with +// a recent (i.e. Vista or later) SDK, as the SDK does not provide IPv6 support +// in that case. + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +enum +{ + sockaddr_storage_maxsize = 128, // Maximum size. + sockaddr_storage_alignsize = (sizeof(__int64)), // Desired alignment. + sockaddr_storage_pad1size = (sockaddr_storage_alignsize - sizeof(short)), + sockaddr_storage_pad2size = (sockaddr_storage_maxsize - + (sizeof(short) + sockaddr_storage_pad1size + sockaddr_storage_alignsize)) +}; + +struct sockaddr_storage_emulation +{ + short ss_family; + char __ss_pad1[sockaddr_storage_pad1size]; + __int64 __ss_align; + char __ss_pad2[sockaddr_storage_pad2size]; +}; + +struct in6_addr_emulation +{ + union + { + u_char Byte[16]; + u_short Word[8]; + } u; +}; + +#if !defined(s6_addr) +# define _S6_un u +# define _S6_u8 Byte +# define s6_addr _S6_un._S6_u8 +#endif // !defined(s6_addr) + +struct sockaddr_in6_emulation +{ + short sin6_family; + u_short sin6_port; + u_long sin6_flowinfo; + in6_addr_emulation sin6_addr; + u_long sin6_scope_id; +}; + +struct ipv6_mreq_emulation +{ + in6_addr_emulation ipv6mr_multiaddr; + unsigned int ipv6mr_interface; +}; + +struct addrinfo_emulation +{ + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + size_t ai_addrlen; + char* ai_canonname; + sockaddr* ai_addr; + addrinfo_emulation* ai_next; +}; + +#if !defined(AI_PASSIVE) +# define AI_PASSIVE 0x1 +#endif + +#if !defined(AI_CANONNAME) +# define AI_CANONNAME 0x2 +#endif + +#if !defined(AI_NUMERICHOST) +# define AI_NUMERICHOST 0x4 +#endif + +#if !defined(EAI_AGAIN) +# define EAI_AGAIN WSATRY_AGAIN +#endif + +#if !defined(EAI_BADFLAGS) +# define EAI_BADFLAGS WSAEINVAL +#endif + +#if !defined(EAI_FAIL) +# define EAI_FAIL WSANO_RECOVERY +#endif + +#if !defined(EAI_FAMILY) +# define EAI_FAMILY WSAEAFNOSUPPORT +#endif + +#if !defined(EAI_MEMORY) +# define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY +#endif + +#if !defined(EAI_NODATA) +# define EAI_NODATA WSANO_DATA +#endif + +#if !defined(EAI_NONAME) +# define EAI_NONAME WSAHOST_NOT_FOUND +#endif + +#if !defined(EAI_SERVICE) +# define EAI_SERVICE WSATYPE_NOT_FOUND +#endif + +#if !defined(EAI_SOCKTYPE) +# define EAI_SOCKTYPE WSAESOCKTNOSUPPORT +#endif + +#if !defined(NI_NOFQDN) +# define NI_NOFQDN 0x01 +#endif + +#if !defined(NI_NUMERICHOST) +# define NI_NUMERICHOST 0x02 +#endif + +#if !defined(NI_NAMEREQD) +# define NI_NAMEREQD 0x04 +#endif + +#if !defined(NI_NUMERICSERV) +# define NI_NUMERICSERV 0x08 +#endif + +#if !defined(NI_DGRAM) +# define NI_DGRAM 0x10 +#endif + +#if !defined(IPPROTO_IPV6) +# define IPPROTO_IPV6 41 +#endif + +#if !defined(IPV6_UNICAST_HOPS) +# define IPV6_UNICAST_HOPS 4 +#endif + +#if !defined(IPV6_MULTICAST_IF) +# define IPV6_MULTICAST_IF 9 +#endif + +#if !defined(IPV6_MULTICAST_HOPS) +# define IPV6_MULTICAST_HOPS 10 +#endif + +#if !defined(IPV6_MULTICAST_LOOP) +# define IPV6_MULTICAST_LOOP 11 +#endif + +#if !defined(IPV6_JOIN_GROUP) +# define IPV6_JOIN_GROUP 12 +#endif + +#if !defined(IPV6_LEAVE_GROUP) +# define IPV6_LEAVE_GROUP 13 +#endif + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_OLD_WIN_SDK) + +// Even newer Platform SDKs that support IPv6 may not define IPV6_V6ONLY. +#if !defined(IPV6_V6ONLY) +# define IPV6_V6ONLY 27 +#endif + +// Some SDKs (e.g. Windows CE) don't define IPPROTO_ICMPV6. +#if !defined(IPPROTO_ICMPV6) +# define IPPROTO_ICMPV6 58 +#endif + +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#endif // ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP diff --git a/include/asio/include/asio/detail/op_queue.hpp b/include/asio/include/asio/detail/op_queue.hpp new file mode 100644 index 0000000..47a55d6 --- /dev/null +++ b/include/asio/include/asio/detail/op_queue.hpp @@ -0,0 +1,162 @@ +// +// detail/op_queue.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_OP_QUEUE_HPP +#define ASIO_DETAIL_OP_QUEUE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class op_queue; + +class op_queue_access +{ +public: + template + static Operation* next(Operation* o) + { + return static_cast(o->next_); + } + + template + static void next(Operation1*& o1, Operation2* o2) + { + o1->next_ = o2; + } + + template + static void destroy(Operation* o) + { + o->destroy(); + } + + template + static Operation*& front(op_queue& q) + { + return q.front_; + } + + template + static Operation*& back(op_queue& q) + { + return q.back_; + } +}; + +template +class op_queue + : private noncopyable +{ +public: + // Constructor. + op_queue() + : front_(0), + back_(0) + { + } + + // Destructor destroys all operations. + ~op_queue() + { + while (Operation* op = front_) + { + pop(); + op_queue_access::destroy(op); + } + } + + // Get the operation at the front of the queue. + Operation* front() + { + return front_; + } + + // Pop an operation from the front of the queue. + void pop() + { + if (front_) + { + Operation* tmp = front_; + front_ = op_queue_access::next(front_); + if (front_ == 0) + back_ = 0; + op_queue_access::next(tmp, static_cast(0)); + } + } + + // Push an operation on to the back of the queue. + void push(Operation* h) + { + op_queue_access::next(h, static_cast(0)); + if (back_) + { + op_queue_access::next(back_, h); + back_ = h; + } + else + { + front_ = back_ = h; + } + } + + // Push all operations from another queue on to the back of the queue. The + // source queue may contain operations of a derived type. + template + void push(op_queue& q) + { + if (Operation* other_front = op_queue_access::front(q)) + { + if (back_) + op_queue_access::next(back_, other_front); + else + front_ = other_front; + back_ = op_queue_access::back(q); + op_queue_access::front(q) = 0; + op_queue_access::back(q) = 0; + } + } + + // Whether the queue is empty. + bool empty() const + { + return front_ == 0; + } + + // Test whether an operation is already enqueued. + bool is_enqueued(Operation* o) const + { + return op_queue_access::next(o) != 0 || back_ == o; + } + +private: + friend class op_queue_access; + + // The front of the queue. + Operation* front_; + + // The back of the queue. + Operation* back_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_OP_QUEUE_HPP diff --git a/include/asio/include/asio/detail/operation.hpp b/include/asio/include/asio/detail/operation.hpp new file mode 100644 index 0000000..51d877e --- /dev/null +++ b/include/asio/include/asio/detail/operation.hpp @@ -0,0 +1,38 @@ +// +// detail/operation.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_OPERATION_HPP +#define ASIO_DETAIL_OPERATION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_operation.hpp" +#else +# include "asio/detail/scheduler_operation.hpp" +#endif + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_IOCP) +typedef win_iocp_operation operation; +#else +typedef scheduler_operation operation; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_OPERATION_HPP diff --git a/include/asio/include/asio/detail/pipe_select_interrupter.hpp b/include/asio/include/asio/detail/pipe_select_interrupter.hpp new file mode 100644 index 0000000..74077ef --- /dev/null +++ b/include/asio/include/asio/detail/pipe_select_interrupter.hpp @@ -0,0 +1,89 @@ +// +// detail/pipe_select_interrupter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP +#define ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) +#if !defined(ASIO_WINDOWS_RUNTIME) +#if !defined(__CYGWIN__) +#if !defined(__SYMBIAN32__) +#if !defined(ASIO_HAS_EVENTFD) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class pipe_select_interrupter +{ +public: + // Constructor. + ASIO_DECL pipe_select_interrupter(); + + // Destructor. + ASIO_DECL ~pipe_select_interrupter(); + + // Recreate the interrupter's descriptors. Used after a fork. + ASIO_DECL void recreate(); + + // Interrupt the select call. + ASIO_DECL void interrupt(); + + // Reset the select interrupter. Returns true if the reset was successful. + ASIO_DECL bool reset(); + + // Get the read descriptor to be passed to select. + int read_descriptor() const + { + return read_descriptor_; + } + +private: + // Open the descriptors. Throws on error. + ASIO_DECL void open_descriptors(); + + // Close the descriptors. + ASIO_DECL void close_descriptors(); + + // The read end of a connection used to interrupt the select call. This file + // descriptor is passed to select such that when it is time to stop, a single + // byte will be written on the other end of the connection and this + // descriptor will become readable. + int read_descriptor_; + + // The write end of a connection used to interrupt the select call. A single + // byte may be written to this to wake up the select which is waiting for the + // other end to become readable. + int write_descriptor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/pipe_select_interrupter.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // !defined(ASIO_HAS_EVENTFD) +#endif // !defined(__SYMBIAN32__) +#endif // !defined(__CYGWIN__) +#endif // !defined(ASIO_WINDOWS_RUNTIME) +#endif // !defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP diff --git a/include/asio/include/asio/detail/pop_options.hpp b/include/asio/include/asio/detail/pop_options.hpp new file mode 100644 index 0000000..f64300a --- /dev/null +++ b/include/asio/include/asio/detail/pop_options.hpp @@ -0,0 +1,141 @@ +// +// detail/pop_options.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +// No header guard + +#if defined(__COMO__) + +// Comeau C++ + +#elif defined(__DMC__) + +// Digital Mars C++ + +#elif defined(__INTEL_COMPILER) || defined(__ICL) \ + || defined(__ICC) || defined(__ECC) + +// Intel C++ + +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# if !defined(ASIO_DISABLE_VISIBILITY) +# pragma GCC visibility pop +# endif // !defined(ASIO_DISABLE_VISIBILITY) +# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) + +#elif defined(__clang__) + +// Clang + +# if defined(__OBJC__) +# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) +# if defined(ASIO_OBJC_WORKAROUND) +# undef Protocol +# undef id +# undef ASIO_OBJC_WORKAROUND +# endif +# endif +# endif + +# if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) +# if !defined(ASIO_DISABLE_VISIBILITY) +# pragma GCC visibility pop +# endif // !defined(ASIO_DISABLE_VISIBILITY) +# endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) + +# pragma GCC diagnostic pop + +#elif defined(__GNUC__) + +// GNU C++ + +# if defined(__MINGW32__) || defined(__CYGWIN__) +# pragma pack (pop) +# endif + +# if defined(__OBJC__) +# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) +# if defined(ASIO_OBJC_WORKAROUND) +# undef Protocol +# undef id +# undef ASIO_OBJC_WORKAROUND +# endif +# endif +# endif + +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# if !defined(ASIO_DISABLE_VISIBILITY) +# pragma GCC visibility pop +# endif // !defined(ASIO_DISABLE_VISIBILITY) +# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) + +# pragma GCC diagnostic pop + +#elif defined(__KCC) + +// Kai C++ + +#elif defined(__sgi) + +// SGI MIPSpro C++ + +#elif defined(__DECCXX) + +// Compaq Tru64 Unix cxx + +#elif defined(__ghs) + +// Greenhills C++ + +#elif defined(__BORLANDC__) && !defined(__clang__) + +// Borland C++ + +# pragma option pop +# pragma nopushoptwarn +# pragma nopackwarning + +#elif defined(__MWERKS__) + +// Metrowerks CodeWarrior + +#elif defined(__SUNPRO_CC) + +// Sun Workshop Compiler C++ + +#elif defined(__HP_aCC) + +// HP aCC + +#elif defined(__MRC__) || defined(__SC__) + +// MPW MrCpp or SCpp + +#elif defined(__IBMCPP__) + +// IBM Visual Age + +#elif defined(_MSC_VER) + +// Microsoft Visual C++ +// +// Must remain the last #elif since some other vendors (Metrowerks, for example) +// also #define _MSC_VER + +# pragma warning (pop) +# pragma pack (pop) + +# if defined(__cplusplus_cli) || defined(__cplusplus_winrt) +# if defined(ASIO_CLR_WORKAROUND) +# undef generic +# undef ASIO_CLR_WORKAROUND +# endif +# endif + +#endif diff --git a/include/asio/include/asio/detail/posix_event.hpp b/include/asio/include/asio/detail/posix_event.hpp new file mode 100644 index 0000000..b194977 --- /dev/null +++ b/include/asio/include/asio/detail/posix_event.hpp @@ -0,0 +1,175 @@ +// +// detail/posix_event.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_EVENT_HPP +#define ASIO_DETAIL_POSIX_EVENT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include +#include +#include "asio/detail/assert.hpp" +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class posix_event + : private noncopyable +{ +public: + // Constructor. + ASIO_DECL posix_event(); + + // Destructor. + ~posix_event() + { + ::pthread_cond_destroy(&cond_); + } + + // Signal the event. (Retained for backward compatibility.) + template + void signal(Lock& lock) + { + this->signal_all(lock); + } + + // Signal all waiters. + template + void signal_all(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + (void)lock; + state_ |= 1; + ::pthread_cond_broadcast(&cond_); // Ignore EINVAL. + } + + // Unlock the mutex and signal one waiter. + template + void unlock_and_signal_one(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + bool have_waiters = (state_ > 1); + lock.unlock(); + if (have_waiters) + ::pthread_cond_signal(&cond_); // Ignore EINVAL. + } + + // Unlock the mutex and signal one waiter who may destroy us. + template + void unlock_and_signal_one_for_destruction(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + bool have_waiters = (state_ > 1); + if (have_waiters) + ::pthread_cond_signal(&cond_); // Ignore EINVAL. + lock.unlock(); + } + + // If there's a waiter, unlock the mutex and signal it. + template + bool maybe_unlock_and_signal_one(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + if (state_ > 1) + { + lock.unlock(); + ::pthread_cond_signal(&cond_); // Ignore EINVAL. + return true; + } + return false; + } + + // Reset the event. + template + void clear(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + (void)lock; + state_ &= ~std::size_t(1); + } + + // Wait for the event to become signalled. + template + void wait(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + while ((state_ & 1) == 0) + { + state_ += 2; + ::pthread_cond_wait(&cond_, &lock.mutex().mutex_); // Ignore EINVAL. + state_ -= 2; + } + } + + // Timed wait for the event to become signalled. + template + bool wait_for_usec(Lock& lock, long usec) + { + ASIO_ASSERT(lock.locked()); + if ((state_ & 1) == 0) + { + state_ += 2; + timespec ts; +#if (defined(__MACH__) && defined(__APPLE__)) \ + || (defined(__ANDROID__) && (__ANDROID_API__ < 21) \ + && defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)) + ts.tv_sec = usec / 1000000; + ts.tv_nsec = (usec % 1000000) * 1000; + ::pthread_cond_timedwait_relative_np( + &cond_, &lock.mutex().mutex_, &ts); // Ignore EINVAL. +#else // (defined(__MACH__) && defined(__APPLE__)) + // || (defined(__ANDROID__) && (__ANDROID_API__ < 21) + // && defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)) + if (::clock_gettime(CLOCK_MONOTONIC, &ts) == 0) + { + ts.tv_sec += usec / 1000000; + ts.tv_nsec += (usec % 1000000) * 1000; + ts.tv_sec += ts.tv_nsec / 1000000000; + ts.tv_nsec = ts.tv_nsec % 1000000000; + ::pthread_cond_timedwait(&cond_, + &lock.mutex().mutex_, &ts); // Ignore EINVAL. + } +#endif // (defined(__MACH__) && defined(__APPLE__)) + // || (defined(__ANDROID__) && (__ANDROID_API__ < 21) + // && defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)) + state_ -= 2; + } + return (state_ & 1) != 0; + } + +private: + ::pthread_cond_t cond_; + std::size_t state_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/posix_event.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_POSIX_EVENT_HPP diff --git a/include/asio/include/asio/detail/posix_fd_set_adapter.hpp b/include/asio/include/asio/detail/posix_fd_set_adapter.hpp new file mode 100644 index 0000000..4e57de9 --- /dev/null +++ b/include/asio/include/asio/detail/posix_fd_set_adapter.hpp @@ -0,0 +1,118 @@ +// +// detail/posix_fd_set_adapter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP +#define ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) \ + && !defined(__CYGWIN__) \ + && !defined(ASIO_WINDOWS_RUNTIME) + +#include +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/reactor_op_queue.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Adapts the FD_SET type to meet the Descriptor_Set concept's requirements. +class posix_fd_set_adapter : noncopyable +{ +public: + posix_fd_set_adapter() + : max_descriptor_(invalid_socket) + { + using namespace std; // Needed for memset on Solaris. + FD_ZERO(&fd_set_); + } + + void reset() + { + using namespace std; // Needed for memset on Solaris. + FD_ZERO(&fd_set_); + } + + bool set(socket_type descriptor) + { + if (descriptor < (socket_type)FD_SETSIZE) + { + if (max_descriptor_ == invalid_socket || descriptor > max_descriptor_) + max_descriptor_ = descriptor; + FD_SET(descriptor, &fd_set_); + return true; + } + return false; + } + + void set(reactor_op_queue& operations, op_queue& ops) + { + reactor_op_queue::iterator i = operations.begin(); + while (i != operations.end()) + { + reactor_op_queue::iterator op_iter = i++; + if (!set(op_iter->first)) + { + asio::error_code ec(error::fd_set_failure); + operations.cancel_operations(op_iter, ops, ec); + } + } + } + + bool is_set(socket_type descriptor) const + { + return FD_ISSET(descriptor, &fd_set_) != 0; + } + + operator fd_set*() + { + return &fd_set_; + } + + socket_type max_descriptor() const + { + return max_descriptor_; + } + + void perform(reactor_op_queue& operations, + op_queue& ops) const + { + reactor_op_queue::iterator i = operations.begin(); + while (i != operations.end()) + { + reactor_op_queue::iterator op_iter = i++; + if (is_set(op_iter->first)) + operations.perform_operations(op_iter, ops); + } + } + +private: + mutable fd_set fd_set_; + socket_type max_descriptor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS) + // && !defined(__CYGWIN__) + // && !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP diff --git a/include/asio/include/asio/detail/posix_global.hpp b/include/asio/include/asio/detail/posix_global.hpp new file mode 100644 index 0000000..9f3a8d1 --- /dev/null +++ b/include/asio/include/asio/detail/posix_global.hpp @@ -0,0 +1,80 @@ +// +// detail/posix_global.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_GLOBAL_HPP +#define ASIO_DETAIL_POSIX_GLOBAL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include +#include + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct posix_global_impl +{ + // Helper function to perform initialisation. + static void do_init() + { + instance_.static_ptr_ = instance_.ptr_ = new T; + } + + // Destructor automatically cleans up the global. + ~posix_global_impl() + { + delete static_ptr_; + } + + static ::pthread_once_t init_once_; + static T* static_ptr_; + static posix_global_impl instance_; + T* ptr_; +}; + +template +::pthread_once_t posix_global_impl::init_once_ = PTHREAD_ONCE_INIT; + +template +T* posix_global_impl::static_ptr_ = 0; + +template +posix_global_impl posix_global_impl::instance_; + +template +T& posix_global() +{ + int result = ::pthread_once( + &posix_global_impl::init_once_, + &posix_global_impl::do_init); + + if (result != 0) + std::terminate(); + + return *posix_global_impl::instance_.ptr_; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_POSIX_GLOBAL_HPP diff --git a/include/asio/include/asio/detail/posix_mutex.hpp b/include/asio/include/asio/detail/posix_mutex.hpp new file mode 100644 index 0000000..293d467 --- /dev/null +++ b/include/asio/include/asio/detail/posix_mutex.hpp @@ -0,0 +1,76 @@ +// +// detail/posix_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_MUTEX_HPP +#define ASIO_DETAIL_POSIX_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class posix_event; + +class posix_mutex + : private noncopyable +{ +public: + typedef asio::detail::scoped_lock scoped_lock; + + // Constructor. + ASIO_DECL posix_mutex(); + + // Destructor. + ~posix_mutex() + { + ::pthread_mutex_destroy(&mutex_); // Ignore EBUSY. + } + + // Lock the mutex. + void lock() + { + (void)::pthread_mutex_lock(&mutex_); // Ignore EINVAL. + } + + // Unlock the mutex. + void unlock() + { + (void)::pthread_mutex_unlock(&mutex_); // Ignore EINVAL. + } + +private: + friend class posix_event; + ::pthread_mutex_t mutex_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/posix_mutex.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_POSIX_MUTEX_HPP diff --git a/include/asio/include/asio/detail/posix_signal_blocker.hpp b/include/asio/include/asio/detail/posix_signal_blocker.hpp new file mode 100644 index 0000000..08b89cb --- /dev/null +++ b/include/asio/include/asio/detail/posix_signal_blocker.hpp @@ -0,0 +1,85 @@ +// +// detail/posix_signal_blocker.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP +#define ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include +#include +#include +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class posix_signal_blocker + : private noncopyable +{ +public: + // Constructor blocks all signals for the calling thread. + posix_signal_blocker() + : blocked_(false) + { + sigset_t new_mask; + sigfillset(&new_mask); + blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0); + } + + // Destructor restores the previous signal mask. + ~posix_signal_blocker() + { + if (blocked_) + pthread_sigmask(SIG_SETMASK, &old_mask_, 0); + } + + // Block all signals for the calling thread. + void block() + { + if (!blocked_) + { + sigset_t new_mask; + sigfillset(&new_mask); + blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0); + } + } + + // Restore the previous signal mask. + void unblock() + { + if (blocked_) + blocked_ = (pthread_sigmask(SIG_SETMASK, &old_mask_, 0) != 0); + } + +private: + // Have signals been blocked. + bool blocked_; + + // The previous signal mask. + sigset_t old_mask_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP diff --git a/include/asio/include/asio/detail/posix_static_mutex.hpp b/include/asio/include/asio/detail/posix_static_mutex.hpp new file mode 100644 index 0000000..7784434 --- /dev/null +++ b/include/asio/include/asio/detail/posix_static_mutex.hpp @@ -0,0 +1,64 @@ +// +// detail/posix_static_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP +#define ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct posix_static_mutex +{ + typedef asio::detail::scoped_lock scoped_lock; + + // Initialise the mutex. + void init() + { + // Nothing to do. + } + + // Lock the mutex. + void lock() + { + (void)::pthread_mutex_lock(&mutex_); // Ignore EINVAL. + } + + // Unlock the mutex. + void unlock() + { + (void)::pthread_mutex_unlock(&mutex_); // Ignore EINVAL. + } + + ::pthread_mutex_t mutex_; +}; + +#define ASIO_POSIX_STATIC_MUTEX_INIT { PTHREAD_MUTEX_INITIALIZER } + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP diff --git a/include/asio/include/asio/detail/posix_thread.hpp b/include/asio/include/asio/detail/posix_thread.hpp new file mode 100644 index 0000000..7cd63df --- /dev/null +++ b/include/asio/include/asio/detail/posix_thread.hpp @@ -0,0 +1,109 @@ +// +// detail/posix_thread.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_THREAD_HPP +#define ASIO_DETAIL_POSIX_THREAD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include +#include +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +extern "C" +{ + ASIO_DECL void* asio_detail_posix_thread_function(void* arg); +} + +class posix_thread + : private noncopyable +{ +public: + // Constructor. + template + posix_thread(Function f, unsigned int = 0) + : joined_(false) + { + start_thread(new func(f)); + } + + // Destructor. + ASIO_DECL ~posix_thread(); + + // Wait for the thread to exit. + ASIO_DECL void join(); + + // Get number of CPUs. + ASIO_DECL static std::size_t hardware_concurrency(); + +private: + friend void* asio_detail_posix_thread_function(void* arg); + + class func_base + { + public: + virtual ~func_base() {} + virtual void run() = 0; + }; + + struct auto_func_base_ptr + { + func_base* ptr; + ~auto_func_base_ptr() { delete ptr; } + }; + + template + class func + : public func_base + { + public: + func(Function f) + : f_(f) + { + } + + virtual void run() + { + f_(); + } + + private: + Function f_; + }; + + ASIO_DECL void start_thread(func_base* arg); + + ::pthread_t thread_; + bool joined_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/posix_thread.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_POSIX_THREAD_HPP diff --git a/include/asio/include/asio/detail/posix_tss_ptr.hpp b/include/asio/include/asio/detail/posix_tss_ptr.hpp new file mode 100644 index 0000000..b4fa0d5 --- /dev/null +++ b/include/asio/include/asio/detail/posix_tss_ptr.hpp @@ -0,0 +1,79 @@ +// +// detail/posix_tss_ptr.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_POSIX_TSS_PTR_HPP +#define ASIO_DETAIL_POSIX_TSS_PTR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_PTHREADS) + +#include +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper function to create thread-specific storage. +ASIO_DECL void posix_tss_ptr_create(pthread_key_t& key); + +template +class posix_tss_ptr + : private noncopyable +{ +public: + // Constructor. + posix_tss_ptr() + { + posix_tss_ptr_create(tss_key_); + } + + // Destructor. + ~posix_tss_ptr() + { + ::pthread_key_delete(tss_key_); + } + + // Get the value. + operator T*() const + { + return static_cast(::pthread_getspecific(tss_key_)); + } + + // Set the value. + void operator=(T* value) + { + ::pthread_setspecific(tss_key_, value); + } + +private: + // Thread-specific storage to allow unlocked access to determine whether a + // thread is a member of the pool. + pthread_key_t tss_key_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/posix_tss_ptr.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_PTHREADS) + +#endif // ASIO_DETAIL_POSIX_TSS_PTR_HPP diff --git a/include/asio/include/asio/detail/push_options.hpp b/include/asio/include/asio/detail/push_options.hpp new file mode 100644 index 0000000..66e21dc --- /dev/null +++ b/include/asio/include/asio/detail/push_options.hpp @@ -0,0 +1,185 @@ +// +// detail/push_options.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +// No header guard + +#if defined(__COMO__) + +// Comeau C++ + +#elif defined(__DMC__) + +// Digital Mars C++ + +#elif defined(__INTEL_COMPILER) || defined(__ICL) \ + || defined(__ICC) || defined(__ECC) + +// Intel C++ + +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# if !defined(ASIO_DISABLE_VISIBILITY) +# pragma GCC visibility push (default) +# endif // !defined(ASIO_DISABLE_VISIBILITY) +# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) + +#elif defined(__clang__) + +// Clang + +# if defined(__OBJC__) +# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) +# if !defined(ASIO_DISABLE_OBJC_WORKAROUND) +# if !defined(Protocol) && !defined(id) +# define Protocol cpp_Protocol +# define id cpp_id +# define ASIO_OBJC_WORKAROUND +# endif +# endif +# endif +# endif + +# if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) +# if !defined(ASIO_DISABLE_VISIBILITY) +# pragma GCC visibility push (default) +# endif // !defined(ASIO_DISABLE_VISIBILITY) +# endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) + +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" + +#elif defined(__GNUC__) + +// GNU C++ + +# if defined(__MINGW32__) || defined(__CYGWIN__) +# pragma pack (push, 8) +# endif + +# if defined(__OBJC__) +# if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1) +# if !defined(ASIO_DISABLE_OBJC_WORKAROUND) +# if !defined(Protocol) && !defined(id) +# define Protocol cpp_Protocol +# define id cpp_id +# define ASIO_OBJC_WORKAROUND +# endif +# endif +# endif +# endif + +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# if !defined(ASIO_DISABLE_VISIBILITY) +# pragma GCC visibility push (default) +# endif // !defined(ASIO_DISABLE_VISIBILITY) +# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) + +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +# if (__GNUC__ >= 7) +# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +# endif // (__GNUC__ >= 7) + +#elif defined(__KCC) + +// Kai C++ + +#elif defined(__sgi) + +// SGI MIPSpro C++ + +#elif defined(__DECCXX) + +// Compaq Tru64 Unix cxx + +#elif defined(__ghs) + +// Greenhills C++ + +#elif defined(__BORLANDC__) && !defined(__clang__) + +// Borland C++ + +# pragma option push -a8 -b -Ve- -Vx- -w-inl -vi- +# pragma nopushoptwarn +# pragma nopackwarning +# if !defined(__MT__) +# error Multithreaded RTL must be selected. +# endif // !defined(__MT__) + +#elif defined(__MWERKS__) + +// Metrowerks CodeWarrior + +#elif defined(__SUNPRO_CC) + +// Sun Workshop Compiler C++ + +#elif defined(__HP_aCC) + +// HP aCC + +#elif defined(__MRC__) || defined(__SC__) + +// MPW MrCpp or SCpp + +#elif defined(__IBMCPP__) + +// IBM Visual Age + +#elif defined(_MSC_VER) + +// Microsoft Visual C++ +// +// Must remain the last #elif since some other vendors (Metrowerks, for example) +// also #define _MSC_VER + +# pragma warning (disable:4103) +# pragma warning (push) +# pragma warning (disable:4127) +# pragma warning (disable:4180) +# pragma warning (disable:4244) +# pragma warning (disable:4355) +# pragma warning (disable:4510) +# pragma warning (disable:4512) +# pragma warning (disable:4610) +# pragma warning (disable:4675) +# if (_MSC_VER < 1600) +// Visual Studio 2008 generates spurious warnings about unused parameters. +# pragma warning (disable:4100) +# endif // (_MSC_VER < 1600) +# if defined(_M_IX86) && defined(_Wp64) +// The /Wp64 option is broken. If you want to check 64 bit portability, use a +// 64 bit compiler! +# pragma warning (disable:4311) +# pragma warning (disable:4312) +# endif // defined(_M_IX86) && defined(_Wp64) +# pragma pack (push, 8) +// Note that if the /Og optimisation flag is enabled with MSVC6, the compiler +// has a tendency to incorrectly optimise away some calls to member template +// functions, even though those functions contain code that should not be +// optimised away! Therefore we will always disable this optimisation option +// for the MSVC6 compiler. +# if (_MSC_VER < 1300) +# pragma optimize ("g", off) +# endif +# if !defined(_MT) +# error Multithreaded RTL must be selected. +# endif // !defined(_MT) + +# if defined(__cplusplus_cli) || defined(__cplusplus_winrt) +# if !defined(ASIO_DISABLE_CLR_WORKAROUND) +# if !defined(generic) +# define generic cpp_generic +# define ASIO_CLR_WORKAROUND +# endif +# endif +# endif + +#endif diff --git a/include/asio/include/asio/detail/reactive_descriptor_service.hpp b/include/asio/include/asio/detail/reactive_descriptor_service.hpp new file mode 100644 index 0000000..11f0328 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_descriptor_service.hpp @@ -0,0 +1,416 @@ +// +// detail/reactive_descriptor_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP +#define ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + +#include "asio/buffer.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/descriptor_ops.hpp" +#include "asio/detail/descriptor_read_op.hpp" +#include "asio/detail/descriptor_write_op.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/reactive_null_buffers_op.hpp" +#include "asio/detail/reactive_wait_op.hpp" +#include "asio/detail/reactor.hpp" +#include "asio/posix/descriptor_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class reactive_descriptor_service : + public execution_context_service_base +{ +public: + // The native type of a descriptor. + typedef int native_handle_type; + + // The implementation type of the descriptor. + class implementation_type + : private asio::detail::noncopyable + { + public: + // Default constructor. + implementation_type() + : descriptor_(-1), + state_(0) + { + } + + private: + // Only this service will have access to the internal values. + friend class reactive_descriptor_service; + + // The native descriptor representation. + int descriptor_; + + // The current state of the descriptor. + descriptor_ops::state_type state_; + + // Per-descriptor data used by the reactor. + reactor::per_descriptor_data reactor_data_; + }; + + // Constructor. + ASIO_DECL reactive_descriptor_service(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Construct a new descriptor implementation. + ASIO_DECL void construct(implementation_type& impl); + + // Move-construct a new descriptor implementation. + ASIO_DECL void move_construct(implementation_type& impl, + implementation_type& other_impl) ASIO_NOEXCEPT; + + // Move-assign from another descriptor implementation. + ASIO_DECL void move_assign(implementation_type& impl, + reactive_descriptor_service& other_service, + implementation_type& other_impl); + + // Destroy a descriptor implementation. + ASIO_DECL void destroy(implementation_type& impl); + + // Assign a native descriptor to a descriptor implementation. + ASIO_DECL asio::error_code assign(implementation_type& impl, + const native_handle_type& native_descriptor, + asio::error_code& ec); + + // Determine whether the descriptor is open. + bool is_open(const implementation_type& impl) const + { + return impl.descriptor_ != -1; + } + + // Destroy a descriptor implementation. + ASIO_DECL asio::error_code close(implementation_type& impl, + asio::error_code& ec); + + // Get the native descriptor representation. + native_handle_type native_handle(const implementation_type& impl) const + { + return impl.descriptor_; + } + + // Release ownership of the native descriptor representation. + ASIO_DECL native_handle_type release(implementation_type& impl); + + // Cancel all operations associated with the descriptor. + ASIO_DECL asio::error_code cancel(implementation_type& impl, + asio::error_code& ec); + + // Perform an IO control command on the descriptor. + template + asio::error_code io_control(implementation_type& impl, + IO_Control_Command& command, asio::error_code& ec) + { + descriptor_ops::ioctl(impl.descriptor_, impl.state_, + command.name(), static_cast(command.data()), ec); + return ec; + } + + // Gets the non-blocking mode of the descriptor. + bool non_blocking(const implementation_type& impl) const + { + return (impl.state_ & descriptor_ops::user_set_non_blocking) != 0; + } + + // Sets the non-blocking mode of the descriptor. + asio::error_code non_blocking(implementation_type& impl, + bool mode, asio::error_code& ec) + { + descriptor_ops::set_user_non_blocking( + impl.descriptor_, impl.state_, mode, ec); + return ec; + } + + // Gets the non-blocking mode of the native descriptor implementation. + bool native_non_blocking(const implementation_type& impl) const + { + return (impl.state_ & descriptor_ops::internal_non_blocking) != 0; + } + + // Sets the non-blocking mode of the native descriptor implementation. + asio::error_code native_non_blocking(implementation_type& impl, + bool mode, asio::error_code& ec) + { + descriptor_ops::set_internal_non_blocking( + impl.descriptor_, impl.state_, mode, ec); + return ec; + } + + // Wait for the descriptor to become ready to read, ready to write, or to have + // pending error conditions. + asio::error_code wait(implementation_type& impl, + posix::descriptor_base::wait_type w, asio::error_code& ec) + { + switch (w) + { + case posix::descriptor_base::wait_read: + descriptor_ops::poll_read(impl.descriptor_, impl.state_, ec); + break; + case posix::descriptor_base::wait_write: + descriptor_ops::poll_write(impl.descriptor_, impl.state_, ec); + break; + case posix::descriptor_base::wait_error: + descriptor_ops::poll_error(impl.descriptor_, impl.state_, ec); + break; + default: + ec = asio::error::invalid_argument; + break; + } + + return ec; + } + + // Asynchronously wait for the descriptor to become ready to read, ready to + // write, or to have pending error conditions. + template + void async_wait(implementation_type& impl, + posix::descriptor_base::wait_type w, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_wait_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", + &impl, impl.descriptor_, "async_wait")); + + int op_type; + switch (w) + { + case posix::descriptor_base::wait_read: + op_type = reactor::read_op; + break; + case posix::descriptor_base::wait_write: + op_type = reactor::write_op; + break; + case posix::descriptor_base::wait_error: + op_type = reactor::except_op; + break; + default: + p.p->ec_ = asio::error::invalid_argument; + reactor_.post_immediate_completion(p.p, is_continuation); + p.v = p.p = 0; + return; + } + + start_op(impl, op_type, p.p, is_continuation, false, false); + p.v = p.p = 0; + } + + // Write some data to the descriptor. + template + size_t write_some(implementation_type& impl, + const ConstBufferSequence& buffers, asio::error_code& ec) + { + typedef buffer_sequence_adapter bufs_type; + + if (bufs_type::is_single_buffer) + { + return descriptor_ops::sync_write1(impl.descriptor_, + impl.state_, bufs_type::first(buffers).data(), + bufs_type::first(buffers).size(), ec); + } + else + { + bufs_type bufs(buffers); + + return descriptor_ops::sync_write(impl.descriptor_, impl.state_, + bufs.buffers(), bufs.count(), bufs.all_empty(), ec); + } + } + + // Wait until data can be written without blocking. + size_t write_some(implementation_type& impl, + const null_buffers&, asio::error_code& ec) + { + // Wait for descriptor to become ready. + descriptor_ops::poll_write(impl.descriptor_, impl.state_, ec); + + return 0; + } + + // Start an asynchronous write. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_write_some(implementation_type& impl, + const ConstBufferSequence& buffers, Handler& handler, + const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef descriptor_write_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.descriptor_, buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", + &impl, impl.descriptor_, "async_write_some")); + + start_op(impl, reactor::write_op, p.p, is_continuation, true, + buffer_sequence_adapter::all_empty(buffers)); + p.v = p.p = 0; + } + + // Start an asynchronous wait until data can be written without blocking. + template + void async_write_some(implementation_type& impl, + const null_buffers&, Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", + &impl, impl.descriptor_, "async_write_some(null_buffers)")); + + start_op(impl, reactor::write_op, p.p, is_continuation, false, false); + p.v = p.p = 0; + } + + // Read some data from the stream. Returns the number of bytes read. + template + size_t read_some(implementation_type& impl, + const MutableBufferSequence& buffers, asio::error_code& ec) + { + typedef buffer_sequence_adapter bufs_type; + + if (bufs_type::is_single_buffer) + { + return descriptor_ops::sync_read1(impl.descriptor_, + impl.state_, bufs_type::first(buffers).data(), + bufs_type::first(buffers).size(), ec); + } + else + { + bufs_type bufs(buffers); + + return descriptor_ops::sync_read(impl.descriptor_, impl.state_, + bufs.buffers(), bufs.count(), bufs.all_empty(), ec); + } + } + + // Wait until data can be read without blocking. + size_t read_some(implementation_type& impl, + const null_buffers&, asio::error_code& ec) + { + // Wait for descriptor to become ready. + descriptor_ops::poll_read(impl.descriptor_, impl.state_, ec); + + return 0; + } + + // Start an asynchronous read. The buffer for the data being read must be + // valid for the lifetime of the asynchronous operation. + template + void async_read_some(implementation_type& impl, + const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef descriptor_read_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.descriptor_, buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", + &impl, impl.descriptor_, "async_read_some")); + + start_op(impl, reactor::read_op, p.p, is_continuation, true, + buffer_sequence_adapter::all_empty(buffers)); + p.v = p.p = 0; + } + + // Wait until data can be read without blocking. + template + void async_read_some(implementation_type& impl, + const null_buffers&, Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor", + &impl, impl.descriptor_, "async_read_some(null_buffers)")); + + start_op(impl, reactor::read_op, p.p, is_continuation, false, false); + p.v = p.p = 0; + } + +private: + // Start the asynchronous operation. + ASIO_DECL void start_op(implementation_type& impl, int op_type, + reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop); + + // The selector that performs event demultiplexing for the service. + reactor& reactor_; + + // Cached success value to avoid accessing category singleton. + const asio::error_code success_ec_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/reactive_descriptor_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + +#endif // ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP diff --git a/include/asio/include/asio/detail/reactive_null_buffers_op.hpp b/include/asio/include/asio/detail/reactive_null_buffers_op.hpp new file mode 100644 index 0000000..190fafa --- /dev/null +++ b/include/asio/include/asio/detail/reactive_null_buffers_op.hpp @@ -0,0 +1,98 @@ +// +// detail/reactive_null_buffers_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_NULL_BUFFERS_OP_HPP +#define ASIO_DETAIL_REACTIVE_NULL_BUFFERS_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_null_buffers_op : public reactor_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_null_buffers_op); + + reactive_null_buffers_op(const asio::error_code& success_ec, + Handler& handler, const IoExecutor& io_ex) + : reactor_op(success_ec, &reactive_null_buffers_op::do_perform, + &reactive_null_buffers_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static status do_perform(reactor_op*) + { + return done; + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_null_buffers_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_NULL_BUFFERS_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_serial_port_service.hpp b/include/asio/include/asio/detail/reactive_serial_port_service.hpp new file mode 100644 index 0000000..f8af411 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_serial_port_service.hpp @@ -0,0 +1,237 @@ +// +// detail/reactive_serial_port_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP +#define ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_SERIAL_PORT) +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#include +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/serial_port_base.hpp" +#include "asio/detail/descriptor_ops.hpp" +#include "asio/detail/reactive_descriptor_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Extend reactive_descriptor_service to provide serial port support. +class reactive_serial_port_service : + public execution_context_service_base +{ +public: + // The native type of a serial port. + typedef reactive_descriptor_service::native_handle_type native_handle_type; + + // The implementation type of the serial port. + typedef reactive_descriptor_service::implementation_type implementation_type; + + ASIO_DECL reactive_serial_port_service(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Construct a new serial port implementation. + void construct(implementation_type& impl) + { + descriptor_service_.construct(impl); + } + + // Move-construct a new serial port implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) + { + descriptor_service_.move_construct(impl, other_impl); + } + + // Move-assign from another serial port implementation. + void move_assign(implementation_type& impl, + reactive_serial_port_service& other_service, + implementation_type& other_impl) + { + descriptor_service_.move_assign(impl, + other_service.descriptor_service_, other_impl); + } + + // Destroy a serial port implementation. + void destroy(implementation_type& impl) + { + descriptor_service_.destroy(impl); + } + + // Open the serial port using the specified device name. + ASIO_DECL asio::error_code open(implementation_type& impl, + const std::string& device, asio::error_code& ec); + + // Assign a native descriptor to a serial port implementation. + asio::error_code assign(implementation_type& impl, + const native_handle_type& native_descriptor, + asio::error_code& ec) + { + return descriptor_service_.assign(impl, native_descriptor, ec); + } + + // Determine whether the serial port is open. + bool is_open(const implementation_type& impl) const + { + return descriptor_service_.is_open(impl); + } + + // Destroy a serial port implementation. + asio::error_code close(implementation_type& impl, + asio::error_code& ec) + { + return descriptor_service_.close(impl, ec); + } + + // Get the native serial port representation. + native_handle_type native_handle(implementation_type& impl) + { + return descriptor_service_.native_handle(impl); + } + + // Cancel all operations associated with the serial port. + asio::error_code cancel(implementation_type& impl, + asio::error_code& ec) + { + return descriptor_service_.cancel(impl, ec); + } + + // Set an option on the serial port. + template + asio::error_code set_option(implementation_type& impl, + const SettableSerialPortOption& option, asio::error_code& ec) + { + return do_set_option(impl, + &reactive_serial_port_service::store_option, + &option, ec); + } + + // Get an option from the serial port. + template + asio::error_code get_option(const implementation_type& impl, + GettableSerialPortOption& option, asio::error_code& ec) const + { + return do_get_option(impl, + &reactive_serial_port_service::load_option, + &option, ec); + } + + // Send a break sequence to the serial port. + asio::error_code send_break(implementation_type& impl, + asio::error_code& ec) + { + int result = ::tcsendbreak(descriptor_service_.native_handle(impl), 0); + descriptor_ops::get_last_error(ec, result < 0); + return ec; + } + + // Write the given data. Returns the number of bytes sent. + template + size_t write_some(implementation_type& impl, + const ConstBufferSequence& buffers, asio::error_code& ec) + { + return descriptor_service_.write_some(impl, buffers, ec); + } + + // Start an asynchronous write. The data being written must be valid for the + // lifetime of the asynchronous operation. + template + void async_write_some(implementation_type& impl, + const ConstBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + descriptor_service_.async_write_some(impl, buffers, handler, io_ex); + } + + // Read some data. Returns the number of bytes received. + template + size_t read_some(implementation_type& impl, + const MutableBufferSequence& buffers, asio::error_code& ec) + { + return descriptor_service_.read_some(impl, buffers, ec); + } + + // Start an asynchronous read. The buffer for the data being received must be + // valid for the lifetime of the asynchronous operation. + template + void async_read_some(implementation_type& impl, + const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + descriptor_service_.async_read_some(impl, buffers, handler, io_ex); + } + +private: + // Function pointer type for storing a serial port option. + typedef asio::error_code (*store_function_type)( + const void*, termios&, asio::error_code&); + + // Helper function template to store a serial port option. + template + static asio::error_code store_option(const void* option, + termios& storage, asio::error_code& ec) + { + static_cast(option)->store(storage, ec); + return ec; + } + + // Helper function to set a serial port option. + ASIO_DECL asio::error_code do_set_option( + implementation_type& impl, store_function_type store, + const void* option, asio::error_code& ec); + + // Function pointer type for loading a serial port option. + typedef asio::error_code (*load_function_type)( + void*, const termios&, asio::error_code&); + + // Helper function template to load a serial port option. + template + static asio::error_code load_option(void* option, + const termios& storage, asio::error_code& ec) + { + static_cast(option)->load(storage, ec); + return ec; + } + + // Helper function to get a serial port option. + ASIO_DECL asio::error_code do_get_option( + const implementation_type& impl, load_function_type load, + void* option, asio::error_code& ec) const; + + // The implementation used for initiating asynchronous operations. + reactive_descriptor_service descriptor_service_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/reactive_serial_port_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) +#endif // defined(ASIO_HAS_SERIAL_PORT) + +#endif // ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_accept_op.hpp b/include/asio/include/asio/detail/reactive_socket_accept_op.hpp new file mode 100644 index 0000000..0bd9279 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_accept_op.hpp @@ -0,0 +1,242 @@ +// +// detail/reactive_socket_accept_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_holder.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_socket_accept_op_base : public reactor_op +{ +public: + reactive_socket_accept_op_base(const asio::error_code& success_ec, + socket_type socket, socket_ops::state_type state, Socket& peer, + const Protocol& protocol, typename Protocol::endpoint* peer_endpoint, + func_type complete_func) + : reactor_op(success_ec, + &reactive_socket_accept_op_base::do_perform, complete_func), + socket_(socket), + state_(state), + peer_(peer), + protocol_(protocol), + peer_endpoint_(peer_endpoint), + addrlen_(peer_endpoint ? peer_endpoint->capacity() : 0) + { + } + + static status do_perform(reactor_op* base) + { + reactive_socket_accept_op_base* o( + static_cast(base)); + + socket_type new_socket = invalid_socket; + status result = socket_ops::non_blocking_accept(o->socket_, + o->state_, o->peer_endpoint_ ? o->peer_endpoint_->data() : 0, + o->peer_endpoint_ ? &o->addrlen_ : 0, o->ec_, new_socket) + ? done : not_done; + o->new_socket_.reset(new_socket); + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_accept", o->ec_)); + + return result; + } + + void do_assign() + { + if (new_socket_.get() != invalid_socket) + { + if (peer_endpoint_) + peer_endpoint_->resize(addrlen_); + peer_.assign(protocol_, new_socket_.get(), ec_); + if (!ec_) + new_socket_.release(); + } + } + +private: + socket_type socket_; + socket_ops::state_type state_; + socket_holder new_socket_; + Socket& peer_; + Protocol protocol_; + typename Protocol::endpoint* peer_endpoint_; + std::size_t addrlen_; +}; + +template +class reactive_socket_accept_op : + public reactive_socket_accept_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_accept_op); + + reactive_socket_accept_op(const asio::error_code& success_ec, + socket_type socket, socket_ops::state_type state, Socket& peer, + const Protocol& protocol, typename Protocol::endpoint* peer_endpoint, + Handler& handler, const IoExecutor& io_ex) + : reactive_socket_accept_op_base( + success_ec, socket, state, peer, protocol, peer_endpoint, + &reactive_socket_accept_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_accept_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + // On success, assign new connection to peer socket object. + if (owner) + o->do_assign(); + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(o->handler_, o->ec_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +#if defined(ASIO_HAS_MOVE) + +template +class reactive_socket_move_accept_op : + private Protocol::socket::template rebind_executor::other, + public reactive_socket_accept_op_base< + typename Protocol::socket::template rebind_executor::other, + Protocol> +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_move_accept_op); + + reactive_socket_move_accept_op(const asio::error_code& success_ec, + const PeerIoExecutor& peer_io_ex, socket_type socket, + socket_ops::state_type state, const Protocol& protocol, + typename Protocol::endpoint* peer_endpoint, Handler& handler, + const IoExecutor& io_ex) + : peer_socket_type(peer_io_ex), + reactive_socket_accept_op_base( + success_ec, socket, state, *this, protocol, peer_endpoint, + &reactive_socket_move_accept_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_move_accept_op* o( + static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + // On success, assign new connection to peer socket object. + if (owner) + o->do_assign(); + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::move_binder2 + handler(0, ASIO_MOVE_CAST(Handler)(o->handler_), o->ec_, + ASIO_MOVE_CAST(peer_socket_type)(*o)); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + typedef typename Protocol::socket::template + rebind_executor::other peer_socket_type; + + Handler handler_; + handler_work work_; +}; + +#endif // defined(ASIO_HAS_MOVE) + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_connect_op.hpp b/include/asio/include/asio/detail/reactive_socket_connect_op.hpp new file mode 100644 index 0000000..14f0110 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_connect_op.hpp @@ -0,0 +1,123 @@ +// +// detail/reactive_socket_connect_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_CONNECT_OP_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_CONNECT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class reactive_socket_connect_op_base : public reactor_op +{ +public: + reactive_socket_connect_op_base(const asio::error_code& success_ec, + socket_type socket, func_type complete_func) + : reactor_op(success_ec, + &reactive_socket_connect_op_base::do_perform, complete_func), + socket_(socket) + { + } + + static status do_perform(reactor_op* base) + { + reactive_socket_connect_op_base* o( + static_cast(base)); + + status result = socket_ops::non_blocking_connect( + o->socket_, o->ec_) ? done : not_done; + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_connect", o->ec_)); + + return result; + } + +private: + socket_type socket_; +}; + +template +class reactive_socket_connect_op : public reactive_socket_connect_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_connect_op); + + reactive_socket_connect_op(const asio::error_code& success_ec, + socket_type socket, Handler& handler, const IoExecutor& io_ex) + : reactive_socket_connect_op_base(success_ec, socket, + &reactive_socket_connect_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_connect_op* o + (static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(o->handler_, o->ec_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_CONNECT_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_recv_op.hpp b/include/asio/include/asio/detail/reactive_socket_recv_op.hpp new file mode 100644 index 0000000..b3af2c4 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_recv_op.hpp @@ -0,0 +1,159 @@ +// +// detail/reactive_socket_recv_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_socket_recv_op_base : public reactor_op +{ +public: + reactive_socket_recv_op_base(const asio::error_code& success_ec, + socket_type socket, socket_ops::state_type state, + const MutableBufferSequence& buffers, + socket_base::message_flags flags, func_type complete_func) + : reactor_op(success_ec, + &reactive_socket_recv_op_base::do_perform, complete_func), + socket_(socket), + state_(state), + buffers_(buffers), + flags_(flags) + { + } + + static status do_perform(reactor_op* base) + { + reactive_socket_recv_op_base* o( + static_cast(base)); + + typedef buffer_sequence_adapter bufs_type; + + status result; + if (bufs_type::is_single_buffer) + { + result = socket_ops::non_blocking_recv1(o->socket_, + bufs_type::first(o->buffers_).data(), + bufs_type::first(o->buffers_).size(), o->flags_, + (o->state_ & socket_ops::stream_oriented) != 0, + o->ec_, o->bytes_transferred_) ? done : not_done; + } + else + { + bufs_type bufs(o->buffers_); + result = socket_ops::non_blocking_recv(o->socket_, + bufs.buffers(), bufs.count(), o->flags_, + (o->state_ & socket_ops::stream_oriented) != 0, + o->ec_, o->bytes_transferred_) ? done : not_done; + } + + if (result == done) + if ((o->state_ & socket_ops::stream_oriented) != 0) + if (o->bytes_transferred_ == 0) + result = done_and_exhausted; + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recv", + o->ec_, o->bytes_transferred_)); + + return result; + } + +private: + socket_type socket_; + socket_ops::state_type state_; + MutableBufferSequence buffers_; + socket_base::message_flags flags_; +}; + +template +class reactive_socket_recv_op : + public reactive_socket_recv_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_recv_op); + + reactive_socket_recv_op(const asio::error_code& success_ec, + socket_type socket, socket_ops::state_type state, + const MutableBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + : reactive_socket_recv_op_base(success_ec, socket, + state, buffers, flags, &reactive_socket_recv_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_recv_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp b/include/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp new file mode 100644 index 0000000..f45bb2c --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp @@ -0,0 +1,164 @@ +// +// detail/reactive_socket_recvfrom_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_socket_recvfrom_op_base : public reactor_op +{ +public: + reactive_socket_recvfrom_op_base(const asio::error_code& success_ec, + socket_type socket, int protocol_type, + const MutableBufferSequence& buffers, Endpoint& endpoint, + socket_base::message_flags flags, func_type complete_func) + : reactor_op(success_ec, + &reactive_socket_recvfrom_op_base::do_perform, complete_func), + socket_(socket), + protocol_type_(protocol_type), + buffers_(buffers), + sender_endpoint_(endpoint), + flags_(flags) + { + } + + static status do_perform(reactor_op* base) + { + reactive_socket_recvfrom_op_base* o( + static_cast(base)); + + typedef buffer_sequence_adapter bufs_type; + + std::size_t addr_len = o->sender_endpoint_.capacity(); + status result; + if (bufs_type::is_single_buffer) + { + result = socket_ops::non_blocking_recvfrom1( + o->socket_, bufs_type::first(o->buffers_).data(), + bufs_type::first(o->buffers_).size(), o->flags_, + o->sender_endpoint_.data(), &addr_len, + o->ec_, o->bytes_transferred_) ? done : not_done; + } + else + { + bufs_type bufs(o->buffers_); + result = socket_ops::non_blocking_recvfrom(o->socket_, + bufs.buffers(), bufs.count(), o->flags_, + o->sender_endpoint_.data(), &addr_len, + o->ec_, o->bytes_transferred_) ? done : not_done; + } + + if (result && !o->ec_) + o->sender_endpoint_.resize(addr_len); + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvfrom", + o->ec_, o->bytes_transferred_)); + + return result; + } + +private: + socket_type socket_; + int protocol_type_; + MutableBufferSequence buffers_; + Endpoint& sender_endpoint_; + socket_base::message_flags flags_; +}; + +template +class reactive_socket_recvfrom_op : + public reactive_socket_recvfrom_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvfrom_op); + + reactive_socket_recvfrom_op(const asio::error_code& success_ec, + socket_type socket, int protocol_type, + const MutableBufferSequence& buffers, Endpoint& endpoint, + socket_base::message_flags flags, Handler& handler, + const IoExecutor& io_ex) + : reactive_socket_recvfrom_op_base( + success_ec, socket, protocol_type, buffers, endpoint, flags, + &reactive_socket_recvfrom_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_recvfrom_op* o( + static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp b/include/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp new file mode 100644 index 0000000..ca49b6b --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp @@ -0,0 +1,145 @@ +// +// detail/reactive_socket_recvmsg_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/socket_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_socket_recvmsg_op_base : public reactor_op +{ +public: + reactive_socket_recvmsg_op_base(const asio::error_code& success_ec, + socket_type socket, const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, func_type complete_func) + : reactor_op(success_ec, + &reactive_socket_recvmsg_op_base::do_perform, complete_func), + socket_(socket), + buffers_(buffers), + in_flags_(in_flags), + out_flags_(out_flags) + { + } + + static status do_perform(reactor_op* base) + { + reactive_socket_recvmsg_op_base* o( + static_cast(base)); + + buffer_sequence_adapter bufs(o->buffers_); + + status result = socket_ops::non_blocking_recvmsg(o->socket_, + bufs.buffers(), bufs.count(), + o->in_flags_, o->out_flags_, + o->ec_, o->bytes_transferred_) ? done : not_done; + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvmsg", + o->ec_, o->bytes_transferred_)); + + return result; + } + +private: + socket_type socket_; + MutableBufferSequence buffers_; + socket_base::message_flags in_flags_; + socket_base::message_flags& out_flags_; +}; + +template +class reactive_socket_recvmsg_op : + public reactive_socket_recvmsg_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvmsg_op); + + reactive_socket_recvmsg_op(const asio::error_code& success_ec, + socket_type socket, const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, Handler& handler, + const IoExecutor& io_ex) + : reactive_socket_recvmsg_op_base( + success_ec, socket, buffers, in_flags, out_flags, + &reactive_socket_recvmsg_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_recvmsg_op* o( + static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_send_op.hpp b/include/asio/include/asio/detail/reactive_socket_send_op.hpp new file mode 100644 index 0000000..4a611c4 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_send_op.hpp @@ -0,0 +1,162 @@ +// +// detail/reactive_socket_send_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_socket_send_op_base : public reactor_op +{ +public: + reactive_socket_send_op_base(const asio::error_code& success_ec, + socket_type socket, socket_ops::state_type state, + const ConstBufferSequence& buffers, + socket_base::message_flags flags, func_type complete_func) + : reactor_op(success_ec, + &reactive_socket_send_op_base::do_perform, complete_func), + socket_(socket), + state_(state), + buffers_(buffers), + flags_(flags) + { + } + + static status do_perform(reactor_op* base) + { + reactive_socket_send_op_base* o( + static_cast(base)); + + typedef buffer_sequence_adapter bufs_type; + + status result; + if (bufs_type::is_single_buffer) + { + result = socket_ops::non_blocking_send1(o->socket_, + bufs_type::first(o->buffers_).data(), + bufs_type::first(o->buffers_).size(), o->flags_, + o->ec_, o->bytes_transferred_) ? done : not_done; + + if (result == done) + if ((o->state_ & socket_ops::stream_oriented) != 0) + if (o->bytes_transferred_ < bufs_type::first(o->buffers_).size()) + result = done_and_exhausted; + } + else + { + bufs_type bufs(o->buffers_); + result = socket_ops::non_blocking_send(o->socket_, + bufs.buffers(), bufs.count(), o->flags_, + o->ec_, o->bytes_transferred_) ? done : not_done; + + if (result == done) + if ((o->state_ & socket_ops::stream_oriented) != 0) + if (o->bytes_transferred_ < bufs.total_size()) + result = done_and_exhausted; + } + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_send", + o->ec_, o->bytes_transferred_)); + + return result; + } + +private: + socket_type socket_; + socket_ops::state_type state_; + ConstBufferSequence buffers_; + socket_base::message_flags flags_; +}; + +template +class reactive_socket_send_op : + public reactive_socket_send_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_send_op); + + reactive_socket_send_op(const asio::error_code& success_ec, + socket_type socket, socket_ops::state_type state, + const ConstBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + : reactive_socket_send_op_base(success_ec, socket, + state, buffers, flags, &reactive_socket_send_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_send_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_sendto_op.hpp b/include/asio/include/asio/detail/reactive_socket_sendto_op.hpp new file mode 100644 index 0000000..622b92d --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_sendto_op.hpp @@ -0,0 +1,156 @@ +// +// detail/reactive_socket_sendto_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SENDTO_OP_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_SENDTO_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_socket_sendto_op_base : public reactor_op +{ +public: + reactive_socket_sendto_op_base(const asio::error_code& success_ec, + socket_type socket, const ConstBufferSequence& buffers, + const Endpoint& endpoint, socket_base::message_flags flags, + func_type complete_func) + : reactor_op(success_ec, + &reactive_socket_sendto_op_base::do_perform, complete_func), + socket_(socket), + buffers_(buffers), + destination_(endpoint), + flags_(flags) + { + } + + static status do_perform(reactor_op* base) + { + reactive_socket_sendto_op_base* o( + static_cast(base)); + + typedef buffer_sequence_adapter bufs_type; + + status result; + if (bufs_type::is_single_buffer) + { + result = socket_ops::non_blocking_sendto1(o->socket_, + bufs_type::first(o->buffers_).data(), + bufs_type::first(o->buffers_).size(), o->flags_, + o->destination_.data(), o->destination_.size(), + o->ec_, o->bytes_transferred_) ? done : not_done; + } + else + { + bufs_type bufs(o->buffers_); + result = socket_ops::non_blocking_sendto(o->socket_, + bufs.buffers(), bufs.count(), o->flags_, + o->destination_.data(), o->destination_.size(), + o->ec_, o->bytes_transferred_) ? done : not_done; + } + + ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_sendto", + o->ec_, o->bytes_transferred_)); + + return result; + } + +private: + socket_type socket_; + ConstBufferSequence buffers_; + Endpoint destination_; + socket_base::message_flags flags_; +}; + +template +class reactive_socket_sendto_op : + public reactive_socket_sendto_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_socket_sendto_op); + + reactive_socket_sendto_op(const asio::error_code& success_ec, + socket_type socket, const ConstBufferSequence& buffers, + const Endpoint& endpoint, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + : reactive_socket_sendto_op_base( + success_ec, socket, buffers, endpoint, flags, + &reactive_socket_sendto_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_socket_sendto_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->bytes_transferred_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_SENDTO_OP_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_service.hpp b/include/asio/include/asio/detail/reactive_socket_service.hpp new file mode 100644 index 0000000..bbb2b84 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_service.hpp @@ -0,0 +1,528 @@ +// +// detail/reactive_socket_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_IOCP) + +#include "asio/buffer.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/socket_base.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/reactive_null_buffers_op.hpp" +#include "asio/detail/reactive_socket_accept_op.hpp" +#include "asio/detail/reactive_socket_connect_op.hpp" +#include "asio/detail/reactive_socket_recvfrom_op.hpp" +#include "asio/detail/reactive_socket_sendto_op.hpp" +#include "asio/detail/reactive_socket_service_base.hpp" +#include "asio/detail/reactor.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_holder.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_socket_service : + public execution_context_service_base >, + public reactive_socket_service_base +{ +public: + // The protocol type. + typedef Protocol protocol_type; + + // The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + // The native type of a socket. + typedef socket_type native_handle_type; + + // The implementation type of the socket. + struct implementation_type : + reactive_socket_service_base::base_implementation_type + { + // Default constructor. + implementation_type() + : protocol_(endpoint_type().protocol()) + { + } + + // The protocol associated with the socket. + protocol_type protocol_; + }; + + // Constructor. + reactive_socket_service(execution_context& context) + : execution_context_service_base< + reactive_socket_service >(context), + reactive_socket_service_base(context) + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + this->base_shutdown(); + } + + // Move-construct a new socket implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) ASIO_NOEXCEPT + { + this->base_move_construct(impl, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + } + + // Move-assign from another socket implementation. + void move_assign(implementation_type& impl, + reactive_socket_service_base& other_service, + implementation_type& other_impl) + { + this->base_move_assign(impl, other_service, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + } + + // Move-construct a new socket implementation from another protocol type. + template + void converting_move_construct(implementation_type& impl, + reactive_socket_service&, + typename reactive_socket_service< + Protocol1>::implementation_type& other_impl) + { + this->base_move_construct(impl, other_impl); + + impl.protocol_ = protocol_type(other_impl.protocol_); + other_impl.protocol_ = typename Protocol1::endpoint().protocol(); + } + + // Open a new socket implementation. + asio::error_code open(implementation_type& impl, + const protocol_type& protocol, asio::error_code& ec) + { + if (!do_open(impl, protocol.family(), + protocol.type(), protocol.protocol(), ec)) + impl.protocol_ = protocol; + return ec; + } + + // Assign a native socket to a socket implementation. + asio::error_code assign(implementation_type& impl, + const protocol_type& protocol, const native_handle_type& native_socket, + asio::error_code& ec) + { + if (!do_assign(impl, protocol.type(), native_socket, ec)) + impl.protocol_ = protocol; + return ec; + } + + // Get the native socket representation. + native_handle_type native_handle(implementation_type& impl) + { + return impl.socket_; + } + + // Bind the socket to the specified local endpoint. + asio::error_code bind(implementation_type& impl, + const endpoint_type& endpoint, asio::error_code& ec) + { + socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec); + return ec; + } + + // Set a socket option. + template + asio::error_code set_option(implementation_type& impl, + const Option& option, asio::error_code& ec) + { + socket_ops::setsockopt(impl.socket_, impl.state_, + option.level(impl.protocol_), option.name(impl.protocol_), + option.data(impl.protocol_), option.size(impl.protocol_), ec); + return ec; + } + + // Set a socket option. + template + asio::error_code get_option(const implementation_type& impl, + Option& option, asio::error_code& ec) const + { + std::size_t size = option.size(impl.protocol_); + socket_ops::getsockopt(impl.socket_, impl.state_, + option.level(impl.protocol_), option.name(impl.protocol_), + option.data(impl.protocol_), &size, ec); + if (!ec) + option.resize(impl.protocol_, size); + return ec; + } + + // Get the local endpoint. + endpoint_type local_endpoint(const implementation_type& impl, + asio::error_code& ec) const + { + endpoint_type endpoint; + std::size_t addr_len = endpoint.capacity(); + if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec)) + return endpoint_type(); + endpoint.resize(addr_len); + return endpoint; + } + + // Get the remote endpoint. + endpoint_type remote_endpoint(const implementation_type& impl, + asio::error_code& ec) const + { + endpoint_type endpoint; + std::size_t addr_len = endpoint.capacity(); + if (socket_ops::getpeername(impl.socket_, + endpoint.data(), &addr_len, false, ec)) + return endpoint_type(); + endpoint.resize(addr_len); + return endpoint; + } + + // Disable sends or receives on the socket. + asio::error_code shutdown(base_implementation_type& impl, + socket_base::shutdown_type what, asio::error_code& ec) + { + socket_ops::shutdown(impl.socket_, what, ec); + return ec; + } + + // Send a datagram to the specified endpoint. Returns the number of bytes + // sent. + template + size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + asio::error_code& ec) + { + typedef buffer_sequence_adapter bufs_type; + + if (bufs_type::is_single_buffer) + { + return socket_ops::sync_sendto1(impl.socket_, impl.state_, + bufs_type::first(buffers).data(), + bufs_type::first(buffers).size(), flags, + destination.data(), destination.size(), ec); + } + else + { + bufs_type bufs(buffers); + return socket_ops::sync_sendto(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), flags, + destination.data(), destination.size(), ec); + } + } + + // Wait until data can be sent without blocking. + size_t send_to(implementation_type& impl, const null_buffers&, + const endpoint_type&, socket_base::message_flags, + asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); + + return 0; + } + + // Start an asynchronous send. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_send_to(implementation_type& impl, + const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_sendto_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.socket_, + buffers, destination, flags, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_send_to")); + + start_op(impl, reactor::write_op, p.p, is_continuation, true, false); + p.v = p.p = 0; + } + + // Start an asynchronous wait until data can be sent without blocking. + template + void async_send_to(implementation_type& impl, const null_buffers&, + const endpoint_type&, socket_base::message_flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_send_to(null_buffers)")); + + start_op(impl, reactor::write_op, p.p, is_continuation, false, false); + p.v = p.p = 0; + } + + // Receive a datagram with the endpoint of the sender. Returns the number of + // bytes received. + template + size_t receive_from(implementation_type& impl, + const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + asio::error_code& ec) + { + typedef buffer_sequence_adapter bufs_type; + + std::size_t addr_len = sender_endpoint.capacity(); + std::size_t bytes_recvd; + if (bufs_type::is_single_buffer) + { + bytes_recvd = socket_ops::sync_recvfrom1(impl.socket_, + impl.state_, bufs_type::first(buffers).data(), + bufs_type::first(buffers).size(), flags, + sender_endpoint.data(), &addr_len, ec); + } + else + { + bufs_type bufs(buffers); + bytes_recvd = socket_ops::sync_recvfrom( + impl.socket_, impl.state_, bufs.buffers(), bufs.count(), + flags, sender_endpoint.data(), &addr_len, ec); + } + + if (!ec) + sender_endpoint.resize(addr_len); + + return bytes_recvd; + } + + // Wait until data can be received without blocking. + size_t receive_from(implementation_type& impl, const null_buffers&, + endpoint_type& sender_endpoint, socket_base::message_flags, + asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + + // Reset endpoint since it can be given no sensible value at this time. + sender_endpoint = endpoint_type(); + + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received and + // the sender_endpoint object must both be valid for the lifetime of the + // asynchronous operation. + template + void async_receive_from(implementation_type& impl, + const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, + socket_base::message_flags flags, Handler& handler, + const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_recvfrom_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + int protocol = impl.protocol_.type(); + p.p = new (p.v) op(success_ec_, impl.socket_, protocol, + buffers, sender_endpoint, flags, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_receive_from")); + + start_op(impl, + (flags & socket_base::message_out_of_band) + ? reactor::except_op : reactor::read_op, + p.p, is_continuation, true, false); + p.v = p.p = 0; + } + + // Wait until data can be received without blocking. + template + void async_receive_from(implementation_type& impl, const null_buffers&, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_receive_from(null_buffers)")); + + // Reset endpoint since it can be given no sensible value at this time. + sender_endpoint = endpoint_type(); + + start_op(impl, + (flags & socket_base::message_out_of_band) + ? reactor::except_op : reactor::read_op, + p.p, is_continuation, false, false); + p.v = p.p = 0; + } + + // Accept a new connection. + template + asio::error_code accept(implementation_type& impl, + Socket& peer, endpoint_type* peer_endpoint, asio::error_code& ec) + { + // We cannot accept a socket that is already open. + if (peer.is_open()) + { + ec = asio::error::already_open; + return ec; + } + + std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; + socket_holder new_socket(socket_ops::sync_accept(impl.socket_, + impl.state_, peer_endpoint ? peer_endpoint->data() : 0, + peer_endpoint ? &addr_len : 0, ec)); + + // On success, assign new connection to peer socket object. + if (new_socket.get() != invalid_socket) + { + if (peer_endpoint) + peer_endpoint->resize(addr_len); + peer.assign(impl.protocol_, new_socket.get(), ec); + if (!ec) + new_socket.release(); + } + + return ec; + } + + // Start an asynchronous accept. The peer and peer_endpoint objects must be + // valid until the accept's handler is invoked. + template + void async_accept(implementation_type& impl, Socket& peer, + endpoint_type* peer_endpoint, Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_accept_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_, + peer, impl.protocol_, peer_endpoint, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_accept")); + + start_accept_op(impl, p.p, is_continuation, peer.is_open()); + p.v = p.p = 0; + } + +#if defined(ASIO_HAS_MOVE) + // Start an asynchronous accept. The peer_endpoint object must be valid until + // the accept's handler is invoked. + template + void async_move_accept(implementation_type& impl, + const PeerIoExecutor& peer_io_ex, endpoint_type* peer_endpoint, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_move_accept_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, peer_io_ex, impl.socket_, + impl.state_, impl.protocol_, peer_endpoint, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_accept")); + + start_accept_op(impl, p.p, is_continuation, false); + p.v = p.p = 0; + } +#endif // defined(ASIO_HAS_MOVE) + + // Connect the socket to the specified endpoint. + asio::error_code connect(implementation_type& impl, + const endpoint_type& peer_endpoint, asio::error_code& ec) + { + socket_ops::sync_connect(impl.socket_, + peer_endpoint.data(), peer_endpoint.size(), ec); + return ec; + } + + // Start an asynchronous connect. + template + void async_connect(implementation_type& impl, + const endpoint_type& peer_endpoint, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_connect_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.socket_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_connect")); + + start_connect_op(impl, p.p, is_continuation, + peer_endpoint.data(), peer_endpoint.size()); + p.v = p.p = 0; + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_HPP diff --git a/include/asio/include/asio/detail/reactive_socket_service_base.hpp b/include/asio/include/asio/detail/reactive_socket_service_base.hpp new file mode 100644 index 0000000..d94b2cc --- /dev/null +++ b/include/asio/include/asio/detail/reactive_socket_service_base.hpp @@ -0,0 +1,541 @@ +// +// detail/reactive_socket_service_base.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP +#define ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_IOCP) \ + && !defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/buffer.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/socket_base.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactive_null_buffers_op.hpp" +#include "asio/detail/reactive_socket_recv_op.hpp" +#include "asio/detail/reactive_socket_recvmsg_op.hpp" +#include "asio/detail/reactive_socket_send_op.hpp" +#include "asio/detail/reactive_wait_op.hpp" +#include "asio/detail/reactor.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_holder.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class reactive_socket_service_base +{ +public: + // The native type of a socket. + typedef socket_type native_handle_type; + + // The implementation type of the socket. + struct base_implementation_type + { + // The native socket representation. + socket_type socket_; + + // The current state of the socket. + socket_ops::state_type state_; + + // Per-descriptor data used by the reactor. + reactor::per_descriptor_data reactor_data_; + }; + + // Constructor. + ASIO_DECL reactive_socket_service_base(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void base_shutdown(); + + // Construct a new socket implementation. + ASIO_DECL void construct(base_implementation_type& impl); + + // Move-construct a new socket implementation. + ASIO_DECL void base_move_construct(base_implementation_type& impl, + base_implementation_type& other_impl) ASIO_NOEXCEPT; + + // Move-assign from another socket implementation. + ASIO_DECL void base_move_assign(base_implementation_type& impl, + reactive_socket_service_base& other_service, + base_implementation_type& other_impl); + + // Destroy a socket implementation. + ASIO_DECL void destroy(base_implementation_type& impl); + + // Determine whether the socket is open. + bool is_open(const base_implementation_type& impl) const + { + return impl.socket_ != invalid_socket; + } + + // Destroy a socket implementation. + ASIO_DECL asio::error_code close( + base_implementation_type& impl, asio::error_code& ec); + + // Release ownership of the socket. + ASIO_DECL socket_type release( + base_implementation_type& impl, asio::error_code& ec); + + // Get the native socket representation. + native_handle_type native_handle(base_implementation_type& impl) + { + return impl.socket_; + } + + // Cancel all operations associated with the socket. + ASIO_DECL asio::error_code cancel( + base_implementation_type& impl, asio::error_code& ec); + + // Determine whether the socket is at the out-of-band data mark. + bool at_mark(const base_implementation_type& impl, + asio::error_code& ec) const + { + return socket_ops::sockatmark(impl.socket_, ec); + } + + // Determine the number of bytes available for reading. + std::size_t available(const base_implementation_type& impl, + asio::error_code& ec) const + { + return socket_ops::available(impl.socket_, ec); + } + + // Place the socket into the state where it will listen for new connections. + asio::error_code listen(base_implementation_type& impl, + int backlog, asio::error_code& ec) + { + socket_ops::listen(impl.socket_, backlog, ec); + return ec; + } + + // Perform an IO control command on the socket. + template + asio::error_code io_control(base_implementation_type& impl, + IO_Control_Command& command, asio::error_code& ec) + { + socket_ops::ioctl(impl.socket_, impl.state_, command.name(), + static_cast(command.data()), ec); + return ec; + } + + // Gets the non-blocking mode of the socket. + bool non_blocking(const base_implementation_type& impl) const + { + return (impl.state_ & socket_ops::user_set_non_blocking) != 0; + } + + // Sets the non-blocking mode of the socket. + asio::error_code non_blocking(base_implementation_type& impl, + bool mode, asio::error_code& ec) + { + socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec); + return ec; + } + + // Gets the non-blocking mode of the native socket implementation. + bool native_non_blocking(const base_implementation_type& impl) const + { + return (impl.state_ & socket_ops::internal_non_blocking) != 0; + } + + // Sets the non-blocking mode of the native socket implementation. + asio::error_code native_non_blocking(base_implementation_type& impl, + bool mode, asio::error_code& ec) + { + socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec); + return ec; + } + + // Wait for the socket to become ready to read, ready to write, or to have + // pending error conditions. + asio::error_code wait(base_implementation_type& impl, + socket_base::wait_type w, asio::error_code& ec) + { + switch (w) + { + case socket_base::wait_read: + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + break; + case socket_base::wait_write: + socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); + break; + case socket_base::wait_error: + socket_ops::poll_error(impl.socket_, impl.state_, -1, ec); + break; + default: + ec = asio::error::invalid_argument; + break; + } + + return ec; + } + + // Asynchronously wait for the socket to become ready to read, ready to + // write, or to have pending error conditions. + template + void async_wait(base_implementation_type& impl, + socket_base::wait_type w, Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_wait_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_wait")); + + int op_type; + switch (w) + { + case socket_base::wait_read: + op_type = reactor::read_op; + break; + case socket_base::wait_write: + op_type = reactor::write_op; + break; + case socket_base::wait_error: + op_type = reactor::except_op; + break; + default: + p.p->ec_ = asio::error::invalid_argument; + reactor_.post_immediate_completion(p.p, is_continuation); + p.v = p.p = 0; + return; + } + + start_op(impl, op_type, p.p, is_continuation, false, false); + p.v = p.p = 0; + } + + // Send the given data to the peer. + template + size_t send(base_implementation_type& impl, + const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + typedef buffer_sequence_adapter bufs_type; + + if (bufs_type::is_single_buffer) + { + return socket_ops::sync_send1(impl.socket_, + impl.state_, bufs_type::first(buffers).data(), + bufs_type::first(buffers).size(), flags, ec); + } + else + { + bufs_type bufs(buffers); + return socket_ops::sync_send(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); + } + } + + // Wait until data can be sent without blocking. + size_t send(base_implementation_type& impl, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); + + return 0; + } + + // Start an asynchronous send. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_send(base_implementation_type& impl, + const ConstBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_send_op< + ConstBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.socket_, + impl.state_, buffers, flags, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_send")); + + start_op(impl, reactor::write_op, p.p, is_continuation, true, + ((impl.state_ & socket_ops::stream_oriented) + && buffer_sequence_adapter::all_empty(buffers))); + p.v = p.p = 0; + } + + // Start an asynchronous wait until data can be sent without blocking. + template + void async_send(base_implementation_type& impl, const null_buffers&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_send(null_buffers)")); + + start_op(impl, reactor::write_op, p.p, is_continuation, false, false); + p.v = p.p = 0; + } + + // Receive some data from the peer. Returns the number of bytes received. + template + size_t receive(base_implementation_type& impl, + const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + typedef buffer_sequence_adapter bufs_type; + + if (bufs_type::is_single_buffer) + { + return socket_ops::sync_recv1(impl.socket_, + impl.state_, bufs_type::first(buffers).data(), + bufs_type::first(buffers).size(), flags, ec); + } + else + { + bufs_type bufs(buffers); + return socket_ops::sync_recv(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); + } + } + + // Wait until data can be received without blocking. + size_t receive(base_implementation_type& impl, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received + // must be valid for the lifetime of the asynchronous operation. + template + void async_receive(base_implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_recv_op< + MutableBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.socket_, + impl.state_, buffers, flags, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_receive")); + + start_op(impl, + (flags & socket_base::message_out_of_band) + ? reactor::except_op : reactor::read_op, + p.p, is_continuation, + (flags & socket_base::message_out_of_band) == 0, + ((impl.state_ & socket_ops::stream_oriented) + && buffer_sequence_adapter::all_empty(buffers))); + p.v = p.p = 0; + } + + // Wait until data can be received without blocking. + template + void async_receive(base_implementation_type& impl, + const null_buffers&, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_receive(null_buffers)")); + + start_op(impl, + (flags & socket_base::message_out_of_band) + ? reactor::except_op : reactor::read_op, + p.p, is_continuation, false, false); + p.v = p.p = 0; + } + + // Receive some data with associated flags. Returns the number of bytes + // received. + template + size_t receive_with_flags(base_implementation_type& impl, + const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, asio::error_code& ec) + { + buffer_sequence_adapter bufs(buffers); + + return socket_ops::sync_recvmsg(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), in_flags, out_flags, ec); + } + + // Wait until data can be received without blocking. + size_t receive_with_flags(base_implementation_type& impl, + const null_buffers&, socket_base::message_flags, + socket_base::message_flags& out_flags, asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + + // Clear out_flags, since we cannot give it any other sensible value when + // performing a null_buffers operation. + out_flags = 0; + + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received + // must be valid for the lifetime of the asynchronous operation. + template + void async_receive_with_flags(base_implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, Handler& handler, + const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_socket_recvmsg_op< + MutableBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, impl.socket_, + buffers, in_flags, out_flags, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_receive_with_flags")); + + start_op(impl, + (in_flags & socket_base::message_out_of_band) + ? reactor::except_op : reactor::read_op, + p.p, is_continuation, + (in_flags & socket_base::message_out_of_band) == 0, false); + p.v = p.p = 0; + } + + // Wait until data can be received without blocking. + template + void async_receive_with_flags(base_implementation_type& impl, + const null_buffers&, socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, Handler& handler, + const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef reactive_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(success_ec_, handler, io_ex); + + ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", + &impl, impl.socket_, "async_receive_with_flags(null_buffers)")); + + // Clear out_flags, since we cannot give it any other sensible value when + // performing a null_buffers operation. + out_flags = 0; + + start_op(impl, + (in_flags & socket_base::message_out_of_band) + ? reactor::except_op : reactor::read_op, + p.p, is_continuation, false, false); + p.v = p.p = 0; + } + +protected: + // Open a new socket implementation. + ASIO_DECL asio::error_code do_open( + base_implementation_type& impl, int af, + int type, int protocol, asio::error_code& ec); + + // Assign a native socket to a socket implementation. + ASIO_DECL asio::error_code do_assign( + base_implementation_type& impl, int type, + const native_handle_type& native_socket, asio::error_code& ec); + + // Start the asynchronous read or write operation. + ASIO_DECL void start_op(base_implementation_type& impl, int op_type, + reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop); + + // Start the asynchronous accept operation. + ASIO_DECL void start_accept_op(base_implementation_type& impl, + reactor_op* op, bool is_continuation, bool peer_is_open); + + // Start the asynchronous connect operation. + ASIO_DECL void start_connect_op(base_implementation_type& impl, + reactor_op* op, bool is_continuation, + const socket_addr_type* addr, size_t addrlen); + + // The selector that performs event demultiplexing for the service. + reactor& reactor_; + + // Cached success value to avoid accessing category singleton. + const asio::error_code success_ec_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/reactive_socket_service_base.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // !defined(ASIO_HAS_IOCP) + // && !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP diff --git a/include/asio/include/asio/detail/reactive_wait_op.hpp b/include/asio/include/asio/detail/reactive_wait_op.hpp new file mode 100644 index 0000000..19f1659 --- /dev/null +++ b/include/asio/include/asio/detail/reactive_wait_op.hpp @@ -0,0 +1,98 @@ +// +// detail/reactive_wait_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTIVE_WAIT_OP_HPP +#define ASIO_DETAIL_REACTIVE_WAIT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactive_wait_op : public reactor_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(reactive_wait_op); + + reactive_wait_op(const asio::error_code& success_ec, + Handler& handler, const IoExecutor& io_ex) + : reactor_op(success_ec, &reactive_wait_op::do_perform, + &reactive_wait_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static status do_perform(reactor_op*) + { + return done; + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + reactive_wait_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(o->handler_, o->ec_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTIVE_WAIT_OP_HPP diff --git a/include/asio/include/asio/detail/reactor.hpp b/include/asio/include/asio/detail/reactor.hpp new file mode 100644 index 0000000..7989134 --- /dev/null +++ b/include/asio/include/asio/detail/reactor.hpp @@ -0,0 +1,32 @@ +// +// detail/reactor.hpp +// ~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTOR_HPP +#define ASIO_DETAIL_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/reactor_fwd.hpp" + +#if defined(ASIO_HAS_EPOLL) +# include "asio/detail/epoll_reactor.hpp" +#elif defined(ASIO_HAS_KQUEUE) +# include "asio/detail/kqueue_reactor.hpp" +#elif defined(ASIO_HAS_DEV_POLL) +# include "asio/detail/dev_poll_reactor.hpp" +#elif defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) +# include "asio/detail/null_reactor.hpp" +#else +# include "asio/detail/select_reactor.hpp" +#endif + +#endif // ASIO_DETAIL_REACTOR_HPP diff --git a/include/asio/include/asio/detail/reactor_fwd.hpp b/include/asio/include/asio/detail/reactor_fwd.hpp new file mode 100644 index 0000000..a5c9436 --- /dev/null +++ b/include/asio/include/asio/detail/reactor_fwd.hpp @@ -0,0 +1,40 @@ +// +// detail/reactor_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTOR_FWD_HPP +#define ASIO_DETAIL_REACTOR_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) +typedef class null_reactor reactor; +#elif defined(ASIO_HAS_IOCP) +typedef class select_reactor reactor; +#elif defined(ASIO_HAS_EPOLL) +typedef class epoll_reactor reactor; +#elif defined(ASIO_HAS_KQUEUE) +typedef class kqueue_reactor reactor; +#elif defined(ASIO_HAS_DEV_POLL) +typedef class dev_poll_reactor reactor; +#else +typedef class select_reactor reactor; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_REACTOR_FWD_HPP diff --git a/include/asio/include/asio/detail/reactor_op.hpp b/include/asio/include/asio/detail/reactor_op.hpp new file mode 100644 index 0000000..b7f88a4 --- /dev/null +++ b/include/asio/include/asio/detail/reactor_op.hpp @@ -0,0 +1,67 @@ +// +// detail/reactor_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTOR_OP_HPP +#define ASIO_DETAIL_REACTOR_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class reactor_op + : public operation +{ +public: + // The error code to be passed to the completion handler. + asio::error_code ec_; + + // The number of bytes transferred, to be passed to the completion handler. + std::size_t bytes_transferred_; + + // Status returned by perform function. May be used to decide whether it is + // worth performing more operations on the descriptor immediately. + enum status { not_done, done, done_and_exhausted }; + + // Perform the operation. Returns true if it is finished. + status perform() + { + return perform_func_(this); + } + +protected: + typedef status (*perform_func_type)(reactor_op*); + + reactor_op(const asio::error_code& success_ec, + perform_func_type perform_func, func_type complete_func) + : operation(complete_func), + ec_(success_ec), + bytes_transferred_(0), + perform_func_(perform_func) + { + } + +private: + perform_func_type perform_func_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTOR_OP_HPP diff --git a/include/asio/include/asio/detail/reactor_op_queue.hpp b/include/asio/include/asio/detail/reactor_op_queue.hpp new file mode 100644 index 0000000..96eca52 --- /dev/null +++ b/include/asio/include/asio/detail/reactor_op_queue.hpp @@ -0,0 +1,168 @@ +// +// detail/reactor_op_queue.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REACTOR_OP_QUEUE_HPP +#define ASIO_DETAIL_REACTOR_OP_QUEUE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/hash_map.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class reactor_op_queue + : private noncopyable +{ +public: + typedef Descriptor key_type; + + struct mapped_type : op_queue + { + mapped_type() {} + mapped_type(const mapped_type&) {} + void operator=(const mapped_type&) {} + }; + + typedef typename hash_map::value_type value_type; + typedef typename hash_map::iterator iterator; + + // Constructor. + reactor_op_queue() + : operations_() + { + } + + // Obtain iterators to all registered descriptors. + iterator begin() { return operations_.begin(); } + iterator end() { return operations_.end(); } + + // Add a new operation to the queue. Returns true if this is the only + // operation for the given descriptor, in which case the reactor's event + // demultiplexing function call may need to be interrupted and restarted. + bool enqueue_operation(Descriptor descriptor, reactor_op* op) + { + std::pair entry = + operations_.insert(value_type(descriptor, mapped_type())); + entry.first->second.push(op); + return entry.second; + } + + // Cancel all operations associated with the descriptor identified by the + // supplied iterator. Any operations pending for the descriptor will be + // cancelled. Returns true if any operations were cancelled, in which case + // the reactor's event demultiplexing function may need to be interrupted and + // restarted. + bool cancel_operations(iterator i, op_queue& ops, + const asio::error_code& ec = + asio::error::operation_aborted) + { + if (i != operations_.end()) + { + while (reactor_op* op = i->second.front()) + { + op->ec_ = ec; + i->second.pop(); + ops.push(op); + } + operations_.erase(i); + return true; + } + + return false; + } + + // Cancel all operations associated with the descriptor. Any operations + // pending for the descriptor will be cancelled. Returns true if any + // operations were cancelled, in which case the reactor's event + // demultiplexing function may need to be interrupted and restarted. + bool cancel_operations(Descriptor descriptor, op_queue& ops, + const asio::error_code& ec = + asio::error::operation_aborted) + { + return this->cancel_operations(operations_.find(descriptor), ops, ec); + } + + // Whether there are no operations in the queue. + bool empty() const + { + return operations_.empty(); + } + + // Determine whether there are any operations associated with the descriptor. + bool has_operation(Descriptor descriptor) const + { + return operations_.find(descriptor) != operations_.end(); + } + + // Perform the operations corresponding to the descriptor identified by the + // supplied iterator. Returns true if there are still unfinished operations + // queued for the descriptor. + bool perform_operations(iterator i, op_queue& ops) + { + if (i != operations_.end()) + { + while (reactor_op* op = i->second.front()) + { + if (op->perform()) + { + i->second.pop(); + ops.push(op); + } + else + { + return true; + } + } + operations_.erase(i); + } + return false; + } + + // Perform the operations corresponding to the descriptor. Returns true if + // there are still unfinished operations queued for the descriptor. + bool perform_operations(Descriptor descriptor, op_queue& ops) + { + return this->perform_operations(operations_.find(descriptor), ops); + } + + // Get all operations owned by the queue. + void get_all_operations(op_queue& ops) + { + iterator i = operations_.begin(); + while (i != operations_.end()) + { + iterator op_iter = i++; + ops.push(op_iter->second); + operations_.erase(op_iter); + } + } + +private: + // The operations that are currently executing asynchronously. + hash_map operations_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_REACTOR_OP_QUEUE_HPP diff --git a/include/asio/include/asio/detail/recycling_allocator.hpp b/include/asio/include/asio/detail/recycling_allocator.hpp new file mode 100644 index 0000000..6c905cd --- /dev/null +++ b/include/asio/include/asio/detail/recycling_allocator.hpp @@ -0,0 +1,106 @@ +// +// detail/recycling_allocator.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_RECYCLING_ALLOCATOR_HPP +#define ASIO_DETAIL_RECYCLING_ALLOCATOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/thread_context.hpp" +#include "asio/detail/thread_info_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class recycling_allocator +{ +public: + typedef T value_type; + + template + struct rebind + { + typedef recycling_allocator other; + }; + + recycling_allocator() + { + } + + template + recycling_allocator(const recycling_allocator&) + { + } + + T* allocate(std::size_t n) + { + typedef thread_context::thread_call_stack call_stack; + void* p = thread_info_base::allocate(Purpose(), + call_stack::top(), sizeof(T) * n); + return static_cast(p); + } + + void deallocate(T* p, std::size_t n) + { + typedef thread_context::thread_call_stack call_stack; + thread_info_base::deallocate(Purpose(), + call_stack::top(), p, sizeof(T) * n); + } +}; + +template +class recycling_allocator +{ +public: + typedef void value_type; + + template + struct rebind + { + typedef recycling_allocator other; + }; + + recycling_allocator() + { + } + + template + recycling_allocator(const recycling_allocator&) + { + } +}; + +template +struct get_recycling_allocator +{ + typedef Allocator type; + static type get(const Allocator& a) { return a; } +}; + +template +struct get_recycling_allocator, Purpose> +{ + typedef recycling_allocator type; + static type get(const std::allocator&) { return type(); } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_RECYCLING_ALLOCATOR_HPP diff --git a/include/asio/include/asio/detail/regex_fwd.hpp b/include/asio/include/asio/detail/regex_fwd.hpp new file mode 100644 index 0000000..6d7b404 --- /dev/null +++ b/include/asio/include/asio/detail/regex_fwd.hpp @@ -0,0 +1,35 @@ +// +// detail/regex_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_REGEX_FWD_HPP +#define ASIO_DETAIL_REGEX_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#if defined(ASIO_HAS_BOOST_REGEX) + +#include +#include + +namespace boost { + +template +struct sub_match; + +template +class match_results; + +} // namespace boost + +#endif // defined(ASIO_HAS_BOOST_REGEX) + +#endif // ASIO_DETAIL_REGEX_FWD_HPP diff --git a/include/asio/include/asio/detail/resolve_endpoint_op.hpp b/include/asio/include/asio/detail/resolve_endpoint_op.hpp new file mode 100644 index 0000000..a9fe053 --- /dev/null +++ b/include/asio/include/asio/detail/resolve_endpoint_op.hpp @@ -0,0 +1,140 @@ +// +// detail/resolve_endpoint_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_RESOLVER_ENDPOINT_OP_HPP +#define ASIO_DETAIL_RESOLVER_ENDPOINT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/resolve_op.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" +#include "asio/ip/basic_resolver_results.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class resolve_endpoint_op : public resolve_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(resolve_endpoint_op); + + typedef typename Protocol::endpoint endpoint_type; + typedef asio::ip::basic_resolver_results results_type; + +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + + resolve_endpoint_op(socket_ops::weak_cancel_token_type cancel_token, + const endpoint_type& endpoint, scheduler_impl& sched, + Handler& handler, const IoExecutor& io_ex) + : resolve_op(&resolve_endpoint_op::do_complete), + cancel_token_(cancel_token), + endpoint_(endpoint), + scheduler_(sched), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the operation object. + resolve_endpoint_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + if (owner && owner != &o->scheduler_) + { + // The operation is being run on the worker io_context. Time to perform + // the resolver operation. + + // Perform the blocking endpoint resolution operation. + char host_name[NI_MAXHOST]; + char service_name[NI_MAXSERV]; + socket_ops::background_getnameinfo(o->cancel_token_, o->endpoint_.data(), + o->endpoint_.size(), host_name, NI_MAXHOST, service_name, NI_MAXSERV, + o->endpoint_.protocol().type(), o->ec_); + o->results_ = results_type::create(o->endpoint_, host_name, service_name); + + // Pass operation back to main io_context for completion. + o->scheduler_.post_deferred_completion(o); + p.v = p.p = 0; + } + else + { + // The operation has been returned to the main io_context. The completion + // handler is ready to be delivered. + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated + // before the upcall is made. Even if we're not about to make an upcall, + // a sub-object of the handler may be the true owner of the memory + // associated with the handler. Consequently, a local copy of the handler + // is required to ensure that any owning sub-object remains valid until + // after we have deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->results_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + } + +private: + socket_ops::weak_cancel_token_type cancel_token_; + endpoint_type endpoint_; + scheduler_impl& scheduler_; + Handler handler_; + handler_work work_; + results_type results_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_RESOLVER_ENDPOINT_OP_HPP diff --git a/include/asio/include/asio/detail/resolve_op.hpp b/include/asio/include/asio/detail/resolve_op.hpp new file mode 100644 index 0000000..a4c6409 --- /dev/null +++ b/include/asio/include/asio/detail/resolve_op.hpp @@ -0,0 +1,45 @@ +// +// detail/resolve_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_RESOLVE_OP_HPP +#define ASIO_DETAIL_RESOLVE_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/error.hpp" +#include "asio/detail/operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class resolve_op : public operation +{ +public: + // The error code to be passed to the completion handler. + asio::error_code ec_; + +protected: + resolve_op(func_type complete_func) + : operation(complete_func) + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_RESOLVE_OP_HPP diff --git a/include/asio/include/asio/detail/resolve_query_op.hpp b/include/asio/include/asio/detail/resolve_query_op.hpp new file mode 100644 index 0000000..e402a9e --- /dev/null +++ b/include/asio/include/asio/detail/resolve_query_op.hpp @@ -0,0 +1,150 @@ +// +// detail/resolve_query_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_RESOLVE_QUERY_OP_HPP +#define ASIO_DETAIL_RESOLVE_QUERY_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/resolve_op.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" +#include "asio/ip/basic_resolver_query.hpp" +#include "asio/ip/basic_resolver_results.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class resolve_query_op : public resolve_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(resolve_query_op); + + typedef asio::ip::basic_resolver_query query_type; + typedef asio::ip::basic_resolver_results results_type; + +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + + resolve_query_op(socket_ops::weak_cancel_token_type cancel_token, + const query_type& query, scheduler_impl& sched, + Handler& handler, const IoExecutor& io_ex) + : resolve_op(&resolve_query_op::do_complete), + cancel_token_(cancel_token), + query_(query), + scheduler_(sched), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex), + addrinfo_(0) + { + } + + ~resolve_query_op() + { + if (addrinfo_) + socket_ops::freeaddrinfo(addrinfo_); + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the operation object. + resolve_query_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + if (owner && owner != &o->scheduler_) + { + // The operation is being run on the worker io_context. Time to perform + // the resolver operation. + + // Perform the blocking host resolution operation. + socket_ops::background_getaddrinfo(o->cancel_token_, + o->query_.host_name().c_str(), o->query_.service_name().c_str(), + o->query_.hints(), &o->addrinfo_, o->ec_); + + // Pass operation back to main io_context for completion. + o->scheduler_.post_deferred_completion(o); + p.v = p.p = 0; + } + else + { + // The operation has been returned to the main io_context. The completion + // handler is ready to be delivered. + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated + // before the upcall is made. Even if we're not about to make an upcall, + // a sub-object of the handler may be the true owner of the memory + // associated with the handler. Consequently, a local copy of the handler + // is required to ensure that any owning sub-object remains valid until + // after we have deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, results_type()); + p.h = asio::detail::addressof(handler.handler_); + if (o->addrinfo_) + { + handler.arg2_ = results_type::create(o->addrinfo_, + o->query_.host_name(), o->query_.service_name()); + } + p.reset(); + + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + } + +private: + socket_ops::weak_cancel_token_type cancel_token_; + query_type query_; + scheduler_impl& scheduler_; + Handler handler_; + handler_work work_; + asio::detail::addrinfo_type* addrinfo_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_RESOLVE_QUERY_OP_HPP diff --git a/include/asio/include/asio/detail/resolver_service.hpp b/include/asio/include/asio/detail/resolver_service.hpp new file mode 100644 index 0000000..b09c568 --- /dev/null +++ b/include/asio/include/asio/detail/resolver_service.hpp @@ -0,0 +1,145 @@ +// +// detail/resolver_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_RESOLVER_SERVICE_HPP +#define ASIO_DETAIL_RESOLVER_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/ip/basic_resolver_query.hpp" +#include "asio/ip/basic_resolver_results.hpp" +#include "asio/detail/concurrency_hint.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/resolve_endpoint_op.hpp" +#include "asio/detail/resolve_query_op.hpp" +#include "asio/detail/resolver_service_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class resolver_service : + public execution_context_service_base >, + public resolver_service_base +{ +public: + // The implementation type of the resolver. A cancellation token is used to + // indicate to the background thread that the operation has been cancelled. + typedef socket_ops::shared_cancel_token_type implementation_type; + + // The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + // The query type. + typedef asio::ip::basic_resolver_query query_type; + + // The results type. + typedef asio::ip::basic_resolver_results results_type; + + // Constructor. + resolver_service(execution_context& context) + : execution_context_service_base >(context), + resolver_service_base(context) + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + this->base_shutdown(); + } + + // Perform any fork-related housekeeping. + void notify_fork(execution_context::fork_event fork_ev) + { + this->base_notify_fork(fork_ev); + } + + // Resolve a query to a list of entries. + results_type resolve(implementation_type&, const query_type& query, + asio::error_code& ec) + { + asio::detail::addrinfo_type* address_info = 0; + + socket_ops::getaddrinfo(query.host_name().c_str(), + query.service_name().c_str(), query.hints(), &address_info, ec); + auto_addrinfo auto_address_info(address_info); + + return ec ? results_type() : results_type::create( + address_info, query.host_name(), query.service_name()); + } + + // Asynchronously resolve a query to a list of entries. + template + void async_resolve(implementation_type& impl, const query_type& query, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef resolve_query_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl, query, scheduler_, handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "resolver", &impl, 0, "async_resolve")); + + start_resolve_op(p.p); + p.v = p.p = 0; + } + + // Resolve an endpoint to a list of entries. + results_type resolve(implementation_type&, + const endpoint_type& endpoint, asio::error_code& ec) + { + char host_name[NI_MAXHOST]; + char service_name[NI_MAXSERV]; + socket_ops::sync_getnameinfo(endpoint.data(), endpoint.size(), + host_name, NI_MAXHOST, service_name, NI_MAXSERV, + endpoint.protocol().type(), ec); + + return ec ? results_type() : results_type::create( + endpoint, host_name, service_name); + } + + // Asynchronously resolve an endpoint to a list of entries. + template + void async_resolve(implementation_type& impl, const endpoint_type& endpoint, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef resolve_endpoint_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl, endpoint, scheduler_, handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "resolver", &impl, 0, "async_resolve")); + + start_resolve_op(p.p); + p.v = p.p = 0; + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_RESOLVER_SERVICE_HPP diff --git a/include/asio/include/asio/detail/resolver_service_base.hpp b/include/asio/include/asio/detail/resolver_service_base.hpp new file mode 100644 index 0000000..51bdf13 --- /dev/null +++ b/include/asio/include/asio/detail/resolver_service_base.hpp @@ -0,0 +1,143 @@ +// +// detail/resolver_service_base.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP +#define ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/resolve_op.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/scoped_ptr.hpp" +#include "asio/detail/thread.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class resolver_service_base +{ +public: + // The implementation type of the resolver. A cancellation token is used to + // indicate to the background thread that the operation has been cancelled. + typedef socket_ops::shared_cancel_token_type implementation_type; + + // Constructor. + ASIO_DECL resolver_service_base(execution_context& context); + + // Destructor. + ASIO_DECL ~resolver_service_base(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void base_shutdown(); + + // Perform any fork-related housekeeping. + ASIO_DECL void base_notify_fork( + execution_context::fork_event fork_ev); + + // Construct a new resolver implementation. + ASIO_DECL void construct(implementation_type& impl); + + // Destroy a resolver implementation. + ASIO_DECL void destroy(implementation_type&); + + // Move-construct a new resolver implementation. + ASIO_DECL void move_construct(implementation_type& impl, + implementation_type& other_impl); + + // Move-assign from another resolver implementation. + ASIO_DECL void move_assign(implementation_type& impl, + resolver_service_base& other_service, + implementation_type& other_impl); + + // Cancel pending asynchronous operations. + ASIO_DECL void cancel(implementation_type& impl); + +protected: + // Helper function to start an asynchronous resolve operation. + ASIO_DECL void start_resolve_op(resolve_op* op); + +#if !defined(ASIO_WINDOWS_RUNTIME) + // Helper class to perform exception-safe cleanup of addrinfo objects. + class auto_addrinfo + : private asio::detail::noncopyable + { + public: + explicit auto_addrinfo(asio::detail::addrinfo_type* ai) + : ai_(ai) + { + } + + ~auto_addrinfo() + { + if (ai_) + socket_ops::freeaddrinfo(ai_); + } + + operator asio::detail::addrinfo_type*() + { + return ai_; + } + + private: + asio::detail::addrinfo_type* ai_; + }; +#endif // !defined(ASIO_WINDOWS_RUNTIME) + + // Helper class to run the work scheduler in a thread. + class work_scheduler_runner; + + // Start the work scheduler if it's not already running. + ASIO_DECL void start_work_thread(); + + // The scheduler implementation used to post completions. +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + scheduler_impl& scheduler_; + +private: + // Mutex to protect access to internal data. + asio::detail::mutex mutex_; + + // Private scheduler used for performing asynchronous host resolution. + asio::detail::scoped_ptr work_scheduler_; + + // Thread used for running the work io_context's run loop. + asio::detail::scoped_ptr work_thread_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/resolver_service_base.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_RESOLVER_SERVICE_BASE_HPP diff --git a/include/asio/include/asio/detail/scheduler.hpp b/include/asio/include/asio/detail/scheduler.hpp new file mode 100644 index 0000000..f367c8f --- /dev/null +++ b/include/asio/include/asio/detail/scheduler.hpp @@ -0,0 +1,232 @@ +// +// detail/scheduler.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SCHEDULER_HPP +#define ASIO_DETAIL_SCHEDULER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/error_code.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/atomic_count.hpp" +#include "asio/detail/conditionally_enabled_event.hpp" +#include "asio/detail/conditionally_enabled_mutex.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/reactor_fwd.hpp" +#include "asio/detail/scheduler_operation.hpp" +#include "asio/detail/thread.hpp" +#include "asio/detail/thread_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct scheduler_thread_info; + +class scheduler + : public execution_context_service_base, + public thread_context +{ +public: + typedef scheduler_operation operation; + + // Constructor. Specifies the number of concurrent threads that are likely to + // run the scheduler. If set to 1 certain optimisation are performed. + ASIO_DECL scheduler(asio::execution_context& ctx, + int concurrency_hint = 0, bool own_thread = true); + + // Destructor. + ASIO_DECL ~scheduler(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Initialise the task, if required. + ASIO_DECL void init_task(); + + // Run the event loop until interrupted or no more work. + ASIO_DECL std::size_t run(asio::error_code& ec); + + // Run until interrupted or one operation is performed. + ASIO_DECL std::size_t run_one(asio::error_code& ec); + + // Run until timeout, interrupted, or one operation is performed. + ASIO_DECL std::size_t wait_one( + long usec, asio::error_code& ec); + + // Poll for operations without blocking. + ASIO_DECL std::size_t poll(asio::error_code& ec); + + // Poll for one operation without blocking. + ASIO_DECL std::size_t poll_one(asio::error_code& ec); + + // Interrupt the event processing loop. + ASIO_DECL void stop(); + + // Determine whether the scheduler is stopped. + ASIO_DECL bool stopped() const; + + // Restart in preparation for a subsequent run invocation. + ASIO_DECL void restart(); + + // Notify that some work has started. + void work_started() + { + ++outstanding_work_; + } + + // Used to compensate for a forthcoming work_finished call. Must be called + // from within a scheduler-owned thread. + ASIO_DECL void compensating_work_started(); + + // Notify that some work has finished. + void work_finished() + { + if (--outstanding_work_ == 0) + stop(); + } + + // Return whether a handler can be dispatched immediately. + bool can_dispatch() + { + return thread_call_stack::contains(this) != 0; + } + + /// Capture the current exception so it can be rethrown from a run function. + ASIO_DECL void capture_current_exception(); + + // Request invocation of the given operation and return immediately. Assumes + // that work_started() has not yet been called for the operation. + ASIO_DECL void post_immediate_completion( + operation* op, bool is_continuation); + + // Request invocation of the given operations and return immediately. Assumes + // that work_started() has not yet been called for the operations. + ASIO_DECL void post_immediate_completions(std::size_t n, + op_queue& ops, bool is_continuation); + + // Request invocation of the given operation and return immediately. Assumes + // that work_started() was previously called for the operation. + ASIO_DECL void post_deferred_completion(operation* op); + + // Request invocation of the given operations and return immediately. Assumes + // that work_started() was previously called for each operation. + ASIO_DECL void post_deferred_completions(op_queue& ops); + + // Enqueue the given operation following a failed attempt to dispatch the + // operation for immediate invocation. + ASIO_DECL void do_dispatch(operation* op); + + // Process unfinished operations as part of a shutdownoperation. Assumes that + // work_started() was previously called for the operations. + ASIO_DECL void abandon_operations(op_queue& ops); + + // Get the concurrency hint that was used to initialise the scheduler. + int concurrency_hint() const + { + return concurrency_hint_; + } + +private: + // The mutex type used by this scheduler. + typedef conditionally_enabled_mutex mutex; + + // The event type used by this scheduler. + typedef conditionally_enabled_event event; + + // Structure containing thread-specific data. + typedef scheduler_thread_info thread_info; + + // Run at most one operation. May block. + ASIO_DECL std::size_t do_run_one(mutex::scoped_lock& lock, + thread_info& this_thread, const asio::error_code& ec); + + // Run at most one operation with a timeout. May block. + ASIO_DECL std::size_t do_wait_one(mutex::scoped_lock& lock, + thread_info& this_thread, long usec, const asio::error_code& ec); + + // Poll for at most one operation. + ASIO_DECL std::size_t do_poll_one(mutex::scoped_lock& lock, + thread_info& this_thread, const asio::error_code& ec); + + // Stop the task and all idle threads. + ASIO_DECL void stop_all_threads(mutex::scoped_lock& lock); + + // Wake a single idle thread, or the task, and always unlock the mutex. + ASIO_DECL void wake_one_thread_and_unlock( + mutex::scoped_lock& lock); + + // Helper class to run the scheduler in its own thread. + class thread_function; + friend class thread_function; + + // Helper class to perform task-related operations on block exit. + struct task_cleanup; + friend struct task_cleanup; + + // Helper class to call work-related operations on block exit. + struct work_cleanup; + friend struct work_cleanup; + + // Whether to optimise for single-threaded use cases. + const bool one_thread_; + + // Mutex to protect access to internal data. + mutable mutex mutex_; + + // Event to wake up blocked threads. + event wakeup_event_; + + // The task to be run by this service. + reactor* task_; + + // Operation object to represent the position of the task in the queue. + struct task_operation : operation + { + task_operation() : operation(0) {} + } task_operation_; + + // Whether the task has been interrupted. + bool task_interrupted_; + + // The count of unfinished work. + atomic_count outstanding_work_; + + // The queue of handlers that are ready to be delivered. + op_queue op_queue_; + + // Flag to indicate that the dispatcher has been stopped. + bool stopped_; + + // Flag to indicate that the dispatcher has been shut down. + bool shutdown_; + + // The concurrency hint used to initialise the scheduler. + const int concurrency_hint_; + + // The thread that is running the scheduler. + asio::detail::thread* thread_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/scheduler.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_SCHEDULER_HPP diff --git a/include/asio/include/asio/detail/scheduler_operation.hpp b/include/asio/include/asio/detail/scheduler_operation.hpp new file mode 100644 index 0000000..c873298 --- /dev/null +++ b/include/asio/include/asio/detail/scheduler_operation.hpp @@ -0,0 +1,78 @@ +// +// detail/scheduler_operation.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SCHEDULER_OPERATION_HPP +#define ASIO_DETAIL_SCHEDULER_OPERATION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/error_code.hpp" +#include "asio/detail/handler_tracking.hpp" +#include "asio/detail/op_queue.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class scheduler; + +// Base class for all operations. A function pointer is used instead of virtual +// functions to avoid the associated overhead. +class scheduler_operation ASIO_INHERIT_TRACKED_HANDLER +{ +public: + typedef scheduler_operation operation_type; + + void complete(void* owner, const asio::error_code& ec, + std::size_t bytes_transferred) + { + func_(owner, this, ec, bytes_transferred); + } + + void destroy() + { + func_(0, this, asio::error_code(), 0); + } + +protected: + typedef void (*func_type)(void*, + scheduler_operation*, + const asio::error_code&, std::size_t); + + scheduler_operation(func_type func) + : next_(0), + func_(func), + task_result_(0) + { + } + + // Prevents deletion through this type. + ~scheduler_operation() + { + } + +private: + friend class op_queue_access; + scheduler_operation* next_; + func_type func_; +protected: + friend class scheduler; + unsigned int task_result_; // Passed into bytes transferred. +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SCHEDULER_OPERATION_HPP diff --git a/include/asio/include/asio/detail/scheduler_thread_info.hpp b/include/asio/include/asio/detail/scheduler_thread_info.hpp new file mode 100644 index 0000000..d69ab9e --- /dev/null +++ b/include/asio/include/asio/detail/scheduler_thread_info.hpp @@ -0,0 +1,40 @@ +// +// detail/scheduler_thread_info.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP +#define ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/op_queue.hpp" +#include "asio/detail/thread_info_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class scheduler; +class scheduler_operation; + +struct scheduler_thread_info : public thread_info_base +{ + op_queue private_op_queue; + long private_outstanding_work; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP diff --git a/include/asio/include/asio/detail/scoped_lock.hpp b/include/asio/include/asio/detail/scoped_lock.hpp new file mode 100644 index 0000000..c0d4f9f --- /dev/null +++ b/include/asio/include/asio/detail/scoped_lock.hpp @@ -0,0 +1,101 @@ +// +// detail/scoped_lock.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SCOPED_LOCK_HPP +#define ASIO_DETAIL_SCOPED_LOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper class to lock and unlock a mutex automatically. +template +class scoped_lock + : private noncopyable +{ +public: + // Tag type used to distinguish constructors. + enum adopt_lock_t { adopt_lock }; + + // Constructor adopts a lock that is already held. + scoped_lock(Mutex& m, adopt_lock_t) + : mutex_(m), + locked_(true) + { + } + + // Constructor acquires the lock. + explicit scoped_lock(Mutex& m) + : mutex_(m) + { + mutex_.lock(); + locked_ = true; + } + + // Destructor releases the lock. + ~scoped_lock() + { + if (locked_) + mutex_.unlock(); + } + + // Explicitly acquire the lock. + void lock() + { + if (!locked_) + { + mutex_.lock(); + locked_ = true; + } + } + + // Explicitly release the lock. + void unlock() + { + if (locked_) + { + mutex_.unlock(); + locked_ = false; + } + } + + // Test whether the lock is held. + bool locked() const + { + return locked_; + } + + // Get the underlying mutex. + Mutex& mutex() + { + return mutex_; + } + +private: + // The underlying mutex. + Mutex& mutex_; + + // Whether the mutex is currently locked or unlocked. + bool locked_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SCOPED_LOCK_HPP diff --git a/include/asio/include/asio/detail/scoped_ptr.hpp b/include/asio/include/asio/detail/scoped_ptr.hpp new file mode 100644 index 0000000..f1e81b6 --- /dev/null +++ b/include/asio/include/asio/detail/scoped_ptr.hpp @@ -0,0 +1,87 @@ +// +// detail/scoped_ptr.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SCOPED_PTR_HPP +#define ASIO_DETAIL_SCOPED_PTR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class scoped_ptr +{ +public: + // Constructor. + explicit scoped_ptr(T* p = 0) + : p_(p) + { + } + + // Destructor. + ~scoped_ptr() + { + delete p_; + } + + // Access. + T* get() + { + return p_; + } + + // Access. + T* operator->() + { + return p_; + } + + // Dereference. + T& operator*() + { + return *p_; + } + + // Reset pointer. + void reset(T* p = 0) + { + delete p_; + p_ = p; + } + + // Release ownership of the pointer. + T* release() + { + T* tmp = p_; + p_ = 0; + return tmp; + } + +private: + // Disallow copying and assignment. + scoped_ptr(const scoped_ptr&); + scoped_ptr& operator=(const scoped_ptr&); + + T* p_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SCOPED_PTR_HPP diff --git a/include/asio/include/asio/detail/select_interrupter.hpp b/include/asio/include/asio/detail/select_interrupter.hpp new file mode 100644 index 0000000..5976cc6 --- /dev/null +++ b/include/asio/include/asio/detail/select_interrupter.hpp @@ -0,0 +1,46 @@ +// +// detail/select_interrupter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SELECT_INTERRUPTER_HPP +#define ASIO_DETAIL_SELECT_INTERRUPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS_RUNTIME) + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) +# include "asio/detail/socket_select_interrupter.hpp" +#elif defined(ASIO_HAS_EVENTFD) +# include "asio/detail/eventfd_select_interrupter.hpp" +#else +# include "asio/detail/pipe_select_interrupter.hpp" +#endif + +namespace asio { +namespace detail { + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) +typedef socket_select_interrupter select_interrupter; +#elif defined(ASIO_HAS_EVENTFD) +typedef eventfd_select_interrupter select_interrupter; +#else +typedef pipe_select_interrupter select_interrupter; +#endif + +} // namespace detail +} // namespace asio + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_SELECT_INTERRUPTER_HPP diff --git a/include/asio/include/asio/detail/select_reactor.hpp b/include/asio/include/asio/detail/select_reactor.hpp new file mode 100644 index 0000000..01eb716 --- /dev/null +++ b/include/asio/include/asio/detail/select_reactor.hpp @@ -0,0 +1,238 @@ +// +// detail/select_reactor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SELECT_REACTOR_HPP +#define ASIO_DETAIL_SELECT_REACTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) \ + || (!defined(ASIO_HAS_DEV_POLL) \ + && !defined(ASIO_HAS_EPOLL) \ + && !defined(ASIO_HAS_KQUEUE) \ + && !defined(ASIO_WINDOWS_RUNTIME)) + +#include +#include "asio/detail/fd_set_adapter.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/reactor_op_queue.hpp" +#include "asio/detail/select_interrupter.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/timer_queue_base.hpp" +#include "asio/detail/timer_queue_set.hpp" +#include "asio/detail/wait_op.hpp" +#include "asio/execution_context.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/thread.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class select_reactor + : public execution_context_service_base +{ +public: +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + enum op_types { read_op = 0, write_op = 1, except_op = 2, + max_select_ops = 3, connect_op = 3, max_ops = 4 }; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + enum op_types { read_op = 0, write_op = 1, except_op = 2, + max_select_ops = 3, connect_op = 1, max_ops = 3 }; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + + // Per-descriptor data. + struct per_descriptor_data + { + }; + + // Constructor. + ASIO_DECL select_reactor(asio::execution_context& ctx); + + // Destructor. + ASIO_DECL ~select_reactor(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Recreate internal descriptors following a fork. + ASIO_DECL void notify_fork( + asio::execution_context::fork_event fork_ev); + + // Initialise the task, but only if the reactor is not in its own thread. + ASIO_DECL void init_task(); + + // Register a socket with the reactor. Returns 0 on success, system error + // code on failure. + ASIO_DECL int register_descriptor(socket_type, per_descriptor_data&); + + // Register a descriptor with an associated single operation. Returns 0 on + // success, system error code on failure. + ASIO_DECL int register_internal_descriptor( + int op_type, socket_type descriptor, + per_descriptor_data& descriptor_data, reactor_op* op); + + // Post a reactor operation for immediate completion. + void post_immediate_completion(reactor_op* op, bool is_continuation) + { + scheduler_.post_immediate_completion(op, is_continuation); + } + + // Start a new operation. The reactor operation will be performed when the + // given descriptor is flagged as ready, or an error has occurred. + ASIO_DECL void start_op(int op_type, socket_type descriptor, + per_descriptor_data&, reactor_op* op, bool is_continuation, bool); + + // Cancel all operations associated with the given descriptor. The + // handlers associated with the descriptor will be invoked with the + // operation_aborted error. + ASIO_DECL void cancel_ops(socket_type descriptor, per_descriptor_data&); + + // Cancel any operations that are running against the descriptor and remove + // its registration from the reactor. The reactor resources associated with + // the descriptor must be released by calling cleanup_descriptor_data. + ASIO_DECL void deregister_descriptor(socket_type descriptor, + per_descriptor_data&, bool closing); + + // Remove the descriptor's registration from the reactor. The reactor + // resources associated with the descriptor must be released by calling + // cleanup_descriptor_data. + ASIO_DECL void deregister_internal_descriptor( + socket_type descriptor, per_descriptor_data&); + + // Perform any post-deregistration cleanup tasks associated with the + // descriptor data. + ASIO_DECL void cleanup_descriptor_data(per_descriptor_data&); + + // Move descriptor registration from one descriptor_data object to another. + ASIO_DECL void move_descriptor(socket_type descriptor, + per_descriptor_data& target_descriptor_data, + per_descriptor_data& source_descriptor_data); + + // Add a new timer queue to the reactor. + template + void add_timer_queue(timer_queue& queue); + + // Remove a timer queue from the reactor. + template + void remove_timer_queue(timer_queue& queue); + + // Schedule a new operation in the given timer queue to expire at the + // specified absolute time. + template + void schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op); + + // Cancel the timer operations associated with the given token. Returns the + // number of operations that have been posted or dispatched. + template + std::size_t cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled = (std::numeric_limits::max)()); + + // Move the timer operations associated with the given timer. + template + void move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& target, + typename timer_queue::per_timer_data& source); + + // Run select once until interrupted or events are ready to be dispatched. + ASIO_DECL void run(long usec, op_queue& ops); + + // Interrupt the select loop. + ASIO_DECL void interrupt(); + +private: +#if defined(ASIO_HAS_IOCP) + // Run the select loop in the thread. + ASIO_DECL void run_thread(); +#endif // defined(ASIO_HAS_IOCP) + + // Helper function to add a new timer queue. + ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); + + // Helper function to remove a timer queue. + ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); + + // Get the timeout value for the select call. + ASIO_DECL timeval* get_timeout(long usec, timeval& tv); + + // Cancel all operations associated with the given descriptor. This function + // does not acquire the select_reactor's mutex. + ASIO_DECL void cancel_ops_unlocked(socket_type descriptor, + const asio::error_code& ec); + + // The scheduler implementation used to post completions. +# if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_type; +# else // defined(ASIO_HAS_IOCP) + typedef class scheduler scheduler_type; +# endif // defined(ASIO_HAS_IOCP) + scheduler_type& scheduler_; + + // Mutex to protect access to internal data. + asio::detail::mutex mutex_; + + // The interrupter is used to break a blocking select call. + select_interrupter interrupter_; + + // The queues of read, write and except operations. + reactor_op_queue op_queue_[max_ops]; + + // The file descriptor sets to be passed to the select system call. + fd_set_adapter fd_sets_[max_select_ops]; + + // The timer queues. + timer_queue_set timer_queues_; + +#if defined(ASIO_HAS_IOCP) + // Helper class to run the reactor loop in a thread. + class thread_function; + friend class thread_function; + + // Does the reactor loop thread need to stop. + bool stop_thread_; + + // The thread that is running the reactor loop. + asio::detail::thread* thread_; +#endif // defined(ASIO_HAS_IOCP) + + // Whether the service has been shut down. + bool shutdown_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/select_reactor.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/select_reactor.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_IOCP) + // || (!defined(ASIO_HAS_DEV_POLL) + // && !defined(ASIO_HAS_EPOLL) + // && !defined(ASIO_HAS_KQUEUE) + // && !defined(ASIO_WINDOWS_RUNTIME)) + +#endif // ASIO_DETAIL_SELECT_REACTOR_HPP diff --git a/include/asio/include/asio/detail/service_registry.hpp b/include/asio/include/asio/detail/service_registry.hpp new file mode 100644 index 0000000..ba2d3ef --- /dev/null +++ b/include/asio/include/asio/detail/service_registry.hpp @@ -0,0 +1,164 @@ +// +// detail/service_registry.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SERVICE_REGISTRY_HPP +#define ASIO_DETAIL_SERVICE_REGISTRY_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/mutex.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +class io_context; + +namespace detail { + +template +class typeid_wrapper {}; + +class service_registry + : private noncopyable +{ +public: + // Constructor. + ASIO_DECL service_registry(execution_context& owner); + + // Destructor. + ASIO_DECL ~service_registry(); + + // Shutdown all services. + ASIO_DECL void shutdown_services(); + + // Destroy all services. + ASIO_DECL void destroy_services(); + + // Notify all services of a fork event. + ASIO_DECL void notify_fork(execution_context::fork_event fork_ev); + + // Get the service object corresponding to the specified service type. Will + // create a new service object automatically if no such object already + // exists. Ownership of the service object is not transferred to the caller. + template + Service& use_service(); + + // Get the service object corresponding to the specified service type. Will + // create a new service object automatically if no such object already + // exists. Ownership of the service object is not transferred to the caller. + // This overload is used for backwards compatibility with services that + // inherit from io_context::service. + template + Service& use_service(io_context& owner); + + // Add a service object. Throws on error, in which case ownership of the + // object is retained by the caller. + template + void add_service(Service* new_service); + + // Check whether a service object of the specified type already exists. + template + bool has_service() const; + +private: + // Initalise a service's key when the key_type typedef is not available. + template + static void init_key(execution_context::service::key& key, ...); + +#if !defined(ASIO_NO_TYPEID) + // Initalise a service's key when the key_type typedef is available. + template + static void init_key(execution_context::service::key& key, + typename enable_if< + is_base_of::value>::type*); +#endif // !defined(ASIO_NO_TYPEID) + + // Initialise a service's key based on its id. + ASIO_DECL static void init_key_from_id( + execution_context::service::key& key, + const execution_context::id& id); + +#if !defined(ASIO_NO_TYPEID) + // Initialise a service's key based on its id. + template + static void init_key_from_id(execution_context::service::key& key, + const service_id& /*id*/); +#endif // !defined(ASIO_NO_TYPEID) + + // Check if a service matches the given id. + ASIO_DECL static bool keys_match( + const execution_context::service::key& key1, + const execution_context::service::key& key2); + + // The type of a factory function used for creating a service instance. + typedef execution_context::service*(*factory_type)(void*); + + // Factory function for creating a service instance. + template + static execution_context::service* create(void* owner); + + // Destroy a service instance. + ASIO_DECL static void destroy(execution_context::service* service); + + // Helper class to manage service pointers. + struct auto_service_ptr; + friend struct auto_service_ptr; + struct auto_service_ptr + { + execution_context::service* ptr_; + ~auto_service_ptr() { destroy(ptr_); } + }; + + // Get the service object corresponding to the specified service key. Will + // create a new service object automatically if no such object already + // exists. Ownership of the service object is not transferred to the caller. + ASIO_DECL execution_context::service* do_use_service( + const execution_context::service::key& key, + factory_type factory, void* owner); + + // Add a service object. Throws on error, in which case ownership of the + // object is retained by the caller. + ASIO_DECL void do_add_service( + const execution_context::service::key& key, + execution_context::service* new_service); + + // Check whether a service object with the specified key already exists. + ASIO_DECL bool do_has_service( + const execution_context::service::key& key) const; + + // Mutex to protect access to internal data. + mutable asio::detail::mutex mutex_; + + // The owner of this service registry and the services it contains. + execution_context& owner_; + + // The first service in the list of contained services. + execution_context::service* first_service_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/service_registry.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/service_registry.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_SERVICE_REGISTRY_HPP diff --git a/include/asio/include/asio/detail/signal_blocker.hpp b/include/asio/include/asio/detail/signal_blocker.hpp new file mode 100644 index 0000000..aefba11 --- /dev/null +++ b/include/asio/include/asio/detail/signal_blocker.hpp @@ -0,0 +1,44 @@ +// +// detail/signal_blocker.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SIGNAL_BLOCKER_HPP +#define ASIO_DETAIL_SIGNAL_BLOCKER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) || defined(ASIO_WINDOWS) \ + || defined(ASIO_WINDOWS_RUNTIME) \ + || defined(__CYGWIN__) || defined(__SYMBIAN32__) +# include "asio/detail/null_signal_blocker.hpp" +#elif defined(ASIO_HAS_PTHREADS) +# include "asio/detail/posix_signal_blocker.hpp" +#else +# error Only Windows and POSIX are supported! +#endif + +namespace asio { +namespace detail { + +#if !defined(ASIO_HAS_THREADS) || defined(ASIO_WINDOWS) \ + || defined(ASIO_WINDOWS_RUNTIME) \ + || defined(__CYGWIN__) || defined(__SYMBIAN32__) +typedef null_signal_blocker signal_blocker; +#elif defined(ASIO_HAS_PTHREADS) +typedef posix_signal_blocker signal_blocker; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_SIGNAL_BLOCKER_HPP diff --git a/include/asio/include/asio/detail/signal_handler.hpp b/include/asio/include/asio/detail/signal_handler.hpp new file mode 100644 index 0000000..23ac7b3 --- /dev/null +++ b/include/asio/include/asio/detail/signal_handler.hpp @@ -0,0 +1,90 @@ +// +// detail/signal_handler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SIGNAL_HANDLER_HPP +#define ASIO_DETAIL_SIGNAL_HANDLER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/signal_op.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class signal_handler : public signal_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(signal_handler); + + signal_handler(Handler& h, const IoExecutor& io_ex) + : signal_op(&signal_handler::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(h)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + signal_handler* h(static_cast(base)); + ptr p = { asio::detail::addressof(h->handler_), h, h }; + + ASIO_HANDLER_COMPLETION((*h)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + h->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(h->handler_, h->ec_, h->signal_number_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SIGNAL_HANDLER_HPP diff --git a/include/asio/include/asio/detail/signal_init.hpp b/include/asio/include/asio/detail/signal_init.hpp new file mode 100644 index 0000000..dbffde2 --- /dev/null +++ b/include/asio/include/asio/detail/signal_init.hpp @@ -0,0 +1,47 @@ +// +// detail/signal_init.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SIGNAL_INIT_HPP +#define ASIO_DETAIL_SIGNAL_INIT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#include + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class signal_init +{ +public: + // Constructor. + signal_init() + { + std::signal(Signal, SIG_IGN); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#endif // ASIO_DETAIL_SIGNAL_INIT_HPP diff --git a/include/asio/include/asio/detail/signal_op.hpp b/include/asio/include/asio/detail/signal_op.hpp new file mode 100644 index 0000000..863fc5d --- /dev/null +++ b/include/asio/include/asio/detail/signal_op.hpp @@ -0,0 +1,49 @@ +// +// detail/signal_op.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SIGNAL_OP_HPP +#define ASIO_DETAIL_SIGNAL_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class signal_op + : public operation +{ +public: + // The error code to be passed to the completion handler. + asio::error_code ec_; + + // The signal number to be passed to the completion handler. + int signal_number_; + +protected: + signal_op(func_type func) + : operation(func), + signal_number_(0) + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SIGNAL_OP_HPP diff --git a/include/asio/include/asio/detail/signal_set_service.hpp b/include/asio/include/asio/detail/signal_set_service.hpp new file mode 100644 index 0000000..a9a8960 --- /dev/null +++ b/include/asio/include/asio/detail/signal_set_service.hpp @@ -0,0 +1,229 @@ +// +// detail/signal_set_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SIGNAL_SET_SERVICE_HPP +#define ASIO_DETAIL_SIGNAL_SET_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include +#include +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/signal_handler.hpp" +#include "asio/detail/signal_op.hpp" +#include "asio/detail/socket_types.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) +# include "asio/detail/reactor.hpp" +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +#if defined(NSIG) && (NSIG > 0) +enum { max_signal_number = NSIG }; +#else +enum { max_signal_number = 128 }; +#endif + +extern ASIO_DECL struct signal_state* get_signal_state(); + +extern "C" ASIO_DECL void asio_signal_handler(int signal_number); + +class signal_set_service : + public execution_context_service_base +{ +public: + // Type used for tracking an individual signal registration. + class registration + { + public: + // Default constructor. + registration() + : signal_number_(0), + queue_(0), + undelivered_(0), + next_in_table_(0), + prev_in_table_(0), + next_in_set_(0) + { + } + + private: + // Only this service will have access to the internal values. + friend class signal_set_service; + + // The signal number that is registered. + int signal_number_; + + // The waiting signal handlers. + op_queue* queue_; + + // The number of undelivered signals. + std::size_t undelivered_; + + // Pointers to adjacent registrations in the registrations_ table. + registration* next_in_table_; + registration* prev_in_table_; + + // Link to next registration in the signal set. + registration* next_in_set_; + }; + + // The implementation type of the signal_set. + class implementation_type + { + public: + // Default constructor. + implementation_type() + : signals_(0) + { + } + + private: + // Only this service will have access to the internal values. + friend class signal_set_service; + + // The pending signal handlers. + op_queue queue_; + + // Linked list of registered signals. + registration* signals_; + }; + + // Constructor. + ASIO_DECL signal_set_service(execution_context& context); + + // Destructor. + ASIO_DECL ~signal_set_service(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Perform fork-related housekeeping. + ASIO_DECL void notify_fork( + asio::execution_context::fork_event fork_ev); + + // Construct a new signal_set implementation. + ASIO_DECL void construct(implementation_type& impl); + + // Destroy a signal_set implementation. + ASIO_DECL void destroy(implementation_type& impl); + + // Add a signal to a signal_set. + ASIO_DECL asio::error_code add(implementation_type& impl, + int signal_number, asio::error_code& ec); + + // Remove a signal to a signal_set. + ASIO_DECL asio::error_code remove(implementation_type& impl, + int signal_number, asio::error_code& ec); + + // Remove all signals from a signal_set. + ASIO_DECL asio::error_code clear(implementation_type& impl, + asio::error_code& ec); + + // Cancel all operations associated with the signal set. + ASIO_DECL asio::error_code cancel(implementation_type& impl, + asio::error_code& ec); + + // Start an asynchronous operation to wait for a signal to be delivered. + template + void async_wait(implementation_type& impl, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef signal_handler op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "signal_set", &impl, 0, "async_wait")); + + start_wait_op(impl, p.p); + p.v = p.p = 0; + } + + // Deliver notification that a particular signal occurred. + ASIO_DECL static void deliver_signal(int signal_number); + +private: + // Helper function to add a service to the global signal state. + ASIO_DECL static void add_service(signal_set_service* service); + + // Helper function to remove a service from the global signal state. + ASIO_DECL static void remove_service(signal_set_service* service); + + // Helper function to create the pipe descriptors. + ASIO_DECL static void open_descriptors(); + + // Helper function to close the pipe descriptors. + ASIO_DECL static void close_descriptors(); + + // Helper function to start a wait operation. + ASIO_DECL void start_wait_op(implementation_type& impl, signal_op* op); + + // The scheduler used for dispatching handlers. +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + scheduler_impl& scheduler_; + +#if !defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_RUNTIME) \ + && !defined(__CYGWIN__) + // The type used for registering for pipe reactor notifications. + class pipe_read_op; + + // The reactor used for waiting for pipe readiness. + reactor& reactor_; + + // The per-descriptor reactor data used for the pipe. + reactor::per_descriptor_data reactor_data_; +#endif // !defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_RUNTIME) + // && !defined(__CYGWIN__) + + // A mapping from signal number to the registered signal sets. + registration* registrations_[max_signal_number]; + + // Pointers to adjacent services in linked list. + signal_set_service* next_; + signal_set_service* prev_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/signal_set_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_SIGNAL_SET_SERVICE_HPP diff --git a/include/asio/include/asio/detail/socket_holder.hpp b/include/asio/include/asio/detail/socket_holder.hpp new file mode 100644 index 0000000..bf631a6 --- /dev/null +++ b/include/asio/include/asio/detail/socket_holder.hpp @@ -0,0 +1,98 @@ +// +// detail/socket_holder.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOCKET_HOLDER_HPP +#define ASIO_DETAIL_SOCKET_HOLDER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Implement the resource acquisition is initialisation idiom for sockets. +class socket_holder + : private noncopyable +{ +public: + // Construct as an uninitialised socket. + socket_holder() + : socket_(invalid_socket) + { + } + + // Construct to take ownership of the specified socket. + explicit socket_holder(socket_type s) + : socket_(s) + { + } + + // Destructor. + ~socket_holder() + { + if (socket_ != invalid_socket) + { + asio::error_code ec; + socket_ops::state_type state = 0; + socket_ops::close(socket_, state, true, ec); + } + } + + // Get the underlying socket. + socket_type get() const + { + return socket_; + } + + // Reset to an uninitialised socket. + void reset() + { + if (socket_ != invalid_socket) + { + asio::error_code ec; + socket_ops::state_type state = 0; + socket_ops::close(socket_, state, true, ec); + socket_ = invalid_socket; + } + } + + // Reset to take ownership of the specified socket. + void reset(socket_type s) + { + reset(); + socket_ = s; + } + + // Release ownership of the socket. + socket_type release() + { + socket_type tmp = socket_; + socket_ = invalid_socket; + return tmp; + } + +private: + // The underlying socket. + socket_type socket_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SOCKET_HOLDER_HPP diff --git a/include/asio/include/asio/detail/socket_ops.hpp b/include/asio/include/asio/detail/socket_ops.hpp new file mode 100644 index 0000000..5098c41 --- /dev/null +++ b/include/asio/include/asio/detail/socket_ops.hpp @@ -0,0 +1,383 @@ +// +// detail/socket_ops.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOCKET_OPS_HPP +#define ASIO_DETAIL_SOCKET_OPS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#include "asio/error_code.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { +namespace socket_ops { + +// Socket state bits. +enum +{ + // The user wants a non-blocking socket. + user_set_non_blocking = 1, + + // The socket has been set non-blocking. + internal_non_blocking = 2, + + // Helper "state" used to determine whether the socket is non-blocking. + non_blocking = user_set_non_blocking | internal_non_blocking, + + // User wants connection_aborted errors, which are disabled by default. + enable_connection_aborted = 4, + + // The user set the linger option. Needs to be checked when closing. + user_set_linger = 8, + + // The socket is stream-oriented. + stream_oriented = 16, + + // The socket is datagram-oriented. + datagram_oriented = 32, + + // The socket may have been dup()-ed. + possible_dup = 64 +}; + +typedef unsigned char state_type; + +struct noop_deleter { void operator()(void*) {} }; +typedef shared_ptr shared_cancel_token_type; +typedef weak_ptr weak_cancel_token_type; + +#if !defined(ASIO_WINDOWS_RUNTIME) + +ASIO_DECL socket_type accept(socket_type s, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec); + +ASIO_DECL socket_type sync_accept(socket_type s, + state_type state, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec); + +#if defined(ASIO_HAS_IOCP) + +ASIO_DECL void complete_iocp_accept(socket_type s, + void* output_buffer, DWORD address_length, + socket_addr_type* addr, std::size_t* addrlen, + socket_type new_socket, asio::error_code& ec); + +#else // defined(ASIO_HAS_IOCP) + +ASIO_DECL bool non_blocking_accept(socket_type s, + state_type state, socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec, socket_type& new_socket); + +#endif // defined(ASIO_HAS_IOCP) + +ASIO_DECL int bind(socket_type s, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec); + +ASIO_DECL int close(socket_type s, state_type& state, + bool destruction, asio::error_code& ec); + +ASIO_DECL bool set_user_non_blocking(socket_type s, + state_type& state, bool value, asio::error_code& ec); + +ASIO_DECL bool set_internal_non_blocking(socket_type s, + state_type& state, bool value, asio::error_code& ec); + +ASIO_DECL int shutdown(socket_type s, + int what, asio::error_code& ec); + +ASIO_DECL int connect(socket_type s, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec); + +ASIO_DECL void sync_connect(socket_type s, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec); + +#if defined(ASIO_HAS_IOCP) + +ASIO_DECL void complete_iocp_connect(socket_type s, + asio::error_code& ec); + +#endif // defined(ASIO_HAS_IOCP) + +ASIO_DECL bool non_blocking_connect(socket_type s, + asio::error_code& ec); + +ASIO_DECL int socketpair(int af, int type, int protocol, + socket_type sv[2], asio::error_code& ec); + +ASIO_DECL bool sockatmark(socket_type s, asio::error_code& ec); + +ASIO_DECL size_t available(socket_type s, asio::error_code& ec); + +ASIO_DECL int listen(socket_type s, + int backlog, asio::error_code& ec); + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) +typedef WSABUF buf; +#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__) +typedef iovec buf; +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +ASIO_DECL void init_buf(buf& b, void* data, size_t size); + +ASIO_DECL void init_buf(buf& b, const void* data, size_t size); + +ASIO_DECL signed_size_type recv(socket_type s, buf* bufs, + size_t count, int flags, asio::error_code& ec); + +ASIO_DECL signed_size_type recv1(socket_type s, + void* data, size_t size, int flags, asio::error_code& ec); + +ASIO_DECL size_t sync_recv(socket_type s, state_type state, buf* bufs, + size_t count, int flags, bool all_empty, asio::error_code& ec); + +ASIO_DECL size_t sync_recv1(socket_type s, state_type state, + void* data, size_t size, int flags, asio::error_code& ec); + +#if defined(ASIO_HAS_IOCP) + +ASIO_DECL void complete_iocp_recv(state_type state, + const weak_cancel_token_type& cancel_token, bool all_empty, + asio::error_code& ec, size_t bytes_transferred); + +#else // defined(ASIO_HAS_IOCP) + +ASIO_DECL bool non_blocking_recv(socket_type s, + buf* bufs, size_t count, int flags, bool is_stream, + asio::error_code& ec, size_t& bytes_transferred); + +ASIO_DECL bool non_blocking_recv1(socket_type s, + void* data, size_t size, int flags, bool is_stream, + asio::error_code& ec, size_t& bytes_transferred); + +#endif // defined(ASIO_HAS_IOCP) + +ASIO_DECL signed_size_type recvfrom(socket_type s, buf* bufs, + size_t count, int flags, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec); + +ASIO_DECL signed_size_type recvfrom1(socket_type s, void* data, + size_t size, int flags, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec); + +ASIO_DECL size_t sync_recvfrom(socket_type s, state_type state, + buf* bufs, size_t count, int flags, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec); + +ASIO_DECL size_t sync_recvfrom1(socket_type s, state_type state, + void* data, size_t size, int flags, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec); + +#if defined(ASIO_HAS_IOCP) + +ASIO_DECL void complete_iocp_recvfrom( + const weak_cancel_token_type& cancel_token, + asio::error_code& ec); + +#else // defined(ASIO_HAS_IOCP) + +ASIO_DECL bool non_blocking_recvfrom(socket_type s, + buf* bufs, size_t count, int flags, + socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec, size_t& bytes_transferred); + +ASIO_DECL bool non_blocking_recvfrom1(socket_type s, + void* data, size_t size, int flags, + socket_addr_type* addr, std::size_t* addrlen, + asio::error_code& ec, size_t& bytes_transferred); + +#endif // defined(ASIO_HAS_IOCP) + +ASIO_DECL signed_size_type recvmsg(socket_type s, buf* bufs, + size_t count, int in_flags, int& out_flags, + asio::error_code& ec); + +ASIO_DECL size_t sync_recvmsg(socket_type s, state_type state, + buf* bufs, size_t count, int in_flags, int& out_flags, + asio::error_code& ec); + +#if defined(ASIO_HAS_IOCP) + +ASIO_DECL void complete_iocp_recvmsg( + const weak_cancel_token_type& cancel_token, + asio::error_code& ec); + +#else // defined(ASIO_HAS_IOCP) + +ASIO_DECL bool non_blocking_recvmsg(socket_type s, + buf* bufs, size_t count, int in_flags, int& out_flags, + asio::error_code& ec, size_t& bytes_transferred); + +#endif // defined(ASIO_HAS_IOCP) + +ASIO_DECL signed_size_type send(socket_type s, const buf* bufs, + size_t count, int flags, asio::error_code& ec); + +ASIO_DECL signed_size_type send1(socket_type s, + const void* data, size_t size, int flags, asio::error_code& ec); + +ASIO_DECL size_t sync_send(socket_type s, state_type state, + const buf* bufs, size_t count, int flags, + bool all_empty, asio::error_code& ec); + +ASIO_DECL size_t sync_send1(socket_type s, state_type state, + const void* data, size_t size, int flags, asio::error_code& ec); + +#if defined(ASIO_HAS_IOCP) + +ASIO_DECL void complete_iocp_send( + const weak_cancel_token_type& cancel_token, + asio::error_code& ec); + +#else // defined(ASIO_HAS_IOCP) + +ASIO_DECL bool non_blocking_send(socket_type s, + const buf* bufs, size_t count, int flags, + asio::error_code& ec, size_t& bytes_transferred); + +ASIO_DECL bool non_blocking_send1(socket_type s, + const void* data, size_t size, int flags, + asio::error_code& ec, size_t& bytes_transferred); + +#endif // defined(ASIO_HAS_IOCP) + +ASIO_DECL signed_size_type sendto(socket_type s, const buf* bufs, + size_t count, int flags, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec); + +ASIO_DECL signed_size_type sendto1(socket_type s, const void* data, + size_t size, int flags, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec); + +ASIO_DECL size_t sync_sendto(socket_type s, state_type state, + const buf* bufs, size_t count, int flags, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec); + +ASIO_DECL size_t sync_sendto1(socket_type s, state_type state, + const void* data, size_t size, int flags, const socket_addr_type* addr, + std::size_t addrlen, asio::error_code& ec); + +#if !defined(ASIO_HAS_IOCP) + +ASIO_DECL bool non_blocking_sendto(socket_type s, + const buf* bufs, size_t count, int flags, + const socket_addr_type* addr, std::size_t addrlen, + asio::error_code& ec, size_t& bytes_transferred); + +ASIO_DECL bool non_blocking_sendto1(socket_type s, + const void* data, size_t size, int flags, + const socket_addr_type* addr, std::size_t addrlen, + asio::error_code& ec, size_t& bytes_transferred); + +#endif // !defined(ASIO_HAS_IOCP) + +ASIO_DECL socket_type socket(int af, int type, int protocol, + asio::error_code& ec); + +ASIO_DECL int setsockopt(socket_type s, state_type& state, + int level, int optname, const void* optval, + std::size_t optlen, asio::error_code& ec); + +ASIO_DECL int getsockopt(socket_type s, state_type state, + int level, int optname, void* optval, + size_t* optlen, asio::error_code& ec); + +ASIO_DECL int getpeername(socket_type s, socket_addr_type* addr, + std::size_t* addrlen, bool cached, asio::error_code& ec); + +ASIO_DECL int getsockname(socket_type s, socket_addr_type* addr, + std::size_t* addrlen, asio::error_code& ec); + +ASIO_DECL int ioctl(socket_type s, state_type& state, + int cmd, ioctl_arg_type* arg, asio::error_code& ec); + +ASIO_DECL int select(int nfds, fd_set* readfds, fd_set* writefds, + fd_set* exceptfds, timeval* timeout, asio::error_code& ec); + +ASIO_DECL int poll_read(socket_type s, + state_type state, int msec, asio::error_code& ec); + +ASIO_DECL int poll_write(socket_type s, + state_type state, int msec, asio::error_code& ec); + +ASIO_DECL int poll_error(socket_type s, + state_type state, int msec, asio::error_code& ec); + +ASIO_DECL int poll_connect(socket_type s, + int msec, asio::error_code& ec); + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +ASIO_DECL const char* inet_ntop(int af, const void* src, char* dest, + size_t length, unsigned long scope_id, asio::error_code& ec); + +ASIO_DECL int inet_pton(int af, const char* src, void* dest, + unsigned long* scope_id, asio::error_code& ec); + +ASIO_DECL int gethostname(char* name, + int namelen, asio::error_code& ec); + +#if !defined(ASIO_WINDOWS_RUNTIME) + +ASIO_DECL asio::error_code getaddrinfo(const char* host, + const char* service, const addrinfo_type& hints, + addrinfo_type** result, asio::error_code& ec); + +ASIO_DECL asio::error_code background_getaddrinfo( + const weak_cancel_token_type& cancel_token, const char* host, + const char* service, const addrinfo_type& hints, + addrinfo_type** result, asio::error_code& ec); + +ASIO_DECL void freeaddrinfo(addrinfo_type* ai); + +ASIO_DECL asio::error_code getnameinfo( + const socket_addr_type* addr, std::size_t addrlen, + char* host, std::size_t hostlen, char* serv, + std::size_t servlen, int flags, asio::error_code& ec); + +ASIO_DECL asio::error_code sync_getnameinfo( + const socket_addr_type* addr, std::size_t addrlen, + char* host, std::size_t hostlen, char* serv, + std::size_t servlen, int sock_type, asio::error_code& ec); + +ASIO_DECL asio::error_code background_getnameinfo( + const weak_cancel_token_type& cancel_token, + const socket_addr_type* addr, std::size_t addrlen, + char* host, std::size_t hostlen, char* serv, + std::size_t servlen, int sock_type, asio::error_code& ec); + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +ASIO_DECL u_long_type network_to_host_long(u_long_type value); + +ASIO_DECL u_long_type host_to_network_long(u_long_type value); + +ASIO_DECL u_short_type network_to_host_short(u_short_type value); + +ASIO_DECL u_short_type host_to_network_short(u_short_type value); + +} // namespace socket_ops +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/socket_ops.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_SOCKET_OPS_HPP diff --git a/include/asio/include/asio/detail/socket_option.hpp b/include/asio/include/asio/detail/socket_option.hpp new file mode 100644 index 0000000..4fe93ac --- /dev/null +++ b/include/asio/include/asio/detail/socket_option.hpp @@ -0,0 +1,316 @@ +// +// detail/socket_option.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOCKET_OPTION_HPP +#define ASIO_DETAIL_SOCKET_OPTION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include +#include "asio/detail/socket_types.hpp" +#include "asio/detail/throw_exception.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { +namespace socket_option { + +// Helper template for implementing boolean-based options. +template +class boolean +{ +public: + // Default constructor. + boolean() + : value_(0) + { + } + + // Construct with a specific option value. + explicit boolean(bool v) + : value_(v ? 1 : 0) + { + } + + // Set the current value of the boolean. + boolean& operator=(bool v) + { + value_ = v ? 1 : 0; + return *this; + } + + // Get the current value of the boolean. + bool value() const + { + return !!value_; + } + + // Convert to bool. + operator bool() const + { + return !!value_; + } + + // Test for false. + bool operator!() const + { + return !value_; + } + + // Get the level of the socket option. + template + int level(const Protocol&) const + { + return Level; + } + + // Get the name of the socket option. + template + int name(const Protocol&) const + { + return Name; + } + + // Get the address of the boolean data. + template + int* data(const Protocol&) + { + return &value_; + } + + // Get the address of the boolean data. + template + const int* data(const Protocol&) const + { + return &value_; + } + + // Get the size of the boolean data. + template + std::size_t size(const Protocol&) const + { + return sizeof(value_); + } + + // Set the size of the boolean data. + template + void resize(const Protocol&, std::size_t s) + { + // On some platforms (e.g. Windows Vista), the getsockopt function will + // return the size of a boolean socket option as one byte, even though a + // four byte integer was passed in. + switch (s) + { + case sizeof(char): + value_ = *reinterpret_cast(&value_) ? 1 : 0; + break; + case sizeof(value_): + break; + default: + { + std::length_error ex("boolean socket option resize"); + asio::detail::throw_exception(ex); + } + } + } + +private: + int value_; +}; + +// Helper template for implementing integer options. +template +class integer +{ +public: + // Default constructor. + integer() + : value_(0) + { + } + + // Construct with a specific option value. + explicit integer(int v) + : value_(v) + { + } + + // Set the value of the int option. + integer& operator=(int v) + { + value_ = v; + return *this; + } + + // Get the current value of the int option. + int value() const + { + return value_; + } + + // Get the level of the socket option. + template + int level(const Protocol&) const + { + return Level; + } + + // Get the name of the socket option. + template + int name(const Protocol&) const + { + return Name; + } + + // Get the address of the int data. + template + int* data(const Protocol&) + { + return &value_; + } + + // Get the address of the int data. + template + const int* data(const Protocol&) const + { + return &value_; + } + + // Get the size of the int data. + template + std::size_t size(const Protocol&) const + { + return sizeof(value_); + } + + // Set the size of the int data. + template + void resize(const Protocol&, std::size_t s) + { + if (s != sizeof(value_)) + { + std::length_error ex("integer socket option resize"); + asio::detail::throw_exception(ex); + } + } + +private: + int value_; +}; + +// Helper template for implementing linger options. +template +class linger +{ +public: + // Default constructor. + linger() + { + value_.l_onoff = 0; + value_.l_linger = 0; + } + + // Construct with specific option values. + linger(bool e, int t) + { + enabled(e); + timeout ASIO_PREVENT_MACRO_SUBSTITUTION(t); + } + + // Set the value for whether linger is enabled. + void enabled(bool value) + { + value_.l_onoff = value ? 1 : 0; + } + + // Get the value for whether linger is enabled. + bool enabled() const + { + return value_.l_onoff != 0; + } + + // Set the value for the linger timeout. + void timeout ASIO_PREVENT_MACRO_SUBSTITUTION(int value) + { +#if defined(WIN32) + value_.l_linger = static_cast(value); +#else + value_.l_linger = value; +#endif + } + + // Get the value for the linger timeout. + int timeout ASIO_PREVENT_MACRO_SUBSTITUTION() const + { + return static_cast(value_.l_linger); + } + + // Get the level of the socket option. + template + int level(const Protocol&) const + { + return Level; + } + + // Get the name of the socket option. + template + int name(const Protocol&) const + { + return Name; + } + + // Get the address of the linger data. + template + detail::linger_type* data(const Protocol&) + { + return &value_; + } + + // Get the address of the linger data. + template + const detail::linger_type* data(const Protocol&) const + { + return &value_; + } + + // Get the size of the linger data. + template + std::size_t size(const Protocol&) const + { + return sizeof(value_); + } + + // Set the size of the int data. + template + void resize(const Protocol&, std::size_t s) + { + if (s != sizeof(value_)) + { + std::length_error ex("linger socket option resize"); + asio::detail::throw_exception(ex); + } + } + +private: + detail::linger_type value_; +}; + +} // namespace socket_option +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SOCKET_OPTION_HPP diff --git a/include/asio/include/asio/detail/socket_select_interrupter.hpp b/include/asio/include/asio/detail/socket_select_interrupter.hpp new file mode 100644 index 0000000..561ad05 --- /dev/null +++ b/include/asio/include/asio/detail/socket_select_interrupter.hpp @@ -0,0 +1,91 @@ +// +// detail/socket_select_interrupter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP +#define ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_WINDOWS_RUNTIME) + +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(__SYMBIAN32__) + +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class socket_select_interrupter +{ +public: + // Constructor. + ASIO_DECL socket_select_interrupter(); + + // Destructor. + ASIO_DECL ~socket_select_interrupter(); + + // Recreate the interrupter's descriptors. Used after a fork. + ASIO_DECL void recreate(); + + // Interrupt the select call. + ASIO_DECL void interrupt(); + + // Reset the select interrupter. Returns true if the reset was successful. + ASIO_DECL bool reset(); + + // Get the read descriptor to be passed to select. + socket_type read_descriptor() const + { + return read_descriptor_; + } + +private: + // Open the descriptors. Throws on error. + ASIO_DECL void open_descriptors(); + + // Close the descriptors. + ASIO_DECL void close_descriptors(); + + // The read end of a connection used to interrupt the select call. This file + // descriptor is passed to select such that when it is time to stop, a single + // byte will be written on the other end of the connection and this + // descriptor will become readable. + socket_type read_descriptor_; + + // The write end of a connection used to interrupt the select call. A single + // byte may be written to this to wake up the select which is waiting for the + // other end to become readable. + socket_type write_descriptor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/socket_select_interrupter.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS) + // || defined(__CYGWIN__) + // || defined(__SYMBIAN32__) + +#endif // !defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP diff --git a/include/asio/include/asio/detail/socket_types.hpp b/include/asio/include/asio/detail/socket_types.hpp new file mode 100644 index 0000000..a118d9d --- /dev/null +++ b/include/asio/include/asio/detail/socket_types.hpp @@ -0,0 +1,416 @@ +// +// detail/socket_types.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOCKET_TYPES_HPP +#define ASIO_DETAIL_SOCKET_TYPES_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) +// Empty. +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) +# error WinSock.h has already been included +# endif // defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) +# if defined(__BORLANDC__) +# include // Needed for __errno +# if !defined(_WSPIAPI_H_) +# define _WSPIAPI_H_ +# define ASIO_WSPIAPI_H_DEFINED +# endif // !defined(_WSPIAPI_H_) +# endif // defined(__BORLANDC__) +# include +# include +# if defined(WINAPI_FAMILY) +# if ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) != 0) +# include +# endif // ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) != 0) +# endif // defined(WINAPI_FAMILY) +# if !defined(ASIO_WINDOWS_APP) +# include +# endif // !defined(ASIO_WINDOWS_APP) +# if defined(ASIO_WSPIAPI_H_DEFINED) +# undef _WSPIAPI_H_ +# undef ASIO_WSPIAPI_H_DEFINED +# endif // defined(ASIO_WSPIAPI_H_DEFINED) +# if !defined(ASIO_NO_DEFAULT_LINKED_LIBS) +# if defined(UNDER_CE) +# pragma comment(lib, "ws2.lib") +# elif defined(_MSC_VER) || defined(__BORLANDC__) +# pragma comment(lib, "ws2_32.lib") +# if !defined(ASIO_WINDOWS_APP) +# pragma comment(lib, "mswsock.lib") +# endif // !defined(ASIO_WINDOWS_APP) +# endif // defined(_MSC_VER) || defined(__BORLANDC__) +# endif // !defined(ASIO_NO_DEFAULT_LINKED_LIBS) +# include "asio/detail/old_win_sdk_compat.hpp" +#else +# include +# if (defined(__MACH__) && defined(__APPLE__)) \ + || defined(__FreeBSD__) || defined(__NetBSD__) \ + || defined(__OpenBSD__) || defined(__linux__) \ + || defined(__EMSCRIPTEN__) +# include +# elif !defined(__SYMBIAN32__) +# include +# endif +# include +# include +# include +# if defined(__hpux) +# include +# endif +# if !defined(__hpux) || defined(__SELECT) +# include +# endif +# include +# include +# include +# include +# if !defined(__SYMBIAN32__) +# include +# endif +# include +# include +# include +# include +# if defined(__sun) +# include +# include +# endif +#endif + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_WINDOWS_RUNTIME) +const int max_addr_v4_str_len = 256; +const int max_addr_v6_str_len = 256; +typedef unsigned __int32 u_long_type; +typedef unsigned __int16 u_short_type; +struct in4_addr_type { u_long_type s_addr; }; +struct in4_mreq_type { in4_addr_type imr_multiaddr, imr_interface; }; +struct in6_addr_type { unsigned char s6_addr[16]; }; +struct in6_mreq_type { in6_addr_type ipv6mr_multiaddr; + unsigned long ipv6mr_interface; }; +struct socket_addr_type { int sa_family; }; +struct sockaddr_in4_type { int sin_family; + in4_addr_type sin_addr; u_short_type sin_port; }; +struct sockaddr_in6_type { int sin6_family; + in6_addr_type sin6_addr; u_short_type sin6_port; + u_long_type sin6_flowinfo; u_long_type sin6_scope_id; }; +struct sockaddr_storage_type { int ss_family; + unsigned char ss_bytes[128 - sizeof(int)]; }; +struct addrinfo_type { int ai_flags; + int ai_family, ai_socktype, ai_protocol; + int ai_addrlen; const void* ai_addr; + const char* ai_canonname; addrinfo_type* ai_next; }; +struct linger_type { u_short_type l_onoff, l_linger; }; +typedef u_long_type ioctl_arg_type; +typedef int signed_size_type; +# define ASIO_OS_DEF(c) ASIO_OS_DEF_##c +# define ASIO_OS_DEF_AF_UNSPEC 0 +# define ASIO_OS_DEF_AF_INET 2 +# define ASIO_OS_DEF_AF_INET6 23 +# define ASIO_OS_DEF_SOCK_STREAM 1 +# define ASIO_OS_DEF_SOCK_DGRAM 2 +# define ASIO_OS_DEF_SOCK_RAW 3 +# define ASIO_OS_DEF_SOCK_SEQPACKET 5 +# define ASIO_OS_DEF_IPPROTO_IP 0 +# define ASIO_OS_DEF_IPPROTO_IPV6 41 +# define ASIO_OS_DEF_IPPROTO_TCP 6 +# define ASIO_OS_DEF_IPPROTO_UDP 17 +# define ASIO_OS_DEF_IPPROTO_ICMP 1 +# define ASIO_OS_DEF_IPPROTO_ICMPV6 58 +# define ASIO_OS_DEF_FIONBIO 1 +# define ASIO_OS_DEF_FIONREAD 2 +# define ASIO_OS_DEF_INADDR_ANY 0 +# define ASIO_OS_DEF_MSG_OOB 0x1 +# define ASIO_OS_DEF_MSG_PEEK 0x2 +# define ASIO_OS_DEF_MSG_DONTROUTE 0x4 +# define ASIO_OS_DEF_MSG_EOR 0 // Not supported. +# define ASIO_OS_DEF_SHUT_RD 0x0 +# define ASIO_OS_DEF_SHUT_WR 0x1 +# define ASIO_OS_DEF_SHUT_RDWR 0x2 +# define ASIO_OS_DEF_SOMAXCONN 0x7fffffff +# define ASIO_OS_DEF_SOL_SOCKET 0xffff +# define ASIO_OS_DEF_SO_BROADCAST 0x20 +# define ASIO_OS_DEF_SO_DEBUG 0x1 +# define ASIO_OS_DEF_SO_DONTROUTE 0x10 +# define ASIO_OS_DEF_SO_KEEPALIVE 0x8 +# define ASIO_OS_DEF_SO_LINGER 0x80 +# define ASIO_OS_DEF_SO_OOBINLINE 0x100 +# define ASIO_OS_DEF_SO_SNDBUF 0x1001 +# define ASIO_OS_DEF_SO_RCVBUF 0x1002 +# define ASIO_OS_DEF_SO_SNDLOWAT 0x1003 +# define ASIO_OS_DEF_SO_RCVLOWAT 0x1004 +# define ASIO_OS_DEF_SO_REUSEADDR 0x4 +# define ASIO_OS_DEF_TCP_NODELAY 0x1 +# define ASIO_OS_DEF_IP_MULTICAST_IF 2 +# define ASIO_OS_DEF_IP_MULTICAST_TTL 3 +# define ASIO_OS_DEF_IP_MULTICAST_LOOP 4 +# define ASIO_OS_DEF_IP_ADD_MEMBERSHIP 5 +# define ASIO_OS_DEF_IP_DROP_MEMBERSHIP 6 +# define ASIO_OS_DEF_IP_TTL 7 +# define ASIO_OS_DEF_IPV6_UNICAST_HOPS 4 +# define ASIO_OS_DEF_IPV6_MULTICAST_IF 9 +# define ASIO_OS_DEF_IPV6_MULTICAST_HOPS 10 +# define ASIO_OS_DEF_IPV6_MULTICAST_LOOP 11 +# define ASIO_OS_DEF_IPV6_JOIN_GROUP 12 +# define ASIO_OS_DEF_IPV6_LEAVE_GROUP 13 +# define ASIO_OS_DEF_AI_CANONNAME 0x2 +# define ASIO_OS_DEF_AI_PASSIVE 0x1 +# define ASIO_OS_DEF_AI_NUMERICHOST 0x4 +# define ASIO_OS_DEF_AI_NUMERICSERV 0x8 +# define ASIO_OS_DEF_AI_V4MAPPED 0x800 +# define ASIO_OS_DEF_AI_ALL 0x100 +# define ASIO_OS_DEF_AI_ADDRCONFIG 0x400 +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) +typedef SOCKET socket_type; +const SOCKET invalid_socket = INVALID_SOCKET; +const int socket_error_retval = SOCKET_ERROR; +const int max_addr_v4_str_len = 256; +const int max_addr_v6_str_len = 256; +typedef sockaddr socket_addr_type; +typedef in_addr in4_addr_type; +typedef ip_mreq in4_mreq_type; +typedef sockaddr_in sockaddr_in4_type; +# if defined(ASIO_HAS_OLD_WIN_SDK) +typedef in6_addr_emulation in6_addr_type; +typedef ipv6_mreq_emulation in6_mreq_type; +typedef sockaddr_in6_emulation sockaddr_in6_type; +typedef sockaddr_storage_emulation sockaddr_storage_type; +typedef addrinfo_emulation addrinfo_type; +# else +typedef in6_addr in6_addr_type; +typedef ipv6_mreq in6_mreq_type; +typedef sockaddr_in6 sockaddr_in6_type; +typedef sockaddr_storage sockaddr_storage_type; +typedef addrinfo addrinfo_type; +# endif +typedef ::linger linger_type; +typedef unsigned long ioctl_arg_type; +typedef u_long u_long_type; +typedef u_short u_short_type; +typedef int signed_size_type; +# define ASIO_OS_DEF(c) ASIO_OS_DEF_##c +# define ASIO_OS_DEF_AF_UNSPEC AF_UNSPEC +# define ASIO_OS_DEF_AF_INET AF_INET +# define ASIO_OS_DEF_AF_INET6 AF_INET6 +# define ASIO_OS_DEF_SOCK_STREAM SOCK_STREAM +# define ASIO_OS_DEF_SOCK_DGRAM SOCK_DGRAM +# define ASIO_OS_DEF_SOCK_RAW SOCK_RAW +# define ASIO_OS_DEF_SOCK_SEQPACKET SOCK_SEQPACKET +# define ASIO_OS_DEF_IPPROTO_IP IPPROTO_IP +# define ASIO_OS_DEF_IPPROTO_IPV6 IPPROTO_IPV6 +# define ASIO_OS_DEF_IPPROTO_TCP IPPROTO_TCP +# define ASIO_OS_DEF_IPPROTO_UDP IPPROTO_UDP +# define ASIO_OS_DEF_IPPROTO_ICMP IPPROTO_ICMP +# define ASIO_OS_DEF_IPPROTO_ICMPV6 IPPROTO_ICMPV6 +# define ASIO_OS_DEF_FIONBIO FIONBIO +# define ASIO_OS_DEF_FIONREAD FIONREAD +# define ASIO_OS_DEF_INADDR_ANY INADDR_ANY +# define ASIO_OS_DEF_MSG_OOB MSG_OOB +# define ASIO_OS_DEF_MSG_PEEK MSG_PEEK +# define ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE +# define ASIO_OS_DEF_MSG_EOR 0 // Not supported on Windows. +# define ASIO_OS_DEF_SHUT_RD SD_RECEIVE +# define ASIO_OS_DEF_SHUT_WR SD_SEND +# define ASIO_OS_DEF_SHUT_RDWR SD_BOTH +# define ASIO_OS_DEF_SOMAXCONN SOMAXCONN +# define ASIO_OS_DEF_SOL_SOCKET SOL_SOCKET +# define ASIO_OS_DEF_SO_BROADCAST SO_BROADCAST +# define ASIO_OS_DEF_SO_DEBUG SO_DEBUG +# define ASIO_OS_DEF_SO_DONTROUTE SO_DONTROUTE +# define ASIO_OS_DEF_SO_KEEPALIVE SO_KEEPALIVE +# define ASIO_OS_DEF_SO_LINGER SO_LINGER +# define ASIO_OS_DEF_SO_OOBINLINE SO_OOBINLINE +# define ASIO_OS_DEF_SO_SNDBUF SO_SNDBUF +# define ASIO_OS_DEF_SO_RCVBUF SO_RCVBUF +# define ASIO_OS_DEF_SO_SNDLOWAT SO_SNDLOWAT +# define ASIO_OS_DEF_SO_RCVLOWAT SO_RCVLOWAT +# define ASIO_OS_DEF_SO_REUSEADDR SO_REUSEADDR +# define ASIO_OS_DEF_TCP_NODELAY TCP_NODELAY +# define ASIO_OS_DEF_IP_MULTICAST_IF IP_MULTICAST_IF +# define ASIO_OS_DEF_IP_MULTICAST_TTL IP_MULTICAST_TTL +# define ASIO_OS_DEF_IP_MULTICAST_LOOP IP_MULTICAST_LOOP +# define ASIO_OS_DEF_IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP +# define ASIO_OS_DEF_IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP +# define ASIO_OS_DEF_IP_TTL IP_TTL +# define ASIO_OS_DEF_IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS +# define ASIO_OS_DEF_IPV6_MULTICAST_IF IPV6_MULTICAST_IF +# define ASIO_OS_DEF_IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS +# define ASIO_OS_DEF_IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP +# define ASIO_OS_DEF_IPV6_JOIN_GROUP IPV6_JOIN_GROUP +# define ASIO_OS_DEF_IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP +# define ASIO_OS_DEF_AI_CANONNAME AI_CANONNAME +# define ASIO_OS_DEF_AI_PASSIVE AI_PASSIVE +# define ASIO_OS_DEF_AI_NUMERICHOST AI_NUMERICHOST +# if defined(AI_NUMERICSERV) +# define ASIO_OS_DEF_AI_NUMERICSERV AI_NUMERICSERV +# else +# define ASIO_OS_DEF_AI_NUMERICSERV 0 +# endif +# if defined(AI_V4MAPPED) +# define ASIO_OS_DEF_AI_V4MAPPED AI_V4MAPPED +# else +# define ASIO_OS_DEF_AI_V4MAPPED 0 +# endif +# if defined(AI_ALL) +# define ASIO_OS_DEF_AI_ALL AI_ALL +# else +# define ASIO_OS_DEF_AI_ALL 0 +# endif +# if defined(AI_ADDRCONFIG) +# define ASIO_OS_DEF_AI_ADDRCONFIG AI_ADDRCONFIG +# else +# define ASIO_OS_DEF_AI_ADDRCONFIG 0 +# endif +# if defined (_WIN32_WINNT) +const int max_iov_len = 64; +# else +const int max_iov_len = 16; +# endif +#else +typedef int socket_type; +const int invalid_socket = -1; +const int socket_error_retval = -1; +const int max_addr_v4_str_len = INET_ADDRSTRLEN; +#if defined(INET6_ADDRSTRLEN) +const int max_addr_v6_str_len = INET6_ADDRSTRLEN + 1 + IF_NAMESIZE; +#else // defined(INET6_ADDRSTRLEN) +const int max_addr_v6_str_len = 256; +#endif // defined(INET6_ADDRSTRLEN) +typedef sockaddr socket_addr_type; +typedef in_addr in4_addr_type; +# if defined(__hpux) +// HP-UX doesn't provide ip_mreq when _XOPEN_SOURCE_EXTENDED is defined. +struct in4_mreq_type +{ + struct in_addr imr_multiaddr; + struct in_addr imr_interface; +}; +# else +typedef ip_mreq in4_mreq_type; +# endif +typedef sockaddr_in sockaddr_in4_type; +typedef in6_addr in6_addr_type; +typedef ipv6_mreq in6_mreq_type; +typedef sockaddr_in6 sockaddr_in6_type; +typedef sockaddr_storage sockaddr_storage_type; +typedef sockaddr_un sockaddr_un_type; +typedef addrinfo addrinfo_type; +typedef ::linger linger_type; +typedef int ioctl_arg_type; +typedef uint32_t u_long_type; +typedef uint16_t u_short_type; +#if defined(ASIO_HAS_SSIZE_T) +typedef ssize_t signed_size_type; +#else // defined(ASIO_HAS_SSIZE_T) +typedef int signed_size_type; +#endif // defined(ASIO_HAS_SSIZE_T) +# define ASIO_OS_DEF(c) ASIO_OS_DEF_##c +# define ASIO_OS_DEF_AF_UNSPEC AF_UNSPEC +# define ASIO_OS_DEF_AF_INET AF_INET +# define ASIO_OS_DEF_AF_INET6 AF_INET6 +# define ASIO_OS_DEF_SOCK_STREAM SOCK_STREAM +# define ASIO_OS_DEF_SOCK_DGRAM SOCK_DGRAM +# define ASIO_OS_DEF_SOCK_RAW SOCK_RAW +# define ASIO_OS_DEF_SOCK_SEQPACKET SOCK_SEQPACKET +# define ASIO_OS_DEF_IPPROTO_IP IPPROTO_IP +# define ASIO_OS_DEF_IPPROTO_IPV6 IPPROTO_IPV6 +# define ASIO_OS_DEF_IPPROTO_TCP IPPROTO_TCP +# define ASIO_OS_DEF_IPPROTO_UDP IPPROTO_UDP +# define ASIO_OS_DEF_IPPROTO_ICMP IPPROTO_ICMP +# define ASIO_OS_DEF_IPPROTO_ICMPV6 IPPROTO_ICMPV6 +# define ASIO_OS_DEF_FIONBIO FIONBIO +# define ASIO_OS_DEF_FIONREAD FIONREAD +# define ASIO_OS_DEF_INADDR_ANY INADDR_ANY +# define ASIO_OS_DEF_MSG_OOB MSG_OOB +# define ASIO_OS_DEF_MSG_PEEK MSG_PEEK +# define ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE +# define ASIO_OS_DEF_MSG_EOR MSG_EOR +# define ASIO_OS_DEF_SHUT_RD SHUT_RD +# define ASIO_OS_DEF_SHUT_WR SHUT_WR +# define ASIO_OS_DEF_SHUT_RDWR SHUT_RDWR +# define ASIO_OS_DEF_SOMAXCONN SOMAXCONN +# define ASIO_OS_DEF_SOL_SOCKET SOL_SOCKET +# define ASIO_OS_DEF_SO_BROADCAST SO_BROADCAST +# define ASIO_OS_DEF_SO_DEBUG SO_DEBUG +# define ASIO_OS_DEF_SO_DONTROUTE SO_DONTROUTE +# define ASIO_OS_DEF_SO_KEEPALIVE SO_KEEPALIVE +# define ASIO_OS_DEF_SO_LINGER SO_LINGER +# define ASIO_OS_DEF_SO_OOBINLINE SO_OOBINLINE +# define ASIO_OS_DEF_SO_SNDBUF SO_SNDBUF +# define ASIO_OS_DEF_SO_RCVBUF SO_RCVBUF +# define ASIO_OS_DEF_SO_SNDLOWAT SO_SNDLOWAT +# define ASIO_OS_DEF_SO_RCVLOWAT SO_RCVLOWAT +# define ASIO_OS_DEF_SO_REUSEADDR SO_REUSEADDR +# define ASIO_OS_DEF_TCP_NODELAY TCP_NODELAY +# define ASIO_OS_DEF_IP_MULTICAST_IF IP_MULTICAST_IF +# define ASIO_OS_DEF_IP_MULTICAST_TTL IP_MULTICAST_TTL +# define ASIO_OS_DEF_IP_MULTICAST_LOOP IP_MULTICAST_LOOP +# define ASIO_OS_DEF_IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP +# define ASIO_OS_DEF_IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP +# define ASIO_OS_DEF_IP_TTL IP_TTL +# define ASIO_OS_DEF_IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS +# define ASIO_OS_DEF_IPV6_MULTICAST_IF IPV6_MULTICAST_IF +# define ASIO_OS_DEF_IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS +# define ASIO_OS_DEF_IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP +# define ASIO_OS_DEF_IPV6_JOIN_GROUP IPV6_JOIN_GROUP +# define ASIO_OS_DEF_IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP +# define ASIO_OS_DEF_AI_CANONNAME AI_CANONNAME +# define ASIO_OS_DEF_AI_PASSIVE AI_PASSIVE +# define ASIO_OS_DEF_AI_NUMERICHOST AI_NUMERICHOST +# if defined(AI_NUMERICSERV) +# define ASIO_OS_DEF_AI_NUMERICSERV AI_NUMERICSERV +# else +# define ASIO_OS_DEF_AI_NUMERICSERV 0 +# endif +// Note: QNX Neutrino 6.3 defines AI_V4MAPPED, AI_ALL and AI_ADDRCONFIG but +// does not implement them. Therefore they are specifically excluded here. +# if defined(AI_V4MAPPED) && !defined(__QNXNTO__) +# define ASIO_OS_DEF_AI_V4MAPPED AI_V4MAPPED +# else +# define ASIO_OS_DEF_AI_V4MAPPED 0 +# endif +# if defined(AI_ALL) && !defined(__QNXNTO__) +# define ASIO_OS_DEF_AI_ALL AI_ALL +# else +# define ASIO_OS_DEF_AI_ALL 0 +# endif +# if defined(AI_ADDRCONFIG) && !defined(__QNXNTO__) +# define ASIO_OS_DEF_AI_ADDRCONFIG AI_ADDRCONFIG +# else +# define ASIO_OS_DEF_AI_ADDRCONFIG 0 +# endif +# if defined(IOV_MAX) +const int max_iov_len = IOV_MAX; +# else +// POSIX platforms are not required to define IOV_MAX. +const int max_iov_len = 16; +# endif +#endif +const int custom_socket_option_level = 0xA5100000; +const int enable_connection_aborted_option = 1; +const int always_fail_option = 2; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_SOCKET_TYPES_HPP diff --git a/include/asio/include/asio/detail/solaris_fenced_block.hpp b/include/asio/include/asio/detail/solaris_fenced_block.hpp new file mode 100644 index 0000000..20f8333 --- /dev/null +++ b/include/asio/include/asio/detail/solaris_fenced_block.hpp @@ -0,0 +1,62 @@ +// +// detail/solaris_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP +#define ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(__sun) + +#include +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class solaris_fenced_block + : private noncopyable +{ +public: + enum half_t { half }; + enum full_t { full }; + + // Constructor for a half fenced block. + explicit solaris_fenced_block(half_t) + { + } + + // Constructor for a full fenced block. + explicit solaris_fenced_block(full_t) + { + membar_consumer(); + } + + // Destructor. + ~solaris_fenced_block() + { + membar_producer(); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(__sun) + +#endif // ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/source_location.hpp b/include/asio/include/asio/detail/source_location.hpp new file mode 100644 index 0000000..7f83175 --- /dev/null +++ b/include/asio/include/asio/detail/source_location.hpp @@ -0,0 +1,45 @@ +// +// detail/source_location.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_SOURCE_LOCATION_HPP +#define ASIO_DETAIL_SOURCE_LOCATION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_SOURCE_LOCATION) + +#if defined(ASIO_HAS_STD_SOURCE_LOCATION) +# include +#elif defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) +# include +#else // defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) +# error ASIO_HAS_SOURCE_LOCATION is set \ + but no source_location is available +#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_STD_SOURCE_LOCATION) +using std::source_location; +#elif defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) +using std::experimental::source_location; +#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION) + +} // namespace detail +} // namespace asio + +#endif // defined(ASIO_HAS_SOURCE_LOCATION) + +#endif // ASIO_DETAIL_SOURCE_LOCATION_HPP diff --git a/include/asio/include/asio/detail/static_mutex.hpp b/include/asio/include/asio/detail/static_mutex.hpp new file mode 100644 index 0000000..2efd167 --- /dev/null +++ b/include/asio/include/asio/detail/static_mutex.hpp @@ -0,0 +1,52 @@ +// +// detail/static_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STATIC_MUTEX_HPP +#define ASIO_DETAIL_STATIC_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) +# include "asio/detail/null_static_mutex.hpp" +#elif defined(ASIO_WINDOWS) +# include "asio/detail/win_static_mutex.hpp" +#elif defined(ASIO_HAS_PTHREADS) +# include "asio/detail/posix_static_mutex.hpp" +#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) +# include "asio/detail/std_static_mutex.hpp" +#else +# error Only Windows and POSIX are supported! +#endif + +namespace asio { +namespace detail { + +#if !defined(ASIO_HAS_THREADS) +typedef null_static_mutex static_mutex; +# define ASIO_STATIC_MUTEX_INIT ASIO_NULL_STATIC_MUTEX_INIT +#elif defined(ASIO_WINDOWS) +typedef win_static_mutex static_mutex; +# define ASIO_STATIC_MUTEX_INIT ASIO_WIN_STATIC_MUTEX_INIT +#elif defined(ASIO_HAS_PTHREADS) +typedef posix_static_mutex static_mutex; +# define ASIO_STATIC_MUTEX_INIT ASIO_POSIX_STATIC_MUTEX_INIT +#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) +typedef std_static_mutex static_mutex; +# define ASIO_STATIC_MUTEX_INIT ASIO_STD_STATIC_MUTEX_INIT +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_STATIC_MUTEX_HPP diff --git a/include/asio/include/asio/detail/std_event.hpp b/include/asio/include/asio/detail/std_event.hpp new file mode 100644 index 0000000..441d9b4 --- /dev/null +++ b/include/asio/include/asio/detail/std_event.hpp @@ -0,0 +1,188 @@ +// +// detail/std_event.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STD_EVENT_HPP +#define ASIO_DETAIL_STD_EVENT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) + +#include +#include +#include "asio/detail/assert.hpp" +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class std_event + : private noncopyable +{ +public: + // Constructor. + std_event() + : state_(0) + { + } + + // Destructor. + ~std_event() + { + } + + // Signal the event. (Retained for backward compatibility.) + template + void signal(Lock& lock) + { + this->signal_all(lock); + } + + // Signal all waiters. + template + void signal_all(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + (void)lock; + state_ |= 1; + cond_.notify_all(); + } + + // Unlock the mutex and signal one waiter. + template + void unlock_and_signal_one(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + bool have_waiters = (state_ > 1); + lock.unlock(); + if (have_waiters) + cond_.notify_one(); + } + + // Unlock the mutex and signal one waiter who may destroy us. + template + void unlock_and_signal_one(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + bool have_waiters = (state_ > 1); + if (have_waiters) + cond_.notify_one(); + lock.unlock(); + } + + // If there's a waiter, unlock the mutex and signal it. + template + bool maybe_unlock_and_signal_one(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + if (state_ > 1) + { + lock.unlock(); + cond_.notify_one(); + return true; + } + return false; + } + + // Reset the event. + template + void clear(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + (void)lock; + state_ &= ~std::size_t(1); + } + + // Wait for the event to become signalled. + template + void wait(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + unique_lock_adapter u_lock(lock); + while ((state_ & 1) == 0) + { + waiter w(state_); + cond_.wait(u_lock.unique_lock_); + } + } + + // Timed wait for the event to become signalled. + template + bool wait_for_usec(Lock& lock, long usec) + { + ASIO_ASSERT(lock.locked()); + unique_lock_adapter u_lock(lock); + if ((state_ & 1) == 0) + { + waiter w(state_); + cond_.wait_for(u_lock.unique_lock_, std::chrono::microseconds(usec)); + } + return (state_ & 1) != 0; + } + +private: + // Helper class to temporarily adapt a scoped_lock into a unique_lock so that + // it can be passed to std::condition_variable::wait(). + struct unique_lock_adapter + { + template + explicit unique_lock_adapter(Lock& lock) + : unique_lock_(lock.mutex().mutex_, std::adopt_lock) + { + } + + ~unique_lock_adapter() + { + unique_lock_.release(); + } + + std::unique_lock unique_lock_; + }; + + // Helper to increment and decrement the state to track outstanding waiters. + class waiter + { + public: + explicit waiter(std::size_t& state) + : state_(state) + { + state_ += 2; + } + + ~waiter() + { + state_ -= 2; + } + + private: + std::size_t& state_; + }; + + std::condition_variable cond_; + std::size_t state_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) + +#endif // ASIO_DETAIL_STD_EVENT_HPP diff --git a/include/asio/include/asio/detail/std_fenced_block.hpp b/include/asio/include/asio/detail/std_fenced_block.hpp new file mode 100644 index 0000000..0d0b054 --- /dev/null +++ b/include/asio/include/asio/detail/std_fenced_block.hpp @@ -0,0 +1,62 @@ +// +// detail/std_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STD_FENCED_BLOCK_HPP +#define ASIO_DETAIL_STD_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_ATOMIC) + +#include +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class std_fenced_block + : private noncopyable +{ +public: + enum half_t { half }; + enum full_t { full }; + + // Constructor for a half fenced block. + explicit std_fenced_block(half_t) + { + } + + // Constructor for a full fenced block. + explicit std_fenced_block(full_t) + { + std::atomic_thread_fence(std::memory_order_acquire); + } + + // Destructor. + ~std_fenced_block() + { + std::atomic_thread_fence(std::memory_order_release); + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_STD_ATOMIC) + +#endif // ASIO_DETAIL_STD_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/std_global.hpp b/include/asio/include/asio/detail/std_global.hpp new file mode 100644 index 0000000..ac1d3ca --- /dev/null +++ b/include/asio/include/asio/detail/std_global.hpp @@ -0,0 +1,70 @@ +// +// detail/std_global.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STD_GLOBAL_HPP +#define ASIO_DETAIL_STD_GLOBAL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_CALL_ONCE) + +#include +#include + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct std_global_impl +{ + // Helper function to perform initialisation. + static void do_init() + { + instance_.ptr_ = new T; + } + + // Destructor automatically cleans up the global. + ~std_global_impl() + { + delete ptr_; + } + + static std::once_flag init_once_; + static std_global_impl instance_; + T* ptr_; +}; + +template +std::once_flag std_global_impl::init_once_; + +template +std_global_impl std_global_impl::instance_; + +template +T& std_global() +{ + std::call_once(std_global_impl::init_once_, &std_global_impl::do_init); + return *std_global_impl::instance_.ptr_; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_STD_CALL_ONCE) + +#endif // ASIO_DETAIL_STD_GLOBAL_HPP diff --git a/include/asio/include/asio/detail/std_mutex.hpp b/include/asio/include/asio/detail/std_mutex.hpp new file mode 100644 index 0000000..0fdff3d --- /dev/null +++ b/include/asio/include/asio/detail/std_mutex.hpp @@ -0,0 +1,73 @@ +// +// detail/std_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STD_MUTEX_HPP +#define ASIO_DETAIL_STD_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) + +#include +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class std_event; + +class std_mutex + : private noncopyable +{ +public: + typedef asio::detail::scoped_lock scoped_lock; + + // Constructor. + std_mutex() + { + } + + // Destructor. + ~std_mutex() + { + } + + // Lock the mutex. + void lock() + { + mutex_.lock(); + } + + // Unlock the mutex. + void unlock() + { + mutex_.unlock(); + } + +private: + friend class std_event; + std::mutex mutex_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) + +#endif // ASIO_DETAIL_STD_MUTEX_HPP diff --git a/include/asio/include/asio/detail/std_static_mutex.hpp b/include/asio/include/asio/detail/std_static_mutex.hpp new file mode 100644 index 0000000..abcb6e8 --- /dev/null +++ b/include/asio/include/asio/detail/std_static_mutex.hpp @@ -0,0 +1,81 @@ +// +// detail/std_static_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STD_STATIC_MUTEX_HPP +#define ASIO_DETAIL_STD_STATIC_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) + +#include +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class std_event; + +class std_static_mutex + : private noncopyable +{ +public: + typedef asio::detail::scoped_lock scoped_lock; + + // Constructor. + std_static_mutex(int) + { + } + + // Destructor. + ~std_static_mutex() + { + } + + // Initialise the mutex. + void init() + { + // Nothing to do. + } + + // Lock the mutex. + void lock() + { + mutex_.lock(); + } + + // Unlock the mutex. + void unlock() + { + mutex_.unlock(); + } + +private: + friend class std_event; + std::mutex mutex_; +}; + +#define ASIO_STD_STATIC_MUTEX_INIT 0 + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) + +#endif // ASIO_DETAIL_STD_STATIC_MUTEX_HPP diff --git a/include/asio/include/asio/detail/std_thread.hpp b/include/asio/include/asio/detail/std_thread.hpp new file mode 100644 index 0000000..7d6386d --- /dev/null +++ b/include/asio/include/asio/detail/std_thread.hpp @@ -0,0 +1,71 @@ +// +// detail/std_thread.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STD_THREAD_HPP +#define ASIO_DETAIL_STD_THREAD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_THREAD) + +#include +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class std_thread + : private noncopyable +{ +public: + // Constructor. + template + std_thread(Function f, unsigned int = 0) + : thread_(f) + { + } + + // Destructor. + ~std_thread() + { + join(); + } + + // Wait for the thread to exit. + void join() + { + if (thread_.joinable()) + thread_.join(); + } + + // Get number of CPUs. + static std::size_t hardware_concurrency() + { + return std::thread::hardware_concurrency(); + } + +private: + std::thread thread_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_STD_THREAD) + +#endif // ASIO_DETAIL_STD_THREAD_HPP diff --git a/include/asio/include/asio/detail/strand_executor_service.hpp b/include/asio/include/asio/detail/strand_executor_service.hpp new file mode 100644 index 0000000..1a984d8 --- /dev/null +++ b/include/asio/include/asio/detail/strand_executor_service.hpp @@ -0,0 +1,166 @@ +// +// detail/strand_executor_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STRAND_EXECUTOR_SERVICE_HPP +#define ASIO_DETAIL_STRAND_EXECUTOR_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/atomic_count.hpp" +#include "asio/detail/executor_op.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/scheduler_operation.hpp" +#include "asio/detail/scoped_ptr.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution.hpp" +#include "asio/execution_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Default service implementation for a strand. +class strand_executor_service + : public execution_context_service_base +{ +public: + // The underlying implementation of a strand. + class strand_impl + { + public: + ASIO_DECL ~strand_impl(); + + private: + friend class strand_executor_service; + + // Mutex to protect access to internal data. + mutex* mutex_; + + // Indicates whether the strand is currently "locked" by a handler. This + // means that there is a handler upcall in progress, or that the strand + // itself has been scheduled in order to invoke some pending handlers. + bool locked_; + + // Indicates that the strand has been shut down and will accept no further + // handlers. + bool shutdown_; + + // The handlers that are waiting on the strand but should not be run until + // after the next time the strand is scheduled. This queue must only be + // modified while the mutex is locked. + op_queue waiting_queue_; + + // The handlers that are ready to be run. Logically speaking, these are the + // handlers that hold the strand's lock. The ready queue is only modified + // from within the strand and so may be accessed without locking the mutex. + op_queue ready_queue_; + + // Pointers to adjacent handle implementations in linked list. + strand_impl* next_; + strand_impl* prev_; + + // The strand service in where the implementation is held. + strand_executor_service* service_; + }; + + typedef shared_ptr implementation_type; + + // Construct a new strand service for the specified context. + ASIO_DECL explicit strand_executor_service(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Create a new strand_executor implementation. + ASIO_DECL implementation_type create_implementation(); + + // Request invocation of the given function. + template + static void execute(const implementation_type& impl, Executor& ex, + ASIO_MOVE_ARG(Function) function, + typename enable_if< + can_query >::value + >::type* = 0); + + // Request invocation of the given function. + template + static void execute(const implementation_type& impl, Executor& ex, + ASIO_MOVE_ARG(Function) function, + typename enable_if< + !can_query >::value + >::type* = 0); + + // Request invocation of the given function. + template + static void dispatch(const implementation_type& impl, Executor& ex, + ASIO_MOVE_ARG(Function) function, const Allocator& a); + + // Request invocation of the given function and return immediately. + template + static void post(const implementation_type& impl, Executor& ex, + ASIO_MOVE_ARG(Function) function, const Allocator& a); + + // Request invocation of the given function and return immediately. + template + static void defer(const implementation_type& impl, Executor& ex, + ASIO_MOVE_ARG(Function) function, const Allocator& a); + + // Determine whether the strand is running in the current thread. + ASIO_DECL static bool running_in_this_thread( + const implementation_type& impl); + +private: + friend class strand_impl; + template class allocator_binder; + template class invoker; + + // Adds a function to the strand. Returns true if it acquires the lock. + ASIO_DECL static bool enqueue(const implementation_type& impl, + scheduler_operation* op); + + // Helper function to request invocation of the given function. + template + static void do_execute(const implementation_type& impl, Executor& ex, + ASIO_MOVE_ARG(Function) function, const Allocator& a); + + // Mutex to protect access to the service-wide state. + mutex mutex_; + + // Number of mutexes shared between all strand objects. + enum { num_mutexes = 193 }; + + // Pool of mutexes. + scoped_ptr mutexes_[num_mutexes]; + + // Extra value used when hashing to prevent recycled memory locations from + // getting the same mutex. + std::size_t salt_; + + // The head of a linked list of all implementations. + strand_impl* impl_list_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/strand_executor_service.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/strand_executor_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_STRAND_EXECUTOR_SERVICE_HPP diff --git a/include/asio/include/asio/detail/strand_service.hpp b/include/asio/include/asio/detail/strand_service.hpp new file mode 100644 index 0000000..5289ac8 --- /dev/null +++ b/include/asio/include/asio/detail/strand_service.hpp @@ -0,0 +1,145 @@ +// +// detail/strand_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STRAND_SERVICE_HPP +#define ASIO_DETAIL_STRAND_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/io_context.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/scoped_ptr.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Default service implementation for a strand. +class strand_service + : public asio::detail::service_base +{ +private: + // Helper class to re-post the strand on exit. + struct on_do_complete_exit; + + // Helper class to re-post the strand on exit. + struct on_dispatch_exit; + +public: + + // The underlying implementation of a strand. + class strand_impl + : public operation + { + public: + strand_impl(); + + private: + // Only this service will have access to the internal values. + friend class strand_service; + friend struct on_do_complete_exit; + friend struct on_dispatch_exit; + + // Mutex to protect access to internal data. + asio::detail::mutex mutex_; + + // Indicates whether the strand is currently "locked" by a handler. This + // means that there is a handler upcall in progress, or that the strand + // itself has been scheduled in order to invoke some pending handlers. + bool locked_; + + // The handlers that are waiting on the strand but should not be run until + // after the next time the strand is scheduled. This queue must only be + // modified while the mutex is locked. + op_queue waiting_queue_; + + // The handlers that are ready to be run. Logically speaking, these are the + // handlers that hold the strand's lock. The ready queue is only modified + // from within the strand and so may be accessed without locking the mutex. + op_queue ready_queue_; + }; + + typedef strand_impl* implementation_type; + + // Construct a new strand service for the specified io_context. + ASIO_DECL explicit strand_service(asio::io_context& io_context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Construct a new strand implementation. + ASIO_DECL void construct(implementation_type& impl); + + // Request the io_context to invoke the given handler. + template + void dispatch(implementation_type& impl, Handler& handler); + + // Request the io_context to invoke the given handler and return immediately. + template + void post(implementation_type& impl, Handler& handler); + + // Determine whether the strand is running in the current thread. + ASIO_DECL bool running_in_this_thread( + const implementation_type& impl) const; + +private: + // Helper function to dispatch a handler. Returns true if the handler should + // be dispatched immediately. + ASIO_DECL bool do_dispatch(implementation_type& impl, operation* op); + + // Helper fiunction to post a handler. + ASIO_DECL void do_post(implementation_type& impl, + operation* op, bool is_continuation); + + ASIO_DECL static void do_complete(void* owner, + operation* base, const asio::error_code& ec, + std::size_t bytes_transferred); + + // The io_context used to obtain an I/O executor. + io_context& io_context_; + + // The io_context implementation used to post completions. + io_context_impl& io_context_impl_; + + // Mutex to protect access to the array of implementations. + asio::detail::mutex mutex_; + + // Number of implementations shared between all strand objects. +#if defined(ASIO_STRAND_IMPLEMENTATIONS) + enum { num_implementations = ASIO_STRAND_IMPLEMENTATIONS }; +#else // defined(ASIO_STRAND_IMPLEMENTATIONS) + enum { num_implementations = 193 }; +#endif // defined(ASIO_STRAND_IMPLEMENTATIONS) + + // Pool of implementations. + scoped_ptr implementations_[num_implementations]; + + // Extra value used when hashing to prevent recycled memory locations from + // getting the same strand implementation. + std::size_t salt_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/strand_service.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/strand_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_STRAND_SERVICE_HPP diff --git a/include/asio/include/asio/detail/string_view.hpp b/include/asio/include/asio/detail/string_view.hpp new file mode 100644 index 0000000..29b894c --- /dev/null +++ b/include/asio/include/asio/detail/string_view.hpp @@ -0,0 +1,47 @@ +// +// detail/string_view.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_STRING_VIEW_HPP +#define ASIO_DETAIL_STRING_VIEW_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STRING_VIEW) + +#if defined(ASIO_HAS_STD_STRING_VIEW) +# include +#elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) +# include +#else // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) +# error ASIO_HAS_STRING_VIEW is set but no string_view is available +#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) + +namespace asio { + +#if defined(ASIO_HAS_STD_STRING_VIEW) +using std::basic_string_view; +using std::string_view; +#elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) +using std::experimental::basic_string_view; +using std::experimental::string_view; +#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW) + +} // namespace asio + +# define ASIO_STRING_VIEW_PARAM asio::string_view +#else // defined(ASIO_HAS_STRING_VIEW) +# define ASIO_STRING_VIEW_PARAM const std::string& +#endif // defined(ASIO_HAS_STRING_VIEW) + +#endif // ASIO_DETAIL_STRING_VIEW_HPP diff --git a/include/asio/include/asio/detail/thread.hpp b/include/asio/include/asio/detail/thread.hpp new file mode 100644 index 0000000..c8af81c --- /dev/null +++ b/include/asio/include/asio/detail/thread.hpp @@ -0,0 +1,60 @@ +// +// detail/thread.hpp +// ~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_THREAD_HPP +#define ASIO_DETAIL_THREAD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) +# include "asio/detail/null_thread.hpp" +#elif defined(ASIO_WINDOWS) +# if defined(UNDER_CE) +# include "asio/detail/wince_thread.hpp" +# elif defined(ASIO_WINDOWS_APP) +# include "asio/detail/winapp_thread.hpp" +# else +# include "asio/detail/win_thread.hpp" +# endif +#elif defined(ASIO_HAS_PTHREADS) +# include "asio/detail/posix_thread.hpp" +#elif defined(ASIO_HAS_STD_THREAD) +# include "asio/detail/std_thread.hpp" +#else +# error Only Windows, POSIX and std::thread are supported! +#endif + +namespace asio { +namespace detail { + +#if !defined(ASIO_HAS_THREADS) +typedef null_thread thread; +#elif defined(ASIO_WINDOWS) +# if defined(UNDER_CE) +typedef wince_thread thread; +# elif defined(ASIO_WINDOWS_APP) +typedef winapp_thread thread; +# else +typedef win_thread thread; +# endif +#elif defined(ASIO_HAS_PTHREADS) +typedef posix_thread thread; +#elif defined(ASIO_HAS_STD_THREAD) +typedef std_thread thread; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_THREAD_HPP diff --git a/include/asio/include/asio/detail/thread_context.hpp b/include/asio/include/asio/detail/thread_context.hpp new file mode 100644 index 0000000..289f310 --- /dev/null +++ b/include/asio/include/asio/detail/thread_context.hpp @@ -0,0 +1,42 @@ +// +// detail/thread_context.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_THREAD_CONTEXT_HPP +#define ASIO_DETAIL_THREAD_CONTEXT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include +#include +#include "asio/detail/call_stack.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class thread_info_base; + +// Base class for things that manage threads (scheduler, win_iocp_io_context). +class thread_context +{ +public: + // Per-thread call stack to track the state of each thread in the context. + typedef call_stack thread_call_stack; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_THREAD_CONTEXT_HPP diff --git a/include/asio/include/asio/detail/thread_group.hpp b/include/asio/include/asio/detail/thread_group.hpp new file mode 100644 index 0000000..cd1a0d3 --- /dev/null +++ b/include/asio/include/asio/detail/thread_group.hpp @@ -0,0 +1,95 @@ +// +// detail/thread_group.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_THREAD_GROUP_HPP +#define ASIO_DETAIL_THREAD_GROUP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/scoped_ptr.hpp" +#include "asio/detail/thread.hpp" + +namespace asio { +namespace detail { + +class thread_group +{ +public: + // Constructor initialises an empty thread group. + thread_group() + : first_(0) + { + } + + // Destructor joins any remaining threads in the group. + ~thread_group() + { + join(); + } + + // Create a new thread in the group. + template + void create_thread(Function f) + { + first_ = new item(f, first_); + } + + // Create new threads in the group. + template + void create_threads(Function f, std::size_t num_threads) + { + for (std::size_t i = 0; i < num_threads; ++i) + create_thread(f); + } + + // Wait for all threads in the group to exit. + void join() + { + while (first_) + { + first_->thread_.join(); + item* tmp = first_; + first_ = first_->next_; + delete tmp; + } + } + + // Test whether the group is empty. + bool empty() const + { + return first_ == 0; + } + +private: + // Structure used to track a single thread in the group. + struct item + { + template + explicit item(Function f, item* next) + : thread_(f), + next_(next) + { + } + + asio::detail::thread thread_; + item* next_; + }; + + // The first thread in the group. + item* first_; +}; + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_THREAD_GROUP_HPP diff --git a/include/asio/include/asio/detail/thread_info_base.hpp b/include/asio/include/asio/detail/thread_info_base.hpp new file mode 100644 index 0000000..3c21d9b --- /dev/null +++ b/include/asio/include/asio/detail/thread_info_base.hpp @@ -0,0 +1,183 @@ +// +// detail/thread_info_base.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_THREAD_INFO_BASE_HPP +#define ASIO_DETAIL_THREAD_INFO_BASE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include +#include "asio/detail/noncopyable.hpp" + +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \ + && !defined(ASIO_NO_EXCEPTIONS) +# include +# include "asio/multiple_exceptions.hpp" +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + // && !defined(ASIO_NO_EXCEPTIONS) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class thread_info_base + : private noncopyable +{ +public: + struct default_tag + { + enum { mem_index = 0 }; + }; + + struct awaitable_frame_tag + { + enum { mem_index = 1 }; + }; + + struct executor_function_tag + { + enum { mem_index = 2 }; + }; + + thread_info_base() +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \ + && !defined(ASIO_NO_EXCEPTIONS) + : has_pending_exception_(0) +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + // && !defined(ASIO_NO_EXCEPTIONS) + { + for (int i = 0; i < max_mem_index; ++i) + reusable_memory_[i] = 0; + } + + ~thread_info_base() + { + for (int i = 0; i < max_mem_index; ++i) + ::operator delete(reusable_memory_[i]); + } + + static void* allocate(thread_info_base* this_thread, std::size_t size) + { + return allocate(default_tag(), this_thread, size); + } + + static void deallocate(thread_info_base* this_thread, + void* pointer, std::size_t size) + { + deallocate(default_tag(), this_thread, pointer, size); + } + + template + static void* allocate(Purpose, thread_info_base* this_thread, + std::size_t size) + { + std::size_t chunks = (size + chunk_size - 1) / chunk_size; + + if (this_thread && this_thread->reusable_memory_[Purpose::mem_index]) + { + void* const pointer = this_thread->reusable_memory_[Purpose::mem_index]; + this_thread->reusable_memory_[Purpose::mem_index] = 0; + + unsigned char* const mem = static_cast(pointer); + if (static_cast(mem[0]) >= chunks) + { + mem[size] = mem[0]; + return pointer; + } + + ::operator delete(pointer); + } + + void* const pointer = ::operator new(chunks * chunk_size + 1); + unsigned char* const mem = static_cast(pointer); + mem[size] = (chunks <= UCHAR_MAX) ? static_cast(chunks) : 0; + return pointer; + } + + template + static void deallocate(Purpose, thread_info_base* this_thread, + void* pointer, std::size_t size) + { + if (size <= chunk_size * UCHAR_MAX) + { + if (this_thread && this_thread->reusable_memory_[Purpose::mem_index] == 0) + { + unsigned char* const mem = static_cast(pointer); + mem[0] = mem[size]; + this_thread->reusable_memory_[Purpose::mem_index] = pointer; + return; + } + } + + ::operator delete(pointer); + } + + void capture_current_exception() + { +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \ + && !defined(ASIO_NO_EXCEPTIONS) + switch (has_pending_exception_) + { + case 0: + has_pending_exception_ = 1; + pending_exception_ = std::current_exception(); + break; + case 1: + has_pending_exception_ = 2; + pending_exception_ = + std::make_exception_ptr( + multiple_exceptions(pending_exception_)); + default: + break; + } +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + // && !defined(ASIO_NO_EXCEPTIONS) + } + + void rethrow_pending_exception() + { +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \ + && !defined(ASIO_NO_EXCEPTIONS) + if (has_pending_exception_ > 0) + { + has_pending_exception_ = 0; + std::exception_ptr ex( + ASIO_MOVE_CAST(std::exception_ptr)( + pending_exception_)); + std::rethrow_exception(ex); + } +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + // && !defined(ASIO_NO_EXCEPTIONS) + } + +private: + enum { chunk_size = 4 }; + enum { max_mem_index = 3 }; + void* reusable_memory_[max_mem_index]; + +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \ + && !defined(ASIO_NO_EXCEPTIONS) + int has_pending_exception_; + std::exception_ptr pending_exception_; +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + // && !defined(ASIO_NO_EXCEPTIONS) +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_THREAD_INFO_BASE_HPP diff --git a/include/asio/include/asio/detail/throw_error.hpp b/include/asio/include/asio/detail/throw_error.hpp new file mode 100644 index 0000000..6ed3112 --- /dev/null +++ b/include/asio/include/asio/detail/throw_error.hpp @@ -0,0 +1,53 @@ +// +// detail/throw_error.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_THROW_ERROR_HPP +#define ASIO_DETAIL_THROW_ERROR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/error_code.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +ASIO_DECL void do_throw_error(const asio::error_code& err); + +ASIO_DECL void do_throw_error(const asio::error_code& err, + const char* location); + +inline void throw_error(const asio::error_code& err) +{ + if (err) + do_throw_error(err); +} + +inline void throw_error(const asio::error_code& err, + const char* location) +{ + if (err) + do_throw_error(err, location); +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/throw_error.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_THROW_ERROR_HPP diff --git a/include/asio/include/asio/detail/throw_exception.hpp b/include/asio/include/asio/detail/throw_exception.hpp new file mode 100644 index 0000000..d6dcaab --- /dev/null +++ b/include/asio/include/asio/detail/throw_exception.hpp @@ -0,0 +1,51 @@ +// +// detail/throw_exception.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_THROW_EXCEPTION_HPP +#define ASIO_DETAIL_THROW_EXCEPTION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_THROW_EXCEPTION) +# include +#endif // defined(ASIO_BOOST_THROW_EXCEPTION) + +namespace asio { +namespace detail { + +#if defined(ASIO_HAS_BOOST_THROW_EXCEPTION) +using boost::throw_exception; +#else // defined(ASIO_HAS_BOOST_THROW_EXCEPTION) + +// Declare the throw_exception function for all targets. +template +void throw_exception(const Exception& e); + +// Only define the throw_exception function when exceptions are enabled. +// Otherwise, it is up to the application to provide a definition of this +// function. +# if !defined(ASIO_NO_EXCEPTIONS) +template +void throw_exception(const Exception& e) +{ + throw e; +} +# endif // !defined(ASIO_NO_EXCEPTIONS) + +#endif // defined(ASIO_HAS_BOOST_THROW_EXCEPTION) + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_THROW_EXCEPTION_HPP diff --git a/include/asio/include/asio/detail/timer_queue.hpp b/include/asio/include/asio/detail/timer_queue.hpp new file mode 100644 index 0000000..32ebdc7 --- /dev/null +++ b/include/asio/include/asio/detail/timer_queue.hpp @@ -0,0 +1,360 @@ +// +// detail/timer_queue.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TIMER_QUEUE_HPP +#define ASIO_DETAIL_TIMER_QUEUE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include +#include "asio/detail/cstdint.hpp" +#include "asio/detail/date_time_fwd.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/timer_queue_base.hpp" +#include "asio/detail/wait_op.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class timer_queue + : public timer_queue_base +{ +public: + // The time type. + typedef typename Time_Traits::time_type time_type; + + // The duration type. + typedef typename Time_Traits::duration_type duration_type; + + // Per-timer data. + class per_timer_data + { + public: + per_timer_data() : + heap_index_((std::numeric_limits::max)()), + next_(0), prev_(0) + { + } + + private: + friend class timer_queue; + + // The operations waiting on the timer. + op_queue op_queue_; + + // The index of the timer in the heap. + std::size_t heap_index_; + + // Pointers to adjacent timers in a linked list. + per_timer_data* next_; + per_timer_data* prev_; + }; + + // Constructor. + timer_queue() + : timers_(), + heap_() + { + } + + // Add a new timer to the queue. Returns true if this is the timer that is + // earliest in the queue, in which case the reactor's event demultiplexing + // function call may need to be interrupted and restarted. + bool enqueue_timer(const time_type& time, per_timer_data& timer, wait_op* op) + { + // Enqueue the timer object. + if (timer.prev_ == 0 && &timer != timers_) + { + if (this->is_positive_infinity(time)) + { + // No heap entry is required for timers that never expire. + timer.heap_index_ = (std::numeric_limits::max)(); + } + else + { + // Put the new timer at the correct position in the heap. This is done + // first since push_back() can throw due to allocation failure. + timer.heap_index_ = heap_.size(); + heap_entry entry = { time, &timer }; + heap_.push_back(entry); + up_heap(heap_.size() - 1); + } + + // Insert the new timer into the linked list of active timers. + timer.next_ = timers_; + timer.prev_ = 0; + if (timers_) + timers_->prev_ = &timer; + timers_ = &timer; + } + + // Enqueue the individual timer operation. + timer.op_queue_.push(op); + + // Interrupt reactor only if newly added timer is first to expire. + return timer.heap_index_ == 0 && timer.op_queue_.front() == op; + } + + // Whether there are no timers in the queue. + virtual bool empty() const + { + return timers_ == 0; + } + + // Get the time for the timer that is earliest in the queue. + virtual long wait_duration_msec(long max_duration) const + { + if (heap_.empty()) + return max_duration; + + return this->to_msec( + Time_Traits::to_posix_duration( + Time_Traits::subtract(heap_[0].time_, Time_Traits::now())), + max_duration); + } + + // Get the time for the timer that is earliest in the queue. + virtual long wait_duration_usec(long max_duration) const + { + if (heap_.empty()) + return max_duration; + + return this->to_usec( + Time_Traits::to_posix_duration( + Time_Traits::subtract(heap_[0].time_, Time_Traits::now())), + max_duration); + } + + // Dequeue all timers not later than the current time. + virtual void get_ready_timers(op_queue& ops) + { + if (!heap_.empty()) + { + const time_type now = Time_Traits::now(); + while (!heap_.empty() && !Time_Traits::less_than(now, heap_[0].time_)) + { + per_timer_data* timer = heap_[0].timer_; + ops.push(timer->op_queue_); + remove_timer(*timer); + } + } + } + + // Dequeue all timers. + virtual void get_all_timers(op_queue& ops) + { + while (timers_) + { + per_timer_data* timer = timers_; + timers_ = timers_->next_; + ops.push(timer->op_queue_); + timer->next_ = 0; + timer->prev_ = 0; + } + + heap_.clear(); + } + + // Cancel and dequeue operations for the given timer. + std::size_t cancel_timer(per_timer_data& timer, op_queue& ops, + std::size_t max_cancelled = (std::numeric_limits::max)()) + { + std::size_t num_cancelled = 0; + if (timer.prev_ != 0 || &timer == timers_) + { + while (wait_op* op = (num_cancelled != max_cancelled) + ? timer.op_queue_.front() : 0) + { + op->ec_ = asio::error::operation_aborted; + timer.op_queue_.pop(); + ops.push(op); + ++num_cancelled; + } + if (timer.op_queue_.empty()) + remove_timer(timer); + } + return num_cancelled; + } + + // Move operations from one timer to another, empty timer. + void move_timer(per_timer_data& target, per_timer_data& source) + { + target.op_queue_.push(source.op_queue_); + + target.heap_index_ = source.heap_index_; + source.heap_index_ = (std::numeric_limits::max)(); + + if (target.heap_index_ < heap_.size()) + heap_[target.heap_index_].timer_ = ⌖ + + if (timers_ == &source) + timers_ = ⌖ + if (source.prev_) + source.prev_->next_ = ⌖ + if (source.next_) + source.next_->prev_= ⌖ + target.next_ = source.next_; + target.prev_ = source.prev_; + source.next_ = 0; + source.prev_ = 0; + } + +private: + // Move the item at the given index up the heap to its correct position. + void up_heap(std::size_t index) + { + while (index > 0) + { + std::size_t parent = (index - 1) / 2; + if (!Time_Traits::less_than(heap_[index].time_, heap_[parent].time_)) + break; + swap_heap(index, parent); + index = parent; + } + } + + // Move the item at the given index down the heap to its correct position. + void down_heap(std::size_t index) + { + std::size_t child = index * 2 + 1; + while (child < heap_.size()) + { + std::size_t min_child = (child + 1 == heap_.size() + || Time_Traits::less_than( + heap_[child].time_, heap_[child + 1].time_)) + ? child : child + 1; + if (Time_Traits::less_than(heap_[index].time_, heap_[min_child].time_)) + break; + swap_heap(index, min_child); + index = min_child; + child = index * 2 + 1; + } + } + + // Swap two entries in the heap. + void swap_heap(std::size_t index1, std::size_t index2) + { + heap_entry tmp = heap_[index1]; + heap_[index1] = heap_[index2]; + heap_[index2] = tmp; + heap_[index1].timer_->heap_index_ = index1; + heap_[index2].timer_->heap_index_ = index2; + } + + // Remove a timer from the heap and list of timers. + void remove_timer(per_timer_data& timer) + { + // Remove the timer from the heap. + std::size_t index = timer.heap_index_; + if (!heap_.empty() && index < heap_.size()) + { + if (index == heap_.size() - 1) + { + timer.heap_index_ = (std::numeric_limits::max)(); + heap_.pop_back(); + } + else + { + swap_heap(index, heap_.size() - 1); + timer.heap_index_ = (std::numeric_limits::max)(); + heap_.pop_back(); + if (index > 0 && Time_Traits::less_than( + heap_[index].time_, heap_[(index - 1) / 2].time_)) + up_heap(index); + else + down_heap(index); + } + } + + // Remove the timer from the linked list of active timers. + if (timers_ == &timer) + timers_ = timer.next_; + if (timer.prev_) + timer.prev_->next_ = timer.next_; + if (timer.next_) + timer.next_->prev_= timer.prev_; + timer.next_ = 0; + timer.prev_ = 0; + } + + // Determine if the specified absolute time is positive infinity. + template + static bool is_positive_infinity(const Time_Type&) + { + return false; + } + + // Determine if the specified absolute time is positive infinity. + template + static bool is_positive_infinity( + const boost::date_time::base_time& time) + { + return time.is_pos_infinity(); + } + + // Helper function to convert a duration into milliseconds. + template + long to_msec(const Duration& d, long max_duration) const + { + if (d.ticks() <= 0) + return 0; + int64_t msec = d.total_milliseconds(); + if (msec == 0) + return 1; + if (msec > max_duration) + return max_duration; + return static_cast(msec); + } + + // Helper function to convert a duration into microseconds. + template + long to_usec(const Duration& d, long max_duration) const + { + if (d.ticks() <= 0) + return 0; + int64_t usec = d.total_microseconds(); + if (usec == 0) + return 1; + if (usec > max_duration) + return max_duration; + return static_cast(usec); + } + + // The head of a linked list of all active timers. + per_timer_data* timers_; + + struct heap_entry + { + // The time when the timer should fire. + time_type time_; + + // The associated timer with enqueued operations. + per_timer_data* timer_; + }; + + // The heap of timers, with the earliest timer at the front. + std::vector heap_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_TIMER_QUEUE_HPP diff --git a/include/asio/include/asio/detail/timer_queue_base.hpp b/include/asio/include/asio/detail/timer_queue_base.hpp new file mode 100644 index 0000000..28e5b27 --- /dev/null +++ b/include/asio/include/asio/detail/timer_queue_base.hpp @@ -0,0 +1,68 @@ +// +// detail/timer_queue_base.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TIMER_QUEUE_BASE_HPP +#define ASIO_DETAIL_TIMER_QUEUE_BASE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class timer_queue_base + : private noncopyable +{ +public: + // Constructor. + timer_queue_base() : next_(0) {} + + // Destructor. + virtual ~timer_queue_base() {} + + // Whether there are no timers in the queue. + virtual bool empty() const = 0; + + // Get the time to wait until the next timer. + virtual long wait_duration_msec(long max_duration) const = 0; + + // Get the time to wait until the next timer. + virtual long wait_duration_usec(long max_duration) const = 0; + + // Dequeue all ready timers. + virtual void get_ready_timers(op_queue& ops) = 0; + + // Dequeue all timers. + virtual void get_all_timers(op_queue& ops) = 0; + +private: + friend class timer_queue_set; + + // Next timer queue in the set. + timer_queue_base* next_; +}; + +template +class timer_queue; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_TIMER_QUEUE_BASE_HPP diff --git a/include/asio/include/asio/detail/timer_queue_ptime.hpp b/include/asio/include/asio/detail/timer_queue_ptime.hpp new file mode 100644 index 0000000..ec25861 --- /dev/null +++ b/include/asio/include/asio/detail/timer_queue_ptime.hpp @@ -0,0 +1,99 @@ +// +// detail/timer_queue_ptime.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TIMER_QUEUE_PTIME_HPP +#define ASIO_DETAIL_TIMER_QUEUE_PTIME_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_DATE_TIME) + +#include "asio/time_traits.hpp" +#include "asio/detail/timer_queue.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct forwarding_posix_time_traits : time_traits {}; + +// Template specialisation for the commonly used instantation. +template <> +class timer_queue > + : public timer_queue_base +{ +public: + // The time type. + typedef boost::posix_time::ptime time_type; + + // The duration type. + typedef boost::posix_time::time_duration duration_type; + + // Per-timer data. + typedef timer_queue::per_timer_data + per_timer_data; + + // Constructor. + ASIO_DECL timer_queue(); + + // Destructor. + ASIO_DECL virtual ~timer_queue(); + + // Add a new timer to the queue. Returns true if this is the timer that is + // earliest in the queue, in which case the reactor's event demultiplexing + // function call may need to be interrupted and restarted. + ASIO_DECL bool enqueue_timer(const time_type& time, + per_timer_data& timer, wait_op* op); + + // Whether there are no timers in the queue. + ASIO_DECL virtual bool empty() const; + + // Get the time for the timer that is earliest in the queue. + ASIO_DECL virtual long wait_duration_msec(long max_duration) const; + + // Get the time for the timer that is earliest in the queue. + ASIO_DECL virtual long wait_duration_usec(long max_duration) const; + + // Dequeue all timers not later than the current time. + ASIO_DECL virtual void get_ready_timers(op_queue& ops); + + // Dequeue all timers. + ASIO_DECL virtual void get_all_timers(op_queue& ops); + + // Cancel and dequeue operations for the given timer. + ASIO_DECL std::size_t cancel_timer( + per_timer_data& timer, op_queue& ops, + std::size_t max_cancelled = (std::numeric_limits::max)()); + + // Move operations from one timer to another, empty timer. + ASIO_DECL void move_timer(per_timer_data& target, + per_timer_data& source); + +private: + timer_queue impl_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/timer_queue_ptime.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + +#endif // ASIO_DETAIL_TIMER_QUEUE_PTIME_HPP diff --git a/include/asio/include/asio/detail/timer_queue_set.hpp b/include/asio/include/asio/detail/timer_queue_set.hpp new file mode 100644 index 0000000..9a3389f --- /dev/null +++ b/include/asio/include/asio/detail/timer_queue_set.hpp @@ -0,0 +1,66 @@ +// +// detail/timer_queue_set.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TIMER_QUEUE_SET_HPP +#define ASIO_DETAIL_TIMER_QUEUE_SET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/timer_queue_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class timer_queue_set +{ +public: + // Constructor. + ASIO_DECL timer_queue_set(); + + // Add a timer queue to the set. + ASIO_DECL void insert(timer_queue_base* q); + + // Remove a timer queue from the set. + ASIO_DECL void erase(timer_queue_base* q); + + // Determine whether all queues are empty. + ASIO_DECL bool all_empty() const; + + // Get the wait duration in milliseconds. + ASIO_DECL long wait_duration_msec(long max_duration) const; + + // Get the wait duration in microseconds. + ASIO_DECL long wait_duration_usec(long max_duration) const; + + // Dequeue all ready timers. + ASIO_DECL void get_ready_timers(op_queue& ops); + + // Dequeue all timers. + ASIO_DECL void get_all_timers(op_queue& ops); + +private: + timer_queue_base* first_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/timer_queue_set.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_DETAIL_TIMER_QUEUE_SET_HPP diff --git a/include/asio/include/asio/detail/timer_scheduler.hpp b/include/asio/include/asio/detail/timer_scheduler.hpp new file mode 100644 index 0000000..5f4ab9e --- /dev/null +++ b/include/asio/include/asio/detail/timer_scheduler.hpp @@ -0,0 +1,35 @@ +// +// detail/timer_scheduler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TIMER_SCHEDULER_HPP +#define ASIO_DETAIL_TIMER_SCHEDULER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/timer_scheduler_fwd.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) +# include "asio/detail/winrt_timer_scheduler.hpp" +#elif defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#elif defined(ASIO_HAS_EPOLL) +# include "asio/detail/epoll_reactor.hpp" +#elif defined(ASIO_HAS_KQUEUE) +# include "asio/detail/kqueue_reactor.hpp" +#elif defined(ASIO_HAS_DEV_POLL) +# include "asio/detail/dev_poll_reactor.hpp" +#else +# include "asio/detail/select_reactor.hpp" +#endif + +#endif // ASIO_DETAIL_TIMER_SCHEDULER_HPP diff --git a/include/asio/include/asio/detail/timer_scheduler_fwd.hpp b/include/asio/include/asio/detail/timer_scheduler_fwd.hpp new file mode 100644 index 0000000..ab4e0a7 --- /dev/null +++ b/include/asio/include/asio/detail/timer_scheduler_fwd.hpp @@ -0,0 +1,40 @@ +// +// detail/timer_scheduler_fwd.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP +#define ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +namespace asio { +namespace detail { + +#if defined(ASIO_WINDOWS_RUNTIME) +typedef class winrt_timer_scheduler timer_scheduler; +#elif defined(ASIO_HAS_IOCP) +typedef class win_iocp_io_context timer_scheduler; +#elif defined(ASIO_HAS_EPOLL) +typedef class epoll_reactor timer_scheduler; +#elif defined(ASIO_HAS_KQUEUE) +typedef class kqueue_reactor timer_scheduler; +#elif defined(ASIO_HAS_DEV_POLL) +typedef class dev_poll_reactor timer_scheduler; +#else +typedef class select_reactor timer_scheduler; +#endif + +} // namespace detail +} // namespace asio + +#endif // ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP diff --git a/include/asio/include/asio/detail/tss_ptr.hpp b/include/asio/include/asio/detail/tss_ptr.hpp new file mode 100644 index 0000000..9bc8ab1 --- /dev/null +++ b/include/asio/include/asio/detail/tss_ptr.hpp @@ -0,0 +1,69 @@ +// +// detail/tss_ptr.hpp +// ~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TSS_PTR_HPP +#define ASIO_DETAIL_TSS_PTR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_THREADS) +# include "asio/detail/null_tss_ptr.hpp" +#elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) +# include "asio/detail/keyword_tss_ptr.hpp" +#elif defined(ASIO_WINDOWS) +# include "asio/detail/win_tss_ptr.hpp" +#elif defined(ASIO_HAS_PTHREADS) +# include "asio/detail/posix_tss_ptr.hpp" +#else +# error Only Windows and POSIX are supported! +#endif + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class tss_ptr +#if !defined(ASIO_HAS_THREADS) + : public null_tss_ptr +#elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) + : public keyword_tss_ptr +#elif defined(ASIO_WINDOWS) + : public win_tss_ptr +#elif defined(ASIO_HAS_PTHREADS) + : public posix_tss_ptr +#endif +{ +public: + void operator=(T* value) + { +#if !defined(ASIO_HAS_THREADS) + null_tss_ptr::operator=(value); +#elif defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION) + keyword_tss_ptr::operator=(value); +#elif defined(ASIO_WINDOWS) + win_tss_ptr::operator=(value); +#elif defined(ASIO_HAS_PTHREADS) + posix_tss_ptr::operator=(value); +#endif + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_TSS_PTR_HPP diff --git a/include/asio/include/asio/detail/type_traits.hpp b/include/asio/include/asio/detail/type_traits.hpp new file mode 100644 index 0000000..92792aa --- /dev/null +++ b/include/asio/include/asio/detail/type_traits.hpp @@ -0,0 +1,148 @@ +// +// detail/type_traits.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_TYPE_TRAITS_HPP +#define ASIO_DETAIL_TYPE_TRAITS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_TYPE_TRAITS) +# include +#else // defined(ASIO_HAS_STD_TYPE_TRAITS) +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif // defined(ASIO_HAS_STD_TYPE_TRAITS) + +namespace asio { + +#if defined(ASIO_HAS_STD_TYPE_TRAITS) +using std::add_const; +using std::add_lvalue_reference; +using std::aligned_storage; +using std::alignment_of; +using std::conditional; +using std::decay; +using std::declval; +using std::enable_if; +using std::false_type; +using std::integral_constant; +using std::is_base_of; +using std::is_class; +using std::is_const; +using std::is_constructible; +using std::is_convertible; +using std::is_copy_constructible; +using std::is_destructible; +using std::is_function; +using std::is_move_constructible; +using std::is_nothrow_copy_constructible; +using std::is_nothrow_destructible; +using std::is_object; +using std::is_reference; +using std::is_same; +using std::is_scalar; +using std::remove_cv; +template +struct remove_cvref : remove_cv::type> {}; +using std::remove_pointer; +using std::remove_reference; +#if defined(ASIO_HAS_STD_INVOKE_RESULT) +template struct result_of; +template +struct result_of : std::invoke_result {}; +#else // defined(ASIO_HAS_STD_INVOKE_RESULT) +using std::result_of; +#endif // defined(ASIO_HAS_STD_INVOKE_RESULT) +using std::true_type; +#else // defined(ASIO_HAS_STD_TYPE_TRAITS) +using boost::add_const; +using boost::add_lvalue_reference; +using boost::aligned_storage; +using boost::alignment_of; +template +struct enable_if : boost::enable_if_c {}; +using boost::conditional; +using boost::decay; +using boost::declval; +using boost::false_type; +using boost::integral_constant; +using boost::is_base_of; +using boost::is_class; +using boost::is_const; +using boost::is_constructible; +using boost::is_convertible; +using boost::is_copy_constructible; +using boost::is_destructible; +using boost::is_function; +#if defined(ASIO_HAS_MOVE) +template +struct is_move_constructible : false_type {}; +#else // defined(ASIO_HAS_MOVE) +template +struct is_move_constructible : is_copy_constructible {}; +#endif // defined(ASIO_HAS_MOVE) +template +struct is_nothrow_copy_constructible : boost::has_nothrow_copy {}; +template +struct is_nothrow_destructible : boost::has_nothrow_destructor {}; +using boost::is_object; +using boost::is_reference; +using boost::is_same; +using boost::is_scalar; +using boost::remove_cv; +template +struct remove_cvref : remove_cv::type> {}; +using boost::remove_pointer; +using boost::remove_reference; +using boost::result_of; +using boost::true_type; +#endif // defined(ASIO_HAS_STD_TYPE_TRAITS) + +template struct void_type { typedef void type; }; + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template struct conjunction : true_type {}; +template struct conjunction : T {}; +template struct conjunction : + conditional, Head>::type {}; + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +} // namespace asio + +#endif // ASIO_DETAIL_TYPE_TRAITS_HPP diff --git a/include/asio/include/asio/detail/variadic_templates.hpp b/include/asio/include/asio/detail/variadic_templates.hpp new file mode 100644 index 0000000..3ef6723 --- /dev/null +++ b/include/asio/include/asio/detail/variadic_templates.hpp @@ -0,0 +1,294 @@ +// +// detail/variadic_templates.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_VARIADIC_TEMPLATES_HPP +#define ASIO_DETAIL_VARIADIC_TEMPLATES_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +# define ASIO_VARIADIC_TPARAMS(n) ASIO_VARIADIC_TPARAMS_##n + +# define ASIO_VARIADIC_TPARAMS_1 \ + typename T1 +# define ASIO_VARIADIC_TPARAMS_2 \ + typename T1, typename T2 +# define ASIO_VARIADIC_TPARAMS_3 \ + typename T1, typename T2, typename T3 +# define ASIO_VARIADIC_TPARAMS_4 \ + typename T1, typename T2, typename T3, typename T4 +# define ASIO_VARIADIC_TPARAMS_5 \ + typename T1, typename T2, typename T3, typename T4, typename T5 +# define ASIO_VARIADIC_TPARAMS_6 \ + typename T1, typename T2, typename T3, typename T4, typename T5, \ + typename T6 +# define ASIO_VARIADIC_TPARAMS_7 \ + typename T1, typename T2, typename T3, typename T4, typename T5, \ + typename T6, typename T7 +# define ASIO_VARIADIC_TPARAMS_8 \ + typename T1, typename T2, typename T3, typename T4, typename T5, \ + typename T6, typename T7, typename T8 + +# define ASIO_VARIADIC_TARGS(n) ASIO_VARIADIC_TARGS_##n + +# define ASIO_VARIADIC_TARGS_1 T1 +# define ASIO_VARIADIC_TARGS_2 T1, T2 +# define ASIO_VARIADIC_TARGS_3 T1, T2, T3 +# define ASIO_VARIADIC_TARGS_4 T1, T2, T3, T4 +# define ASIO_VARIADIC_TARGS_5 T1, T2, T3, T4, T5 +# define ASIO_VARIADIC_TARGS_6 T1, T2, T3, T4, T5, T6 +# define ASIO_VARIADIC_TARGS_7 T1, T2, T3, T4, T5, T6, T7 +# define ASIO_VARIADIC_TARGS_8 T1, T2, T3, T4, T5, T6, T7, T8 + +# define ASIO_VARIADIC_BYVAL_PARAMS(n) \ + ASIO_VARIADIC_BYVAL_PARAMS_##n + +# define ASIO_VARIADIC_BYVAL_PARAMS_1 T1 x1 +# define ASIO_VARIADIC_BYVAL_PARAMS_2 T1 x1, T2 x2 +# define ASIO_VARIADIC_BYVAL_PARAMS_3 T1 x1, T2 x2, T3 x3 +# define ASIO_VARIADIC_BYVAL_PARAMS_4 T1 x1, T2 x2, T3 x3, T4 x4 +# define ASIO_VARIADIC_BYVAL_PARAMS_5 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5 +# define ASIO_VARIADIC_BYVAL_PARAMS_6 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, \ + T6 x6 +# define ASIO_VARIADIC_BYVAL_PARAMS_7 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, \ + T6 x6, T7 x7 +# define ASIO_VARIADIC_BYVAL_PARAMS_8 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, \ + T6 x6, T7 x7, T8 x8 + +# define ASIO_VARIADIC_BYVAL_ARGS(n) \ + ASIO_VARIADIC_BYVAL_ARGS_##n + +# define ASIO_VARIADIC_BYVAL_ARGS_1 x1 +# define ASIO_VARIADIC_BYVAL_ARGS_2 x1, x2 +# define ASIO_VARIADIC_BYVAL_ARGS_3 x1, x2, x3 +# define ASIO_VARIADIC_BYVAL_ARGS_4 x1, x2, x3, x4 +# define ASIO_VARIADIC_BYVAL_ARGS_5 x1, x2, x3, x4, x5 +# define ASIO_VARIADIC_BYVAL_ARGS_6 x1, x2, x3, x4, x5, x6 +# define ASIO_VARIADIC_BYVAL_ARGS_7 x1, x2, x3, x4, x5, x6, x7 +# define ASIO_VARIADIC_BYVAL_ARGS_8 x1, x2, x3, x4, x5, x6, x7, x8 + +# define ASIO_VARIADIC_CONSTREF_PARAMS(n) \ + ASIO_VARIADIC_CONSTREF_PARAMS_##n + +# define ASIO_VARIADIC_CONSTREF_PARAMS_1 \ + const T1& x1 +# define ASIO_VARIADIC_CONSTREF_PARAMS_2 \ + const T1& x1, const T2& x2 +# define ASIO_VARIADIC_CONSTREF_PARAMS_3 \ + const T1& x1, const T2& x2, const T3& x3 +# define ASIO_VARIADIC_CONSTREF_PARAMS_4 \ + const T1& x1, const T2& x2, const T3& x3, const T4& x4 +# define ASIO_VARIADIC_CONSTREF_PARAMS_5 \ + const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5 +# define ASIO_VARIADIC_CONSTREF_PARAMS_6 \ + const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5, \ + const T6& x6 +# define ASIO_VARIADIC_CONSTREF_PARAMS_7 \ + const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5, \ + const T6& x6, const T7& x7 +# define ASIO_VARIADIC_CONSTREF_PARAMS_8 \ + const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5, \ + const T6& x6, const T7& x7, const T8& x8 + +# define ASIO_VARIADIC_MOVE_PARAMS(n) \ + ASIO_VARIADIC_MOVE_PARAMS_##n + +# define ASIO_VARIADIC_MOVE_PARAMS_1 \ + ASIO_MOVE_ARG(T1) x1 +# define ASIO_VARIADIC_MOVE_PARAMS_2 \ + ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2 +# define ASIO_VARIADIC_MOVE_PARAMS_3 \ + ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ + ASIO_MOVE_ARG(T3) x3 +# define ASIO_VARIADIC_MOVE_PARAMS_4 \ + ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ + ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4 +# define ASIO_VARIADIC_MOVE_PARAMS_5 \ + ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ + ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \ + ASIO_MOVE_ARG(T5) x5 +# define ASIO_VARIADIC_MOVE_PARAMS_6 \ + ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ + ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \ + ASIO_MOVE_ARG(T5) x5, ASIO_MOVE_ARG(T6) x6 +# define ASIO_VARIADIC_MOVE_PARAMS_7 \ + ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ + ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \ + ASIO_MOVE_ARG(T5) x5, ASIO_MOVE_ARG(T6) x6, \ + ASIO_MOVE_ARG(T7) x7 +# define ASIO_VARIADIC_MOVE_PARAMS_8 \ + ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \ + ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \ + ASIO_MOVE_ARG(T5) x5, ASIO_MOVE_ARG(T6) x6, \ + ASIO_MOVE_ARG(T7) x7, ASIO_MOVE_ARG(T8) x8 + +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS(n) \ + ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_##n + +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_1 \ + ASIO_MOVE_ARG(T1) +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_2 \ + ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2) +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_3 \ + ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \ + ASIO_MOVE_ARG(T3) +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_4 \ + ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \ + ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4) +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_5 \ + ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \ + ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \ + ASIO_MOVE_ARG(T5) +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_6 \ + ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \ + ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \ + ASIO_MOVE_ARG(T5), ASIO_MOVE_ARG(T6) +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_7 \ + ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \ + ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \ + ASIO_MOVE_ARG(T5), ASIO_MOVE_ARG(T6), \ + ASIO_MOVE_ARG(T7) +# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_8 \ + ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \ + ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \ + ASIO_MOVE_ARG(T5), ASIO_MOVE_ARG(T6), \ + ASIO_MOVE_ARG(T7), ASIO_MOVE_ARG(T8) + +# define ASIO_VARIADIC_MOVE_ARGS(n) \ + ASIO_VARIADIC_MOVE_ARGS_##n + +# define ASIO_VARIADIC_MOVE_ARGS_1 \ + ASIO_MOVE_CAST(T1)(x1) +# define ASIO_VARIADIC_MOVE_ARGS_2 \ + ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2) +# define ASIO_VARIADIC_MOVE_ARGS_3 \ + ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ + ASIO_MOVE_CAST(T3)(x3) +# define ASIO_VARIADIC_MOVE_ARGS_4 \ + ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ + ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4) +# define ASIO_VARIADIC_MOVE_ARGS_5 \ + ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ + ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \ + ASIO_MOVE_CAST(T5)(x5) +# define ASIO_VARIADIC_MOVE_ARGS_6 \ + ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ + ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \ + ASIO_MOVE_CAST(T5)(x5), ASIO_MOVE_CAST(T6)(x6) +# define ASIO_VARIADIC_MOVE_ARGS_7 \ + ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ + ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \ + ASIO_MOVE_CAST(T5)(x5), ASIO_MOVE_CAST(T6)(x6), \ + ASIO_MOVE_CAST(T7)(x7) +# define ASIO_VARIADIC_MOVE_ARGS_8 \ + ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \ + ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \ + ASIO_MOVE_CAST(T5)(x5), ASIO_MOVE_CAST(T6)(x6), \ + ASIO_MOVE_CAST(T7)(x7), ASIO_MOVE_CAST(T8)(x8) + +# define ASIO_VARIADIC_DECLVAL(n) \ + ASIO_VARIADIC_DECLVAL_##n + +# define ASIO_VARIADIC_DECLVAL_1 \ + declval() +# define ASIO_VARIADIC_DECLVAL_2 \ + declval(), declval() +# define ASIO_VARIADIC_DECLVAL_3 \ + declval(), declval(), declval() +# define ASIO_VARIADIC_DECLVAL_4 \ + declval(), declval(), declval(), declval() +# define ASIO_VARIADIC_DECLVAL_5 \ + declval(), declval(), declval(), declval(), \ + declval() +# define ASIO_VARIADIC_DECLVAL_6 \ + declval(), declval(), declval(), declval(), \ + declval(), declval() +# define ASIO_VARIADIC_DECLVAL_7 \ + declval(), declval(), declval(), declval(), \ + declval(), declval(), declval() +# define ASIO_VARIADIC_DECLVAL_8 \ + declval(), declval(), declval(), declval(), \ + declval(), declval(), declval(), declval() + +# define ASIO_VARIADIC_MOVE_DECLVAL(n) \ + ASIO_VARIADIC_MOVE_DECLVAL_##n + +# define ASIO_VARIADIC_MOVE_DECLVAL_1 \ + declval() +# define ASIO_VARIADIC_MOVE_DECLVAL_2 \ + declval(), declval() +# define ASIO_VARIADIC_MOVE_DECLVAL_3 \ + declval(), declval(), \ + declval() +# define ASIO_VARIADIC_MOVE_DECLVAL_4 \ + declval(), declval(), \ + declval(), declval() +# define ASIO_VARIADIC_MOVE_DECLVAL_5 \ + declval(), declval(), \ + declval(), declval(), \ + declval() +# define ASIO_VARIADIC_MOVE_DECLVAL_6 \ + declval(), declval(), \ + declval(), declval(), \ + declval(), declval() +# define ASIO_VARIADIC_MOVE_DECLVAL_7 \ + declval(), declval(), \ + declval(), declval(), \ + declval(), declval(), \ + declval() +# define ASIO_VARIADIC_MOVE_DECLVAL_8 \ + declval(), declval(), \ + declval(), declval(), \ + declval(), declval(), \ + declval(), declval() + +# define ASIO_VARIADIC_DECAY(n) \ + ASIO_VARIADIC_DECAY_##n + +# define ASIO_VARIADIC_DECAY_1 \ + typename decay::type +# define ASIO_VARIADIC_DECAY_2 \ + typename decay::type, typename decay::type +# define ASIO_VARIADIC_DECAY_3 \ + typename decay::type, typename decay::type, \ + typename decay::type +# define ASIO_VARIADIC_DECAY_4 \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type +# define ASIO_VARIADIC_DECAY_5 \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type, \ + typename decay::type +# define ASIO_VARIADIC_DECAY_6 \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type +# define ASIO_VARIADIC_DECAY_7 \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type, \ + typename decay::type +# define ASIO_VARIADIC_DECAY_8 \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type, \ + typename decay::type, typename decay::type + +# define ASIO_VARIADIC_GENERATE(m) m(1) m(2) m(3) m(4) m(5) m(6) m(7) m(8) +# define ASIO_VARIADIC_GENERATE_5(m) m(1) m(2) m(3) m(4) m(5) + +#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#endif // ASIO_DETAIL_VARIADIC_TEMPLATES_HPP diff --git a/include/asio/include/asio/detail/wait_handler.hpp b/include/asio/include/asio/detail/wait_handler.hpp new file mode 100644 index 0000000..0c09819 --- /dev/null +++ b/include/asio/include/asio/detail/wait_handler.hpp @@ -0,0 +1,90 @@ +// +// detail/wait_handler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WAIT_HANDLER_HPP +#define ASIO_DETAIL_WAIT_HANDLER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/wait_op.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class wait_handler : public wait_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(wait_handler); + + wait_handler(Handler& h, const IoExecutor& io_ex) + : wait_op(&wait_handler::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(h)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& /*ec*/, + std::size_t /*bytes_transferred*/) + { + // Take ownership of the handler object. + wait_handler* h(static_cast(base)); + ptr p = { asio::detail::addressof(h->handler_), h, h }; + + ASIO_HANDLER_COMPLETION((*h)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + h->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(h->handler_, h->ec_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_WAIT_HANDLER_HPP diff --git a/include/asio/include/asio/detail/wait_op.hpp b/include/asio/include/asio/detail/wait_op.hpp new file mode 100644 index 0000000..9ea7c7b --- /dev/null +++ b/include/asio/include/asio/detail/wait_op.hpp @@ -0,0 +1,45 @@ +// +// detail/wait_op.hpp +// ~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WAIT_OP_HPP +#define ASIO_DETAIL_WAIT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class wait_op + : public operation +{ +public: + // The error code to be passed to the completion handler. + asio::error_code ec_; + +protected: + wait_op(func_type func) + : operation(func) + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_WAIT_OP_HPP diff --git a/include/asio/include/asio/detail/win_event.hpp b/include/asio/include/asio/detail/win_event.hpp new file mode 100644 index 0000000..721795b --- /dev/null +++ b/include/asio/include/asio/detail/win_event.hpp @@ -0,0 +1,164 @@ +// +// detail/win_event.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_EVENT_HPP +#define ASIO_DETAIL_WIN_EVENT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include +#include "asio/detail/assert.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_event + : private noncopyable +{ +public: + // Constructor. + ASIO_DECL win_event(); + + // Destructor. + ASIO_DECL ~win_event(); + + // Signal the event. (Retained for backward compatibility.) + template + void signal(Lock& lock) + { + this->signal_all(lock); + } + + // Signal all waiters. + template + void signal_all(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + (void)lock; + state_ |= 1; + ::SetEvent(events_[0]); + } + + // Unlock the mutex and signal one waiter. + template + void unlock_and_signal_one(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + bool have_waiters = (state_ > 1); + lock.unlock(); + if (have_waiters) + ::SetEvent(events_[1]); + } + + // Unlock the mutex and signal one waiter who may destroy us. + template + void unlock_and_signal_one_for_destruction(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + bool have_waiters = (state_ > 1); + if (have_waiters) + ::SetEvent(events_[1]); + lock.unlock(); + } + + // If there's a waiter, unlock the mutex and signal it. + template + bool maybe_unlock_and_signal_one(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + state_ |= 1; + if (state_ > 1) + { + lock.unlock(); + ::SetEvent(events_[1]); + return true; + } + return false; + } + + // Reset the event. + template + void clear(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + (void)lock; + ::ResetEvent(events_[0]); + state_ &= ~std::size_t(1); + } + + // Wait for the event to become signalled. + template + void wait(Lock& lock) + { + ASIO_ASSERT(lock.locked()); + while ((state_ & 1) == 0) + { + state_ += 2; + lock.unlock(); +#if defined(ASIO_WINDOWS_APP) + ::WaitForMultipleObjectsEx(2, events_, false, INFINITE, false); +#else // defined(ASIO_WINDOWS_APP) + ::WaitForMultipleObjects(2, events_, false, INFINITE); +#endif // defined(ASIO_WINDOWS_APP) + lock.lock(); + state_ -= 2; + } + } + + // Timed wait for the event to become signalled. + template + bool wait_for_usec(Lock& lock, long usec) + { + ASIO_ASSERT(lock.locked()); + if ((state_ & 1) == 0) + { + state_ += 2; + lock.unlock(); + DWORD msec = usec > 0 ? (usec < 1000 ? 1 : usec / 1000) : 0; +#if defined(ASIO_WINDOWS_APP) + ::WaitForMultipleObjectsEx(2, events_, false, msec, false); +#else // defined(ASIO_WINDOWS_APP) + ::WaitForMultipleObjects(2, events_, false, msec); +#endif // defined(ASIO_WINDOWS_APP) + lock.lock(); + state_ -= 2; + } + return (state_ & 1) != 0; + } + +private: + HANDLE events_[2]; + std::size_t state_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_event.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_WIN_EVENT_HPP diff --git a/include/asio/include/asio/detail/win_fd_set_adapter.hpp b/include/asio/include/asio/detail/win_fd_set_adapter.hpp new file mode 100644 index 0000000..f810180 --- /dev/null +++ b/include/asio/include/asio/detail/win_fd_set_adapter.hpp @@ -0,0 +1,149 @@ +// +// detail/win_fd_set_adapter.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP +#define ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/reactor_op_queue.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Adapts the FD_SET type to meet the Descriptor_Set concept's requirements. +class win_fd_set_adapter : noncopyable +{ +public: + enum { default_fd_set_size = 1024 }; + + win_fd_set_adapter() + : capacity_(default_fd_set_size), + max_descriptor_(invalid_socket) + { + fd_set_ = static_cast(::operator new( + sizeof(win_fd_set) - sizeof(SOCKET) + + sizeof(SOCKET) * (capacity_))); + fd_set_->fd_count = 0; + } + + ~win_fd_set_adapter() + { + ::operator delete(fd_set_); + } + + void reset() + { + fd_set_->fd_count = 0; + max_descriptor_ = invalid_socket; + } + + bool set(socket_type descriptor) + { + for (u_int i = 0; i < fd_set_->fd_count; ++i) + if (fd_set_->fd_array[i] == descriptor) + return true; + + reserve(fd_set_->fd_count + 1); + fd_set_->fd_array[fd_set_->fd_count++] = descriptor; + return true; + } + + void set(reactor_op_queue& operations, op_queue&) + { + reactor_op_queue::iterator i = operations.begin(); + while (i != operations.end()) + { + reactor_op_queue::iterator op_iter = i++; + reserve(fd_set_->fd_count + 1); + fd_set_->fd_array[fd_set_->fd_count++] = op_iter->first; + } + } + + bool is_set(socket_type descriptor) const + { + return !!__WSAFDIsSet(descriptor, + const_cast(reinterpret_cast(fd_set_))); + } + + operator fd_set*() + { + return reinterpret_cast(fd_set_); + } + + socket_type max_descriptor() const + { + return max_descriptor_; + } + + void perform(reactor_op_queue& operations, + op_queue& ops) const + { + for (u_int i = 0; i < fd_set_->fd_count; ++i) + operations.perform_operations(fd_set_->fd_array[i], ops); + } + +private: + // This structure is defined to be compatible with the Windows API fd_set + // structure, but without being dependent on the value of FD_SETSIZE. We use + // the "struct hack" to allow the number of descriptors to be varied at + // runtime. + struct win_fd_set + { + u_int fd_count; + SOCKET fd_array[1]; + }; + + // Increase the fd_set_ capacity to at least the specified number of elements. + void reserve(u_int n) + { + if (n <= capacity_) + return; + + u_int new_capacity = capacity_ + capacity_ / 2; + if (new_capacity < n) + new_capacity = n; + + win_fd_set* new_fd_set = static_cast(::operator new( + sizeof(win_fd_set) - sizeof(SOCKET) + + sizeof(SOCKET) * (new_capacity))); + + new_fd_set->fd_count = fd_set_->fd_count; + for (u_int i = 0; i < fd_set_->fd_count; ++i) + new_fd_set->fd_array[i] = fd_set_->fd_array[i]; + + ::operator delete(fd_set_); + fd_set_ = new_fd_set; + capacity_ = new_capacity; + } + + win_fd_set* fd_set_; + u_int capacity_; + socket_type max_descriptor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#endif // ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP diff --git a/include/asio/include/asio/detail/win_fenced_block.hpp b/include/asio/include/asio/detail/win_fenced_block.hpp new file mode 100644 index 0000000..17a0785 --- /dev/null +++ b/include/asio/include/asio/detail/win_fenced_block.hpp @@ -0,0 +1,90 @@ +// +// detail/win_fenced_block.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_FENCED_BLOCK_HPP +#define ASIO_DETAIL_WIN_FENCED_BLOCK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) && !defined(UNDER_CE) + +#include "asio/detail/socket_types.hpp" +#include "asio/detail/noncopyable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_fenced_block + : private noncopyable +{ +public: + enum half_t { half }; + enum full_t { full }; + + // Constructor for a half fenced block. + explicit win_fenced_block(half_t) + { + } + + // Constructor for a full fenced block. + explicit win_fenced_block(full_t) + { +#if defined(__BORLANDC__) + LONG barrier = 0; + ::InterlockedExchange(&barrier, 1); +#elif defined(ASIO_MSVC) \ + && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier)) +# if defined(_M_IX86) +# pragma warning(push) +# pragma warning(disable:4793) + LONG barrier; + __asm { xchg barrier, eax } +# pragma warning(pop) +# endif // defined(_M_IX86) +#else + MemoryBarrier(); +#endif + } + + // Destructor. + ~win_fenced_block() + { +#if defined(__BORLANDC__) + LONG barrier = 0; + ::InterlockedExchange(&barrier, 1); +#elif defined(ASIO_MSVC) \ + && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier)) +# if defined(_M_IX86) +# pragma warning(push) +# pragma warning(disable:4793) + LONG barrier; + __asm { xchg barrier, eax } +# pragma warning(pop) +# endif // defined(_M_IX86) +#else + MemoryBarrier(); +#endif + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) && !defined(UNDER_CE) + +#endif // ASIO_DETAIL_WIN_FENCED_BLOCK_HPP diff --git a/include/asio/include/asio/detail/win_global.hpp b/include/asio/include/asio/detail/win_global.hpp new file mode 100644 index 0000000..feaa3a3 --- /dev/null +++ b/include/asio/include/asio/detail/win_global.hpp @@ -0,0 +1,71 @@ +// +// detail/win_global.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_GLOBAL_HPP +#define ASIO_DETAIL_WIN_GLOBAL_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/static_mutex.hpp" +#include "asio/detail/tss_ptr.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct win_global_impl +{ + // Destructor automatically cleans up the global. + ~win_global_impl() + { + delete ptr_; + } + + static win_global_impl instance_; + static static_mutex mutex_; + T* ptr_; + static tss_ptr tss_ptr_; +}; + +template +win_global_impl win_global_impl::instance_ = { 0 }; + +template +static_mutex win_global_impl::mutex_ = ASIO_STATIC_MUTEX_INIT; + +template +tss_ptr win_global_impl::tss_ptr_; + +template +T& win_global() +{ + if (static_cast(win_global_impl::tss_ptr_) == 0) + { + win_global_impl::mutex_.init(); + static_mutex::scoped_lock lock(win_global_impl::mutex_); + if (win_global_impl::instance_.ptr_ == 0) + win_global_impl::instance_.ptr_ = new T; + win_global_impl::tss_ptr_ = win_global_impl::instance_.ptr_; + } + + return *win_global_impl::tss_ptr_; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_WIN_GLOBAL_HPP diff --git a/include/asio/include/asio/detail/win_iocp_handle_read_op.hpp b/include/asio/include/asio/detail/win_iocp_handle_read_op.hpp new file mode 100644 index 0000000..9135cba --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_handle_read_op.hpp @@ -0,0 +1,117 @@ +// +// detail/win_iocp_handle_read_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_HANDLE_READ_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_HANDLE_READ_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_handle_read_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_handle_read_op); + + win_iocp_handle_read_op(const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + : operation(&win_iocp_handle_read_op::do_complete), + buffers_(buffers), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t bytes_transferred) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_handle_read_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + if (owner) + { + // Check whether buffers are still valid. + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_HANDLE_EOF) + ec = asio::error::eof; + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + MutableBufferSequence buffers_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_HANDLE_READ_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_handle_service.hpp b/include/asio/include/asio/detail/win_iocp_handle_service.hpp new file mode 100644 index 0000000..d3311d1 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_handle_service.hpp @@ -0,0 +1,335 @@ +// +// detail/win_iocp_handle_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_HANDLE_SERVICE_HPP +#define ASIO_DETAIL_WIN_IOCP_HANDLE_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/cstdint.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/win_iocp_handle_read_op.hpp" +#include "asio/detail/win_iocp_handle_write_op.hpp" +#include "asio/detail/win_iocp_io_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_iocp_handle_service : + public execution_context_service_base +{ +public: + // The native type of a stream handle. + typedef HANDLE native_handle_type; + + // The implementation type of the stream handle. + class implementation_type + { + public: + // Default constructor. + implementation_type() + : handle_(INVALID_HANDLE_VALUE), + safe_cancellation_thread_id_(0), + next_(0), + prev_(0) + { + } + + private: + // Only this service will have access to the internal values. + friend class win_iocp_handle_service; + + // The native stream handle representation. + native_handle_type handle_; + + // The ID of the thread from which it is safe to cancel asynchronous + // operations. 0 means no asynchronous operations have been started yet. + // ~0 means asynchronous operations have been started from more than one + // thread, and cancellation is not supported for the handle. + DWORD safe_cancellation_thread_id_; + + // Pointers to adjacent handle implementations in linked list. + implementation_type* next_; + implementation_type* prev_; + }; + + ASIO_DECL win_iocp_handle_service(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Construct a new handle implementation. + ASIO_DECL void construct(implementation_type& impl); + + // Move-construct a new handle implementation. + ASIO_DECL void move_construct(implementation_type& impl, + implementation_type& other_impl); + + // Move-assign from another handle implementation. + ASIO_DECL void move_assign(implementation_type& impl, + win_iocp_handle_service& other_service, + implementation_type& other_impl); + + // Destroy a handle implementation. + ASIO_DECL void destroy(implementation_type& impl); + + // Assign a native handle to a handle implementation. + ASIO_DECL asio::error_code assign(implementation_type& impl, + const native_handle_type& handle, asio::error_code& ec); + + // Determine whether the handle is open. + bool is_open(const implementation_type& impl) const + { + return impl.handle_ != INVALID_HANDLE_VALUE; + } + + // Destroy a handle implementation. + ASIO_DECL asio::error_code close(implementation_type& impl, + asio::error_code& ec); + + // Get the native handle representation. + native_handle_type native_handle(const implementation_type& impl) const + { + return impl.handle_; + } + + // Cancel all operations associated with the handle. + ASIO_DECL asio::error_code cancel(implementation_type& impl, + asio::error_code& ec); + + // Write the given data. Returns the number of bytes written. + template + size_t write_some(implementation_type& impl, + const ConstBufferSequence& buffers, asio::error_code& ec) + { + return write_some_at(impl, 0, buffers, ec); + } + + // Write the given data at the specified offset. Returns the number of bytes + // written. + template + size_t write_some_at(implementation_type& impl, uint64_t offset, + const ConstBufferSequence& buffers, asio::error_code& ec) + { + asio::const_buffer buffer = + buffer_sequence_adapter::first(buffers); + + return do_write(impl, offset, buffer, ec); + } + + // Start an asynchronous write. The data being written must be valid for the + // lifetime of the asynchronous operation. + template + void async_write_some(implementation_type& impl, + const ConstBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_handle_write_op< + ConstBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, + reinterpret_cast(impl.handle_), "async_write_some")); + + start_write_op(impl, 0, + buffer_sequence_adapter::first(buffers), p.p); + p.v = p.p = 0; + } + + // Start an asynchronous write at a specified offset. The data being written + // must be valid for the lifetime of the asynchronous operation. + template + void async_write_some_at(implementation_type& impl, + uint64_t offset, const ConstBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_handle_write_op< + ConstBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, + reinterpret_cast(impl.handle_), "async_write_some_at")); + + start_write_op(impl, offset, + buffer_sequence_adapter::first(buffers), p.p); + p.v = p.p = 0; + } + + // Read some data. Returns the number of bytes received. + template + size_t read_some(implementation_type& impl, + const MutableBufferSequence& buffers, asio::error_code& ec) + { + return read_some_at(impl, 0, buffers, ec); + } + + // Read some data at a specified offset. Returns the number of bytes received. + template + size_t read_some_at(implementation_type& impl, uint64_t offset, + const MutableBufferSequence& buffers, asio::error_code& ec) + { + asio::mutable_buffer buffer = + buffer_sequence_adapter::first(buffers); + + return do_read(impl, offset, buffer, ec); + } + + // Start an asynchronous read. The buffer for the data being received must be + // valid for the lifetime of the asynchronous operation. + template + void async_read_some(implementation_type& impl, + const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_handle_read_op< + MutableBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, + reinterpret_cast(impl.handle_), "async_read_some")); + + start_read_op(impl, 0, + buffer_sequence_adapter::first(buffers), p.p); + p.v = p.p = 0; + } + + // Start an asynchronous read at a specified offset. The buffer for the data + // being received must be valid for the lifetime of the asynchronous + // operation. + template + void async_read_some_at(implementation_type& impl, + uint64_t offset, const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_handle_read_op< + MutableBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((iocp_service_.context(), *p.p, "handle", &impl, + reinterpret_cast(impl.handle_), "async_read_some_at")); + + start_read_op(impl, offset, + buffer_sequence_adapter::first(buffers), p.p); + p.v = p.p = 0; + } + +private: + // Prevent the use of the null_buffers type with this service. + size_t write_some(implementation_type& impl, + const null_buffers& buffers, asio::error_code& ec); + size_t write_some_at(implementation_type& impl, uint64_t offset, + const null_buffers& buffers, asio::error_code& ec); + template + void async_write_some(implementation_type& impl, + const null_buffers& buffers, Handler& handler, + const IoExecutor& io_ex); + template + void async_write_some_at(implementation_type& impl, uint64_t offset, + const null_buffers& buffers, Handler& handler, const IoExecutor& io_ex); + size_t read_some(implementation_type& impl, + const null_buffers& buffers, asio::error_code& ec); + size_t read_some_at(implementation_type& impl, uint64_t offset, + const null_buffers& buffers, asio::error_code& ec); + template + void async_read_some(implementation_type& impl, + const null_buffers& buffers, Handler& handler, + const IoExecutor& io_ex); + template + void async_read_some_at(implementation_type& impl, uint64_t offset, + const null_buffers& buffers, Handler& handler, const IoExecutor& io_ex); + + // Helper class for waiting for synchronous operations to complete. + class overlapped_wrapper; + + // Helper function to perform a synchronous write operation. + ASIO_DECL size_t do_write(implementation_type& impl, + uint64_t offset, const asio::const_buffer& buffer, + asio::error_code& ec); + + // Helper function to start a write operation. + ASIO_DECL void start_write_op(implementation_type& impl, + uint64_t offset, const asio::const_buffer& buffer, + operation* op); + + // Helper function to perform a synchronous write operation. + ASIO_DECL size_t do_read(implementation_type& impl, + uint64_t offset, const asio::mutable_buffer& buffer, + asio::error_code& ec); + + // Helper function to start a read operation. + ASIO_DECL void start_read_op(implementation_type& impl, + uint64_t offset, const asio::mutable_buffer& buffer, + operation* op); + + // Update the ID of the thread from which cancellation is safe. + ASIO_DECL void update_cancellation_thread_id(implementation_type& impl); + + // Helper function to close a handle when the associated object is being + // destroyed. + ASIO_DECL void close_for_destruction(implementation_type& impl); + + // The IOCP service used for running asynchronous operations and dispatching + // handlers. + win_iocp_io_context& iocp_service_; + + // Mutex to protect access to the linked list of implementations. + mutex mutex_; + + // The head of a linked list of all implementations. + implementation_type* impl_list_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_iocp_handle_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_HANDLE_SERVICE_HPP diff --git a/include/asio/include/asio/detail/win_iocp_handle_write_op.hpp b/include/asio/include/asio/detail/win_iocp_handle_write_op.hpp new file mode 100644 index 0000000..c03df65 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_handle_write_op.hpp @@ -0,0 +1,110 @@ +// +// detail/win_iocp_handle_write_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_HANDLE_WRITE_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_HANDLE_WRITE_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_handle_write_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_handle_write_op); + + win_iocp_handle_write_op(const ConstBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + : operation(&win_iocp_handle_write_op::do_complete), + buffers_(buffers), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& ec, std::size_t bytes_transferred) + { + // Take ownership of the operation object. + win_iocp_handle_write_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + if (owner) + { + // Check whether buffers are still valid. + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + ConstBufferSequence buffers_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_HANDLE_WRITE_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_io_context.hpp b/include/asio/include/asio/detail/win_iocp_io_context.hpp new file mode 100644 index 0000000..b1a27ee --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_io_context.hpp @@ -0,0 +1,342 @@ +// +// detail/win_iocp_io_context.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_IO_CONTEXT_HPP +#define ASIO_DETAIL_WIN_IOCP_IO_CONTEXT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/limits.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/scoped_ptr.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/thread.hpp" +#include "asio/detail/thread_context.hpp" +#include "asio/detail/timer_queue_base.hpp" +#include "asio/detail/timer_queue_set.hpp" +#include "asio/detail/wait_op.hpp" +#include "asio/detail/win_iocp_operation.hpp" +#include "asio/detail/win_iocp_thread_info.hpp" +#include "asio/execution_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class wait_op; + +class win_iocp_io_context + : public execution_context_service_base, + public thread_context +{ +public: + // Constructor. Specifies a concurrency hint that is passed through to the + // underlying I/O completion port. + ASIO_DECL win_iocp_io_context(asio::execution_context& ctx, + int concurrency_hint = -1, bool own_thread = true); + + // Destructor. + ASIO_DECL ~win_iocp_io_context(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Initialise the task. Nothing to do here. + void init_task() + { + } + + // Register a handle with the IO completion port. + ASIO_DECL asio::error_code register_handle( + HANDLE handle, asio::error_code& ec); + + // Run the event loop until stopped or no more work. + ASIO_DECL size_t run(asio::error_code& ec); + + // Run until stopped or one operation is performed. + ASIO_DECL size_t run_one(asio::error_code& ec); + + // Run until timeout, interrupted, or one operation is performed. + ASIO_DECL size_t wait_one(long usec, asio::error_code& ec); + + // Poll for operations without blocking. + ASIO_DECL size_t poll(asio::error_code& ec); + + // Poll for one operation without blocking. + ASIO_DECL size_t poll_one(asio::error_code& ec); + + // Stop the event processing loop. + ASIO_DECL void stop(); + + // Determine whether the io_context is stopped. + bool stopped() const + { + return ::InterlockedExchangeAdd(&stopped_, 0) != 0; + } + + // Restart in preparation for a subsequent run invocation. + void restart() + { + ::InterlockedExchange(&stopped_, 0); + } + + // Notify that some work has started. + void work_started() + { + ::InterlockedIncrement(&outstanding_work_); + } + + // Notify that some work has finished. + void work_finished() + { + if (::InterlockedDecrement(&outstanding_work_) == 0) + stop(); + } + + // Return whether a handler can be dispatched immediately. + bool can_dispatch() + { + return thread_call_stack::contains(this) != 0; + } + + /// Capture the current exception so it can be rethrown from a run function. + ASIO_DECL void capture_current_exception(); + + // Request invocation of the given operation and return immediately. Assumes + // that work_started() has not yet been called for the operation. + void post_immediate_completion(win_iocp_operation* op, bool) + { + work_started(); + post_deferred_completion(op); + } + + // Request invocation of the given operation and return immediately. Assumes + // that work_started() was previously called for the operation. + ASIO_DECL void post_deferred_completion(win_iocp_operation* op); + + // Request invocation of the given operation and return immediately. Assumes + // that work_started() was previously called for the operations. + ASIO_DECL void post_deferred_completions( + op_queue& ops); + + // Request invocation of the given operation using the thread-private queue + // and return immediately. Assumes that work_started() has not yet been + // called for the operation. + void post_private_immediate_completion(win_iocp_operation* op) + { + post_immediate_completion(op, false); + } + + // Request invocation of the given operation using the thread-private queue + // and return immediately. Assumes that work_started() was previously called + // for the operation. + void post_private_deferred_completion(win_iocp_operation* op) + { + post_deferred_completion(op); + } + + // Enqueue the given operation following a failed attempt to dispatch the + // operation for immediate invocation. + void do_dispatch(operation* op) + { + post_immediate_completion(op, false); + } + + // Process unfinished operations as part of a shutdown operation. Assumes + // that work_started() was previously called for the operations. + ASIO_DECL void abandon_operations(op_queue& ops); + + // Called after starting an overlapped I/O operation that did not complete + // immediately. The caller must have already called work_started() prior to + // starting the operation. + ASIO_DECL void on_pending(win_iocp_operation* op); + + // Called after starting an overlapped I/O operation that completed + // immediately. The caller must have already called work_started() prior to + // starting the operation. + ASIO_DECL void on_completion(win_iocp_operation* op, + DWORD last_error = 0, DWORD bytes_transferred = 0); + + // Called after starting an overlapped I/O operation that completed + // immediately. The caller must have already called work_started() prior to + // starting the operation. + ASIO_DECL void on_completion(win_iocp_operation* op, + const asio::error_code& ec, DWORD bytes_transferred = 0); + + // Add a new timer queue to the service. + template + void add_timer_queue(timer_queue& timer_queue); + + // Remove a timer queue from the service. + template + void remove_timer_queue(timer_queue& timer_queue); + + // Schedule a new operation in the given timer queue to expire at the + // specified absolute time. + template + void schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op); + + // Cancel the timer associated with the given token. Returns the number of + // handlers that have been posted or dispatched. + template + std::size_t cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled = (std::numeric_limits::max)()); + + // Move the timer operations associated with the given timer. + template + void move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& to, + typename timer_queue::per_timer_data& from); + + // Get the concurrency hint that was used to initialise the io_context. + int concurrency_hint() const + { + return concurrency_hint_; + } + +private: +#if defined(WINVER) && (WINVER < 0x0500) + typedef DWORD dword_ptr_t; + typedef ULONG ulong_ptr_t; +#else // defined(WINVER) && (WINVER < 0x0500) + typedef DWORD_PTR dword_ptr_t; + typedef ULONG_PTR ulong_ptr_t; +#endif // defined(WINVER) && (WINVER < 0x0500) + + // Dequeues at most one operation from the I/O completion port, and then + // executes it. Returns the number of operations that were dequeued (i.e. + // either 0 or 1). + ASIO_DECL size_t do_one(DWORD msec, + win_iocp_thread_info& this_thread, asio::error_code& ec); + + // Helper to calculate the GetQueuedCompletionStatus timeout. + ASIO_DECL static DWORD get_gqcs_timeout(); + + // Helper function to add a new timer queue. + ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); + + // Helper function to remove a timer queue. + ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); + + // Called to recalculate and update the timeout. + ASIO_DECL void update_timeout(); + + // Helper class to call work_finished() on block exit. + struct work_finished_on_block_exit; + + // Helper class for managing a HANDLE. + struct auto_handle + { + HANDLE handle; + auto_handle() : handle(0) {} + ~auto_handle() { if (handle) ::CloseHandle(handle); } + }; + + // The IO completion port used for queueing operations. + auto_handle iocp_; + + // The count of unfinished work. + long outstanding_work_; + + // Flag to indicate whether the event loop has been stopped. + mutable long stopped_; + + // Flag to indicate whether there is an in-flight stop event. Every event + // posted using PostQueuedCompletionStatus consumes non-paged pool, so to + // avoid exhausting this resouce we limit the number of outstanding events. + long stop_event_posted_; + + // Flag to indicate whether the service has been shut down. + long shutdown_; + + enum + { + // Timeout to use with GetQueuedCompletionStatus on older versions of + // Windows. Some versions of windows have a "bug" where a call to + // GetQueuedCompletionStatus can appear stuck even though there are events + // waiting on the queue. Using a timeout helps to work around the issue. + default_gqcs_timeout = 500, + + // Maximum waitable timer timeout, in milliseconds. + max_timeout_msec = 5 * 60 * 1000, + + // Maximum waitable timer timeout, in microseconds. + max_timeout_usec = max_timeout_msec * 1000, + + // Completion key value used to wake up a thread to dispatch timers or + // completed operations. + wake_for_dispatch = 1, + + // Completion key value to indicate that an operation has posted with the + // original last_error and bytes_transferred values stored in the fields of + // the OVERLAPPED structure. + overlapped_contains_result = 2 + }; + + // Timeout to use with GetQueuedCompletionStatus. + const DWORD gqcs_timeout_; + + // Helper class to run the scheduler in its own thread. + struct thread_function; + friend struct thread_function; + + // Function object for processing timeouts in a background thread. + struct timer_thread_function; + friend struct timer_thread_function; + + // Background thread used for processing timeouts. + scoped_ptr timer_thread_; + + // A waitable timer object used for waiting for timeouts. + auto_handle waitable_timer_; + + // Non-zero if timers or completed operations need to be dispatched. + long dispatch_required_; + + // Mutex for protecting access to the timer queues and completed operations. + mutex dispatch_mutex_; + + // The timer queues. + timer_queue_set timer_queues_; + + // The operations that are ready to dispatch. + op_queue completed_ops_; + + // The concurrency hint used to initialise the io_context. + const int concurrency_hint_; + + // The thread that is running the io_context. + scoped_ptr thread_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/win_iocp_io_context.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_iocp_io_context.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_IO_CONTEXT_HPP diff --git a/include/asio/include/asio/detail/win_iocp_null_buffers_op.hpp b/include/asio/include/asio/detail/win_iocp_null_buffers_op.hpp new file mode 100644 index 0000000..091832f --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_null_buffers_op.hpp @@ -0,0 +1,127 @@ +// +// detail/win_iocp_null_buffers_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_NULL_BUFFERS_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_NULL_BUFFERS_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_null_buffers_op : public reactor_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_null_buffers_op); + + win_iocp_null_buffers_op(socket_ops::weak_cancel_token_type cancel_token, + Handler& handler, const IoExecutor& io_ex) + : reactor_op(asio::error_code(), + &win_iocp_null_buffers_op::do_perform, + &win_iocp_null_buffers_op::do_complete), + cancel_token_(cancel_token), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static status do_perform(reactor_op*) + { + return done; + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t bytes_transferred) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_null_buffers_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // The reactor may have stored a result in the operation object. + if (o->ec_) + ec = o->ec_; + + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_NETNAME_DELETED) + { + if (o->cancel_token_.expired()) + ec = asio::error::operation_aborted; + else + ec = asio::error::connection_reset; + } + else if (ec.value() == ERROR_PORT_UNREACHABLE) + { + ec = asio::error::connection_refused; + } + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + socket_ops::weak_cancel_token_type cancel_token_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_NULL_BUFFERS_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_operation.hpp b/include/asio/include/asio/detail/win_iocp_operation.hpp new file mode 100644 index 0000000..984f4f5 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_operation.hpp @@ -0,0 +1,96 @@ +// +// detail/win_iocp_operation.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_OPERATION_HPP +#define ASIO_DETAIL_WIN_IOCP_OPERATION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/handler_tracking.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/error_code.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_iocp_io_context; + +// Base class for all operations. A function pointer is used instead of virtual +// functions to avoid the associated overhead. +class win_iocp_operation + : public OVERLAPPED + ASIO_ALSO_INHERIT_TRACKED_HANDLER +{ +public: + typedef win_iocp_operation operation_type; + + void complete(void* owner, const asio::error_code& ec, + std::size_t bytes_transferred) + { + func_(owner, this, ec, bytes_transferred); + } + + void destroy() + { + func_(0, this, asio::error_code(), 0); + } + +protected: + typedef void (*func_type)( + void*, win_iocp_operation*, + const asio::error_code&, std::size_t); + + win_iocp_operation(func_type func) + : next_(0), + func_(func) + { + reset(); + } + + // Prevents deletion through this type. + ~win_iocp_operation() + { + } + + void reset() + { + Internal = 0; + InternalHigh = 0; + Offset = 0; + OffsetHigh = 0; + hEvent = 0; + ready_ = 0; + } + +private: + friend class op_queue_access; + friend class win_iocp_io_context; + win_iocp_operation* next_; + func_type func_; + long ready_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_OPERATION_HPP diff --git a/include/asio/include/asio/detail/win_iocp_overlapped_op.hpp b/include/asio/include/asio/detail/win_iocp_overlapped_op.hpp new file mode 100644 index 0000000..71bd73f --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_overlapped_op.hpp @@ -0,0 +1,96 @@ +// +// detail/win_iocp_overlapped_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_OVERLAPPED_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_OVERLAPPED_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_overlapped_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_overlapped_op); + + win_iocp_overlapped_op(Handler& handler, const IoExecutor& io_ex) + : operation(&win_iocp_overlapped_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& ec, std::size_t bytes_transferred) + { + // Take ownership of the operation object. + win_iocp_overlapped_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_OVERLAPPED_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp b/include/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp new file mode 100644 index 0000000..985bbea --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp @@ -0,0 +1,171 @@ +// +// detail/win_iocp_overlapped_ptr.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_OVERLAPPED_PTR_HPP +#define ASIO_DETAIL_WIN_IOCP_OVERLAPPED_PTR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/io_context.hpp" +#include "asio/query.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/win_iocp_overlapped_op.hpp" +#include "asio/detail/win_iocp_io_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Wraps a handler to create an OVERLAPPED object for use with overlapped I/O. +class win_iocp_overlapped_ptr + : private noncopyable +{ +public: + // Construct an empty win_iocp_overlapped_ptr. + win_iocp_overlapped_ptr() + : ptr_(0), + iocp_service_(0) + { + } + + // Construct an win_iocp_overlapped_ptr to contain the specified handler. + template + explicit win_iocp_overlapped_ptr(const Executor& ex, + ASIO_MOVE_ARG(Handler) handler) + : ptr_(0), + iocp_service_(0) + { + this->reset(ex, ASIO_MOVE_CAST(Handler)(handler)); + } + + // Destructor automatically frees the OVERLAPPED object unless released. + ~win_iocp_overlapped_ptr() + { + reset(); + } + + // Reset to empty. + void reset() + { + if (ptr_) + { + ptr_->destroy(); + ptr_ = 0; + iocp_service_->work_finished(); + iocp_service_ = 0; + } + } + + // Reset to contain the specified handler, freeing any current OVERLAPPED + // object. + template + void reset(const Executor& ex, Handler handler) + { + win_iocp_io_context* iocp_service = this->get_iocp_service(ex); + + typedef win_iocp_overlapped_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(handler, ex); + + ASIO_HANDLER_CREATION((ex.context(), *p.p, + "iocp_service", iocp_service, 0, "overlapped")); + + iocp_service->work_started(); + reset(); + ptr_ = p.p; + p.v = p.p = 0; + iocp_service_ = iocp_service; + } + + // Get the contained OVERLAPPED object. + OVERLAPPED* get() + { + return ptr_; + } + + // Get the contained OVERLAPPED object. + const OVERLAPPED* get() const + { + return ptr_; + } + + // Release ownership of the OVERLAPPED object. + OVERLAPPED* release() + { + if (ptr_) + iocp_service_->on_pending(ptr_); + + OVERLAPPED* tmp = ptr_; + ptr_ = 0; + iocp_service_ = 0; + return tmp; + } + + // Post completion notification for overlapped operation. Releases ownership. + void complete(const asio::error_code& ec, + std::size_t bytes_transferred) + { + if (ptr_) + { + iocp_service_->on_completion(ptr_, ec, + static_cast(bytes_transferred)); + ptr_ = 0; + iocp_service_ = 0; + } + } + +private: + template + static win_iocp_io_context* get_iocp_service(const Executor& ex, + typename enable_if< + can_query::value + >::type* = 0) + { + return &use_service( + asio::query(ex, execution::context)); + } + + template + static win_iocp_io_context* get_iocp_service(const Executor& ex, + typename enable_if< + !can_query::value + >::type* = 0) + { + return &use_service(ex.context()); + } + + static win_iocp_io_context* get_iocp_service( + const io_context::executor_type& ex) + { + return &asio::query(ex, execution::context).impl_; + } + + win_iocp_operation* ptr_; + win_iocp_io_context* iocp_service_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_OVERLAPPED_PTR_HPP diff --git a/include/asio/include/asio/detail/win_iocp_serial_port_service.hpp b/include/asio/include/asio/detail/win_iocp_serial_port_service.hpp new file mode 100644 index 0000000..d4c2b4b --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_serial_port_service.hpp @@ -0,0 +1,232 @@ +// +// detail/win_iocp_serial_port_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP +#define ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) + +#include +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/win_iocp_handle_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Extend win_iocp_handle_service to provide serial port support. +class win_iocp_serial_port_service : + public execution_context_service_base +{ +public: + // The native type of a serial port. + typedef win_iocp_handle_service::native_handle_type native_handle_type; + + // The implementation type of the serial port. + typedef win_iocp_handle_service::implementation_type implementation_type; + + // Constructor. + ASIO_DECL win_iocp_serial_port_service(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Construct a new serial port implementation. + void construct(implementation_type& impl) + { + handle_service_.construct(impl); + } + + // Move-construct a new serial port implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) + { + handle_service_.move_construct(impl, other_impl); + } + + // Move-assign from another serial port implementation. + void move_assign(implementation_type& impl, + win_iocp_serial_port_service& other_service, + implementation_type& other_impl) + { + handle_service_.move_assign(impl, + other_service.handle_service_, other_impl); + } + + // Destroy a serial port implementation. + void destroy(implementation_type& impl) + { + handle_service_.destroy(impl); + } + + // Open the serial port using the specified device name. + ASIO_DECL asio::error_code open(implementation_type& impl, + const std::string& device, asio::error_code& ec); + + // Assign a native handle to a serial port implementation. + asio::error_code assign(implementation_type& impl, + const native_handle_type& handle, asio::error_code& ec) + { + return handle_service_.assign(impl, handle, ec); + } + + // Determine whether the serial port is open. + bool is_open(const implementation_type& impl) const + { + return handle_service_.is_open(impl); + } + + // Destroy a serial port implementation. + asio::error_code close(implementation_type& impl, + asio::error_code& ec) + { + return handle_service_.close(impl, ec); + } + + // Get the native serial port representation. + native_handle_type native_handle(implementation_type& impl) + { + return handle_service_.native_handle(impl); + } + + // Cancel all operations associated with the handle. + asio::error_code cancel(implementation_type& impl, + asio::error_code& ec) + { + return handle_service_.cancel(impl, ec); + } + + // Set an option on the serial port. + template + asio::error_code set_option(implementation_type& impl, + const SettableSerialPortOption& option, asio::error_code& ec) + { + return do_set_option(impl, + &win_iocp_serial_port_service::store_option, + &option, ec); + } + + // Get an option from the serial port. + template + asio::error_code get_option(const implementation_type& impl, + GettableSerialPortOption& option, asio::error_code& ec) const + { + return do_get_option(impl, + &win_iocp_serial_port_service::load_option, + &option, ec); + } + + // Send a break sequence to the serial port. + asio::error_code send_break(implementation_type&, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Write the given data. Returns the number of bytes sent. + template + size_t write_some(implementation_type& impl, + const ConstBufferSequence& buffers, asio::error_code& ec) + { + return handle_service_.write_some(impl, buffers, ec); + } + + // Start an asynchronous write. The data being written must be valid for the + // lifetime of the asynchronous operation. + template + void async_write_some(implementation_type& impl, + const ConstBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + handle_service_.async_write_some(impl, buffers, handler, io_ex); + } + + // Read some data. Returns the number of bytes received. + template + size_t read_some(implementation_type& impl, + const MutableBufferSequence& buffers, asio::error_code& ec) + { + return handle_service_.read_some(impl, buffers, ec); + } + + // Start an asynchronous read. The buffer for the data being received must be + // valid for the lifetime of the asynchronous operation. + template + void async_read_some(implementation_type& impl, + const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + { + handle_service_.async_read_some(impl, buffers, handler, io_ex); + } + +private: + // Function pointer type for storing a serial port option. + typedef asio::error_code (*store_function_type)( + const void*, ::DCB&, asio::error_code&); + + // Helper function template to store a serial port option. + template + static asio::error_code store_option(const void* option, + ::DCB& storage, asio::error_code& ec) + { + static_cast(option)->store(storage, ec); + return ec; + } + + // Helper function to set a serial port option. + ASIO_DECL asio::error_code do_set_option( + implementation_type& impl, store_function_type store, + const void* option, asio::error_code& ec); + + // Function pointer type for loading a serial port option. + typedef asio::error_code (*load_function_type)( + void*, const ::DCB&, asio::error_code&); + + // Helper function template to load a serial port option. + template + static asio::error_code load_option(void* option, + const ::DCB& storage, asio::error_code& ec) + { + static_cast(option)->load(storage, ec); + return ec; + } + + // Helper function to get a serial port option. + ASIO_DECL asio::error_code do_get_option( + const implementation_type& impl, load_function_type load, + void* option, asio::error_code& ec) const; + + // The implementation used for initiating asynchronous operations. + win_iocp_handle_service handle_service_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_iocp_serial_port_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) + +#endif // ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_accept_op.hpp b/include/asio/include/asio/detail/win_iocp_socket_accept_op.hpp new file mode 100644 index 0000000..745125b --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_accept_op.hpp @@ -0,0 +1,312 @@ +// +// detail/win_iocp_socket_accept_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_ACCEPT_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_ACCEPT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/win_iocp_socket_service_base.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_socket_accept_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_accept_op); + + win_iocp_socket_accept_op(win_iocp_socket_service_base& socket_service, + socket_type socket, Socket& peer, const Protocol& protocol, + typename Protocol::endpoint* peer_endpoint, + bool enable_connection_aborted, Handler& handler, const IoExecutor& io_ex) + : operation(&win_iocp_socket_accept_op::do_complete), + socket_service_(socket_service), + socket_(socket), + peer_(peer), + protocol_(protocol), + peer_endpoint_(peer_endpoint), + enable_connection_aborted_(enable_connection_aborted), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + socket_holder& new_socket() + { + return new_socket_; + } + + void* output_buffer() + { + return output_buffer_; + } + + DWORD address_length() + { + return sizeof(sockaddr_storage_type) + 16; + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t /*bytes_transferred*/) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_socket_accept_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + if (owner) + { + typename Protocol::endpoint peer_endpoint; + std::size_t addr_len = peer_endpoint.capacity(); + socket_ops::complete_iocp_accept(o->socket_, + o->output_buffer(), o->address_length(), + peer_endpoint.data(), &addr_len, + o->new_socket_.get(), ec); + + // Restart the accept operation if we got the connection_aborted error + // and the enable_connection_aborted socket option is not set. + if (ec == asio::error::connection_aborted + && !o->enable_connection_aborted_) + { + o->reset(); + o->socket_service_.restart_accept_op(o->socket_, + o->new_socket_, o->protocol_.family(), + o->protocol_.type(), o->protocol_.protocol(), + o->output_buffer(), o->address_length(), o); + p.v = p.p = 0; + return; + } + + // If the socket was successfully accepted, transfer ownership of the + // socket to the peer object. + if (!ec) + { + o->peer_.assign(o->protocol_, + typename Socket::native_handle_type( + o->new_socket_.get(), peer_endpoint), ec); + if (!ec) + o->new_socket_.release(); + } + + // Pass endpoint back to caller. + if (o->peer_endpoint_) + *o->peer_endpoint_ = peer_endpoint; + } + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(o->handler_, ec); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + win_iocp_socket_service_base& socket_service_; + socket_type socket_; + socket_holder new_socket_; + Socket& peer_; + Protocol protocol_; + typename Protocol::endpoint* peer_endpoint_; + unsigned char output_buffer_[(sizeof(sockaddr_storage_type) + 16) * 2]; + bool enable_connection_aborted_; + Handler handler_; + handler_work work_; +}; + +#if defined(ASIO_HAS_MOVE) + +template +class win_iocp_socket_move_accept_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_move_accept_op); + + win_iocp_socket_move_accept_op( + win_iocp_socket_service_base& socket_service, socket_type socket, + const Protocol& protocol, const PeerIoExecutor& peer_io_ex, + typename Protocol::endpoint* peer_endpoint, + bool enable_connection_aborted, Handler& handler, const IoExecutor& io_ex) + : operation(&win_iocp_socket_move_accept_op::do_complete), + socket_service_(socket_service), + socket_(socket), + peer_(peer_io_ex), + protocol_(protocol), + peer_endpoint_(peer_endpoint), + enable_connection_aborted_(enable_connection_aborted), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + socket_holder& new_socket() + { + return new_socket_; + } + + void* output_buffer() + { + return output_buffer_; + } + + DWORD address_length() + { + return sizeof(sockaddr_storage_type) + 16; + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t /*bytes_transferred*/) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_socket_move_accept_op* o( + static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + if (owner) + { + typename Protocol::endpoint peer_endpoint; + std::size_t addr_len = peer_endpoint.capacity(); + socket_ops::complete_iocp_accept(o->socket_, + o->output_buffer(), o->address_length(), + peer_endpoint.data(), &addr_len, + o->new_socket_.get(), ec); + + // Restart the accept operation if we got the connection_aborted error + // and the enable_connection_aborted socket option is not set. + if (ec == asio::error::connection_aborted + && !o->enable_connection_aborted_) + { + o->reset(); + o->socket_service_.restart_accept_op(o->socket_, + o->new_socket_, o->protocol_.family(), + o->protocol_.type(), o->protocol_.protocol(), + o->output_buffer(), o->address_length(), o); + p.v = p.p = 0; + return; + } + + // If the socket was successfully accepted, transfer ownership of the + // socket to the peer object. + if (!ec) + { + o->peer_.assign(o->protocol_, + typename Protocol::socket::native_handle_type( + o->new_socket_.get(), peer_endpoint), ec); + if (!ec) + o->new_socket_.release(); + } + + // Pass endpoint back to caller. + if (o->peer_endpoint_) + *o->peer_endpoint_ = peer_endpoint; + } + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::move_binder2 + handler(0, ASIO_MOVE_CAST(Handler)(o->handler_), ec, + ASIO_MOVE_CAST(peer_socket_type)(o->peer_)); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + typedef typename Protocol::socket::template + rebind_executor::other peer_socket_type; + + win_iocp_socket_service_base& socket_service_; + socket_type socket_; + socket_holder new_socket_; + peer_socket_type peer_; + Protocol protocol_; + typename Protocol::endpoint* peer_endpoint_; + unsigned char output_buffer_[(sizeof(sockaddr_storage_type) + 16) * 2]; + bool enable_connection_aborted_; + Handler handler_; + handler_work work_; +}; + +#endif // defined(ASIO_HAS_MOVE) + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_ACCEPT_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_connect_op.hpp b/include/asio/include/asio/detail/win_iocp_socket_connect_op.hpp new file mode 100644 index 0000000..8971499 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_connect_op.hpp @@ -0,0 +1,135 @@ +// +// detail/win_iocp_socket_connect_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_CONNECT_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_CONNECT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_iocp_socket_connect_op_base : public reactor_op +{ +public: + win_iocp_socket_connect_op_base(socket_type socket, func_type complete_func) + : reactor_op(asio::error_code(), + &win_iocp_socket_connect_op_base::do_perform, complete_func), + socket_(socket), + connect_ex_(false) + { + } + + static status do_perform(reactor_op* base) + { + win_iocp_socket_connect_op_base* o( + static_cast(base)); + + return socket_ops::non_blocking_connect( + o->socket_, o->ec_) ? done : not_done; + } + + socket_type socket_; + bool connect_ex_; +}; + +template +class win_iocp_socket_connect_op : public win_iocp_socket_connect_op_base +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_connect_op); + + win_iocp_socket_connect_op(socket_type socket, + Handler& handler, const IoExecutor& io_ex) + : win_iocp_socket_connect_op_base(socket, + &win_iocp_socket_connect_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t /*bytes_transferred*/) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_socket_connect_op* o( + static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + if (owner) + { + if (o->connect_ex_) + socket_ops::complete_iocp_connect(o->socket_, ec); + else + ec = o->ec_; + } + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(o->handler_, ec); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_CONNECT_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_recv_op.hpp b/include/asio/include/asio/detail/win_iocp_socket_recv_op.hpp new file mode 100644 index 0000000..4b57107 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_recv_op.hpp @@ -0,0 +1,124 @@ +// +// detail/win_iocp_socket_recv_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_RECV_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_RECV_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_socket_recv_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recv_op); + + win_iocp_socket_recv_op(socket_ops::state_type state, + socket_ops::weak_cancel_token_type cancel_token, + const MutableBufferSequence& buffers, Handler& handler, + const IoExecutor& io_ex) + : operation(&win_iocp_socket_recv_op::do_complete), + state_(state), + cancel_token_(cancel_token), + buffers_(buffers), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t bytes_transferred) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_socket_recv_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + // Check whether buffers are still valid. + if (owner) + { + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + socket_ops::complete_iocp_recv(o->state_, o->cancel_token_, + buffer_sequence_adapter::all_empty(o->buffers_), + ec, bytes_transferred); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + socket_ops::state_type state_; + socket_ops::weak_cancel_token_type cancel_token_; + MutableBufferSequence buffers_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_RECV_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp b/include/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp new file mode 100644 index 0000000..b8f6abd --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp @@ -0,0 +1,133 @@ +// +// detail/win_iocp_socket_recvfrom_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_socket_recvfrom_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recvfrom_op); + + win_iocp_socket_recvfrom_op(Endpoint& endpoint, + socket_ops::weak_cancel_token_type cancel_token, + const MutableBufferSequence& buffers, Handler& handler, + const IoExecutor& io_ex) + : operation(&win_iocp_socket_recvfrom_op::do_complete), + endpoint_(endpoint), + endpoint_size_(static_cast(endpoint.capacity())), + cancel_token_(cancel_token), + buffers_(buffers), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + int& endpoint_size() + { + return endpoint_size_; + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t bytes_transferred) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_socket_recvfrom_op* o( + static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + // Check whether buffers are still valid. + if (owner) + { + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + socket_ops::complete_iocp_recvfrom(o->cancel_token_, ec); + + // Record the size of the endpoint returned by the operation. + o->endpoint_.resize(o->endpoint_size_); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Endpoint& endpoint_; + int endpoint_size_; + socket_ops::weak_cancel_token_type cancel_token_; + MutableBufferSequence buffers_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp b/include/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp new file mode 100644 index 0000000..79f1789 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp @@ -0,0 +1,125 @@ +// +// detail/win_iocp_socket_recvmsg_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" +#include "asio/socket_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_socket_recvmsg_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recvmsg_op); + + win_iocp_socket_recvmsg_op( + socket_ops::weak_cancel_token_type cancel_token, + const MutableBufferSequence& buffers, + socket_base::message_flags& out_flags, + Handler& handler, const IoExecutor& io_ex) + : operation(&win_iocp_socket_recvmsg_op::do_complete), + cancel_token_(cancel_token), + buffers_(buffers), + out_flags_(out_flags), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t bytes_transferred) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_socket_recvmsg_op* o( + static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + // Check whether buffers are still valid. + if (owner) + { + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + socket_ops::complete_iocp_recvmsg(o->cancel_token_, ec); + o->out_flags_ = 0; + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + socket_ops::weak_cancel_token_type cancel_token_; + MutableBufferSequence buffers_; + socket_base::message_flags& out_flags_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_send_op.hpp b/include/asio/include/asio/detail/win_iocp_socket_send_op.hpp new file mode 100644 index 0000000..15a4632 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_send_op.hpp @@ -0,0 +1,118 @@ +// +// detail/win_iocp_socket_send_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_SEND_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_SEND_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_socket_send_op : public operation +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_send_op); + + win_iocp_socket_send_op(socket_ops::weak_cancel_token_type cancel_token, + const ConstBufferSequence& buffers, Handler& handler, + const IoExecutor& io_ex) + : operation(&win_iocp_socket_send_op::do_complete), + cancel_token_(cancel_token), + buffers_(buffers), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t bytes_transferred) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_socket_send_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + // Check whether buffers are still valid. + if (owner) + { + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + socket_ops::complete_iocp_send(o->cancel_token_, ec); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, ec, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + socket_ops::weak_cancel_token_type cancel_token_; + ConstBufferSequence buffers_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_SEND_OP_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_service.hpp b/include/asio/include/asio/detail/win_iocp_socket_service.hpp new file mode 100644 index 0000000..53dc163 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_service.hpp @@ -0,0 +1,581 @@ +// +// detail/win_iocp_socket_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/socket_base.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/select_reactor.hpp" +#include "asio/detail/socket_holder.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/win_iocp_io_context.hpp" +#include "asio/detail/win_iocp_null_buffers_op.hpp" +#include "asio/detail/win_iocp_socket_accept_op.hpp" +#include "asio/detail/win_iocp_socket_connect_op.hpp" +#include "asio/detail/win_iocp_socket_recvfrom_op.hpp" +#include "asio/detail/win_iocp_socket_send_op.hpp" +#include "asio/detail/win_iocp_socket_service_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_socket_service : + public execution_context_service_base >, + public win_iocp_socket_service_base +{ +public: + // The protocol type. + typedef Protocol protocol_type; + + // The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + // The native type of a socket. + class native_handle_type + { + public: + native_handle_type(socket_type s) + : socket_(s), + have_remote_endpoint_(false) + { + } + + native_handle_type(socket_type s, const endpoint_type& ep) + : socket_(s), + have_remote_endpoint_(true), + remote_endpoint_(ep) + { + } + + void operator=(socket_type s) + { + socket_ = s; + have_remote_endpoint_ = false; + remote_endpoint_ = endpoint_type(); + } + + operator socket_type() const + { + return socket_; + } + + bool have_remote_endpoint() const + { + return have_remote_endpoint_; + } + + endpoint_type remote_endpoint() const + { + return remote_endpoint_; + } + + private: + socket_type socket_; + bool have_remote_endpoint_; + endpoint_type remote_endpoint_; + }; + + // The implementation type of the socket. + struct implementation_type : + win_iocp_socket_service_base::base_implementation_type + { + // Default constructor. + implementation_type() + : protocol_(endpoint_type().protocol()), + have_remote_endpoint_(false), + remote_endpoint_() + { + } + + // The protocol associated with the socket. + protocol_type protocol_; + + // Whether we have a cached remote endpoint. + bool have_remote_endpoint_; + + // A cached remote endpoint. + endpoint_type remote_endpoint_; + }; + + // Constructor. + win_iocp_socket_service(execution_context& context) + : execution_context_service_base< + win_iocp_socket_service >(context), + win_iocp_socket_service_base(context) + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + this->base_shutdown(); + } + + // Move-construct a new socket implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) ASIO_NOEXCEPT + { + this->base_move_construct(impl, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + + impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_; + other_impl.have_remote_endpoint_ = false; + + impl.remote_endpoint_ = other_impl.remote_endpoint_; + other_impl.remote_endpoint_ = endpoint_type(); + } + + // Move-assign from another socket implementation. + void move_assign(implementation_type& impl, + win_iocp_socket_service_base& other_service, + implementation_type& other_impl) + { + this->base_move_assign(impl, other_service, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + + impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_; + other_impl.have_remote_endpoint_ = false; + + impl.remote_endpoint_ = other_impl.remote_endpoint_; + other_impl.remote_endpoint_ = endpoint_type(); + } + + // Move-construct a new socket implementation from another protocol type. + template + void converting_move_construct(implementation_type& impl, + win_iocp_socket_service&, + typename win_iocp_socket_service< + Protocol1>::implementation_type& other_impl) + { + this->base_move_construct(impl, other_impl); + + impl.protocol_ = protocol_type(other_impl.protocol_); + other_impl.protocol_ = typename Protocol1::endpoint().protocol(); + + impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_; + other_impl.have_remote_endpoint_ = false; + + impl.remote_endpoint_ = other_impl.remote_endpoint_; + other_impl.remote_endpoint_ = typename Protocol1::endpoint(); + } + + // Open a new socket implementation. + asio::error_code open(implementation_type& impl, + const protocol_type& protocol, asio::error_code& ec) + { + if (!do_open(impl, protocol.family(), + protocol.type(), protocol.protocol(), ec)) + { + impl.protocol_ = protocol; + impl.have_remote_endpoint_ = false; + impl.remote_endpoint_ = endpoint_type(); + } + return ec; + } + + // Assign a native socket to a socket implementation. + asio::error_code assign(implementation_type& impl, + const protocol_type& protocol, const native_handle_type& native_socket, + asio::error_code& ec) + { + if (!do_assign(impl, protocol.type(), native_socket, ec)) + { + impl.protocol_ = protocol; + impl.have_remote_endpoint_ = native_socket.have_remote_endpoint(); + impl.remote_endpoint_ = native_socket.remote_endpoint(); + } + return ec; + } + + // Get the native socket representation. + native_handle_type native_handle(implementation_type& impl) + { + if (impl.have_remote_endpoint_) + return native_handle_type(impl.socket_, impl.remote_endpoint_); + return native_handle_type(impl.socket_); + } + + // Bind the socket to the specified local endpoint. + asio::error_code bind(implementation_type& impl, + const endpoint_type& endpoint, asio::error_code& ec) + { + socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec); + return ec; + } + + // Set a socket option. + template + asio::error_code set_option(implementation_type& impl, + const Option& option, asio::error_code& ec) + { + socket_ops::setsockopt(impl.socket_, impl.state_, + option.level(impl.protocol_), option.name(impl.protocol_), + option.data(impl.protocol_), option.size(impl.protocol_), ec); + return ec; + } + + // Set a socket option. + template + asio::error_code get_option(const implementation_type& impl, + Option& option, asio::error_code& ec) const + { + std::size_t size = option.size(impl.protocol_); + socket_ops::getsockopt(impl.socket_, impl.state_, + option.level(impl.protocol_), option.name(impl.protocol_), + option.data(impl.protocol_), &size, ec); + if (!ec) + option.resize(impl.protocol_, size); + return ec; + } + + // Get the local endpoint. + endpoint_type local_endpoint(const implementation_type& impl, + asio::error_code& ec) const + { + endpoint_type endpoint; + std::size_t addr_len = endpoint.capacity(); + if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec)) + return endpoint_type(); + endpoint.resize(addr_len); + return endpoint; + } + + // Get the remote endpoint. + endpoint_type remote_endpoint(const implementation_type& impl, + asio::error_code& ec) const + { + endpoint_type endpoint = impl.remote_endpoint_; + std::size_t addr_len = endpoint.capacity(); + if (socket_ops::getpeername(impl.socket_, endpoint.data(), + &addr_len, impl.have_remote_endpoint_, ec)) + return endpoint_type(); + endpoint.resize(addr_len); + return endpoint; + } + + // Disable sends or receives on the socket. + asio::error_code shutdown(base_implementation_type& impl, + socket_base::shutdown_type what, asio::error_code& ec) + { + socket_ops::shutdown(impl.socket_, what, ec); + return ec; + } + + // Send a datagram to the specified endpoint. Returns the number of bytes + // sent. + template + size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + asio::error_code& ec) + { + buffer_sequence_adapter bufs(buffers); + + return socket_ops::sync_sendto(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), flags, + destination.data(), destination.size(), ec); + } + + // Wait until data can be sent without blocking. + size_t send_to(implementation_type& impl, const null_buffers&, + const endpoint_type&, socket_base::message_flags, + asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); + + return 0; + } + + // Start an asynchronous send. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_send_to(implementation_type& impl, + const ConstBufferSequence& buffers, const endpoint_type& destination, + socket_base::message_flags flags, Handler& handler, + const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_send_op< + ConstBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_send_to")); + + buffer_sequence_adapter bufs(buffers); + + start_send_to_op(impl, bufs.buffers(), bufs.count(), + destination.data(), static_cast(destination.size()), + flags, p.p); + p.v = p.p = 0; + } + + // Start an asynchronous wait until data can be sent without blocking. + template + void async_send_to(implementation_type& impl, const null_buffers&, + const endpoint_type&, socket_base::message_flags, Handler& handler, + const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_send_to(null_buffers)")); + + start_reactor_op(impl, select_reactor::write_op, p.p); + p.v = p.p = 0; + } + + // Receive a datagram with the endpoint of the sender. Returns the number of + // bytes received. + template + size_t receive_from(implementation_type& impl, + const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + asio::error_code& ec) + { + buffer_sequence_adapter bufs(buffers); + + std::size_t addr_len = sender_endpoint.capacity(); + std::size_t bytes_recvd = socket_ops::sync_recvfrom( + impl.socket_, impl.state_, bufs.buffers(), bufs.count(), + flags, sender_endpoint.data(), &addr_len, ec); + + if (!ec) + sender_endpoint.resize(addr_len); + + return bytes_recvd; + } + + // Wait until data can be received without blocking. + size_t receive_from(implementation_type& impl, + const null_buffers&, endpoint_type& sender_endpoint, + socket_base::message_flags, asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + + // Reset endpoint since it can be given no sensible value at this time. + sender_endpoint = endpoint_type(); + + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received and + // the sender_endpoint object must both be valid for the lifetime of the + // asynchronous operation. + template + void async_receive_from(implementation_type& impl, + const MutableBufferSequence& buffers, endpoint_type& sender_endp, + socket_base::message_flags flags, Handler& handler, + const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_recvfrom_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(sender_endp, impl.cancel_token_, + buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_receive_from")); + + buffer_sequence_adapter bufs(buffers); + + start_receive_from_op(impl, bufs.buffers(), bufs.count(), + sender_endp.data(), flags, &p.p->endpoint_size(), p.p); + p.v = p.p = 0; + } + + // Wait until data can be received without blocking. + template + void async_receive_from(implementation_type& impl, const null_buffers&, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_receive_from(null_buffers)")); + + // Reset endpoint since it can be given no sensible value at this time. + sender_endpoint = endpoint_type(); + + start_null_buffers_receive_op(impl, flags, p.p); + p.v = p.p = 0; + } + + // Accept a new connection. + template + asio::error_code accept(implementation_type& impl, Socket& peer, + endpoint_type* peer_endpoint, asio::error_code& ec) + { + // We cannot accept a socket that is already open. + if (peer.is_open()) + { + ec = asio::error::already_open; + return ec; + } + + std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; + socket_holder new_socket(socket_ops::sync_accept(impl.socket_, + impl.state_, peer_endpoint ? peer_endpoint->data() : 0, + peer_endpoint ? &addr_len : 0, ec)); + + // On success, assign new connection to peer socket object. + if (new_socket.get() != invalid_socket) + { + if (peer_endpoint) + peer_endpoint->resize(addr_len); + peer.assign(impl.protocol_, new_socket.get(), ec); + if (!ec) + new_socket.release(); + } + + return ec; + } + + // Start an asynchronous accept. The peer and peer_endpoint objects + // must be valid until the accept's handler is invoked. + template + void async_accept(implementation_type& impl, Socket& peer, + endpoint_type* peer_endpoint, Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_accept_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + bool enable_connection_aborted = + (impl.state_ & socket_ops::enable_connection_aborted) != 0; + p.p = new (p.v) op(*this, impl.socket_, peer, impl.protocol_, + peer_endpoint, enable_connection_aborted, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_accept")); + + start_accept_op(impl, peer.is_open(), p.p->new_socket(), + impl.protocol_.family(), impl.protocol_.type(), + impl.protocol_.protocol(), p.p->output_buffer(), + p.p->address_length(), p.p); + p.v = p.p = 0; + } + +#if defined(ASIO_HAS_MOVE) + // Start an asynchronous accept. The peer and peer_endpoint objects + // must be valid until the accept's handler is invoked. + template + void async_move_accept(implementation_type& impl, + const PeerIoExecutor& peer_io_ex, endpoint_type* peer_endpoint, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_move_accept_op< + protocol_type, PeerIoExecutor, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + bool enable_connection_aborted = + (impl.state_ & socket_ops::enable_connection_aborted) != 0; + p.p = new (p.v) op(*this, impl.socket_, impl.protocol_, + peer_io_ex, peer_endpoint, enable_connection_aborted, + handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_accept")); + + start_accept_op(impl, false, p.p->new_socket(), + impl.protocol_.family(), impl.protocol_.type(), + impl.protocol_.protocol(), p.p->output_buffer(), + p.p->address_length(), p.p); + p.v = p.p = 0; + } +#endif // defined(ASIO_HAS_MOVE) + + // Connect the socket to the specified endpoint. + asio::error_code connect(implementation_type& impl, + const endpoint_type& peer_endpoint, asio::error_code& ec) + { + socket_ops::sync_connect(impl.socket_, + peer_endpoint.data(), peer_endpoint.size(), ec); + return ec; + } + + // Start an asynchronous connect. + template + void async_connect(implementation_type& impl, + const endpoint_type& peer_endpoint, Handler& handler, + const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_connect_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.socket_, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_connect")); + + start_connect_op(impl, impl.protocol_.family(), impl.protocol_.type(), + peer_endpoint.data(), static_cast(peer_endpoint.size()), p.p); + p.v = p.p = 0; + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_HPP diff --git a/include/asio/include/asio/detail/win_iocp_socket_service_base.hpp b/include/asio/include/asio/detail/win_iocp_socket_service_base.hpp new file mode 100644 index 0000000..6e37745 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_socket_service_base.hpp @@ -0,0 +1,600 @@ +// +// detail/win_iocp_socket_service_base.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP +#define ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/socket_base.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/operation.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/select_reactor.hpp" +#include "asio/detail/socket_holder.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/win_iocp_io_context.hpp" +#include "asio/detail/win_iocp_null_buffers_op.hpp" +#include "asio/detail/win_iocp_socket_connect_op.hpp" +#include "asio/detail/win_iocp_socket_send_op.hpp" +#include "asio/detail/win_iocp_socket_recv_op.hpp" +#include "asio/detail/win_iocp_socket_recvmsg_op.hpp" +#include "asio/detail/win_iocp_wait_op.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_iocp_socket_service_base +{ +public: + // The implementation type of the socket. + struct base_implementation_type + { + // The native socket representation. + socket_type socket_; + + // The current state of the socket. + socket_ops::state_type state_; + + // We use a shared pointer as a cancellation token here to work around the + // broken Windows support for cancellation. MSDN says that when you call + // closesocket any outstanding WSARecv or WSASend operations will complete + // with the error ERROR_OPERATION_ABORTED. In practice they complete with + // ERROR_NETNAME_DELETED, which means you can't tell the difference between + // a local cancellation and the socket being hard-closed by the peer. + socket_ops::shared_cancel_token_type cancel_token_; + + // Per-descriptor data used by the reactor. + select_reactor::per_descriptor_data reactor_data_; + +#if defined(ASIO_ENABLE_CANCELIO) + // The ID of the thread from which it is safe to cancel asynchronous + // operations. 0 means no asynchronous operations have been started yet. + // ~0 means asynchronous operations have been started from more than one + // thread, and cancellation is not supported for the socket. + DWORD safe_cancellation_thread_id_; +#endif // defined(ASIO_ENABLE_CANCELIO) + + // Pointers to adjacent socket implementations in linked list. + base_implementation_type* next_; + base_implementation_type* prev_; + }; + + // Constructor. + ASIO_DECL win_iocp_socket_service_base(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void base_shutdown(); + + // Construct a new socket implementation. + ASIO_DECL void construct(base_implementation_type& impl); + + // Move-construct a new socket implementation. + ASIO_DECL void base_move_construct(base_implementation_type& impl, + base_implementation_type& other_impl) ASIO_NOEXCEPT; + + // Move-assign from another socket implementation. + ASIO_DECL void base_move_assign(base_implementation_type& impl, + win_iocp_socket_service_base& other_service, + base_implementation_type& other_impl); + + // Destroy a socket implementation. + ASIO_DECL void destroy(base_implementation_type& impl); + + // Determine whether the socket is open. + bool is_open(const base_implementation_type& impl) const + { + return impl.socket_ != invalid_socket; + } + + // Destroy a socket implementation. + ASIO_DECL asio::error_code close( + base_implementation_type& impl, asio::error_code& ec); + + // Release ownership of the socket. + ASIO_DECL socket_type release( + base_implementation_type& impl, asio::error_code& ec); + + // Cancel all operations associated with the socket. + ASIO_DECL asio::error_code cancel( + base_implementation_type& impl, asio::error_code& ec); + + // Determine whether the socket is at the out-of-band data mark. + bool at_mark(const base_implementation_type& impl, + asio::error_code& ec) const + { + return socket_ops::sockatmark(impl.socket_, ec); + } + + // Determine the number of bytes available for reading. + std::size_t available(const base_implementation_type& impl, + asio::error_code& ec) const + { + return socket_ops::available(impl.socket_, ec); + } + + // Place the socket into the state where it will listen for new connections. + asio::error_code listen(base_implementation_type& impl, + int backlog, asio::error_code& ec) + { + socket_ops::listen(impl.socket_, backlog, ec); + return ec; + } + + // Perform an IO control command on the socket. + template + asio::error_code io_control(base_implementation_type& impl, + IO_Control_Command& command, asio::error_code& ec) + { + socket_ops::ioctl(impl.socket_, impl.state_, command.name(), + static_cast(command.data()), ec); + return ec; + } + + // Gets the non-blocking mode of the socket. + bool non_blocking(const base_implementation_type& impl) const + { + return (impl.state_ & socket_ops::user_set_non_blocking) != 0; + } + + // Sets the non-blocking mode of the socket. + asio::error_code non_blocking(base_implementation_type& impl, + bool mode, asio::error_code& ec) + { + socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec); + return ec; + } + + // Gets the non-blocking mode of the native socket implementation. + bool native_non_blocking(const base_implementation_type& impl) const + { + return (impl.state_ & socket_ops::internal_non_blocking) != 0; + } + + // Sets the non-blocking mode of the native socket implementation. + asio::error_code native_non_blocking(base_implementation_type& impl, + bool mode, asio::error_code& ec) + { + socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec); + return ec; + } + + // Wait for the socket to become ready to read, ready to write, or to have + // pending error conditions. + asio::error_code wait(base_implementation_type& impl, + socket_base::wait_type w, asio::error_code& ec) + { + switch (w) + { + case socket_base::wait_read: + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + break; + case socket_base::wait_write: + socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); + break; + case socket_base::wait_error: + socket_ops::poll_error(impl.socket_, impl.state_, -1, ec); + break; + default: + ec = asio::error::invalid_argument; + break; + } + + return ec; + } + + // Asynchronously wait for the socket to become ready to read, ready to + // write, or to have pending error conditions. + template + void async_wait(base_implementation_type& impl, + socket_base::wait_type w, Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_wait_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_wait")); + + switch (w) + { + case socket_base::wait_read: + start_null_buffers_receive_op(impl, 0, p.p); + break; + case socket_base::wait_write: + start_reactor_op(impl, select_reactor::write_op, p.p); + break; + case socket_base::wait_error: + start_reactor_op(impl, select_reactor::except_op, p.p); + break; + default: + p.p->ec_ = asio::error::invalid_argument; + iocp_service_.post_immediate_completion(p.p, is_continuation); + break; + } + + p.v = p.p = 0; + } + + // Send the given data to the peer. Returns the number of bytes sent. + template + size_t send(base_implementation_type& impl, + const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + buffer_sequence_adapter bufs(buffers); + + return socket_ops::sync_send(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); + } + + // Wait until data can be sent without blocking. + size_t send(base_implementation_type& impl, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); + + return 0; + } + + // Start an asynchronous send. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_send(base_implementation_type& impl, + const ConstBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_send_op< + ConstBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_send")); + + buffer_sequence_adapter bufs(buffers); + + start_send_op(impl, bufs.buffers(), bufs.count(), flags, + (impl.state_ & socket_ops::stream_oriented) != 0 && bufs.all_empty(), + p.p); + p.v = p.p = 0; + } + + // Start an asynchronous wait until data can be sent without blocking. + template + void async_send(base_implementation_type& impl, const null_buffers&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_send(null_buffers)")); + + start_reactor_op(impl, select_reactor::write_op, p.p); + p.v = p.p = 0; + } + + // Receive some data from the peer. Returns the number of bytes received. + template + size_t receive(base_implementation_type& impl, + const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + buffer_sequence_adapter bufs(buffers); + + return socket_ops::sync_recv(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); + } + + // Wait until data can be received without blocking. + size_t receive(base_implementation_type& impl, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received + // must be valid for the lifetime of the asynchronous operation. + template + void async_receive(base_implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_recv_op< + MutableBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.state_, impl.cancel_token_, + buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_receive")); + + buffer_sequence_adapter bufs(buffers); + + start_receive_op(impl, bufs.buffers(), bufs.count(), flags, + (impl.state_ & socket_ops::stream_oriented) != 0 && bufs.all_empty(), + p.p); + p.v = p.p = 0; + } + + // Wait until data can be received without blocking. + template + void async_receive(base_implementation_type& impl, + const null_buffers&, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_receive(null_buffers)")); + + start_null_buffers_receive_op(impl, flags, p.p); + p.v = p.p = 0; + } + + // Receive some data with associated flags. Returns the number of bytes + // received. + template + size_t receive_with_flags(base_implementation_type& impl, + const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, asio::error_code& ec) + { + buffer_sequence_adapter bufs(buffers); + + return socket_ops::sync_recvmsg(impl.socket_, impl.state_, + bufs.buffers(), bufs.count(), in_flags, out_flags, ec); + } + + // Wait until data can be received without blocking. + size_t receive_with_flags(base_implementation_type& impl, + const null_buffers&, socket_base::message_flags, + socket_base::message_flags& out_flags, asio::error_code& ec) + { + // Wait for socket to become ready. + socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); + + // Clear out_flags, since we cannot give it any other sensible value when + // performing a null_buffers operation. + out_flags = 0; + + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received + // must be valid for the lifetime of the asynchronous operation. + template + void async_receive_with_flags(base_implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, Handler& handler, + const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_socket_recvmsg_op< + MutableBufferSequence, Handler, IoExecutor> op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, + buffers, out_flags, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_receive_with_flags")); + + buffer_sequence_adapter bufs(buffers); + + start_receive_op(impl, bufs.buffers(), bufs.count(), in_flags, false, p.p); + p.v = p.p = 0; + } + + // Wait until data can be received without blocking. + template + void async_receive_with_flags(base_implementation_type& impl, + const null_buffers&, socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, Handler& handler, + const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef win_iocp_null_buffers_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(impl.cancel_token_, handler, io_ex); + + ASIO_HANDLER_CREATION((context_, *p.p, "socket", + &impl, impl.socket_, "async_receive_with_flags(null_buffers)")); + + // Reset out_flags since it can be given no sensible value at this time. + out_flags = 0; + + start_null_buffers_receive_op(impl, in_flags, p.p); + p.v = p.p = 0; + } + + // Helper function to restart an asynchronous accept operation. + ASIO_DECL void restart_accept_op(socket_type s, + socket_holder& new_socket, int family, int type, int protocol, + void* output_buffer, DWORD address_length, operation* op); + +protected: + // Open a new socket implementation. + ASIO_DECL asio::error_code do_open( + base_implementation_type& impl, int family, int type, + int protocol, asio::error_code& ec); + + // Assign a native socket to a socket implementation. + ASIO_DECL asio::error_code do_assign( + base_implementation_type& impl, int type, + socket_type native_socket, asio::error_code& ec); + + // Helper function to start an asynchronous send operation. + ASIO_DECL void start_send_op(base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, + socket_base::message_flags flags, bool noop, operation* op); + + // Helper function to start an asynchronous send_to operation. + ASIO_DECL void start_send_to_op(base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, + const socket_addr_type* addr, int addrlen, + socket_base::message_flags flags, operation* op); + + // Helper function to start an asynchronous receive operation. + ASIO_DECL void start_receive_op(base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, + socket_base::message_flags flags, bool noop, operation* op); + + // Helper function to start an asynchronous null_buffers receive operation. + ASIO_DECL void start_null_buffers_receive_op( + base_implementation_type& impl, + socket_base::message_flags flags, reactor_op* op); + + // Helper function to start an asynchronous receive_from operation. + ASIO_DECL void start_receive_from_op(base_implementation_type& impl, + WSABUF* buffers, std::size_t buffer_count, socket_addr_type* addr, + socket_base::message_flags flags, int* addrlen, operation* op); + + // Helper function to start an asynchronous accept operation. + ASIO_DECL void start_accept_op(base_implementation_type& impl, + bool peer_is_open, socket_holder& new_socket, int family, int type, + int protocol, void* output_buffer, DWORD address_length, operation* op); + + // Start an asynchronous read or write operation using the reactor. + ASIO_DECL void start_reactor_op(base_implementation_type& impl, + int op_type, reactor_op* op); + + // Start the asynchronous connect operation using the reactor. + ASIO_DECL void start_connect_op(base_implementation_type& impl, + int family, int type, const socket_addr_type* remote_addr, + std::size_t remote_addrlen, win_iocp_socket_connect_op_base* op); + + // Helper function to close a socket when the associated object is being + // destroyed. + ASIO_DECL void close_for_destruction(base_implementation_type& impl); + + // Update the ID of the thread from which cancellation is safe. + ASIO_DECL void update_cancellation_thread_id( + base_implementation_type& impl); + + // Helper function to get the reactor. If no reactor has been created yet, a + // new one is obtained from the execution context and a pointer to it is + // cached in this service. + ASIO_DECL select_reactor& get_reactor(); + + // The type of a ConnectEx function pointer, as old SDKs may not provide it. + typedef BOOL (PASCAL *connect_ex_fn)(SOCKET, + const socket_addr_type*, int, void*, DWORD, DWORD*, OVERLAPPED*); + + // Helper function to get the ConnectEx pointer. If no ConnectEx pointer has + // been obtained yet, one is obtained using WSAIoctl and the pointer is + // cached. Returns a null pointer if ConnectEx is not available. + ASIO_DECL connect_ex_fn get_connect_ex( + base_implementation_type& impl, int type); + + // The type of a NtSetInformationFile function pointer. + typedef LONG (NTAPI *nt_set_info_fn)(HANDLE, ULONG_PTR*, void*, ULONG, ULONG); + + // Helper function to get the NtSetInformationFile function pointer. If no + // NtSetInformationFile pointer has been obtained yet, one is obtained using + // GetProcAddress and the pointer is cached. Returns a null pointer if + // NtSetInformationFile is not available. + ASIO_DECL nt_set_info_fn get_nt_set_info(); + + // Helper function to emulate InterlockedCompareExchangePointer functionality + // for: + // - very old Platform SDKs; and + // - platform SDKs where MSVC's /Wp64 option causes spurious warnings. + ASIO_DECL void* interlocked_compare_exchange_pointer( + void** dest, void* exch, void* cmp); + + // Helper function to emulate InterlockedExchangePointer functionality for: + // - very old Platform SDKs; and + // - platform SDKs where MSVC's /Wp64 option causes spurious warnings. + ASIO_DECL void* interlocked_exchange_pointer(void** dest, void* val); + + // The execution context used to obtain the reactor, if required. + execution_context& context_; + + // The IOCP service used for running asynchronous operations and dispatching + // handlers. + win_iocp_io_context& iocp_service_; + + // The reactor used for performing connect operations. This object is created + // only if needed. + select_reactor* reactor_; + + // Pointer to ConnectEx implementation. + void* connect_ex_; + + // Pointer to NtSetInformationFile implementation. + void* nt_set_info_; + + // Mutex to protect access to the linked list of implementations. + asio::detail::mutex mutex_; + + // The head of a linked list of all implementations. + base_implementation_type* impl_list_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_iocp_socket_service_base.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP diff --git a/include/asio/include/asio/detail/win_iocp_thread_info.hpp b/include/asio/include/asio/detail/win_iocp_thread_info.hpp new file mode 100644 index 0000000..90fa3ba --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_thread_info.hpp @@ -0,0 +1,34 @@ +// +// detail/win_iocp_thread_info.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP +#define ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/thread_info_base.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct win_iocp_thread_info : public thread_info_base +{ +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP diff --git a/include/asio/include/asio/detail/win_iocp_wait_op.hpp b/include/asio/include/asio/detail/win_iocp_wait_op.hpp new file mode 100644 index 0000000..f6c61e1 --- /dev/null +++ b/include/asio/include/asio/detail/win_iocp_wait_op.hpp @@ -0,0 +1,128 @@ +// +// detail/win_iocp_wait_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_IOCP_WAIT_OP_HPP +#define ASIO_DETAIL_WIN_IOCP_WAIT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_IOCP) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/reactor_op.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class win_iocp_wait_op : public reactor_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(win_iocp_wait_op); + + win_iocp_wait_op(socket_ops::weak_cancel_token_type cancel_token, + Handler& handler, const IoExecutor& io_ex) + : reactor_op(asio::error_code(), + &win_iocp_wait_op::do_perform, + &win_iocp_wait_op::do_complete), + cancel_token_(cancel_token), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static status do_perform(reactor_op*) + { + return done; + } + + static void do_complete(void* owner, operation* base, + const asio::error_code& result_ec, + std::size_t /*bytes_transferred*/) + { + asio::error_code ec(result_ec); + + // Take ownership of the operation object. + win_iocp_wait_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // The reactor may have stored a result in the operation object. + if (o->ec_) + ec = o->ec_; + + // Map non-portable errors to their portable counterparts. + if (ec.value() == ERROR_NETNAME_DELETED) + { + if (o->cancel_token_.expired()) + ec = asio::error::operation_aborted; + else + ec = asio::error::connection_reset; + } + else if (ec.value() == ERROR_PORT_UNREACHABLE) + { + ec = asio::error::connection_refused; + } + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(o->handler_, ec); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + socket_ops::weak_cancel_token_type cancel_token_; + Handler handler_; + handler_work work_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_IOCP) + +#endif // ASIO_DETAIL_WIN_IOCP_WAIT_OP_HPP diff --git a/include/asio/include/asio/detail/win_mutex.hpp b/include/asio/include/asio/detail/win_mutex.hpp new file mode 100644 index 0000000..e02f34e --- /dev/null +++ b/include/asio/include/asio/detail/win_mutex.hpp @@ -0,0 +1,78 @@ +// +// detail/win_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_MUTEX_HPP +#define ASIO_DETAIL_WIN_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_lock.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_mutex + : private noncopyable +{ +public: + typedef asio::detail::scoped_lock scoped_lock; + + // Constructor. + ASIO_DECL win_mutex(); + + // Destructor. + ~win_mutex() + { + ::DeleteCriticalSection(&crit_section_); + } + + // Lock the mutex. + void lock() + { + ::EnterCriticalSection(&crit_section_); + } + + // Unlock the mutex. + void unlock() + { + ::LeaveCriticalSection(&crit_section_); + } + +private: + // Initialisation must be performed in a separate function to the constructor + // since the compiler does not support the use of structured exceptions and + // C++ exceptions in the same function. + ASIO_DECL int do_init(); + + ::CRITICAL_SECTION crit_section_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_mutex.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_WIN_MUTEX_HPP diff --git a/include/asio/include/asio/detail/win_object_handle_service.hpp b/include/asio/include/asio/detail/win_object_handle_service.hpp new file mode 100644 index 0000000..bba4a92 --- /dev/null +++ b/include/asio/include/asio/detail/win_object_handle_service.hpp @@ -0,0 +1,195 @@ +// +// detail/win_object_handle_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2011 Boris Schaeling (boris@highscore.de) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_OBJECT_HANDLE_SERVICE_HPP +#define ASIO_DETAIL_WIN_OBJECT_HANDLE_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) + +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/wait_handler.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class win_object_handle_service : + public execution_context_service_base +{ +public: + // The native type of an object handle. + typedef HANDLE native_handle_type; + + // The implementation type of the object handle. + class implementation_type + { + public: + // Default constructor. + implementation_type() + : handle_(INVALID_HANDLE_VALUE), + wait_handle_(INVALID_HANDLE_VALUE), + owner_(0), + next_(0), + prev_(0) + { + } + + private: + // Only this service will have access to the internal values. + friend class win_object_handle_service; + + // The native object handle representation. May be accessed or modified + // without locking the mutex. + native_handle_type handle_; + + // The handle used to unregister the wait operation. The mutex must be + // locked when accessing or modifying this member. + HANDLE wait_handle_; + + // The operations waiting on the object handle. If there is a registered + // wait then the mutex must be locked when accessing or modifying this + // member + op_queue op_queue_; + + // The service instance that owns the object handle implementation. + win_object_handle_service* owner_; + + // Pointers to adjacent handle implementations in linked list. The mutex + // must be locked when accessing or modifying these members. + implementation_type* next_; + implementation_type* prev_; + }; + + // Constructor. + ASIO_DECL win_object_handle_service(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Construct a new handle implementation. + ASIO_DECL void construct(implementation_type& impl); + + // Move-construct a new handle implementation. + ASIO_DECL void move_construct(implementation_type& impl, + implementation_type& other_impl); + + // Move-assign from another handle implementation. + ASIO_DECL void move_assign(implementation_type& impl, + win_object_handle_service& other_service, + implementation_type& other_impl); + + // Destroy a handle implementation. + ASIO_DECL void destroy(implementation_type& impl); + + // Assign a native handle to a handle implementation. + ASIO_DECL asio::error_code assign(implementation_type& impl, + const native_handle_type& handle, asio::error_code& ec); + + // Determine whether the handle is open. + bool is_open(const implementation_type& impl) const + { + return impl.handle_ != INVALID_HANDLE_VALUE && impl.handle_ != 0; + } + + // Destroy a handle implementation. + ASIO_DECL asio::error_code close(implementation_type& impl, + asio::error_code& ec); + + // Get the native handle representation. + native_handle_type native_handle(const implementation_type& impl) const + { + return impl.handle_; + } + + // Cancel all operations associated with the handle. + ASIO_DECL asio::error_code cancel(implementation_type& impl, + asio::error_code& ec); + + // Perform a synchronous wait for the object to enter a signalled state. + ASIO_DECL void wait(implementation_type& impl, + asio::error_code& ec); + + /// Start an asynchronous wait. + template + void async_wait(implementation_type& impl, + Handler& handler, const IoExecutor& io_ex) + { + // Allocate and construct an operation to wrap the handler. + typedef wait_handler op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), *p.p, "object_handle", + &impl, reinterpret_cast(impl.wait_handle_), "async_wait")); + + start_wait_op(impl, p.p); + p.v = p.p = 0; + } + +private: + // Helper function to start an asynchronous wait operation. + ASIO_DECL void start_wait_op(implementation_type& impl, wait_op* op); + + // Helper function to register a wait operation. + ASIO_DECL void register_wait_callback( + implementation_type& impl, mutex::scoped_lock& lock); + + // Callback function invoked when the registered wait completes. + static ASIO_DECL VOID CALLBACK wait_callback( + PVOID param, BOOLEAN timeout); + + // The scheduler used to post completions. +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + scheduler_impl& scheduler_; + + // Mutex to protect access to internal state. + mutex mutex_; + + // The head of a linked list of all implementations. + implementation_type* impl_list_; + + // Flag to indicate that the dispatcher has been shut down. + bool shutdown_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_object_handle_service.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) + +#endif // ASIO_DETAIL_WIN_OBJECT_HANDLE_SERVICE_HPP diff --git a/include/asio/include/asio/detail/win_static_mutex.hpp b/include/asio/include/asio/detail/win_static_mutex.hpp new file mode 100644 index 0000000..c96e708 --- /dev/null +++ b/include/asio/include/asio/detail/win_static_mutex.hpp @@ -0,0 +1,74 @@ +// +// detail/win_static_mutex.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_STATIC_MUTEX_HPP +#define ASIO_DETAIL_WIN_STATIC_MUTEX_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include "asio/detail/scoped_lock.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct win_static_mutex +{ + typedef asio::detail::scoped_lock scoped_lock; + + // Initialise the mutex. + ASIO_DECL void init(); + + // Initialisation must be performed in a separate function to the "public" + // init() function since the compiler does not support the use of structured + // exceptions and C++ exceptions in the same function. + ASIO_DECL int do_init(); + + // Lock the mutex. + void lock() + { + ::EnterCriticalSection(&crit_section_); + } + + // Unlock the mutex. + void unlock() + { + ::LeaveCriticalSection(&crit_section_); + } + + bool initialised_; + ::CRITICAL_SECTION crit_section_; +}; + +#if defined(UNDER_CE) +# define ASIO_WIN_STATIC_MUTEX_INIT { false, { 0, 0, 0, 0, 0 } } +#else // defined(UNDER_CE) +# define ASIO_WIN_STATIC_MUTEX_INIT { false, { 0, 0, 0, 0, 0, 0 } } +#endif // defined(UNDER_CE) + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_static_mutex.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_WIN_STATIC_MUTEX_HPP diff --git a/include/asio/include/asio/detail/win_thread.hpp b/include/asio/include/asio/detail/win_thread.hpp new file mode 100644 index 0000000..6c7168c --- /dev/null +++ b/include/asio/include/asio/detail/win_thread.hpp @@ -0,0 +1,147 @@ +// +// detail/win_thread.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_THREAD_HPP +#define ASIO_DETAIL_WIN_THREAD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) \ + && !defined(ASIO_WINDOWS_APP) \ + && !defined(UNDER_CE) + +#include +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +ASIO_DECL unsigned int __stdcall win_thread_function(void* arg); + +#if defined(WINVER) && (WINVER < 0x0500) +ASIO_DECL void __stdcall apc_function(ULONG data); +#else +ASIO_DECL void __stdcall apc_function(ULONG_PTR data); +#endif + +template +class win_thread_base +{ +public: + static bool terminate_threads() + { + return ::InterlockedExchangeAdd(&terminate_threads_, 0) != 0; + } + + static void set_terminate_threads(bool b) + { + ::InterlockedExchange(&terminate_threads_, b ? 1 : 0); + } + +private: + static long terminate_threads_; +}; + +template +long win_thread_base::terminate_threads_ = 0; + +class win_thread + : private noncopyable, + public win_thread_base +{ +public: + // Constructor. + template + win_thread(Function f, unsigned int stack_size = 0) + : thread_(0), + exit_event_(0) + { + start_thread(new func(f), stack_size); + } + + // Destructor. + ASIO_DECL ~win_thread(); + + // Wait for the thread to exit. + ASIO_DECL void join(); + + // Get number of CPUs. + ASIO_DECL static std::size_t hardware_concurrency(); + +private: + friend ASIO_DECL unsigned int __stdcall win_thread_function(void* arg); + +#if defined(WINVER) && (WINVER < 0x0500) + friend ASIO_DECL void __stdcall apc_function(ULONG); +#else + friend ASIO_DECL void __stdcall apc_function(ULONG_PTR); +#endif + + class func_base + { + public: + virtual ~func_base() {} + virtual void run() = 0; + ::HANDLE entry_event_; + ::HANDLE exit_event_; + }; + + struct auto_func_base_ptr + { + func_base* ptr; + ~auto_func_base_ptr() { delete ptr; } + }; + + template + class func + : public func_base + { + public: + func(Function f) + : f_(f) + { + } + + virtual void run() + { + f_(); + } + + private: + Function f_; + }; + + ASIO_DECL void start_thread(func_base* arg, unsigned int stack_size); + + ::HANDLE thread_; + ::HANDLE exit_event_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_thread.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS) + // && !defined(ASIO_WINDOWS_APP) + // && !defined(UNDER_CE) + +#endif // ASIO_DETAIL_WIN_THREAD_HPP diff --git a/include/asio/include/asio/detail/win_tss_ptr.hpp b/include/asio/include/asio/detail/win_tss_ptr.hpp new file mode 100644 index 0000000..7044cd1 --- /dev/null +++ b/include/asio/include/asio/detail/win_tss_ptr.hpp @@ -0,0 +1,79 @@ +// +// detail/win_tss_ptr.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WIN_TSS_PTR_HPP +#define ASIO_DETAIL_WIN_TSS_PTR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/socket_types.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// Helper function to create thread-specific storage. +ASIO_DECL DWORD win_tss_ptr_create(); + +template +class win_tss_ptr + : private noncopyable +{ +public: + // Constructor. + win_tss_ptr() + : tss_key_(win_tss_ptr_create()) + { + } + + // Destructor. + ~win_tss_ptr() + { + ::TlsFree(tss_key_); + } + + // Get the value. + operator T*() const + { + return static_cast(::TlsGetValue(tss_key_)); + } + + // Set the value. + void operator=(T* value) + { + ::TlsSetValue(tss_key_, value); + } + +private: + // Thread-specific storage to allow unlocked access to determine whether a + // thread is a member of the pool. + DWORD tss_key_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/win_tss_ptr.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS) + +#endif // ASIO_DETAIL_WIN_TSS_PTR_HPP diff --git a/include/asio/include/asio/detail/winapp_thread.hpp b/include/asio/include/asio/detail/winapp_thread.hpp new file mode 100644 index 0000000..74e3fdd --- /dev/null +++ b/include/asio/include/asio/detail/winapp_thread.hpp @@ -0,0 +1,124 @@ +// +// detail/winapp_thread.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINAPP_THREAD_HPP +#define ASIO_DETAIL_WINAPP_THREAD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) && defined(ASIO_WINDOWS_APP) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_ptr.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +DWORD WINAPI winapp_thread_function(LPVOID arg); + +class winapp_thread + : private noncopyable +{ +public: + // Constructor. + template + winapp_thread(Function f, unsigned int = 0) + { + scoped_ptr arg(new func(f)); + DWORD thread_id = 0; + thread_ = ::CreateThread(0, 0, winapp_thread_function, + arg.get(), 0, &thread_id); + if (!thread_) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "thread"); + } + arg.release(); + } + + // Destructor. + ~winapp_thread() + { + ::CloseHandle(thread_); + } + + // Wait for the thread to exit. + void join() + { + ::WaitForSingleObjectEx(thread_, INFINITE, false); + } + + // Get number of CPUs. + static std::size_t hardware_concurrency() + { + SYSTEM_INFO system_info; + ::GetNativeSystemInfo(&system_info); + return system_info.dwNumberOfProcessors; + } + +private: + friend DWORD WINAPI winapp_thread_function(LPVOID arg); + + class func_base + { + public: + virtual ~func_base() {} + virtual void run() = 0; + }; + + template + class func + : public func_base + { + public: + func(Function f) + : f_(f) + { + } + + virtual void run() + { + f_(); + } + + private: + Function f_; + }; + + ::HANDLE thread_; +}; + +inline DWORD WINAPI winapp_thread_function(LPVOID arg) +{ + scoped_ptr func( + static_cast(arg)); + func->run(); + return 0; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) && defined(ASIO_WINDOWS_APP) + +#endif // ASIO_DETAIL_WINAPP_THREAD_HPP diff --git a/include/asio/include/asio/detail/wince_thread.hpp b/include/asio/include/asio/detail/wince_thread.hpp new file mode 100644 index 0000000..37bf2ad --- /dev/null +++ b/include/asio/include/asio/detail/wince_thread.hpp @@ -0,0 +1,124 @@ +// +// detail/wince_thread.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINCE_THREAD_HPP +#define ASIO_DETAIL_WINCE_THREAD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) && defined(UNDER_CE) + +#include "asio/detail/noncopyable.hpp" +#include "asio/detail/scoped_ptr.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +DWORD WINAPI wince_thread_function(LPVOID arg); + +class wince_thread + : private noncopyable +{ +public: + // Constructor. + template + wince_thread(Function f, unsigned int = 0) + { + scoped_ptr arg(new func(f)); + DWORD thread_id = 0; + thread_ = ::CreateThread(0, 0, wince_thread_function, + arg.get(), 0, &thread_id); + if (!thread_) + { + DWORD last_error = ::GetLastError(); + asio::error_code ec(last_error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "thread"); + } + arg.release(); + } + + // Destructor. + ~wince_thread() + { + ::CloseHandle(thread_); + } + + // Wait for the thread to exit. + void join() + { + ::WaitForSingleObject(thread_, INFINITE); + } + + // Get number of CPUs. + static std::size_t hardware_concurrency() + { + SYSTEM_INFO system_info; + ::GetSystemInfo(&system_info); + return system_info.dwNumberOfProcessors; + } + +private: + friend DWORD WINAPI wince_thread_function(LPVOID arg); + + class func_base + { + public: + virtual ~func_base() {} + virtual void run() = 0; + }; + + template + class func + : public func_base + { + public: + func(Function f) + : f_(f) + { + } + + virtual void run() + { + f_(); + } + + private: + Function f_; + }; + + ::HANDLE thread_; +}; + +inline DWORD WINAPI wince_thread_function(LPVOID arg) +{ + scoped_ptr func( + static_cast(arg)); + func->run(); + return 0; +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS) && defined(UNDER_CE) + +#endif // ASIO_DETAIL_WINCE_THREAD_HPP diff --git a/include/asio/include/asio/detail/winrt_async_manager.hpp b/include/asio/include/asio/detail/winrt_async_manager.hpp new file mode 100644 index 0000000..6058be2 --- /dev/null +++ b/include/asio/include/asio/detail/winrt_async_manager.hpp @@ -0,0 +1,305 @@ +// +// detail/winrt_async_manager.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_ASYNC_MANAGER_HPP +#define ASIO_DETAIL_WINRT_ASYNC_MANAGER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include +#include "asio/detail/atomic_count.hpp" +#include "asio/detail/winrt_async_op.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class winrt_async_manager + : public execution_context_service_base +{ +public: + // Constructor. + winrt_async_manager(execution_context& context) + : execution_context_service_base(context), + scheduler_(use_service(context)), + outstanding_ops_(1) + { + } + + // Destructor. + ~winrt_async_manager() + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + if (--outstanding_ops_ > 0) + { + // Block until last operation is complete. + std::future f = promise_.get_future(); + f.wait(); + } + } + + void sync(Windows::Foundation::IAsyncAction^ action, + asio::error_code& ec) + { + using namespace Windows::Foundation; + using Windows::Foundation::AsyncStatus; + + auto promise = std::make_shared>(); + auto future = promise->get_future(); + + action->Completed = ref new AsyncActionCompletedHandler( + [promise](IAsyncAction^ action, AsyncStatus status) + { + switch (status) + { + case AsyncStatus::Canceled: + promise->set_value(asio::error::operation_aborted); + break; + case AsyncStatus::Error: + case AsyncStatus::Completed: + default: + asio::error_code ec( + action->ErrorCode.Value, + asio::system_category()); + promise->set_value(ec); + break; + } + }); + + ec = future.get(); + } + + template + TResult sync(Windows::Foundation::IAsyncOperation^ operation, + asio::error_code& ec) + { + using namespace Windows::Foundation; + using Windows::Foundation::AsyncStatus; + + auto promise = std::make_shared>(); + auto future = promise->get_future(); + + operation->Completed = ref new AsyncOperationCompletedHandler( + [promise](IAsyncOperation^ operation, AsyncStatus status) + { + switch (status) + { + case AsyncStatus::Canceled: + promise->set_value(asio::error::operation_aborted); + break; + case AsyncStatus::Error: + case AsyncStatus::Completed: + default: + asio::error_code ec( + operation->ErrorCode.Value, + asio::system_category()); + promise->set_value(ec); + break; + } + }); + + ec = future.get(); + return operation->GetResults(); + } + + template + TResult sync( + Windows::Foundation::IAsyncOperationWithProgress< + TResult, TProgress>^ operation, + asio::error_code& ec) + { + using namespace Windows::Foundation; + using Windows::Foundation::AsyncStatus; + + auto promise = std::make_shared>(); + auto future = promise->get_future(); + + operation->Completed + = ref new AsyncOperationWithProgressCompletedHandler( + [promise](IAsyncOperationWithProgress^ operation, + AsyncStatus status) + { + switch (status) + { + case AsyncStatus::Canceled: + promise->set_value(asio::error::operation_aborted); + break; + case AsyncStatus::Started: + break; + case AsyncStatus::Error: + case AsyncStatus::Completed: + default: + asio::error_code ec( + operation->ErrorCode.Value, + asio::system_category()); + promise->set_value(ec); + break; + } + }); + + ec = future.get(); + return operation->GetResults(); + } + + void async(Windows::Foundation::IAsyncAction^ action, + winrt_async_op* handler) + { + using namespace Windows::Foundation; + using Windows::Foundation::AsyncStatus; + + auto on_completed = ref new AsyncActionCompletedHandler( + [this, handler](IAsyncAction^ action, AsyncStatus status) + { + switch (status) + { + case AsyncStatus::Canceled: + handler->ec_ = asio::error::operation_aborted; + break; + case AsyncStatus::Started: + return; + case AsyncStatus::Completed: + case AsyncStatus::Error: + default: + handler->ec_ = asio::error_code( + action->ErrorCode.Value, + asio::system_category()); + break; + } + scheduler_.post_deferred_completion(handler); + if (--outstanding_ops_ == 0) + promise_.set_value(); + }); + + scheduler_.work_started(); + ++outstanding_ops_; + action->Completed = on_completed; + } + + template + void async(Windows::Foundation::IAsyncOperation^ operation, + winrt_async_op* handler) + { + using namespace Windows::Foundation; + using Windows::Foundation::AsyncStatus; + + auto on_completed = ref new AsyncOperationCompletedHandler( + [this, handler](IAsyncOperation^ operation, AsyncStatus status) + { + switch (status) + { + case AsyncStatus::Canceled: + handler->ec_ = asio::error::operation_aborted; + break; + case AsyncStatus::Started: + return; + case AsyncStatus::Completed: + handler->result_ = operation->GetResults(); + // Fall through. + case AsyncStatus::Error: + default: + handler->ec_ = asio::error_code( + operation->ErrorCode.Value, + asio::system_category()); + break; + } + scheduler_.post_deferred_completion(handler); + if (--outstanding_ops_ == 0) + promise_.set_value(); + }); + + scheduler_.work_started(); + ++outstanding_ops_; + operation->Completed = on_completed; + } + + template + void async( + Windows::Foundation::IAsyncOperationWithProgress< + TResult, TProgress>^ operation, + winrt_async_op* handler) + { + using namespace Windows::Foundation; + using Windows::Foundation::AsyncStatus; + + auto on_completed + = ref new AsyncOperationWithProgressCompletedHandler( + [this, handler](IAsyncOperationWithProgress< + TResult, TProgress>^ operation, AsyncStatus status) + { + switch (status) + { + case AsyncStatus::Canceled: + handler->ec_ = asio::error::operation_aborted; + break; + case AsyncStatus::Started: + return; + case AsyncStatus::Completed: + handler->result_ = operation->GetResults(); + // Fall through. + case AsyncStatus::Error: + default: + handler->ec_ = asio::error_code( + operation->ErrorCode.Value, + asio::system_category()); + break; + } + scheduler_.post_deferred_completion(handler); + if (--outstanding_ops_ == 0) + promise_.set_value(); + }); + + scheduler_.work_started(); + ++outstanding_ops_; + operation->Completed = on_completed; + } + +private: + // The scheduler implementation used to post completed handlers. +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + scheduler_impl& scheduler_; + + // Count of outstanding operations. + atomic_count outstanding_ops_; + + // Used to keep wait for outstanding operations to complete. + std::promise promise_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_ASYNC_MANAGER_HPP diff --git a/include/asio/include/asio/detail/winrt_async_op.hpp b/include/asio/include/asio/detail/winrt_async_op.hpp new file mode 100644 index 0000000..78c411b --- /dev/null +++ b/include/asio/include/asio/detail/winrt_async_op.hpp @@ -0,0 +1,65 @@ +// +// detail/winrt_async_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_ASYNC_OP_HPP +#define ASIO_DETAIL_WINRT_ASYNC_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/operation.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class winrt_async_op + : public operation +{ +public: + // The error code to be passed to the completion handler. + asio::error_code ec_; + + // The result of the operation, to be passed to the completion handler. + TResult result_; + +protected: + winrt_async_op(func_type complete_func) + : operation(complete_func), + result_() + { + } +}; + +template <> +class winrt_async_op + : public operation +{ +public: + // The error code to be passed to the completion handler. + asio::error_code ec_; + +protected: + winrt_async_op(func_type complete_func) + : operation(complete_func) + { + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_WINRT_ASYNC_OP_HPP diff --git a/include/asio/include/asio/detail/winrt_resolve_op.hpp b/include/asio/include/asio/detail/winrt_resolve_op.hpp new file mode 100644 index 0000000..d2537b9 --- /dev/null +++ b/include/asio/include/asio/detail/winrt_resolve_op.hpp @@ -0,0 +1,125 @@ +// +// detail/winrt_resolve_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_RESOLVE_OP_HPP +#define ASIO_DETAIL_WINRT_RESOLVE_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/winrt_async_op.hpp" +#include "asio/ip/basic_resolver_results.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class winrt_resolve_op : + public winrt_async_op< + Windows::Foundation::Collections::IVectorView< + Windows::Networking::EndpointPair^>^> +{ +public: + ASIO_DEFINE_HANDLER_PTR(winrt_resolve_op); + + typedef typename Protocol::endpoint endpoint_type; + typedef asio::ip::basic_resolver_query query_type; + typedef asio::ip::basic_resolver_results results_type; + + winrt_resolve_op(const query_type& query, + Handler& handler, const IoExecutor& io_ex) + : winrt_async_op< + Windows::Foundation::Collections::IVectorView< + Windows::Networking::EndpointPair^>^>( + &winrt_resolve_op::do_complete), + query_(query), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code&, std::size_t) + { + // Take ownership of the operation object. + winrt_resolve_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + results_type results = results_type(); + if (!o->ec_) + { + try + { + results = results_type::create(o->result_, o->query_.hints(), + o->query_.host_name(), o->query_.service_name()); + } + catch (Platform::Exception^ e) + { + o->ec_ = asio::error_code(e->HResult, + asio::system_category()); + } + } + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, results); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "...")); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + query_type query_; + Handler handler_; + handler_work executor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_RESOLVE_OP_HPP diff --git a/include/asio/include/asio/detail/winrt_resolver_service.hpp b/include/asio/include/asio/detail/winrt_resolver_service.hpp new file mode 100644 index 0000000..e3d2859 --- /dev/null +++ b/include/asio/include/asio/detail/winrt_resolver_service.hpp @@ -0,0 +1,212 @@ +// +// detail/winrt_resolver_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_RESOLVER_SERVICE_HPP +#define ASIO_DETAIL_WINRT_RESOLVER_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/ip/basic_resolver_query.hpp" +#include "asio/ip/basic_resolver_results.hpp" +#include "asio/post.hpp" +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/socket_ops.hpp" +#include "asio/detail/winrt_async_manager.hpp" +#include "asio/detail/winrt_resolve_op.hpp" +#include "asio/detail/winrt_utils.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class winrt_resolver_service : + public execution_context_service_base > +{ +public: + // The implementation type of the resolver. A cancellation token is used to + // indicate to the asynchronous operation that the operation has been + // cancelled. + typedef socket_ops::shared_cancel_token_type implementation_type; + + // The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + // The query type. + typedef asio::ip::basic_resolver_query query_type; + + // The results type. + typedef asio::ip::basic_resolver_results results_type; + + // Constructor. + winrt_resolver_service(execution_context& context) + : execution_context_service_base< + winrt_resolver_service >(context), + scheduler_(use_service(context)), + async_manager_(use_service(context)) + { + } + + // Destructor. + ~winrt_resolver_service() + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + } + + // Perform any fork-related housekeeping. + void notify_fork(execution_context::fork_event) + { + } + + // Construct a new resolver implementation. + void construct(implementation_type&) + { + } + + // Move-construct a new resolver implementation. + void move_construct(implementation_type&, + implementation_type&) + { + } + + // Move-assign from another resolver implementation. + void move_assign(implementation_type&, + winrt_resolver_service&, implementation_type&) + { + } + + // Destroy a resolver implementation. + void destroy(implementation_type&) + { + } + + // Cancel pending asynchronous operations. + void cancel(implementation_type&) + { + } + + // Resolve a query to a list of entries. + results_type resolve(implementation_type&, + const query_type& query, asio::error_code& ec) + { + try + { + using namespace Windows::Networking::Sockets; + auto endpoint_pairs = async_manager_.sync( + DatagramSocket::GetEndpointPairsAsync( + winrt_utils::host_name(query.host_name()), + winrt_utils::string(query.service_name())), ec); + + if (ec) + return results_type(); + + return results_type::create( + endpoint_pairs, query.hints(), + query.host_name(), query.service_name()); + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + return results_type(); + } + } + + // Asynchronously resolve a query to a list of entries. + template + void async_resolve(implementation_type& impl, const query_type& query, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef winrt_resolve_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(query, handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "resolver", &impl, 0, "async_resolve")); + (void)impl; + + try + { + using namespace Windows::Networking::Sockets; + async_manager_.async(DatagramSocket::GetEndpointPairsAsync( + winrt_utils::host_name(query.host_name()), + winrt_utils::string(query.service_name())), p.p); + p.v = p.p = 0; + } + catch (Platform::Exception^ e) + { + p.p->ec_ = asio::error_code( + e->HResult, asio::system_category()); + scheduler_.post_immediate_completion(p.p, is_continuation); + p.v = p.p = 0; + } + } + + // Resolve an endpoint to a list of entries. + results_type resolve(implementation_type&, + const endpoint_type&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return results_type(); + } + + // Asynchronously resolve an endpoint to a list of entries. + template + void async_resolve(implementation_type&, const endpoint_type&, + Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const results_type results; + asio::post(io_ex, detail::bind_handler(handler, ec, results)); + } + +private: + // The scheduler implementation used for delivering completions. +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + scheduler_impl& scheduler_; + + winrt_async_manager& async_manager_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_RESOLVER_SERVICE_HPP diff --git a/include/asio/include/asio/detail/winrt_socket_connect_op.hpp b/include/asio/include/asio/detail/winrt_socket_connect_op.hpp new file mode 100644 index 0000000..004fc09 --- /dev/null +++ b/include/asio/include/asio/detail/winrt_socket_connect_op.hpp @@ -0,0 +1,98 @@ +// +// detail/winrt_socket_connect_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_SOCKET_CONNECT_OP_HPP +#define ASIO_DETAIL_WINRT_SOCKET_CONNECT_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/winrt_async_op.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class winrt_socket_connect_op : + public winrt_async_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(winrt_socket_connect_op); + + winrt_socket_connect_op(Handler& handler, const IoExecutor& io_ex) + : winrt_async_op(&winrt_socket_connect_op::do_complete), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code&, std::size_t) + { + // Take ownership of the operation object. + winrt_socket_connect_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder1 + handler(o->handler_, o->ec_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + Handler handler_; + handler_work executor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_SOCKET_CONNECT_OP_HPP diff --git a/include/asio/include/asio/detail/winrt_socket_recv_op.hpp b/include/asio/include/asio/detail/winrt_socket_recv_op.hpp new file mode 100644 index 0000000..74fae76 --- /dev/null +++ b/include/asio/include/asio/detail/winrt_socket_recv_op.hpp @@ -0,0 +1,119 @@ +// +// detail/winrt_socket_recv_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_SOCKET_RECV_OP_HPP +#define ASIO_DETAIL_WINRT_SOCKET_RECV_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/winrt_async_op.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class winrt_socket_recv_op : + public winrt_async_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(winrt_socket_recv_op); + + winrt_socket_recv_op(const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + : winrt_async_op( + &winrt_socket_recv_op::do_complete), + buffers_(buffers), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code&, std::size_t) + { + // Take ownership of the operation object. + winrt_socket_recv_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + // Check whether buffers are still valid. + if (owner) + { + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + std::size_t bytes_transferred = o->result_ ? o->result_->Length : 0; + if (bytes_transferred == 0 && !o->ec_ && + !buffer_sequence_adapter::all_empty(o->buffers_)) + { + o->ec_ = asio::error::eof; + } + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, bytes_transferred); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + MutableBufferSequence buffers_; + Handler handler_; + handler_work executor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_SOCKET_RECV_OP_HPP diff --git a/include/asio/include/asio/detail/winrt_socket_send_op.hpp b/include/asio/include/asio/detail/winrt_socket_send_op.hpp new file mode 100644 index 0000000..6129c80 --- /dev/null +++ b/include/asio/include/asio/detail/winrt_socket_send_op.hpp @@ -0,0 +1,110 @@ +// +// detail/winrt_socket_send_op.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_SOCKET_SEND_OP_HPP +#define ASIO_DETAIL_WINRT_SOCKET_SEND_OP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/fenced_block.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" +#include "asio/detail/handler_work.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/winrt_async_op.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class winrt_socket_send_op : + public winrt_async_op +{ +public: + ASIO_DEFINE_HANDLER_PTR(winrt_socket_send_op); + + winrt_socket_send_op(const ConstBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) + : winrt_async_op(&winrt_socket_send_op::do_complete), + buffers_(buffers), + handler_(ASIO_MOVE_CAST(Handler)(handler)), + work_(handler_, io_ex) + { + } + + static void do_complete(void* owner, operation* base, + const asio::error_code&, std::size_t) + { + // Take ownership of the operation object. + winrt_socket_send_op* o(static_cast(base)); + ptr p = { asio::detail::addressof(o->handler_), o, o }; + + ASIO_HANDLER_COMPLETION((*o)); + + // Take ownership of the operation's outstanding work. + handler_work w( + ASIO_MOVE_CAST2(handler_work)( + o->work_)); + +#if defined(ASIO_ENABLE_BUFFER_DEBUGGING) + // Check whether buffers are still valid. + if (owner) + { + buffer_sequence_adapter::validate(o->buffers_); + } +#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING) + + // Make a copy of the handler so that the memory can be deallocated before + // the upcall is made. Even if we're not about to make an upcall, a + // sub-object of the handler may be the true owner of the memory associated + // with the handler. Consequently, a local copy of the handler is required + // to ensure that any owning sub-object remains valid until after we have + // deallocated the memory here. + detail::binder2 + handler(o->handler_, o->ec_, o->result_); + p.h = asio::detail::addressof(handler.handler_); + p.reset(); + + // Make the upcall if required. + if (owner) + { + fenced_block b(fenced_block::half); + ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); + w.complete(handler, handler.handler_); + ASIO_HANDLER_INVOCATION_END; + } + } + +private: + ConstBufferSequence buffers_; + Handler handler_; + handler_work executor_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_SOCKET_SEND_OP_HPP diff --git a/include/asio/include/asio/detail/winrt_ssocket_service.hpp b/include/asio/include/asio/detail/winrt_ssocket_service.hpp new file mode 100644 index 0000000..45b614a --- /dev/null +++ b/include/asio/include/asio/detail/winrt_ssocket_service.hpp @@ -0,0 +1,250 @@ +// +// detail/winrt_ssocket_service.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_SSOCKET_SERVICE_HPP +#define ASIO_DETAIL_WINRT_SSOCKET_SERVICE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/winrt_socket_connect_op.hpp" +#include "asio/detail/winrt_ssocket_service_base.hpp" +#include "asio/detail/winrt_utils.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +class winrt_ssocket_service : + public execution_context_service_base >, + public winrt_ssocket_service_base +{ +public: + // The protocol type. + typedef Protocol protocol_type; + + // The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + // The native type of a socket. + typedef Windows::Networking::Sockets::StreamSocket^ native_handle_type; + + // The implementation type of the socket. + struct implementation_type : base_implementation_type + { + // Default constructor. + implementation_type() + : base_implementation_type(), + protocol_(endpoint_type().protocol()) + { + } + + // The protocol associated with the socket. + protocol_type protocol_; + }; + + // Constructor. + winrt_ssocket_service(execution_context& context) + : execution_context_service_base >(context), + winrt_ssocket_service_base(context) + { + } + + // Destroy all user-defined handler objects owned by the service. + void shutdown() + { + this->base_shutdown(); + } + + // Move-construct a new socket implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) ASIO_NOEXCEPT + { + this->base_move_construct(impl, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + } + + // Move-assign from another socket implementation. + void move_assign(implementation_type& impl, + winrt_ssocket_service& other_service, + implementation_type& other_impl) + { + this->base_move_assign(impl, other_service, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + } + + // Move-construct a new socket implementation from another protocol type. + template + void converting_move_construct(implementation_type& impl, + winrt_ssocket_service&, + typename winrt_ssocket_service< + Protocol1>::implementation_type& other_impl) + { + this->base_move_construct(impl, other_impl); + + impl.protocol_ = protocol_type(other_impl.protocol_); + other_impl.protocol_ = typename Protocol1::endpoint().protocol(); + } + + // Open a new socket implementation. + asio::error_code open(implementation_type& impl, + const protocol_type& protocol, asio::error_code& ec) + { + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + try + { + impl.socket_ = ref new Windows::Networking::Sockets::StreamSocket; + impl.protocol_ = protocol; + ec = asio::error_code(); + } + catch (Platform::Exception^ e) + { + ec = asio::error_code(e->HResult, + asio::system_category()); + } + + return ec; + } + + // Assign a native socket to a socket implementation. + asio::error_code assign(implementation_type& impl, + const protocol_type& protocol, const native_handle_type& native_socket, + asio::error_code& ec) + { + if (is_open(impl)) + { + ec = asio::error::already_open; + return ec; + } + + impl.socket_ = native_socket; + impl.protocol_ = protocol; + ec = asio::error_code(); + + return ec; + } + + // Bind the socket to the specified local endpoint. + asio::error_code bind(implementation_type&, + const endpoint_type&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Get the local endpoint. + endpoint_type local_endpoint(const implementation_type& impl, + asio::error_code& ec) const + { + endpoint_type endpoint; + endpoint.resize(do_get_endpoint(impl, true, + endpoint.data(), endpoint.size(), ec)); + return endpoint; + } + + // Get the remote endpoint. + endpoint_type remote_endpoint(const implementation_type& impl, + asio::error_code& ec) const + { + endpoint_type endpoint; + endpoint.resize(do_get_endpoint(impl, false, + endpoint.data(), endpoint.size(), ec)); + return endpoint; + } + + // Disable sends or receives on the socket. + asio::error_code shutdown(implementation_type&, + socket_base::shutdown_type, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Set a socket option. + template + asio::error_code set_option(implementation_type& impl, + const Option& option, asio::error_code& ec) + { + return do_set_option(impl, option.level(impl.protocol_), + option.name(impl.protocol_), option.data(impl.protocol_), + option.size(impl.protocol_), ec); + } + + // Get a socket option. + template + asio::error_code get_option(const implementation_type& impl, + Option& option, asio::error_code& ec) const + { + std::size_t size = option.size(impl.protocol_); + do_get_option(impl, option.level(impl.protocol_), + option.name(impl.protocol_), + option.data(impl.protocol_), &size, ec); + if (!ec) + option.resize(impl.protocol_, size); + return ec; + } + + // Connect the socket to the specified endpoint. + asio::error_code connect(implementation_type& impl, + const endpoint_type& peer_endpoint, asio::error_code& ec) + { + return do_connect(impl, peer_endpoint.data(), ec); + } + + // Start an asynchronous connect. + template + void async_connect(implementation_type& impl, + const endpoint_type& peer_endpoint, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef winrt_socket_connect_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "socket", &impl, 0, "async_connect")); + + start_connect_op(impl, peer_endpoint.data(), p.p, is_continuation); + p.v = p.p = 0; + } +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_SSOCKET_SERVICE_HPP diff --git a/include/asio/include/asio/detail/winrt_ssocket_service_base.hpp b/include/asio/include/asio/detail/winrt_ssocket_service_base.hpp new file mode 100644 index 0000000..ec2722f --- /dev/null +++ b/include/asio/include/asio/detail/winrt_ssocket_service_base.hpp @@ -0,0 +1,362 @@ +// +// detail/winrt_ssocket_service_base.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP +#define ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include "asio/buffer.hpp" +#include "asio/error.hpp" +#include "asio/execution_context.hpp" +#include "asio/socket_base.hpp" +#include "asio/detail/buffer_sequence_adapter.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/socket_types.hpp" +#include "asio/detail/winrt_async_manager.hpp" +#include "asio/detail/winrt_socket_recv_op.hpp" +#include "asio/detail/winrt_socket_send_op.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class winrt_ssocket_service_base +{ +public: + // The native type of a socket. + typedef Windows::Networking::Sockets::StreamSocket^ native_handle_type; + + // The implementation type of the socket. + struct base_implementation_type + { + // Default constructor. + base_implementation_type() + : socket_(nullptr), + next_(0), + prev_(0) + { + } + + // The underlying native socket. + native_handle_type socket_; + + // Pointers to adjacent socket implementations in linked list. + base_implementation_type* next_; + base_implementation_type* prev_; + }; + + // Constructor. + ASIO_DECL winrt_ssocket_service_base(execution_context& context); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void base_shutdown(); + + // Construct a new socket implementation. + ASIO_DECL void construct(base_implementation_type&); + + // Move-construct a new socket implementation. + ASIO_DECL void base_move_construct(base_implementation_type& impl, + base_implementation_type& other_impl) ASIO_NOEXCEPT; + + // Move-assign from another socket implementation. + ASIO_DECL void base_move_assign(base_implementation_type& impl, + winrt_ssocket_service_base& other_service, + base_implementation_type& other_impl); + + // Destroy a socket implementation. + ASIO_DECL void destroy(base_implementation_type& impl); + + // Determine whether the socket is open. + bool is_open(const base_implementation_type& impl) const + { + return impl.socket_ != nullptr; + } + + // Destroy a socket implementation. + ASIO_DECL asio::error_code close( + base_implementation_type& impl, asio::error_code& ec); + + // Release ownership of the socket. + ASIO_DECL native_handle_type release( + base_implementation_type& impl, asio::error_code& ec); + + // Get the native socket representation. + native_handle_type native_handle(base_implementation_type& impl) + { + return impl.socket_; + } + + // Cancel all operations associated with the socket. + asio::error_code cancel(base_implementation_type&, + asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Determine whether the socket is at the out-of-band data mark. + bool at_mark(const base_implementation_type&, + asio::error_code& ec) const + { + ec = asio::error::operation_not_supported; + return false; + } + + // Determine the number of bytes available for reading. + std::size_t available(const base_implementation_type&, + asio::error_code& ec) const + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Perform an IO control command on the socket. + template + asio::error_code io_control(base_implementation_type&, + IO_Control_Command&, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Gets the non-blocking mode of the socket. + bool non_blocking(const base_implementation_type&) const + { + return false; + } + + // Sets the non-blocking mode of the socket. + asio::error_code non_blocking(base_implementation_type&, + bool, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Gets the non-blocking mode of the native socket implementation. + bool native_non_blocking(const base_implementation_type&) const + { + return false; + } + + // Sets the non-blocking mode of the native socket implementation. + asio::error_code native_non_blocking(base_implementation_type&, + bool, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return ec; + } + + // Send the given data to the peer. + template + std::size_t send(base_implementation_type& impl, + const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return do_send(impl, + buffer_sequence_adapter::first(buffers), flags, ec); + } + + // Wait until data can be sent without blocking. + std::size_t send(base_implementation_type&, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Start an asynchronous send. The data being sent must be valid for the + // lifetime of the asynchronous operation. + template + void async_send(base_implementation_type& impl, + const ConstBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef winrt_socket_send_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "socket", &impl, 0, "async_send")); + + start_send_op(impl, + buffer_sequence_adapter::first(buffers), + flags, p.p, is_continuation); + p.v = p.p = 0; + } + + // Start an asynchronous wait until data can be sent without blocking. + template + void async_send(base_implementation_type&, const null_buffers&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, + detail::bind_handler(handler, ec, bytes_transferred)); + } + + // Receive some data from the peer. Returns the number of bytes received. + template + std::size_t receive(base_implementation_type& impl, + const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return do_receive(impl, + buffer_sequence_adapter::first(buffers), flags, ec); + } + + // Wait until data can be received without blocking. + std::size_t receive(base_implementation_type&, const null_buffers&, + socket_base::message_flags, asio::error_code& ec) + { + ec = asio::error::operation_not_supported; + return 0; + } + + // Start an asynchronous receive. The buffer for the data being received + // must be valid for the lifetime of the asynchronous operation. + template + void async_receive(base_implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, + Handler& handler, const IoExecutor& io_ex) + { + bool is_continuation = + asio_handler_cont_helpers::is_continuation(handler); + + // Allocate and construct an operation to wrap the handler. + typedef winrt_socket_recv_op op; + typename op::ptr p = { asio::detail::addressof(handler), + op::ptr::allocate(handler), 0 }; + p.p = new (p.v) op(buffers, handler, io_ex); + + ASIO_HANDLER_CREATION((scheduler_.context(), + *p.p, "socket", &impl, 0, "async_receive")); + + start_receive_op(impl, + buffer_sequence_adapter::first(buffers), + flags, p.p, is_continuation); + p.v = p.p = 0; + } + + // Wait until data can be received without blocking. + template + void async_receive(base_implementation_type&, const null_buffers&, + socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) + { + asio::error_code ec = asio::error::operation_not_supported; + const std::size_t bytes_transferred = 0; + asio::post(io_ex, + detail::bind_handler(handler, ec, bytes_transferred)); + } + +protected: + // Helper function to obtain endpoints associated with the connection. + ASIO_DECL std::size_t do_get_endpoint( + const base_implementation_type& impl, bool local, + void* addr, std::size_t addr_len, asio::error_code& ec) const; + + // Helper function to set a socket option. + ASIO_DECL asio::error_code do_set_option( + base_implementation_type& impl, + int level, int optname, const void* optval, + std::size_t optlen, asio::error_code& ec); + + // Helper function to get a socket option. + ASIO_DECL void do_get_option( + const base_implementation_type& impl, + int level, int optname, void* optval, + std::size_t* optlen, asio::error_code& ec) const; + + // Helper function to perform a synchronous connect. + ASIO_DECL asio::error_code do_connect( + base_implementation_type& impl, + const void* addr, asio::error_code& ec); + + // Helper function to start an asynchronous connect. + ASIO_DECL void start_connect_op( + base_implementation_type& impl, const void* addr, + winrt_async_op* op, bool is_continuation); + + // Helper function to perform a synchronous send. + ASIO_DECL std::size_t do_send( + base_implementation_type& impl, const asio::const_buffer& data, + socket_base::message_flags flags, asio::error_code& ec); + + // Helper function to start an asynchronous send. + ASIO_DECL void start_send_op(base_implementation_type& impl, + const asio::const_buffer& data, socket_base::message_flags flags, + winrt_async_op* op, bool is_continuation); + + // Helper function to perform a synchronous receive. + ASIO_DECL std::size_t do_receive( + base_implementation_type& impl, const asio::mutable_buffer& data, + socket_base::message_flags flags, asio::error_code& ec); + + // Helper function to start an asynchronous receive. + ASIO_DECL void start_receive_op(base_implementation_type& impl, + const asio::mutable_buffer& data, socket_base::message_flags flags, + winrt_async_op* op, + bool is_continuation); + + // The scheduler implementation used for delivering completions. +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + scheduler_impl& scheduler_; + + // The manager that keeps track of outstanding operations. + winrt_async_manager& async_manager_; + + // Mutex to protect access to the linked list of implementations. + asio::detail::mutex mutex_; + + // The head of a linked list of all implementations. + base_implementation_type* impl_list_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/winrt_ssocket_service_base.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP diff --git a/include/asio/include/asio/detail/winrt_timer_scheduler.hpp b/include/asio/include/asio/detail/winrt_timer_scheduler.hpp new file mode 100644 index 0000000..f27ed36 --- /dev/null +++ b/include/asio/include/asio/detail/winrt_timer_scheduler.hpp @@ -0,0 +1,147 @@ +// +// detail/winrt_timer_scheduler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_TIMER_SCHEDULER_HPP +#define ASIO_DETAIL_WINRT_TIMER_SCHEDULER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include +#include "asio/detail/event.hpp" +#include "asio/detail/limits.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/op_queue.hpp" +#include "asio/detail/thread.hpp" +#include "asio/detail/timer_queue_base.hpp" +#include "asio/detail/timer_queue_set.hpp" +#include "asio/detail/wait_op.hpp" +#include "asio/execution_context.hpp" + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_io_context.hpp" +#else // defined(ASIO_HAS_IOCP) +# include "asio/detail/scheduler.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#if defined(ASIO_HAS_IOCP) +# include "asio/detail/thread.hpp" +#endif // defined(ASIO_HAS_IOCP) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class winrt_timer_scheduler + : public execution_context_service_base +{ +public: + // Constructor. + ASIO_DECL winrt_timer_scheduler(execution_context& context); + + // Destructor. + ASIO_DECL ~winrt_timer_scheduler(); + + // Destroy all user-defined handler objects owned by the service. + ASIO_DECL void shutdown(); + + // Recreate internal descriptors following a fork. + ASIO_DECL void notify_fork(execution_context::fork_event fork_ev); + + // Initialise the task. No effect as this class uses its own thread. + ASIO_DECL void init_task(); + + // Add a new timer queue to the reactor. + template + void add_timer_queue(timer_queue& queue); + + // Remove a timer queue from the reactor. + template + void remove_timer_queue(timer_queue& queue); + + // Schedule a new operation in the given timer queue to expire at the + // specified absolute time. + template + void schedule_timer(timer_queue& queue, + const typename Time_Traits::time_type& time, + typename timer_queue::per_timer_data& timer, wait_op* op); + + // Cancel the timer operations associated with the given token. Returns the + // number of operations that have been posted or dispatched. + template + std::size_t cancel_timer(timer_queue& queue, + typename timer_queue::per_timer_data& timer, + std::size_t max_cancelled = (std::numeric_limits::max)()); + + // Move the timer operations associated with the given timer. + template + void move_timer(timer_queue& queue, + typename timer_queue::per_timer_data& to, + typename timer_queue::per_timer_data& from); + +private: + // Run the select loop in the thread. + ASIO_DECL void run_thread(); + + // Entry point for the select loop thread. + ASIO_DECL static void call_run_thread(winrt_timer_scheduler* reactor); + + // Helper function to add a new timer queue. + ASIO_DECL void do_add_timer_queue(timer_queue_base& queue); + + // Helper function to remove a timer queue. + ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue); + + // The scheduler implementation used to post completions. +#if defined(ASIO_HAS_IOCP) + typedef class win_iocp_io_context scheduler_impl; +#else + typedef class scheduler scheduler_impl; +#endif + scheduler_impl& scheduler_; + + // Mutex used to protect internal variables. + asio::detail::mutex mutex_; + + // Event used to wake up background thread. + asio::detail::event event_; + + // The timer queues. + timer_queue_set timer_queues_; + + // The background thread that is waiting for timers to expire. + asio::detail::thread* thread_; + + // Does the background thread need to stop. + bool stop_thread_; + + // Whether the service has been shut down. + bool shutdown_; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/detail/impl/winrt_timer_scheduler.hpp" +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/winrt_timer_scheduler.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_TIMER_SCHEDULER_HPP diff --git a/include/asio/include/asio/detail/winrt_utils.hpp b/include/asio/include/asio/detail/winrt_utils.hpp new file mode 100644 index 0000000..04b3e6f --- /dev/null +++ b/include/asio/include/asio/detail/winrt_utils.hpp @@ -0,0 +1,106 @@ +// +// detail/winrt_utils.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINRT_UTILS_HPP +#define ASIO_DETAIL_WINRT_UTILS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS_RUNTIME) + +#include +#include +#include +#include +#include +#include +#include +#include "asio/buffer.hpp" +#include "asio/error_code.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/socket_ops.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { +namespace winrt_utils { + +inline Platform::String^ string(const char* from) +{ + std::wstring tmp(from, from + std::strlen(from)); + return ref new Platform::String(tmp.c_str()); +} + +inline Platform::String^ string(const std::string& from) +{ + std::wstring tmp(from.begin(), from.end()); + return ref new Platform::String(tmp.c_str()); +} + +inline std::string string(Platform::String^ from) +{ + std::wstring_convert> converter; + return converter.to_bytes(from->Data()); +} + +inline Platform::String^ string(unsigned short from) +{ + return string(std::to_string(from)); +} + +template +inline Platform::String^ string(const T& from) +{ + return string(from.to_string()); +} + +inline int integer(Platform::String^ from) +{ + return _wtoi(from->Data()); +} + +template +inline Windows::Networking::HostName^ host_name(const T& from) +{ + return ref new Windows::Networking::HostName((string)(from)); +} + +template +inline Windows::Storage::Streams::IBuffer^ buffer_dup( + const ConstBufferSequence& buffers) +{ + using Microsoft::WRL::ComPtr; + using asio::buffer_size; + std::size_t size = buffer_size(buffers); + auto b = ref new Windows::Storage::Streams::Buffer(size); + ComPtr insp = reinterpret_cast(b); + ComPtr bacc; + insp.As(&bacc); + byte* bytes = nullptr; + bacc->Buffer(&bytes); + asio::buffer_copy(asio::buffer(bytes, size), buffers); + b->Length = size; + return b; +} + +} // namespace winrt_utils +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_WINDOWS_RUNTIME) + +#endif // ASIO_DETAIL_WINRT_UTILS_HPP diff --git a/include/asio/include/asio/detail/winsock_init.hpp b/include/asio/include/asio/detail/winsock_init.hpp new file mode 100644 index 0000000..cde044f --- /dev/null +++ b/include/asio/include/asio/detail/winsock_init.hpp @@ -0,0 +1,128 @@ +// +// detail/winsock_init.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WINSOCK_INIT_HPP +#define ASIO_DETAIL_WINSOCK_INIT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +class winsock_init_base +{ +protected: + // Structure to track result of initialisation and number of uses. POD is used + // to ensure that the values are zero-initialised prior to any code being run. + struct data + { + long init_count_; + long result_; + }; + + ASIO_DECL static void startup(data& d, + unsigned char major, unsigned char minor); + + ASIO_DECL static void manual_startup(data& d); + + ASIO_DECL static void cleanup(data& d); + + ASIO_DECL static void manual_cleanup(data& d); + + ASIO_DECL static void throw_on_error(data& d); +}; + +template +class winsock_init : private winsock_init_base +{ +public: + winsock_init(bool allow_throw = true) + { + startup(data_, Major, Minor); + if (allow_throw) + throw_on_error(data_); + } + + winsock_init(const winsock_init&) + { + startup(data_, Major, Minor); + throw_on_error(data_); + } + + ~winsock_init() + { + cleanup(data_); + } + + // This class may be used to indicate that user code will manage Winsock + // initialisation and cleanup. This may be required in the case of a DLL, for + // example, where it is not safe to initialise Winsock from global object + // constructors. + // + // To prevent asio from initialising Winsock, the object must be constructed + // before any Asio's own global objects. With MSVC, this may be accomplished + // by adding the following code to the DLL: + // + // #pragma warning(push) + // #pragma warning(disable:4073) + // #pragma init_seg(lib) + // asio::detail::winsock_init<>::manual manual_winsock_init; + // #pragma warning(pop) + class manual + { + public: + manual() + { + manual_startup(data_); + } + + manual(const manual&) + { + manual_startup(data_); + } + + ~manual() + { + manual_cleanup(data_); + } + }; + +private: + friend class manual; + static data data_; +}; + +template +winsock_init_base::data winsock_init::data_; + +// Static variable to ensure that winsock is initialised before main, and +// therefore before any other threads can get started. +static const winsock_init<>& winsock_init_instance = winsock_init<>(false); + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/detail/impl/winsock_init.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) + +#endif // ASIO_DETAIL_WINSOCK_INIT_HPP diff --git a/include/asio/include/asio/detail/work_dispatcher.hpp b/include/asio/include/asio/detail/work_dispatcher.hpp new file mode 100644 index 0000000..5b4433d --- /dev/null +++ b/include/asio/include/asio/detail/work_dispatcher.hpp @@ -0,0 +1,148 @@ +// +// detail/work_dispatcher.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WORK_DISPATCHER_HPP +#define ASIO_DETAIL_WORK_DISPATCHER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/associated_executor.hpp" +#include "asio/associated_allocator.hpp" +#include "asio/executor_work_guard.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/allocator.hpp" +#include "asio/execution/blocking.hpp" +#include "asio/execution/outstanding_work.hpp" +#include "asio/prefer.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct is_work_dispatcher_required : true_type +{ +}; + +template +struct is_work_dispatcher_required::asio_associated_executor_is_unspecialised, + void + >::value + >::type> : false_type +{ +}; + +template +class work_dispatcher +{ +public: + template + work_dispatcher(ASIO_MOVE_ARG(CompletionHandler) handler, + const Executor& handler_ex) + : handler_(ASIO_MOVE_CAST(CompletionHandler)(handler)), + executor_(asio::prefer(handler_ex, + execution::outstanding_work.tracked)) + { + } + +#if defined(ASIO_HAS_MOVE) + work_dispatcher(const work_dispatcher& other) + : handler_(other.handler_), + executor_(other.executor_) + { + } + + work_dispatcher(work_dispatcher&& other) + : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)), + executor_(ASIO_MOVE_CAST(work_executor_type)(other.executor_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + execution::execute( + asio::prefer(executor_, + execution::blocking.possibly, + execution::allocator((get_associated_allocator)(handler_))), + ASIO_MOVE_CAST(Handler)(handler_)); + } + +private: + typedef typename decay< + typename prefer_result::type + >::type work_executor_type; + + Handler handler_; + work_executor_type executor_; +}; + +#if !defined(ASIO_NO_TS_EXECUTORS) + +template +class work_dispatcher::value>::type> +{ +public: + template + work_dispatcher(ASIO_MOVE_ARG(CompletionHandler) handler, + const Executor& handler_ex) + : work_(handler_ex), + handler_(ASIO_MOVE_CAST(CompletionHandler)(handler)) + { + } + +#if defined(ASIO_HAS_MOVE) + work_dispatcher(const work_dispatcher& other) + : work_(other.work_), + handler_(other.handler_) + { + } + + work_dispatcher(work_dispatcher&& other) + : work_(ASIO_MOVE_CAST(executor_work_guard)(other.work_)), + handler_(ASIO_MOVE_CAST(Handler)(other.handler_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + typename associated_allocator::type alloc( + (get_associated_allocator)(handler_)); + work_.get_executor().dispatch( + ASIO_MOVE_CAST(Handler)(handler_), alloc); + work_.reset(); + } + +private: + executor_work_guard work_; + Handler handler_; +}; + +#endif // !defined(ASIO_NO_TS_EXECUTORS) + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_WORK_DISPATCHER_HPP diff --git a/include/asio/include/asio/detail/wrapped_handler.hpp b/include/asio/include/asio/detail/wrapped_handler.hpp new file mode 100644 index 0000000..b1aed8b --- /dev/null +++ b/include/asio/include/asio/detail/wrapped_handler.hpp @@ -0,0 +1,327 @@ +// +// detail/wrapped_handler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DETAIL_WRAPPED_HANDLER_HPP +#define ASIO_DETAIL_WRAPPED_HANDLER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/bind_handler.hpp" +#include "asio/detail/handler_alloc_helpers.hpp" +#include "asio/detail/handler_cont_helpers.hpp" +#include "asio/detail/handler_invoke_helpers.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +struct is_continuation_delegated +{ + template + bool operator()(Dispatcher&, Handler& handler) const + { + return asio_handler_cont_helpers::is_continuation(handler); + } +}; + +struct is_continuation_if_running +{ + template + bool operator()(Dispatcher& dispatcher, Handler&) const + { + return dispatcher.running_in_this_thread(); + } +}; + +template +class wrapped_handler +{ +public: + typedef void result_type; + + wrapped_handler(Dispatcher dispatcher, Handler& handler) + : dispatcher_(dispatcher), + handler_(ASIO_MOVE_CAST(Handler)(handler)) + { + } + +#if defined(ASIO_HAS_MOVE) + wrapped_handler(const wrapped_handler& other) + : dispatcher_(other.dispatcher_), + handler_(other.handler_) + { + } + + wrapped_handler(wrapped_handler&& other) + : dispatcher_(other.dispatcher_), + handler_(ASIO_MOVE_CAST(Handler)(other.handler_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + dispatcher_.dispatch(ASIO_MOVE_CAST(Handler)(handler_)); + } + + void operator()() const + { + dispatcher_.dispatch(handler_); + } + + template + void operator()(const Arg1& arg1) + { + dispatcher_.dispatch(detail::bind_handler(handler_, arg1)); + } + + template + void operator()(const Arg1& arg1) const + { + dispatcher_.dispatch(detail::bind_handler(handler_, arg1)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2) + { + dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2) const + { + dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) + { + dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2, arg3)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) const + { + dispatcher_.dispatch(detail::bind_handler(handler_, arg1, arg2, arg3)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, + const Arg4& arg4) + { + dispatcher_.dispatch( + detail::bind_handler(handler_, arg1, arg2, arg3, arg4)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, + const Arg4& arg4) const + { + dispatcher_.dispatch( + detail::bind_handler(handler_, arg1, arg2, arg3, arg4)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, + const Arg4& arg4, const Arg5& arg5) + { + dispatcher_.dispatch( + detail::bind_handler(handler_, arg1, arg2, arg3, arg4, arg5)); + } + + template + void operator()(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, + const Arg4& arg4, const Arg5& arg5) const + { + dispatcher_.dispatch( + detail::bind_handler(handler_, arg1, arg2, arg3, arg4, arg5)); + } + +//private: + Dispatcher dispatcher_; + Handler handler_; +}; + +template +class rewrapped_handler +{ +public: + explicit rewrapped_handler(Handler& handler, const Context& context) + : context_(context), + handler_(ASIO_MOVE_CAST(Handler)(handler)) + { + } + + explicit rewrapped_handler(const Handler& handler, const Context& context) + : context_(context), + handler_(handler) + { + } + +#if defined(ASIO_HAS_MOVE) + rewrapped_handler(const rewrapped_handler& other) + : context_(other.context_), + handler_(other.handler_) + { + } + + rewrapped_handler(rewrapped_handler&& other) + : context_(ASIO_MOVE_CAST(Context)(other.context_)), + handler_(ASIO_MOVE_CAST(Handler)(other.handler_)) + { + } +#endif // defined(ASIO_HAS_MOVE) + + void operator()() + { + handler_(); + } + + void operator()() const + { + handler_(); + } + +//private: + Context context_; + Handler handler_; +}; + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + wrapped_handler* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + wrapped_handler* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + wrapped_handler* this_handler) +{ + return IsContinuation()(this_handler->dispatcher_, this_handler->handler_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, + wrapped_handler* this_handler) +{ + this_handler->dispatcher_.dispatch( + rewrapped_handler( + function, this_handler->handler_)); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, + wrapped_handler* this_handler) +{ + this_handler->dispatcher_.dispatch( + rewrapped_handler( + function, this_handler->handler_)); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, + rewrapped_handler* this_handler) +{ +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) + return asio_handler_alloc_helpers::allocate( + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, + rewrapped_handler* this_handler) +{ + asio_handler_alloc_helpers::deallocate( + pointer, size, this_handler->context_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline bool asio_handler_is_continuation( + rewrapped_handler* this_handler) +{ + return asio_handler_cont_helpers::is_continuation( + this_handler->context_); +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, + rewrapped_handler* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->context_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +template +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, + rewrapped_handler* this_handler) +{ + asio_handler_invoke_helpers::invoke( + function, this_handler->context_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) +} + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_DETAIL_WRAPPED_HANDLER_HPP diff --git a/include/asio/include/asio/dispatch.hpp b/include/asio/include/asio/dispatch.hpp new file mode 100644 index 0000000..2e5d197 --- /dev/null +++ b/include/asio/include/asio/dispatch.hpp @@ -0,0 +1,121 @@ +// +// dispatch.hpp +// ~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_DISPATCH_HPP +#define ASIO_DISPATCH_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/async_result.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution_context.hpp" +#include "asio/execution/executor.hpp" +#include "asio/is_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Submits a completion token or function object for execution. +/** + * This function submits an object for execution using the object's associated + * executor. The function object may be called from the current thread prior to + * returning from dispatch(). Otherwise, it is queued for execution. + * + * This function has the following effects: + * + * @li Constructs a function object handler of type @c Handler, initialized + * with handler(forward(token)). + * + * @li Constructs an object @c result of type async_result, + * initializing the object as result(handler). + * + * @li Obtains the handler's associated executor object @c ex by performing + * get_associated_executor(handler). + * + * @li Obtains the handler's associated allocator object @c alloc by performing + * get_associated_allocator(handler). + * + * @li Performs ex.dispatch(std::move(handler), alloc). + * + * @li Returns result.get(). + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch( + ASIO_MOVE_ARG(CompletionToken) token); + +/// Submits a completion token or function object for execution. +/** + * This function submits an object for execution using the specified executor. + * The function object may be called from the current thread prior to returning + * from dispatch(). Otherwise, it is queued for execution. + * + * This function has the following effects: + * + * @li Constructs a function object handler of type @c Handler, initialized + * with handler(forward(token)). + * + * @li Constructs an object @c result of type async_result, + * initializing the object as result(handler). + * + * @li Obtains the handler's associated executor object @c ex1 by performing + * get_associated_executor(handler). + * + * @li Creates a work object @c w by performing make_work(ex1). + * + * @li Obtains the handler's associated allocator object @c alloc by performing + * get_associated_allocator(handler). + * + * @li Constructs a function object @c f with a function call operator that + * performs ex1.dispatch(std::move(handler), alloc) followed by + * w.reset(). + * + * @li Performs Executor(ex).dispatch(std::move(f), alloc). + * + * @li Returns result.get(). + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch( + const Executor& ex, + ASIO_MOVE_ARG(CompletionToken) token + ASIO_DEFAULT_COMPLETION_TOKEN(Executor), + typename enable_if< + execution::is_executor::value || is_executor::value + >::type* = 0); + +/// Submits a completion token or function object for execution. +/** + * @returns dispatch(ctx.get_executor(), + * forward(token)). + */ +template +ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch( + ExecutionContext& ctx, + ASIO_MOVE_ARG(CompletionToken) token + ASIO_DEFAULT_COMPLETION_TOKEN( + typename ExecutionContext::executor_type), + typename enable_if::value>::type* = 0); + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#include "asio/impl/dispatch.hpp" + +#endif // ASIO_DISPATCH_HPP diff --git a/include/asio/include/asio/error.hpp b/include/asio/include/asio/error.hpp new file mode 100644 index 0000000..c685d4a --- /dev/null +++ b/include/asio/include/asio/error.hpp @@ -0,0 +1,356 @@ +// +// error.hpp +// ~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ERROR_HPP +#define ASIO_ERROR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/error_code.hpp" +#include "asio/system_error.hpp" +#if defined(ASIO_WINDOWS) \ + || defined(__CYGWIN__) \ + || defined(ASIO_WINDOWS_RUNTIME) +# include +#else +# include +# include +#endif + +#if defined(GENERATING_DOCUMENTATION) +/// INTERNAL ONLY. +# define ASIO_NATIVE_ERROR(e) implementation_defined +/// INTERNAL ONLY. +# define ASIO_SOCKET_ERROR(e) implementation_defined +/// INTERNAL ONLY. +# define ASIO_NETDB_ERROR(e) implementation_defined +/// INTERNAL ONLY. +# define ASIO_GETADDRINFO_ERROR(e) implementation_defined +/// INTERNAL ONLY. +# define ASIO_WIN_OR_POSIX(e_win, e_posix) implementation_defined +#elif defined(ASIO_WINDOWS_RUNTIME) +# define ASIO_NATIVE_ERROR(e) __HRESULT_FROM_WIN32(e) +# define ASIO_SOCKET_ERROR(e) __HRESULT_FROM_WIN32(WSA ## e) +# define ASIO_NETDB_ERROR(e) __HRESULT_FROM_WIN32(WSA ## e) +# define ASIO_GETADDRINFO_ERROR(e) __HRESULT_FROM_WIN32(WSA ## e) +# define ASIO_WIN_OR_POSIX(e_win, e_posix) e_win +#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__) +# define ASIO_NATIVE_ERROR(e) e +# define ASIO_SOCKET_ERROR(e) WSA ## e +# define ASIO_NETDB_ERROR(e) WSA ## e +# define ASIO_GETADDRINFO_ERROR(e) WSA ## e +# define ASIO_WIN_OR_POSIX(e_win, e_posix) e_win +#else +# define ASIO_NATIVE_ERROR(e) e +# define ASIO_SOCKET_ERROR(e) e +# define ASIO_NETDB_ERROR(e) e +# define ASIO_GETADDRINFO_ERROR(e) e +# define ASIO_WIN_OR_POSIX(e_win, e_posix) e_posix +#endif + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace error { + +enum basic_errors +{ + /// Permission denied. + access_denied = ASIO_SOCKET_ERROR(EACCES), + + /// Address family not supported by protocol. + address_family_not_supported = ASIO_SOCKET_ERROR(EAFNOSUPPORT), + + /// Address already in use. + address_in_use = ASIO_SOCKET_ERROR(EADDRINUSE), + + /// Transport endpoint is already connected. + already_connected = ASIO_SOCKET_ERROR(EISCONN), + + /// Operation already in progress. + already_started = ASIO_SOCKET_ERROR(EALREADY), + + /// Broken pipe. + broken_pipe = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(ERROR_BROKEN_PIPE), + ASIO_NATIVE_ERROR(EPIPE)), + + /// A connection has been aborted. + connection_aborted = ASIO_SOCKET_ERROR(ECONNABORTED), + + /// Connection refused. + connection_refused = ASIO_SOCKET_ERROR(ECONNREFUSED), + + /// Connection reset by peer. + connection_reset = ASIO_SOCKET_ERROR(ECONNRESET), + + /// Bad file descriptor. + bad_descriptor = ASIO_SOCKET_ERROR(EBADF), + + /// Bad address. + fault = ASIO_SOCKET_ERROR(EFAULT), + + /// No route to host. + host_unreachable = ASIO_SOCKET_ERROR(EHOSTUNREACH), + + /// Operation now in progress. + in_progress = ASIO_SOCKET_ERROR(EINPROGRESS), + + /// Interrupted system call. + interrupted = ASIO_SOCKET_ERROR(EINTR), + + /// Invalid argument. + invalid_argument = ASIO_SOCKET_ERROR(EINVAL), + + /// Message too long. + message_size = ASIO_SOCKET_ERROR(EMSGSIZE), + + /// The name was too long. + name_too_long = ASIO_SOCKET_ERROR(ENAMETOOLONG), + + /// Network is down. + network_down = ASIO_SOCKET_ERROR(ENETDOWN), + + /// Network dropped connection on reset. + network_reset = ASIO_SOCKET_ERROR(ENETRESET), + + /// Network is unreachable. + network_unreachable = ASIO_SOCKET_ERROR(ENETUNREACH), + + /// Too many open files. + no_descriptors = ASIO_SOCKET_ERROR(EMFILE), + + /// No buffer space available. + no_buffer_space = ASIO_SOCKET_ERROR(ENOBUFS), + + /// Cannot allocate memory. + no_memory = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(ERROR_OUTOFMEMORY), + ASIO_NATIVE_ERROR(ENOMEM)), + + /// Operation not permitted. + no_permission = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(ERROR_ACCESS_DENIED), + ASIO_NATIVE_ERROR(EPERM)), + + /// Protocol not available. + no_protocol_option = ASIO_SOCKET_ERROR(ENOPROTOOPT), + + /// No such device. + no_such_device = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(ERROR_BAD_UNIT), + ASIO_NATIVE_ERROR(ENODEV)), + + /// Transport endpoint is not connected. + not_connected = ASIO_SOCKET_ERROR(ENOTCONN), + + /// Socket operation on non-socket. + not_socket = ASIO_SOCKET_ERROR(ENOTSOCK), + + /// Operation cancelled. + operation_aborted = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(ERROR_OPERATION_ABORTED), + ASIO_NATIVE_ERROR(ECANCELED)), + + /// Operation not supported. + operation_not_supported = ASIO_SOCKET_ERROR(EOPNOTSUPP), + + /// Cannot send after transport endpoint shutdown. + shut_down = ASIO_SOCKET_ERROR(ESHUTDOWN), + + /// Connection timed out. + timed_out = ASIO_SOCKET_ERROR(ETIMEDOUT), + + /// Resource temporarily unavailable. + try_again = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(ERROR_RETRY), + ASIO_NATIVE_ERROR(EAGAIN)), + + /// The socket is marked non-blocking and the requested operation would block. + would_block = ASIO_SOCKET_ERROR(EWOULDBLOCK) +}; + +enum netdb_errors +{ + /// Host not found (authoritative). + host_not_found = ASIO_NETDB_ERROR(HOST_NOT_FOUND), + + /// Host not found (non-authoritative). + host_not_found_try_again = ASIO_NETDB_ERROR(TRY_AGAIN), + + /// The query is valid but does not have associated address data. + no_data = ASIO_NETDB_ERROR(NO_DATA), + + /// A non-recoverable error occurred. + no_recovery = ASIO_NETDB_ERROR(NO_RECOVERY) +}; + +enum addrinfo_errors +{ + /// The service is not supported for the given socket type. + service_not_found = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(WSATYPE_NOT_FOUND), + ASIO_GETADDRINFO_ERROR(EAI_SERVICE)), + + /// The socket type is not supported. + socket_type_not_supported = ASIO_WIN_OR_POSIX( + ASIO_NATIVE_ERROR(WSAESOCKTNOSUPPORT), + ASIO_GETADDRINFO_ERROR(EAI_SOCKTYPE)) +}; + +enum misc_errors +{ + /// Already open. + already_open = 1, + + /// End of file or stream. + eof, + + /// Element not found. + not_found, + + /// The descriptor cannot fit into the select system call's fd_set. + fd_set_failure +}; + +inline const asio::error_category& get_system_category() +{ + return asio::system_category(); +} + +#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +extern ASIO_DECL +const asio::error_category& get_netdb_category(); + +extern ASIO_DECL +const asio::error_category& get_addrinfo_category(); + +#else // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +inline const asio::error_category& get_netdb_category() +{ + return get_system_category(); +} + +inline const asio::error_category& get_addrinfo_category() +{ + return get_system_category(); +} + +#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) + +extern ASIO_DECL +const asio::error_category& get_misc_category(); + +static const asio::error_category& + system_category ASIO_UNUSED_VARIABLE + = asio::error::get_system_category(); +static const asio::error_category& + netdb_category ASIO_UNUSED_VARIABLE + = asio::error::get_netdb_category(); +static const asio::error_category& + addrinfo_category ASIO_UNUSED_VARIABLE + = asio::error::get_addrinfo_category(); +static const asio::error_category& + misc_category ASIO_UNUSED_VARIABLE + = asio::error::get_misc_category(); + +} // namespace error +} // namespace asio + +#if defined(ASIO_HAS_STD_SYSTEM_ERROR) +namespace std { + +template<> struct is_error_code_enum +{ + static const bool value = true; +}; + +template<> struct is_error_code_enum +{ + static const bool value = true; +}; + +template<> struct is_error_code_enum +{ + static const bool value = true; +}; + +template<> struct is_error_code_enum +{ + static const bool value = true; +}; + +} // namespace std +#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) + +namespace asio { +namespace error { + +inline asio::error_code make_error_code(basic_errors e) +{ + return asio::error_code( + static_cast(e), get_system_category()); +} + +inline asio::error_code make_error_code(netdb_errors e) +{ + return asio::error_code( + static_cast(e), get_netdb_category()); +} + +inline asio::error_code make_error_code(addrinfo_errors e) +{ + return asio::error_code( + static_cast(e), get_addrinfo_category()); +} + +inline asio::error_code make_error_code(misc_errors e) +{ + return asio::error_code( + static_cast(e), get_misc_category()); +} + +} // namespace error +namespace stream_errc { + // Simulates the proposed stream_errc scoped enum. + using error::eof; + using error::not_found; +} // namespace stream_errc +namespace socket_errc { + // Simulates the proposed socket_errc scoped enum. + using error::already_open; + using error::not_found; +} // namespace socket_errc +namespace resolver_errc { + // Simulates the proposed resolver_errc scoped enum. + using error::host_not_found; + const error::netdb_errors try_again = error::host_not_found_try_again; + using error::service_not_found; +} // namespace resolver_errc +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#undef ASIO_NATIVE_ERROR +#undef ASIO_SOCKET_ERROR +#undef ASIO_NETDB_ERROR +#undef ASIO_GETADDRINFO_ERROR +#undef ASIO_WIN_OR_POSIX + +#if defined(ASIO_HEADER_ONLY) +# include "asio/impl/error.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_ERROR_HPP diff --git a/include/asio/include/asio/error_code.hpp b/include/asio/include/asio/error_code.hpp new file mode 100644 index 0000000..2ff6814 --- /dev/null +++ b/include/asio/include/asio/error_code.hpp @@ -0,0 +1,202 @@ +// +// error_code.hpp +// ~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ERROR_CODE_HPP +#define ASIO_ERROR_CODE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_STD_SYSTEM_ERROR) +# include +#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) +# include +# include "asio/detail/noncopyable.hpp" +# if !defined(ASIO_NO_IOSTREAM) +# include +# endif // !defined(ASIO_NO_IOSTREAM) +#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(ASIO_HAS_STD_SYSTEM_ERROR) + +typedef std::error_category error_category; + +#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) + +/// Base class for all error categories. +class error_category : private noncopyable +{ +public: + /// Destructor. + virtual ~error_category() + { + } + + /// Returns a string naming the error gategory. + virtual const char* name() const = 0; + + /// Returns a string describing the error denoted by @c value. + virtual std::string message(int value) const = 0; + + /// Equality operator to compare two error categories. + bool operator==(const error_category& rhs) const + { + return this == &rhs; + } + + /// Inequality operator to compare two error categories. + bool operator!=(const error_category& rhs) const + { + return !(*this == rhs); + } +}; + +#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) + +/// Returns the error category used for the system errors produced by asio. +extern ASIO_DECL const error_category& system_category(); + +#if defined(ASIO_HAS_STD_SYSTEM_ERROR) + +typedef std::error_code error_code; + +#else // defined(ASIO_HAS_STD_SYSTEM_ERROR) + +/// Class to represent an error code value. +class error_code +{ +public: + /// Default constructor. + error_code() + : value_(0), + category_(&system_category()) + { + } + + /// Construct with specific error code and category. + error_code(int v, const error_category& c) + : value_(v), + category_(&c) + { + } + + /// Construct from an error code enum. + template + error_code(ErrorEnum e) + { + *this = make_error_code(e); + } + + /// Clear the error value to the default. + void clear() + { + value_ = 0; + category_ = &system_category(); + } + + /// Assign a new error value. + void assign(int v, const error_category& c) + { + value_ = v; + category_ = &c; + } + + /// Get the error value. + int value() const + { + return value_; + } + + /// Get the error category. + const error_category& category() const + { + return *category_; + } + + /// Get the message associated with the error. + std::string message() const + { + return category_->message(value_); + } + + struct unspecified_bool_type_t + { + }; + + typedef void (*unspecified_bool_type)(unspecified_bool_type_t); + + static void unspecified_bool_true(unspecified_bool_type_t) {} + + /// Operator returns non-null if there is a non-success error code. + operator unspecified_bool_type() const + { + if (value_ == 0) + return 0; + else + return &error_code::unspecified_bool_true; + } + + /// Operator to test if the error represents success. + bool operator!() const + { + return value_ == 0; + } + + /// Equality operator to compare two error objects. + friend bool operator==(const error_code& e1, const error_code& e2) + { + return e1.value_ == e2.value_ && e1.category_ == e2.category_; + } + + /// Inequality operator to compare two error objects. + friend bool operator!=(const error_code& e1, const error_code& e2) + { + return e1.value_ != e2.value_ || e1.category_ != e2.category_; + } + +private: + // The value associated with the error code. + int value_; + + // The category associated with the error code. + const error_category* category_; +}; + +# if !defined(ASIO_NO_IOSTREAM) + +/// Output an error code. +template +std::basic_ostream& operator<<( + std::basic_ostream& os, const error_code& ec) +{ + os << ec.category().name() << ':' << ec.value(); + return os; +} + +# endif // !defined(ASIO_NO_IOSTREAM) + +#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/impl/error_code.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_ERROR_CODE_HPP diff --git a/include/asio/include/asio/execution.hpp b/include/asio/include/asio/execution.hpp new file mode 100644 index 0000000..828b46b --- /dev/null +++ b/include/asio/include/asio/execution.hpp @@ -0,0 +1,48 @@ +// +// execution.hpp +// ~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_HPP +#define ASIO_EXECUTION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/execution/allocator.hpp" +#include "asio/execution/any_executor.hpp" +#include "asio/execution/bad_executor.hpp" +#include "asio/execution/blocking.hpp" +#include "asio/execution/blocking_adaptation.hpp" +#include "asio/execution/bulk_execute.hpp" +#include "asio/execution/bulk_guarantee.hpp" +#include "asio/execution/connect.hpp" +#include "asio/execution/context.hpp" +#include "asio/execution/context_as.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/invocable_archetype.hpp" +#include "asio/execution/mapping.hpp" +#include "asio/execution/occupancy.hpp" +#include "asio/execution/operation_state.hpp" +#include "asio/execution/outstanding_work.hpp" +#include "asio/execution/prefer_only.hpp" +#include "asio/execution/receiver.hpp" +#include "asio/execution/receiver_invocation_error.hpp" +#include "asio/execution/relationship.hpp" +#include "asio/execution/schedule.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/execution/set_done.hpp" +#include "asio/execution/set_error.hpp" +#include "asio/execution/set_value.hpp" +#include "asio/execution/start.hpp" +#include "asio/execution/submit.hpp" + +#endif // ASIO_EXECUTION_HPP diff --git a/include/asio/include/asio/execution/allocator.hpp b/include/asio/include/asio/execution/allocator.hpp new file mode 100644 index 0000000..e9f3344 --- /dev/null +++ b/include/asio/include/asio/execution/allocator.hpp @@ -0,0 +1,249 @@ +// +// execution/allocator.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_ALLOCATOR_HPP +#define ASIO_EXECUTION_ALLOCATOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property to describe which allocator an executor will use to allocate the +/// memory required to store a submitted function object. +template +struct allocator_t +{ + /// The allocator_t property applies to executors, senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The allocator_t property can be required. + static constexpr bool is_requirable = true; + + /// The allocator_t property can be preferred. + static constexpr bool is_preferable = true; + + /// Default constructor. + constexpr allocator_t(); + + /// Obtain the allocator stored in the allocator_t property object. + /** + * Present only if @c ProtoAllocator is non-void. + */ + constexpr ProtoAllocator value() const; + + /// Create an allocator_t object with a different allocator. + /** + * Present only if @c ProtoAllocator is void. + */ + template + allocator_t allocator; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { + +template +struct allocator_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = allocator_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + ASIO_CONSTEXPR ProtoAllocator value() const + { + return a_; + } + +private: + friend struct allocator_t; + + explicit ASIO_CONSTEXPR allocator_t(const ProtoAllocator& a) + : a_(a) + { + } + + ProtoAllocator a_; +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T allocator_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template <> +struct allocator_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + + ASIO_CONSTEXPR allocator_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = allocator_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + template + ASIO_CONSTEXPR allocator_t operator()( + const OtherProtoAllocator& a) const + { + return allocator_t(a); + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template +const T allocator_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr allocator_t allocator; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +template +struct allocator_instance +{ + static allocator_t instance; +}; + +template +allocator_t allocator_instance::instance; + +namespace { +static const allocator_t& allocator = allocator_instance::instance; +} // namespace +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property > + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query, + typename enable_if< + traits::query_static_constexpr_member >::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member >::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member >::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_ALLOCATOR_HPP diff --git a/include/asio/include/asio/execution/any_executor.hpp b/include/asio/include/asio/execution/any_executor.hpp new file mode 100644 index 0000000..ce8a4c0 --- /dev/null +++ b/include/asio/include/asio/execution/any_executor.hpp @@ -0,0 +1,2264 @@ +// +// execution/any_executor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_ANY_EXECUTOR_HPP +#define ASIO_EXECUTION_ANY_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include +#include "asio/detail/assert.hpp" +#include "asio/detail/cstddef.hpp" +#include "asio/detail/executor_function.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/non_const_lvalue.hpp" +#include "asio/detail/scoped_ptr.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/detail/throw_exception.hpp" +#include "asio/detail/variadic_templates.hpp" +#include "asio/execution/bad_executor.hpp" +#include "asio/execution/blocking.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/executor.hpp" +#include "asio/prefer.hpp" +#include "asio/query.hpp" +#include "asio/require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// Polymorphic executor wrapper. +template +class any_executor +{ +public: + /// Default constructor. + any_executor() noexcept; + + /// Construct in an empty state. Equivalent effects to default constructor. + any_executor(nullptr_t) noexcept; + + /// Copy constructor. + any_executor(const any_executor& e) noexcept; + + /// Move constructor. + any_executor(any_executor&& e) noexcept; + + /// Construct to point to the same target as another any_executor. + template + any_executor(any_executor e); + + /// Construct a polymorphic wrapper for the specified executor. + template + any_executor(Executor e); + + /// Assignment operator. + any_executor& operator=(const any_executor& e) noexcept; + + /// Move assignment operator. + any_executor& operator=(any_executor&& e) noexcept; + + /// Assignment operator that sets the polymorphic wrapper to the empty state. + any_executor& operator=(nullptr_t); + + /// Assignment operator to create a polymorphic wrapper for the specified + /// executor. + template + any_executor& operator=(Executor e); + + /// Destructor. + ~any_executor(); + + /// Swap targets with another polymorphic wrapper. + void swap(any_executor& other) noexcept; + + /// Obtain a polymorphic wrapper with the specified property. + /** + * Do not call this function directly. It is intended for use with the + * asio::require and asio::prefer customisation points. + * + * For example: + * @code execution::any_executor ex = ...; + * auto ex2 = asio::requre(ex, execution::blocking.possibly); @endcode + */ + template + any_executor require(Property) const; + + /// Obtain a polymorphic wrapper with the specified property. + /** + * Do not call this function directly. It is intended for use with the + * asio::prefer customisation point. + * + * For example: + * @code execution::any_executor ex = ...; + * auto ex2 = asio::prefer(ex, execution::blocking.possibly); @endcode + */ + template + any_executor prefer(Property) const; + + /// Obtain the value associated with the specified property. + /** + * Do not call this function directly. It is intended for use with the + * asio::query customisation point. + * + * For example: + * @code execution::any_executor ex = ...; + * size_t n = asio::query(ex, execution::occupancy); @endcode + */ + template + typename Property::polymorphic_query_result_type query(Property) const; + + /// Execute the function on the target executor. + /** + * Do not call this function directly. It is intended for use with the + * execution::execute customisation point. + * + * For example: + * @code execution::any_executor<> ex = ...; + * execution::execute(ex, my_function_object); @endcode + * + * Throws asio::bad_executor if the polymorphic wrapper has no target. + */ + template + void execute(Function&& f) const; + + /// Obtain the underlying execution context. + /** + * This function is provided for backward compatibility. It is automatically + * defined when the @c SupportableProperties... list includes a property of + * type execution::context_as, for some type U. + */ + automatically_determined context() const; + + /// Determine whether the wrapper has a target executor. + /** + * @returns @c true if the polymorphic wrapper has a target executor, + * otherwise false. + */ + explicit operator bool() const noexcept; + + /// Get the type of the target executor. + const type_info& target_type() const noexcept; + + /// Get a pointer to the target executor. + template Executor* target() noexcept; + + /// Get a pointer to the target executor. + template const Executor* target() const noexcept; +}; + +/// Equality operator. +/** + * @relates any_executor + */ +template +bool operator==(const any_executor& a, + const any_executor& b) noexcept; + +/// Equality operator. +/** + * @relates any_executor + */ +template +bool operator==(const any_executor& a, + nullptr_t) noexcept; + +/// Equality operator. +/** + * @relates any_executor + */ +template +bool operator==(nullptr_t, + const any_executor& b) noexcept; + +/// Inequality operator. +/** + * @relates any_executor + */ +template +bool operator!=(const any_executor& a, + const any_executor& b) noexcept; + +/// Inequality operator. +/** + * @relates any_executor + */ +template +bool operator!=(const any_executor& a, + nullptr_t) noexcept; + +/// Inequality operator. +/** + * @relates any_executor + */ +template +bool operator!=(nullptr_t, + const any_executor& b) noexcept; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { + +#if !defined(ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL) +#define ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +class any_executor; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +class any_executor; + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#endif // !defined(ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL) + +template +struct context_as_t; + +namespace detail { + +// Traits used to detect whether a property is requirable or preferable, taking +// into account that T::is_requirable or T::is_preferable may not not be well +// formed. + +template +struct is_requirable : false_type {}; + +template +struct is_requirable::type> : + true_type {}; + +template +struct is_preferable : false_type {}; + +template +struct is_preferable::type> : + true_type {}; + +// Trait used to detect context_as property, for backward compatibility. + +template +struct is_context_as : false_type {}; + +template +struct is_context_as > : true_type {}; + +// Helper template to: +// - Check if a target can supply the supportable properties. +// - Find the first convertible-from-T property in the list. + +template +struct supportable_properties; + +template +struct supportable_properties +{ + template + struct is_valid_target : integral_constant::value + ? can_require::value + : true + ) + && + ( + is_preferable::value + ? can_prefer::value + : true + ) + && + ( + !is_requirable::value && !is_preferable::value + ? can_query::value + : true + ) + > + { + }; + + struct found + { + ASIO_STATIC_CONSTEXPR(bool, value = true); + typedef Prop type; + typedef typename Prop::polymorphic_query_result_type query_result_type; + ASIO_STATIC_CONSTEXPR(std::size_t, index = I); + }; + + struct not_found + { + ASIO_STATIC_CONSTEXPR(bool, value = false); + }; + + template + struct find_convertible_property : + conditional< + is_same::value || is_convertible::value, + found, + not_found + >::type {}; + + template + struct find_convertible_requirable_property : + conditional< + is_requirable::value + && (is_same::value || is_convertible::value), + found, + not_found + >::type {}; + + template + struct find_convertible_preferable_property : + conditional< + is_preferable::value + && (is_same::value || is_convertible::value), + found, + not_found + >::type {}; + + struct find_context_as_property : + conditional< + is_context_as::value, + found, + not_found + >::type {}; +}; + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct supportable_properties +{ + template + struct is_valid_target : integral_constant::template is_valid_target::value + && + supportable_properties::template is_valid_target::value + ) + > + { + }; + + template + struct find_convertible_property : + conditional< + is_convertible::value, + typename supportable_properties::found, + typename supportable_properties::template find_convertible_property + >::type {}; + + template + struct find_convertible_requirable_property : + conditional< + is_requirable::value + && is_convertible::value, + typename supportable_properties::found, + typename supportable_properties::template find_convertible_requirable_property + >::type {}; + + template + struct find_convertible_preferable_property : + conditional< + is_preferable::value + && is_convertible::value, + typename supportable_properties::found, + typename supportable_properties::template find_convertible_preferable_property + >::type {}; + + struct find_context_as_property : + conditional< + is_context_as::value, + typename supportable_properties::found, + typename supportable_properties::find_context_as_property + >::type {}; +}; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#define ASIO_PRIVATE_ANY_EXECUTOR_PROPS_BASE_DEF(n) \ + template \ + struct supportable_properties \ + { \ + template \ + struct is_valid_target : integral_constant::template is_valid_target::value \ + && \ + supportable_properties::template \ + is_valid_target::value \ + ) \ + > \ + { \ + }; \ + \ + template \ + struct find_convertible_property : \ + conditional< \ + is_convertible::value, \ + typename supportable_properties::found, \ + typename supportable_properties::template \ + find_convertible_property \ + >::type {}; \ + \ + template \ + struct find_convertible_requirable_property : \ + conditional< \ + is_requirable::value \ + && is_convertible::value, \ + typename supportable_properties::found, \ + typename supportable_properties::template \ + find_convertible_requirable_property \ + >::type {}; \ + \ + template \ + struct find_convertible_preferable_property : \ + conditional< \ + is_preferable::value \ + && is_convertible::value, \ + typename supportable_properties::found, \ + typename supportable_properties::template \ + find_convertible_preferable_property \ + >::type {}; \ + \ + struct find_context_as_property : \ + conditional< \ + is_context_as::value, \ + typename supportable_properties::found, \ + typename supportable_properties::find_context_as_property \ + >::type {}; \ + }; \ + /**/ +ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_PROPS_BASE_DEF) +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROPS_BASE_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct is_valid_target_executor : + conditional< + is_executor::value, + typename supportable_properties<0, Props>::template is_valid_target, + false_type + >::type +{ +}; + +class any_executor_base +{ +public: + any_executor_base() ASIO_NOEXCEPT + : object_fns_(object_fns_table()), + target_(0), + target_fns_(target_fns_table()) + { + } + + template + any_executor_base(Executor ex, false_type) + : target_fns_(target_fns_table( + any_executor_base::query_blocking(ex, + can_query()) + == execution::blocking.always)) + { + any_executor_base::construct_object(ex, + integral_constant::value <= alignment_of::value + >()); + } + + template + any_executor_base(Executor other, true_type) + : object_fns_(object_fns_table >()), + target_fns_(other.target_fns_) + { + asio::detail::shared_ptr p = + asio::detail::make_shared( + ASIO_MOVE_CAST(Executor)(other)); + target_ = p->template target(); + new (&object_) asio::detail::shared_ptr( + ASIO_MOVE_CAST(asio::detail::shared_ptr)(p)); + } + + any_executor_base(const any_executor_base& other) ASIO_NOEXCEPT + : object_fns_(other.object_fns_), + target_fns_(other.target_fns_) + { + object_fns_->copy(*this, other); + } + + ~any_executor_base() ASIO_NOEXCEPT + { + object_fns_->destroy(*this); + } + + any_executor_base& operator=( + const any_executor_base& other) ASIO_NOEXCEPT + { + if (this != &other) + { + object_fns_->destroy(*this); + object_fns_ = other.object_fns_; + target_fns_ = other.target_fns_; + object_fns_->copy(*this, other); + } + return *this; + } + + any_executor_base& operator=(nullptr_t) ASIO_NOEXCEPT + { + object_fns_->destroy(*this); + target_ = 0; + object_fns_ = object_fns_table(); + target_fns_ = target_fns_table(); + return *this; + } + +#if defined(ASIO_HAS_MOVE) + + any_executor_base(any_executor_base&& other) ASIO_NOEXCEPT + : object_fns_(other.object_fns_), + target_fns_(other.target_fns_) + { + other.object_fns_ = object_fns_table(); + other.target_fns_ = target_fns_table(); + object_fns_->move(*this, other); + other.target_ = 0; + } + + any_executor_base& operator=( + any_executor_base&& other) ASIO_NOEXCEPT + { + if (this != &other) + { + object_fns_->destroy(*this); + object_fns_ = other.object_fns_; + other.object_fns_ = object_fns_table(); + target_fns_ = other.target_fns_; + other.target_fns_ = target_fns_table(); + object_fns_->move(*this, other); + other.target_ = 0; + } + return *this; + } + +#endif // defined(ASIO_HAS_MOVE) + + void swap(any_executor_base& other) ASIO_NOEXCEPT + { + if (this != &other) + { + any_executor_base tmp(ASIO_MOVE_CAST(any_executor_base)(other)); + other = ASIO_MOVE_CAST(any_executor_base)(*this); + *this = ASIO_MOVE_CAST(any_executor_base)(tmp); + } + } + + template + void execute(ASIO_MOVE_ARG(F) f) const + { + if (target_fns_->blocking_execute != 0) + { + asio::detail::non_const_lvalue f2(f); + target_fns_->blocking_execute(*this, function_view(f2.value)); + } + else + { + target_fns_->execute(*this, + function(ASIO_MOVE_CAST(F)(f), std::allocator())); + } + } + + template + Executor* target() + { + return static_cast(target_); + } + + template + const Executor* target() const + { + return static_cast(target_); + } + + const std::type_info& target_type() const + { + return target_fns_->target_type(); + } + + struct unspecified_bool_type_t {}; + typedef void (*unspecified_bool_type)(unspecified_bool_type_t); + static void unspecified_bool_true(unspecified_bool_type_t) {} + + operator unspecified_bool_type() const ASIO_NOEXCEPT + { + return target_ ? &any_executor_base::unspecified_bool_true : 0; + } + + bool operator!() const ASIO_NOEXCEPT + { + return target_ == 0; + } + +protected: + bool equality_helper(const any_executor_base& other) const ASIO_NOEXCEPT + { + if (target_ == other.target_) + return true; + if (target_ && !other.target_) + return false; + if (!target_ && other.target_) + return false; + if (target_fns_ != other.target_fns_) + return false; + return target_fns_->equal(*this, other); + } + + template + Ex& object() + { + return *static_cast(static_cast(&object_)); + } + + template + const Ex& object() const + { + return *static_cast(static_cast(&object_)); + } + + struct object_fns + { + void (*destroy)(any_executor_base&); + void (*copy)(any_executor_base&, const any_executor_base&); + void (*move)(any_executor_base&, any_executor_base&); + const void* (*target)(const any_executor_base&); + }; + + static void destroy_void(any_executor_base&) + { + } + + static void copy_void(any_executor_base& ex1, const any_executor_base&) + { + ex1.target_ = 0; + } + + static void move_void(any_executor_base& ex1, any_executor_base&) + { + ex1.target_ = 0; + } + + static const void* target_void(const any_executor_base&) + { + return 0; + } + + template + static const object_fns* object_fns_table( + typename enable_if< + is_same::value + >::type* = 0) + { + static const object_fns fns = + { + &any_executor_base::destroy_void, + &any_executor_base::copy_void, + &any_executor_base::move_void, + &any_executor_base::target_void + }; + return &fns; + } + + static void destroy_shared(any_executor_base& ex) + { + typedef asio::detail::shared_ptr type; + ex.object().~type(); + } + + static void copy_shared(any_executor_base& ex1, const any_executor_base& ex2) + { + typedef asio::detail::shared_ptr type; + new (&ex1.object_) type(ex2.object()); + ex1.target_ = ex2.target_; + } + + static void move_shared(any_executor_base& ex1, any_executor_base& ex2) + { + typedef asio::detail::shared_ptr type; + new (&ex1.object_) type(ASIO_MOVE_CAST(type)(ex2.object())); + ex1.target_ = ex2.target_; + ex2.object().~type(); + } + + static const void* target_shared(const any_executor_base& ex) + { + typedef asio::detail::shared_ptr type; + return ex.object().get(); + } + + template + static const object_fns* object_fns_table( + typename enable_if< + is_same >::value + >::type* = 0) + { + static const object_fns fns = + { + &any_executor_base::destroy_shared, + &any_executor_base::copy_shared, + &any_executor_base::move_shared, + &any_executor_base::target_shared + }; + return &fns; + } + + template + static void destroy_object(any_executor_base& ex) + { + ex.object().~Obj(); + } + + template + static void copy_object(any_executor_base& ex1, const any_executor_base& ex2) + { + new (&ex1.object_) Obj(ex2.object()); + ex1.target_ = &ex1.object(); + } + + template + static void move_object(any_executor_base& ex1, any_executor_base& ex2) + { + new (&ex1.object_) Obj(ASIO_MOVE_CAST(Obj)(ex2.object())); + ex1.target_ = &ex1.object(); + ex2.object().~Obj(); + } + + template + static const void* target_object(const any_executor_base& ex) + { + return &ex.object(); + } + + template + static const object_fns* object_fns_table( + typename enable_if< + !is_same::value + && !is_same >::value + >::type* = 0) + { + static const object_fns fns = + { + &any_executor_base::destroy_object, + &any_executor_base::copy_object, + &any_executor_base::move_object, + &any_executor_base::target_object + }; + return &fns; + } + + typedef asio::detail::executor_function function; + typedef asio::detail::executor_function_view function_view; + + struct target_fns + { + const std::type_info& (*target_type)(); + bool (*equal)(const any_executor_base&, const any_executor_base&); + void (*execute)(const any_executor_base&, ASIO_MOVE_ARG(function)); + void (*blocking_execute)(const any_executor_base&, function_view); + }; + + static const std::type_info& target_type_void() + { + return typeid(void); + } + + static bool equal_void(const any_executor_base&, const any_executor_base&) + { + return true; + } + + static void execute_void(const any_executor_base&, + ASIO_MOVE_ARG(function)) + { + bad_executor ex; + asio::detail::throw_exception(ex); + } + + static void blocking_execute_void(const any_executor_base&, function_view) + { + bad_executor ex; + asio::detail::throw_exception(ex); + } + + template + static const target_fns* target_fns_table( + typename enable_if< + is_same::value + >::type* = 0) + { + static const target_fns fns = + { + &any_executor_base::target_type_void, + &any_executor_base::equal_void, + &any_executor_base::execute_void, + &any_executor_base::blocking_execute_void + }; + return &fns; + } + + template + static const std::type_info& target_type_ex() + { + return typeid(Ex); + } + + template + static bool equal_ex(const any_executor_base& ex1, + const any_executor_base& ex2) + { + return *ex1.target() == *ex2.target(); + } + + template + static void execute_ex(const any_executor_base& ex, + ASIO_MOVE_ARG(function) f) + { + execution::execute(*ex.target(), ASIO_MOVE_CAST(function)(f)); + } + + template + static void blocking_execute_ex(const any_executor_base& ex, function_view f) + { + execution::execute(*ex.target(), f); + } + + template + static const target_fns* target_fns_table(bool is_always_blocking, + typename enable_if< + !is_same::value + >::type* = 0) + { + static const target_fns fns_with_execute = + { + &any_executor_base::target_type_ex, + &any_executor_base::equal_ex, + &any_executor_base::execute_ex, + 0 + }; + + static const target_fns fns_with_blocking_execute = + { + &any_executor_base::target_type_ex, + &any_executor_base::equal_ex, + 0, + &any_executor_base::blocking_execute_ex + }; + + return is_always_blocking ? &fns_with_blocking_execute : &fns_with_execute; + } + +#if defined(ASIO_MSVC) +# pragma warning (push) +# pragma warning (disable:4702) +#endif // defined(ASIO_MSVC) + + static void query_fn_void(void*, const void*, const void*) + { + bad_executor ex; + asio::detail::throw_exception(ex); + } + + template + static void query_fn_non_void(void*, const void* ex, const void* prop, + typename enable_if< + asio::can_query::value + && is_same::value + >::type*) + { + asio::query(*static_cast(ex), + *static_cast(prop)); + } + + template + static void query_fn_non_void(void*, const void*, const void*, + typename enable_if< + !asio::can_query::value + && is_same::value + >::type*) + { + } + + template + static void query_fn_non_void(void* result, const void* ex, const void* prop, + typename enable_if< + asio::can_query::value + && !is_same::value + && is_reference::value + >::type*) + { + *static_cast::type**>(result) + = &static_cast( + asio::query(*static_cast(ex), + *static_cast(prop))); + } + + template + static void query_fn_non_void(void*, const void*, const void*, + typename enable_if< + !asio::can_query::value + && !is_same::value + && is_reference::value + >::type*) + { + std::terminate(); // Combination should not be possible. + } + + template + static void query_fn_non_void(void* result, const void* ex, const void* prop, + typename enable_if< + asio::can_query::value + && !is_same::value + && is_scalar::value + >::type*) + { + *static_cast(result) + = static_cast( + asio::query(*static_cast(ex), + *static_cast(prop))); + } + + template + static void query_fn_non_void(void* result, const void*, const void*, + typename enable_if< + !asio::can_query::value + && !is_same::value + && is_scalar::value + >::type*) + { + *static_cast(result) + = typename Prop::polymorphic_query_result_type(); + } + + template + static void query_fn_non_void(void* result, const void* ex, const void* prop, + typename enable_if< + asio::can_query::value + && !is_same::value + && !is_reference::value + && !is_scalar::value + >::type*) + { + *static_cast(result) + = new typename Prop::polymorphic_query_result_type( + asio::query(*static_cast(ex), + *static_cast(prop))); + } + + template + static void query_fn_non_void(void* result, const void*, const void*, ...) + { + *static_cast(result) + = new typename Prop::polymorphic_query_result_type(); + } + + template + static void query_fn_impl(void* result, const void* ex, const void* prop, + typename enable_if< + is_same::value + >::type*) + { + query_fn_void(result, ex, prop); + } + + template + static void query_fn_impl(void* result, const void* ex, const void* prop, + typename enable_if< + !is_same::value + >::type*) + { + query_fn_non_void(result, ex, prop, 0); + } + + template + static void query_fn(void* result, const void* ex, const void* prop) + { + query_fn_impl(result, ex, prop, 0); + } + + template + static Poly require_fn_impl(const void*, const void*, + typename enable_if< + is_same::value + >::type*) + { + bad_executor ex; + asio::detail::throw_exception(ex); + return Poly(); + } + + template + static Poly require_fn_impl(const void* ex, const void* prop, + typename enable_if< + !is_same::value && Prop::is_requirable + >::type*) + { + return asio::require(*static_cast(ex), + *static_cast(prop)); + } + + template + static Poly require_fn_impl(const void*, const void*, ...) + { + return Poly(); + } + + template + static Poly require_fn(const void* ex, const void* prop) + { + return require_fn_impl(ex, prop, 0); + } + + template + static Poly prefer_fn_impl(const void*, const void*, + typename enable_if< + is_same::value + >::type*) + { + bad_executor ex; + asio::detail::throw_exception(ex); + return Poly(); + } + + template + static Poly prefer_fn_impl(const void* ex, const void* prop, + typename enable_if< + !is_same::value && Prop::is_preferable + >::type*) + { + return asio::prefer(*static_cast(ex), + *static_cast(prop)); + } + + template + static Poly prefer_fn_impl(const void*, const void*, ...) + { + return Poly(); + } + + template + static Poly prefer_fn(const void* ex, const void* prop) + { + return prefer_fn_impl(ex, prop, 0); + } + + template + struct prop_fns + { + void (*query)(void*, const void*, const void*); + Poly (*require)(const void*, const void*); + Poly (*prefer)(const void*, const void*); + }; + +#if defined(ASIO_MSVC) +# pragma warning (pop) +#endif // defined(ASIO_MSVC) + +private: + template + static execution::blocking_t query_blocking(const Executor& ex, true_type) + { + return asio::query(ex, execution::blocking); + } + + template + static execution::blocking_t query_blocking(const Executor&, false_type) + { + return execution::blocking_t(); + } + + template + void construct_object(Executor& ex, true_type) + { + object_fns_ = object_fns_table(); + target_ = new (&object_) Executor(ASIO_MOVE_CAST(Executor)(ex)); + } + + template + void construct_object(Executor& ex, false_type) + { + object_fns_ = object_fns_table >(); + asio::detail::shared_ptr p = + asio::detail::make_shared( + ASIO_MOVE_CAST(Executor)(ex)); + target_ = p.get(); + new (&object_) asio::detail::shared_ptr( + ASIO_MOVE_CAST(asio::detail::shared_ptr)(p)); + } + +/*private:*/public: +// template friend class any_executor; + + typedef aligned_storage< + sizeof(asio::detail::shared_ptr), + alignment_of >::value + >::type object_type; + + object_type object_; + const object_fns* object_fns_; + void* target_; + const target_fns* target_fns_; +}; + +template +struct any_executor_context +{ +}; + +#if !defined(ASIO_NO_TS_EXECUTORS) + +template +struct any_executor_context::type> +{ + typename Property::query_result_type context() const + { + return static_cast(this)->query(typename Property::type()); + } +}; + +#endif // !defined(ASIO_NO_TS_EXECUTORS) + +} // namespace detail + +template <> +class any_executor<> : public detail::any_executor_base +{ +public: + any_executor() ASIO_NOEXCEPT + : detail::any_executor_base() + { + } + + any_executor(nullptr_t) ASIO_NOEXCEPT + : detail::any_executor_base() + { + } + + template + any_executor(Executor ex, + typename enable_if< + conditional< + !is_same::value + && !is_base_of::value, + is_executor, + false_type + >::type::value + >::type* = 0) + : detail::any_executor_base( + ASIO_MOVE_CAST(Executor)(ex), false_type()) + { + } + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + + template + any_executor(any_executor other) + : detail::any_executor_base( + static_cast(other)) + { + } + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + + template + any_executor(any_executor other) + : detail::any_executor_base( + static_cast(other)) + { + } + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + + any_executor(const any_executor& other) ASIO_NOEXCEPT + : detail::any_executor_base( + static_cast(other)) + { + } + + any_executor& operator=(const any_executor& other) ASIO_NOEXCEPT + { + if (this != &other) + { + detail::any_executor_base::operator=( + static_cast(other)); + } + return *this; + } + + any_executor& operator=(nullptr_t p) ASIO_NOEXCEPT + { + detail::any_executor_base::operator=(p); + return *this; + } + +#if defined(ASIO_HAS_MOVE) + + any_executor(any_executor&& other) ASIO_NOEXCEPT + : detail::any_executor_base( + static_cast( + static_cast(other))) + { + } + + any_executor& operator=(any_executor&& other) ASIO_NOEXCEPT + { + if (this != &other) + { + detail::any_executor_base::operator=( + static_cast( + static_cast(other))); + } + return *this; + } + +#endif // defined(ASIO_HAS_MOVE) + + void swap(any_executor& other) ASIO_NOEXCEPT + { + detail::any_executor_base::swap( + static_cast(other)); + } + + using detail::any_executor_base::execute; + using detail::any_executor_base::target; + using detail::any_executor_base::target_type; + using detail::any_executor_base::operator unspecified_bool_type; + using detail::any_executor_base::operator!; + + bool equality_helper(const any_executor& other) const ASIO_NOEXCEPT + { + return any_executor_base::equality_helper(other); + } +}; + +inline bool operator==(const any_executor<>& a, + const any_executor<>& b) ASIO_NOEXCEPT +{ + return a.equality_helper(b); +} + +inline bool operator==(const any_executor<>& a, nullptr_t) ASIO_NOEXCEPT +{ + return !a; +} + +inline bool operator==(nullptr_t, const any_executor<>& b) ASIO_NOEXCEPT +{ + return !b; +} + +inline bool operator!=(const any_executor<>& a, + const any_executor<>& b) ASIO_NOEXCEPT +{ + return !a.equality_helper(b); +} + +inline bool operator!=(const any_executor<>& a, nullptr_t) ASIO_NOEXCEPT +{ + return !!a; +} + +inline bool operator!=(nullptr_t, const any_executor<>& b) ASIO_NOEXCEPT +{ + return !!b; +} + +inline void swap(any_executor<>& a, any_executor<>& b) ASIO_NOEXCEPT +{ + return a.swap(b); +} + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +class any_executor : + public detail::any_executor_base, + public detail::any_executor_context< + any_executor, + typename detail::supportable_properties< + 0, void(SupportableProperties...)>::find_context_as_property> +{ +public: + any_executor() ASIO_NOEXCEPT + : detail::any_executor_base(), + prop_fns_(prop_fns_table()) + { + } + + any_executor(nullptr_t) ASIO_NOEXCEPT + : detail::any_executor_base(), + prop_fns_(prop_fns_table()) + { + } + + template + any_executor(Executor ex, + typename enable_if< + conditional< + !is_same::value + && !is_base_of::value, + detail::is_valid_target_executor< + Executor, void(SupportableProperties...)>, + false_type + >::type::value + >::type* = 0) + : detail::any_executor_base( + ASIO_MOVE_CAST(Executor)(ex), false_type()), + prop_fns_(prop_fns_table()) + { + } + + template + any_executor(any_executor other, + typename enable_if< + conditional< + !is_same< + any_executor, + any_executor + >::value, + typename detail::supportable_properties< + 0, void(SupportableProperties...)>::template is_valid_target< + any_executor >, + false_type + >::type::value + >::type* = 0) + : detail::any_executor_base(ASIO_MOVE_CAST( + any_executor)(other), true_type()), + prop_fns_(prop_fns_table >()) + { + } + + any_executor(const any_executor& other) ASIO_NOEXCEPT + : detail::any_executor_base( + static_cast(other)), + prop_fns_(other.prop_fns_) + { + } + + any_executor& operator=(const any_executor& other) ASIO_NOEXCEPT + { + if (this != &other) + { + prop_fns_ = other.prop_fns_; + detail::any_executor_base::operator=( + static_cast(other)); + } + return *this; + } + + any_executor& operator=(nullptr_t p) ASIO_NOEXCEPT + { + prop_fns_ = prop_fns_table(); + detail::any_executor_base::operator=(p); + return *this; + } + +#if defined(ASIO_HAS_MOVE) + + any_executor(any_executor&& other) ASIO_NOEXCEPT + : detail::any_executor_base( + static_cast( + static_cast(other))), + prop_fns_(other.prop_fns_) + { + other.prop_fns_ = prop_fns_table(); + } + + any_executor& operator=(any_executor&& other) ASIO_NOEXCEPT + { + if (this != &other) + { + prop_fns_ = other.prop_fns_; + detail::any_executor_base::operator=( + static_cast( + static_cast(other))); + } + return *this; + } + +#endif // defined(ASIO_HAS_MOVE) + + void swap(any_executor& other) ASIO_NOEXCEPT + { + if (this != &other) + { + detail::any_executor_base::swap( + static_cast(other)); + const prop_fns* tmp_prop_fns = other.prop_fns_; + other.prop_fns_ = prop_fns_; + prop_fns_ = tmp_prop_fns; + } + } + + using detail::any_executor_base::execute; + using detail::any_executor_base::target; + using detail::any_executor_base::target_type; + using detail::any_executor_base::operator unspecified_bool_type; + using detail::any_executor_base::operator!; + + bool equality_helper(const any_executor& other) const ASIO_NOEXCEPT + { + return any_executor_base::equality_helper(other); + } + + template + struct find_convertible_property : + detail::supportable_properties< + 0, void(SupportableProperties...)>::template + find_convertible_property {}; + + template + void query(const Property& p, + typename enable_if< + is_same< + typename find_convertible_property::query_result_type, + void + >::value + >::type* = 0) const + { + typedef find_convertible_property found; + prop_fns_[found::index].query(0, object_fns_->target(*this), + &static_cast(p)); + } + + template + typename find_convertible_property::query_result_type + query(const Property& p, + typename enable_if< + !is_same< + typename find_convertible_property::query_result_type, + void + >::value + && + is_reference< + typename find_convertible_property::query_result_type + >::value + >::type* = 0) const + { + typedef find_convertible_property found; + typename remove_reference< + typename found::query_result_type>::type* result = 0; + prop_fns_[found::index].query(&result, object_fns_->target(*this), + &static_cast(p)); + return *result; + } + + template + typename find_convertible_property::query_result_type + query(const Property& p, + typename enable_if< + !is_same< + typename find_convertible_property::query_result_type, + void + >::value + && + is_scalar< + typename find_convertible_property::query_result_type + >::value + >::type* = 0) const + { + typedef find_convertible_property found; + typename found::query_result_type result; + prop_fns_[found::index].query(&result, object_fns_->target(*this), + &static_cast(p)); + return result; + } + + template + typename find_convertible_property::query_result_type + query(const Property& p, + typename enable_if< + !is_same< + typename find_convertible_property::query_result_type, + void + >::value + && + !is_reference< + typename find_convertible_property::query_result_type + >::value + && + !is_scalar< + typename find_convertible_property::query_result_type + >::value + >::type* = 0) const + { + typedef find_convertible_property found; + typename found::query_result_type* result; + prop_fns_[found::index].query(&result, object_fns_->target(*this), + &static_cast(p)); + return *asio::detail::scoped_ptr< + typename found::query_result_type>(result); + } + + template + struct find_convertible_requirable_property : + detail::supportable_properties< + 0, void(SupportableProperties...)>::template + find_convertible_requirable_property {}; + + template + any_executor require(const Property& p, + typename enable_if< + find_convertible_requirable_property::value + >::type* = 0) const + { + typedef find_convertible_requirable_property found; + return prop_fns_[found::index].require(object_fns_->target(*this), + &static_cast(p)); + } + + template + struct find_convertible_preferable_property : + detail::supportable_properties< + 0, void(SupportableProperties...)>::template + find_convertible_preferable_property {}; + + template + any_executor prefer(const Property& p, + typename enable_if< + find_convertible_preferable_property::value + >::type* = 0) const + { + typedef find_convertible_preferable_property found; + return prop_fns_[found::index].prefer(object_fns_->target(*this), + &static_cast(p)); + } + +//private: + template + static const prop_fns* prop_fns_table() + { + static const prop_fns fns[] = + { + { + &detail::any_executor_base::query_fn< + Ex, SupportableProperties>, + &detail::any_executor_base::require_fn< + any_executor, Ex, SupportableProperties>, + &detail::any_executor_base::prefer_fn< + any_executor, Ex, SupportableProperties> + }... + }; + return fns; + } + + const prop_fns* prop_fns_; +}; + +template +inline bool operator==(const any_executor& a, + const any_executor& b) ASIO_NOEXCEPT +{ + return a.equality_helper(b); +} + +template +inline bool operator==(const any_executor& a, + nullptr_t) ASIO_NOEXCEPT +{ + return !a; +} + +template +inline bool operator==(nullptr_t, + const any_executor& b) ASIO_NOEXCEPT +{ + return !b; +} + +template +inline bool operator!=(const any_executor& a, + const any_executor& b) ASIO_NOEXCEPT +{ + return !a.equality_helper(b); +} + +template +inline bool operator!=(const any_executor& a, + nullptr_t) ASIO_NOEXCEPT +{ + return !!a; +} + +template +inline bool operator!=(nullptr_t, + const any_executor& b) ASIO_NOEXCEPT +{ + return !!b; +} + +template +inline void swap(any_executor& a, + any_executor& b) ASIO_NOEXCEPT +{ + return a.swap(b); +} + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS(n) \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_##n + +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_1 \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_2 \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_1, \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_3 \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_2, \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_4 \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_3, \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_5 \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_4, \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_6 \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_5, \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_7 \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_6, \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } +#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_8 \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_7, \ + { \ + &detail::any_executor_base::query_fn, \ + &detail::any_executor_base::require_fn, \ + &detail::any_executor_base::prefer_fn \ + } + +#if defined(ASIO_HAS_MOVE) + +# define ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS \ + any_executor(any_executor&& other) ASIO_NOEXCEPT \ + : detail::any_executor_base( \ + static_cast( \ + static_cast(other))), \ + prop_fns_(other.prop_fns_) \ + { \ + other.prop_fns_ = prop_fns_table(); \ + } \ + \ + any_executor& operator=(any_executor&& other) ASIO_NOEXCEPT \ + { \ + if (this != &other) \ + { \ + prop_fns_ = other.prop_fns_; \ + detail::any_executor_base::operator=( \ + static_cast( \ + static_cast(other))); \ + } \ + return *this; \ + } \ + /**/ +#else // defined(ASIO_HAS_MOVE) + +# define ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS + +#endif // defined(ASIO_HAS_MOVE) + +#define ASIO_PRIVATE_ANY_EXECUTOR_DEF(n) \ + template \ + class any_executor : \ + public detail::any_executor_base, \ + public detail::any_executor_context< \ + any_executor, \ + typename detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::find_context_as_property> \ + { \ + public: \ + any_executor() ASIO_NOEXCEPT \ + : detail::any_executor_base(), \ + prop_fns_(prop_fns_table()) \ + { \ + } \ + \ + any_executor(nullptr_t) ASIO_NOEXCEPT \ + : detail::any_executor_base(), \ + prop_fns_(prop_fns_table()) \ + { \ + } \ + \ + template \ + any_executor(Executor ex, \ + typename enable_if< \ + conditional< \ + !is_same::value \ + && !is_base_of::value, \ + detail::is_valid_target_executor< \ + Executor, void(ASIO_VARIADIC_TARGS(n))>, \ + false_type \ + >::type::value \ + >::type* = 0) \ + : detail::any_executor_base(ASIO_MOVE_CAST( \ + Executor)(ex), false_type()), \ + prop_fns_(prop_fns_table()) \ + { \ + } \ + \ + any_executor(const any_executor& other) ASIO_NOEXCEPT \ + : detail::any_executor_base( \ + static_cast(other)), \ + prop_fns_(other.prop_fns_) \ + { \ + } \ + \ + any_executor(any_executor<> other) \ + : detail::any_executor_base(ASIO_MOVE_CAST( \ + any_executor<>)(other), true_type()), \ + prop_fns_(prop_fns_table >()) \ + { \ + } \ + \ + template \ + any_executor(OtherAnyExecutor other, \ + typename enable_if< \ + conditional< \ + !is_same::value \ + && is_base_of::value, \ + typename detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + is_valid_target, \ + false_type \ + >::type::value \ + >::type* = 0) \ + : detail::any_executor_base(ASIO_MOVE_CAST( \ + OtherAnyExecutor)(other), true_type()), \ + prop_fns_(prop_fns_table()) \ + { \ + } \ + \ + any_executor& operator=(const any_executor& other) ASIO_NOEXCEPT \ + { \ + if (this != &other) \ + { \ + prop_fns_ = other.prop_fns_; \ + detail::any_executor_base::operator=( \ + static_cast(other)); \ + } \ + return *this; \ + } \ + \ + any_executor& operator=(nullptr_t p) ASIO_NOEXCEPT \ + { \ + prop_fns_ = prop_fns_table(); \ + detail::any_executor_base::operator=(p); \ + return *this; \ + } \ + \ + ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS \ + \ + void swap(any_executor& other) ASIO_NOEXCEPT \ + { \ + if (this != &other) \ + { \ + detail::any_executor_base::swap( \ + static_cast(other)); \ + const prop_fns* tmp_prop_fns = other.prop_fns_; \ + other.prop_fns_ = prop_fns_; \ + prop_fns_ = tmp_prop_fns; \ + } \ + } \ + \ + using detail::any_executor_base::execute; \ + using detail::any_executor_base::target; \ + using detail::any_executor_base::target_type; \ + using detail::any_executor_base::operator unspecified_bool_type; \ + using detail::any_executor_base::operator!; \ + \ + bool equality_helper(const any_executor& other) const ASIO_NOEXCEPT \ + { \ + return any_executor_base::equality_helper(other); \ + } \ + \ + template \ + struct find_convertible_property : \ + detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + find_convertible_property {}; \ + \ + template \ + void query(const Property& p, \ + typename enable_if< \ + is_same< \ + typename find_convertible_property::query_result_type, \ + void \ + >::value \ + >::type* = 0) const \ + { \ + typedef find_convertible_property found; \ + prop_fns_[found::index].query(0, object_fns_->target(*this), \ + &static_cast(p)); \ + } \ + \ + template \ + typename find_convertible_property::query_result_type \ + query(const Property& p, \ + typename enable_if< \ + !is_same< \ + typename find_convertible_property::query_result_type, \ + void \ + >::value \ + && \ + is_reference< \ + typename find_convertible_property::query_result_type \ + >::value \ + >::type* = 0) const \ + { \ + typedef find_convertible_property found; \ + typename remove_reference< \ + typename found::query_result_type>::type* result; \ + prop_fns_[found::index].query(&result, object_fns_->target(*this), \ + &static_cast(p)); \ + return *result; \ + } \ + \ + template \ + typename find_convertible_property::query_result_type \ + query(const Property& p, \ + typename enable_if< \ + !is_same< \ + typename find_convertible_property::query_result_type, \ + void \ + >::value \ + && \ + is_scalar< \ + typename find_convertible_property::query_result_type \ + >::value \ + >::type* = 0) const \ + { \ + typedef find_convertible_property found; \ + typename found::query_result_type result; \ + prop_fns_[found::index].query(&result, object_fns_->target(*this), \ + &static_cast(p)); \ + return result; \ + } \ + \ + template \ + typename find_convertible_property::query_result_type \ + query(const Property& p, \ + typename enable_if< \ + !is_same< \ + typename find_convertible_property::query_result_type, \ + void \ + >::value \ + && \ + !is_reference< \ + typename find_convertible_property::query_result_type \ + >::value \ + && \ + !is_scalar< \ + typename find_convertible_property::query_result_type \ + >::value \ + >::type* = 0) const \ + { \ + typedef find_convertible_property found; \ + typename found::query_result_type* result; \ + prop_fns_[found::index].query(&result, object_fns_->target(*this), \ + &static_cast(p)); \ + return *asio::detail::scoped_ptr< \ + typename found::query_result_type>(result); \ + } \ + \ + template \ + struct find_convertible_requirable_property : \ + detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + find_convertible_requirable_property {}; \ + \ + template \ + any_executor require(const Property& p, \ + typename enable_if< \ + find_convertible_requirable_property::value \ + >::type* = 0) const \ + { \ + typedef find_convertible_requirable_property found; \ + return prop_fns_[found::index].require(object_fns_->target(*this), \ + &static_cast(p)); \ + } \ + \ + template \ + struct find_convertible_preferable_property : \ + detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + find_convertible_preferable_property {}; \ + \ + template \ + any_executor prefer(const Property& p, \ + typename enable_if< \ + find_convertible_preferable_property::value \ + >::type* = 0) const \ + { \ + typedef find_convertible_preferable_property found; \ + return prop_fns_[found::index].prefer(object_fns_->target(*this), \ + &static_cast(p)); \ + } \ + \ + template \ + static const prop_fns* prop_fns_table() \ + { \ + static const prop_fns fns[] = \ + { \ + ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS(n) \ + }; \ + return fns; \ + } \ + \ + const prop_fns* prop_fns_; \ + typedef detail::supportable_properties<0, \ + void(ASIO_VARIADIC_TARGS(n))> supportable_properties_type; \ + }; \ + \ + template \ + inline bool operator==(const any_executor& a, \ + const any_executor& b) ASIO_NOEXCEPT \ + { \ + return a.equality_helper(b); \ + } \ + \ + template \ + inline bool operator==(const any_executor& a, \ + nullptr_t) ASIO_NOEXCEPT \ + { \ + return !a; \ + } \ + \ + template \ + inline bool operator==(nullptr_t, \ + const any_executor& b) ASIO_NOEXCEPT \ + { \ + return !b; \ + } \ + \ + template \ + inline bool operator!=(const any_executor& a, \ + const any_executor& b) ASIO_NOEXCEPT \ + { \ + return !a.equality_helper(b); \ + } \ + \ + template \ + inline bool operator!=(const any_executor& a, \ + nullptr_t) ASIO_NOEXCEPT \ + { \ + return !!a; \ + } \ + \ + template \ + inline bool operator!=(nullptr_t, \ + const any_executor& b) ASIO_NOEXCEPT \ + { \ + return !!b; \ + } \ + \ + template \ + inline void swap(any_executor& a, \ + any_executor& b) ASIO_NOEXCEPT \ + { \ + return a.swap(b); \ + } \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_DEF) +#undef ASIO_PRIVATE_ANY_EXECUTOR_DEF +#undef ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_1 +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_2 +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_3 +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_4 +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_5 +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_6 +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_7 +#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_8 + +#endif // if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +} // namespace execution +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct equality_comparable > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; +}; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template <> +struct equality_comparable > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; +}; + +#define ASIO_PRIVATE_ANY_EXECUTOR_EQUALITY_COMPARABLE_DEF(n) \ + template \ + struct equality_comparable< \ + execution::any_executor > \ + { \ + static const bool is_valid = true; \ + static const bool is_noexcept = true; \ + }; \ + /**/ + ASIO_VARIADIC_GENERATE( + ASIO_PRIVATE_ANY_EXECUTOR_EQUALITY_COMPARABLE_DEF) +#undef ASIO_PRIVATE_ANY_EXECUTOR_EQUALITY_COMPARABLE_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) +#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct execute_member, F> +{ + static const bool is_valid = true; + static const bool is_noexcept = false; + typedef void result_type; +}; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct execute_member, F> +{ + static const bool is_valid = true; + static const bool is_noexcept = false; + typedef void result_type; +}; + +#define ASIO_PRIVATE_ANY_EXECUTOR_EXECUTE_MEMBER_DEF(n) \ + template \ + struct execute_member< \ + execution::any_executor, F> \ + { \ + static const bool is_valid = true; \ + static const bool is_noexcept = false; \ + typedef void result_type; \ + }; \ + /**/ + ASIO_VARIADIC_GENERATE( + ASIO_PRIVATE_ANY_EXECUTOR_EXECUTE_MEMBER_DEF) +#undef ASIO_PRIVATE_ANY_EXECUTOR_EXECUTE_MEMBER_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) +#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct query_member< + execution::any_executor, Prop, + typename enable_if< + execution::detail::supportable_properties< + 0, void(SupportableProperties...)>::template + find_convertible_property::value + >::type> +{ + static const bool is_valid = true; + static const bool is_noexcept = false; + typedef typename execution::detail::supportable_properties< + 0, void(SupportableProperties...)>::template + find_convertible_property::query_result_type result_type; +}; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#define ASIO_PRIVATE_ANY_EXECUTOR_QUERY_MEMBER_DEF(n) \ + template \ + struct query_member< \ + execution::any_executor, Prop, \ + typename enable_if< \ + execution::detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + find_convertible_property::value \ + >::type> \ + { \ + static const bool is_valid = true; \ + static const bool is_noexcept = false; \ + typedef typename execution::detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + find_convertible_property::query_result_type result_type; \ + }; \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_QUERY_MEMBER_DEF) +#undef ASIO_PRIVATE_ANY_EXECUTOR_QUERY_MEMBER_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct require_member< + execution::any_executor, Prop, + typename enable_if< + execution::detail::supportable_properties< + 0, void(SupportableProperties...)>::template + find_convertible_requirable_property::value + >::type> +{ + static const bool is_valid = true; + static const bool is_noexcept = false; + typedef execution::any_executor result_type; +}; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#define ASIO_PRIVATE_ANY_EXECUTOR_REQUIRE_MEMBER_DEF(n) \ + template \ + struct require_member< \ + execution::any_executor, Prop, \ + typename enable_if< \ + execution::detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + find_convertible_requirable_property::value \ + >::type> \ + { \ + static const bool is_valid = true; \ + static const bool is_noexcept = false; \ + typedef execution::any_executor result_type; \ + }; \ + /**/ + ASIO_VARIADIC_GENERATE( + ASIO_PRIVATE_ANY_EXECUTOR_REQUIRE_MEMBER_DEF) +#undef ASIO_PRIVATE_ANY_EXECUTOR_REQUIRE_MEMBER_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) +#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT) +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct prefer_member< + execution::any_executor, Prop, + typename enable_if< + execution::detail::supportable_properties< + 0, void(SupportableProperties...)>::template + find_convertible_preferable_property::value + >::type> +{ + static const bool is_valid = true; + static const bool is_noexcept = false; + typedef execution::any_executor result_type; +}; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#define ASIO_PRIVATE_ANY_EXECUTOR_PREFER_FREE_DEF(n) \ + template \ + struct prefer_member< \ + execution::any_executor, Prop, \ + typename enable_if< \ + execution::detail::supportable_properties< \ + 0, void(ASIO_VARIADIC_TARGS(n))>::template \ + find_convertible_preferable_property::value \ + >::type> \ + { \ + static const bool is_valid = true; \ + static const bool is_noexcept = false; \ + typedef execution::any_executor result_type; \ + }; \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_PREFER_FREE_DEF) +#undef ASIO_PRIVATE_ANY_EXECUTOR_PREFER_FREE_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) +#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_ANY_EXECUTOR_HPP diff --git a/include/asio/include/asio/execution/bad_executor.hpp b/include/asio/include/asio/execution/bad_executor.hpp new file mode 100644 index 0000000..0069529 --- /dev/null +++ b/include/asio/include/asio/execution/bad_executor.hpp @@ -0,0 +1,47 @@ +// +// execution/bad_executor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_BAD_EXECUTOR_HPP +#define ASIO_EXECUTION_BAD_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { + +/// Exception thrown when trying to access an empty polymorphic executor. +class bad_executor + : public std::exception +{ +public: + /// Constructor. + ASIO_DECL bad_executor() ASIO_NOEXCEPT; + + /// Obtain message associated with exception. + ASIO_DECL virtual const char* what() const + ASIO_NOEXCEPT_OR_NOTHROW; +}; + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/execution/impl/bad_executor.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_EXECUTION_BAD_EXECUTOR_HPP diff --git a/include/asio/include/asio/execution/blocking.hpp b/include/asio/include/asio/execution/blocking.hpp new file mode 100644 index 0000000..4d19349 --- /dev/null +++ b/include/asio/include/asio/execution/blocking.hpp @@ -0,0 +1,1351 @@ +// +// execution/blocking.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_BLOCKING_HPP +#define ASIO_EXECUTION_BLOCKING_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/prefer.hpp" +#include "asio/query.hpp" +#include "asio/require.hpp" +#include "asio/traits/query_free.hpp" +#include "asio/traits/query_member.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" +#include "asio/traits/static_require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property to describe what guarantees an executor makes about the blocking +/// behaviour of their execution functions. +struct blocking_t +{ + /// The blocking_t property applies to executors, senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The top-level blocking_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The top-level blocking_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef blocking_t polymorphic_query_result_type; + + /// A sub-property that indicates that invocation of an executor's execution + /// function may block pending completion of one or more invocations of the + /// submitted function object. + struct possibly_t + { + /// The blocking_t::possibly_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The blocking_t::possibly_t property can be required. + static constexpr bool is_requirable = true; + + /// The blocking_t::possibly_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef blocking_t polymorphic_query_result_type; + + /// Default constructor. + constexpr possibly_t(); + + /// Get the value associated with a property object. + /** + * @returns possibly_t(); + */ + static constexpr blocking_t value(); + }; + + /// A sub-property that indicates that invocation of an executor's execution + /// function shall block until completion of all invocations of the submitted + /// function object. + struct always_t + { + /// The blocking_t::always_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The blocking_t::always_t property can be required. + static constexpr bool is_requirable = true; + + /// The blocking_t::always_t property can be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef blocking_t polymorphic_query_result_type; + + /// Default constructor. + constexpr always_t(); + + /// Get the value associated with a property object. + /** + * @returns always_t(); + */ + static constexpr blocking_t value(); + }; + + /// A sub-property that indicates that invocation of an executor's execution + /// function shall not block pending completion of the invocations of the + /// submitted function object. + struct never_t + { + /// The blocking_t::never_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The blocking_t::never_t property can be required. + static constexpr bool is_requirable = true; + + /// The blocking_t::never_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef blocking_t polymorphic_query_result_type; + + /// Default constructor. + constexpr never_t(); + + /// Get the value associated with a property object. + /** + * @returns never_t(); + */ + static constexpr blocking_t value(); + }; + + /// A special value used for accessing the blocking_t::possibly_t property. + static constexpr possibly_t possibly; + + /// A special value used for accessing the blocking_t::always_t property. + static constexpr always_t always; + + /// A special value used for accessing the blocking_t::never_t property. + static constexpr never_t never; + + /// Default constructor. + constexpr blocking_t(); + + /// Construct from a sub-property value. + constexpr blocking_t(possibly_t); + + /// Construct from a sub-property value. + constexpr blocking_t(always_t); + + /// Construct from a sub-property value. + constexpr blocking_t(never_t); + + /// Compare property values for equality. + friend constexpr bool operator==( + const blocking_t& a, const blocking_t& b) noexcept; + + /// Compare property values for inequality. + friend constexpr bool operator!=( + const blocking_t& a, const blocking_t& b) noexcept; +}; + +/// A special value used for accessing the blocking_t property. +constexpr blocking_t blocking; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { +namespace blocking { + +template struct possibly_t; +template struct always_t; +template struct never_t; + +} // namespace blocking +namespace blocking_adaptation { + +template struct allowed_t; + +template +void blocking_execute( + ASIO_MOVE_ARG(Executor) ex, + ASIO_MOVE_ARG(Function) func); + +} // namespace blocking_adaptation + +template +struct blocking_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef blocking_t polymorphic_query_result_type; + + typedef detail::blocking::possibly_t possibly_t; + typedef detail::blocking::always_t always_t; + typedef detail::blocking::never_t never_t; + + ASIO_CONSTEXPR blocking_t() + : value_(-1) + { + } + + ASIO_CONSTEXPR blocking_t(possibly_t) + : value_(0) + { + } + + ASIO_CONSTEXPR blocking_t(always_t) + : value_(1) + { + } + + ASIO_CONSTEXPR blocking_t(never_t) + : value_(2) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = blocking_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + friend ASIO_CONSTEXPR bool operator==( + const blocking_t& a, const blocking_t& b) + { + return a.value_ == b.value_; + } + + friend ASIO_CONSTEXPR bool operator!=( + const blocking_t& a, const blocking_t& b) + { + return a.value_ != b.value_; + } + + struct convertible_from_blocking_t + { + ASIO_CONSTEXPR convertible_from_blocking_t(blocking_t) {} + }; + + template + friend ASIO_CONSTEXPR blocking_t query( + const Executor& ex, convertible_from_blocking_t, + typename enable_if< + can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::possibly_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, possibly_t()); + } + + template + friend ASIO_CONSTEXPR blocking_t query( + const Executor& ex, convertible_from_blocking_t, + typename enable_if< + !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::always_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, always_t()); + } + + template + friend ASIO_CONSTEXPR blocking_t query( + const Executor& ex, convertible_from_blocking_t, + typename enable_if< + !can_query::value + && !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::never_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, never_t()); + } + + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(possibly_t, possibly); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(always_t, always); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(never_t, never); + +#if !defined(ASIO_HAS_CONSTEXPR) + static const blocking_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) + +private: + int value_; +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T blocking_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const blocking_t blocking_t::instance; +#endif + +template +const typename blocking_t::possibly_t blocking_t::possibly; + +template +const typename blocking_t::always_t blocking_t::always; + +template +const typename blocking_t::never_t blocking_t::never; + +namespace blocking { + +template +struct possibly_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef blocking_t polymorphic_query_result_type; + + ASIO_CONSTEXPR possibly_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR possibly_t static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query >::value + && !can_query >::value + >::type* = 0) ASIO_NOEXCEPT + { + return possibly_t(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = possibly_t::static_query(); +#endif // defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR blocking_t value() + { + return possibly_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const possibly_t&, const possibly_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const possibly_t&, const possibly_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator==( + const possibly_t&, const always_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const possibly_t&, const always_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator==( + const possibly_t&, const never_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const possibly_t&, const never_t&) + { + return true; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T possibly_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +class adapter +{ +public: + adapter(int, const Executor& e) ASIO_NOEXCEPT + : executor_(e) + { + } + + adapter(const adapter& other) ASIO_NOEXCEPT + : executor_(other.executor_) + { + } + +#if defined(ASIO_HAS_MOVE) + adapter(adapter&& other) ASIO_NOEXCEPT + : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + template + static ASIO_CONSTEXPR always_t query( + blocking_t) ASIO_NOEXCEPT + { + return always_t(); + } + + template + static ASIO_CONSTEXPR always_t query( + possibly_t) ASIO_NOEXCEPT + { + return always_t(); + } + + template + static ASIO_CONSTEXPR always_t query( + always_t) ASIO_NOEXCEPT + { + return always_t(); + } + + template + static ASIO_CONSTEXPR always_t query( + never_t) ASIO_NOEXCEPT + { + return always_t(); + } + + template + typename enable_if< + can_query::value, + typename query_result::type + >::type query(const Property& p) const + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) + { + return asio::query(executor_, p); + } + + template + typename enable_if< + can_require >::value, + typename require_result >::type + >::type require(possibly_t) const ASIO_NOEXCEPT + { + return asio::require(executor_, possibly_t()); + } + + template + typename enable_if< + can_require >::value, + typename require_result >::type + >::type require(never_t) const ASIO_NOEXCEPT + { + return asio::require(executor_, never_t()); + } + + template + typename enable_if< + can_require::value, + adapter::type + >::type> + >::type require(const Property& p) const + ASIO_NOEXCEPT_IF(( + is_nothrow_require::value)) + { + return adapter::type + >::type>(0, asio::require(executor_, p)); + } + + template + typename enable_if< + can_prefer::value, + adapter::type + >::type> + >::type prefer(const Property& p) const + ASIO_NOEXCEPT_IF(( + is_nothrow_prefer::value)) + { + return adapter::type + >::type>(0, asio::prefer(executor_, p)); + } + + template + typename enable_if< + execution::can_execute::value + >::type execute(ASIO_MOVE_ARG(Function) f) const + { + blocking_adaptation::blocking_execute( + executor_, ASIO_MOVE_CAST(Function)(f)); + } + + friend bool operator==(const adapter& a, const adapter& b) ASIO_NOEXCEPT + { + return a.executor_ == b.executor_; + } + + friend bool operator!=(const adapter& a, const adapter& b) ASIO_NOEXCEPT + { + return a.executor_ != b.executor_; + } + +private: + Executor executor_; +}; + +template +struct always_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef blocking_t polymorphic_query_result_type; + + ASIO_CONSTEXPR always_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = always_t::static_query(); +#endif // defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR blocking_t value() + { + return always_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const always_t&, const always_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const always_t&, const always_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator==( + const always_t&, const possibly_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const always_t&, const possibly_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator==( + const always_t&, const never_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const always_t&, const never_t&) + { + return true; + } + + template + friend adapter require( + const Executor& e, const always_t&, + typename enable_if< + is_executor::value + && traits::static_require< + const Executor&, + blocking_adaptation::allowed_t<0> + >::is_valid + >::type* = 0) + { + return adapter(0, e); + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T always_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct never_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef blocking_t polymorphic_query_result_type; + + ASIO_CONSTEXPR never_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = never_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR blocking_t value() + { + return never_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const never_t&, const never_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const never_t&, const never_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator==( + const never_t&, const possibly_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const never_t&, const possibly_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator==( + const never_t&, const always_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const never_t&, const always_t&) + { + return true; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T never_t::static_query_v; +#endif // defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace blocking +} // namespace detail + +typedef detail::blocking_t<> blocking_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr blocking_t blocking; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const blocking_t& blocking = blocking_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free_default::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::blocking_t result_type; +}; + +template +struct query_free_default::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::blocking_t result_type; +}; + +template +struct query_free_default::value + && !can_query::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::blocking_t result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query::value + && !can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef execution::blocking_t::possibly_t result_type; + + static ASIO_CONSTEXPR result_type value() + { + return result_type(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::blocking_t::possibly_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::blocking_t::always_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::blocking_t::never_t>::value)); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT) + +template +struct require_free_default::type>::value + && execution::is_executor::value + && traits::static_require< + const T&, + execution::detail::blocking_adaptation::allowed_t<0> + >::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef execution::detail::blocking::adapter result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +template +struct equality_comparable< + execution::detail::blocking::adapter > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + +template +struct execute_member< + execution::detail::blocking::adapter, Function> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) + +template +struct query_static_constexpr_member< + execution::detail::blocking::adapter, + execution::detail::blocking_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef execution::blocking_t::always_t result_type; + + static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT + { + return result_type(); + } +}; + +template +struct query_static_constexpr_member< + execution::detail::blocking::adapter, + execution::detail::blocking::always_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef execution::blocking_t::always_t result_type; + + static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT + { + return result_type(); + } +}; + +template +struct query_static_constexpr_member< + execution::detail::blocking::adapter, + execution::detail::blocking::possibly_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef execution::blocking_t::always_t result_type; + + static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT + { + return result_type(); + } +}; + +template +struct query_static_constexpr_member< + execution::detail::blocking::adapter, + execution::detail::blocking::never_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef execution::blocking_t::always_t result_type; + + static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT + { + return result_type(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) + +template +struct query_member< + execution::detail::blocking::adapter, Property, + typename enable_if< + can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + typedef typename query_result::type result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) + +template +struct require_member< + execution::detail::blocking::adapter, + execution::detail::blocking::possibly_t, + typename enable_if< + can_require< + const Executor&, + execution::detail::blocking::possibly_t + >::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_require >::value)); + typedef typename require_result >::type result_type; +}; + +template +struct require_member< + execution::detail::blocking::adapter, + execution::detail::blocking::never_t, + typename enable_if< + can_require< + const Executor&, + execution::detail::blocking::never_t + >::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_require >::value)); + typedef typename require_result >::type result_type; +}; + +template +struct require_member< + execution::detail::blocking::adapter, Property, + typename enable_if< + can_require::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_require::value)); + typedef execution::detail::blocking::adapter::type + >::type> result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) + +template +struct prefer_member< + execution::detail::blocking::adapter, Property, + typename enable_if< + can_prefer::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_prefer::value)); + typedef execution::detail::blocking::adapter::type + >::type> result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_BLOCKING_HPP diff --git a/include/asio/include/asio/execution/blocking_adaptation.hpp b/include/asio/include/asio/execution/blocking_adaptation.hpp new file mode 100644 index 0000000..8f4bf81 --- /dev/null +++ b/include/asio/include/asio/execution/blocking_adaptation.hpp @@ -0,0 +1,1064 @@ +// +// execution/blocking_adaptation.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_BLOCKING_ADAPTATION_HPP +#define ASIO_EXECUTION_BLOCKING_ADAPTATION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/event.hpp" +#include "asio/detail/mutex.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/prefer.hpp" +#include "asio/query.hpp" +#include "asio/require.hpp" +#include "asio/traits/prefer_member.hpp" +#include "asio/traits/query_free.hpp" +#include "asio/traits/query_member.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/require_member.hpp" +#include "asio/traits/static_query.hpp" +#include "asio/traits/static_require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property to describe whether automatic adaptation of an executor is +/// allowed in order to apply the blocking_adaptation_t::allowed_t property. +struct blocking_adaptation_t +{ + /// The blocking_adaptation_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The top-level blocking_adaptation_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The top-level blocking_adaptation_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef blocking_adaptation_t polymorphic_query_result_type; + + /// A sub-property that indicates that automatic adaptation is not allowed. + struct disallowed_t + { + /// The blocking_adaptation_t::disallowed_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The blocking_adaptation_t::disallowed_t property can be required. + static constexpr bool is_requirable = true; + + /// The blocking_adaptation_t::disallowed_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef blocking_adaptation_t polymorphic_query_result_type; + + /// Default constructor. + constexpr disallowed_t(); + + /// Get the value associated with a property object. + /** + * @returns disallowed_t(); + */ + static constexpr blocking_adaptation_t value(); + }; + + /// A sub-property that indicates that automatic adaptation is allowed. + struct allowed_t + { + /// The blocking_adaptation_t::allowed_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The blocking_adaptation_t::allowed_t property can be required. + static constexpr bool is_requirable = true; + + /// The blocking_adaptation_t::allowed_t property can be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef blocking_adaptation_t polymorphic_query_result_type; + + /// Default constructor. + constexpr allowed_t(); + + /// Get the value associated with a property object. + /** + * @returns allowed_t(); + */ + static constexpr blocking_adaptation_t value(); + }; + + /// A special value used for accessing the blocking_adaptation_t::disallowed_t + /// property. + static constexpr disallowed_t disallowed; + + /// A special value used for accessing the blocking_adaptation_t::allowed_t + /// property. + static constexpr allowed_t allowed; + + /// Default constructor. + constexpr blocking_adaptation_t(); + + /// Construct from a sub-property value. + constexpr blocking_adaptation_t(disallowed_t); + + /// Construct from a sub-property value. + constexpr blocking_adaptation_t(allowed_t); + + /// Compare property values for equality. + friend constexpr bool operator==( + const blocking_adaptation_t& a, const blocking_adaptation_t& b) noexcept; + + /// Compare property values for inequality. + friend constexpr bool operator!=( + const blocking_adaptation_t& a, const blocking_adaptation_t& b) noexcept; +}; + +/// A special value used for accessing the blocking_adaptation_t property. +constexpr blocking_adaptation_t blocking_adaptation; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { +namespace blocking_adaptation { + +template struct disallowed_t; +template struct allowed_t; + +} // namespace blocking_adaptation + +template +struct blocking_adaptation_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef blocking_adaptation_t polymorphic_query_result_type; + + typedef detail::blocking_adaptation::disallowed_t disallowed_t; + typedef detail::blocking_adaptation::allowed_t allowed_t; + + ASIO_CONSTEXPR blocking_adaptation_t() + : value_(-1) + { + } + + ASIO_CONSTEXPR blocking_adaptation_t(disallowed_t) + : value_(0) + { + } + + ASIO_CONSTEXPR blocking_adaptation_t(allowed_t) + : value_(1) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member< + T, blocking_adaptation_t>::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member< + T, blocking_adaptation_t + >::is_noexcept)) + { + return traits::query_static_constexpr_member< + T, blocking_adaptation_t>::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member< + T, blocking_adaptation_t>::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member< + T, blocking_adaptation_t>::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = blocking_adaptation_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + friend ASIO_CONSTEXPR bool operator==( + const blocking_adaptation_t& a, const blocking_adaptation_t& b) + { + return a.value_ == b.value_; + } + + friend ASIO_CONSTEXPR bool operator!=( + const blocking_adaptation_t& a, const blocking_adaptation_t& b) + { + return a.value_ != b.value_; + } + + struct convertible_from_blocking_adaptation_t + { + ASIO_CONSTEXPR convertible_from_blocking_adaptation_t( + blocking_adaptation_t) + { + } + }; + + template + friend ASIO_CONSTEXPR blocking_adaptation_t query( + const Executor& ex, convertible_from_blocking_adaptation_t, + typename enable_if< + can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::disallowed_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, disallowed_t()); + } + + template + friend ASIO_CONSTEXPR blocking_adaptation_t query( + const Executor& ex, convertible_from_blocking_adaptation_t, + typename enable_if< + !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::allowed_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, allowed_t()); + } + + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(disallowed_t, disallowed); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(allowed_t, allowed); + +#if !defined(ASIO_HAS_CONSTEXPR) + static const blocking_adaptation_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) + +private: + int value_; +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T blocking_adaptation_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const blocking_adaptation_t blocking_adaptation_t::instance; +#endif + +template +const typename blocking_adaptation_t::disallowed_t +blocking_adaptation_t::disallowed; + +template +const typename blocking_adaptation_t::allowed_t +blocking_adaptation_t::allowed; + +namespace blocking_adaptation { + +template +struct disallowed_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef blocking_adaptation_t polymorphic_query_result_type; + + ASIO_CONSTEXPR disallowed_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR disallowed_t static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query >::value + >::type* = 0) ASIO_NOEXCEPT + { + return disallowed_t(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = disallowed_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR blocking_adaptation_t value() + { + return disallowed_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const disallowed_t&, const disallowed_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const disallowed_t&, const disallowed_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T disallowed_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +class adapter +{ +public: + adapter(int, const Executor& e) ASIO_NOEXCEPT + : executor_(e) + { + } + + adapter(const adapter& other) ASIO_NOEXCEPT + : executor_(other.executor_) + { + } + +#if defined(ASIO_HAS_MOVE) + adapter(adapter&& other) ASIO_NOEXCEPT + : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + template + static ASIO_CONSTEXPR allowed_t query( + blocking_adaptation_t) ASIO_NOEXCEPT + { + return allowed_t(); + } + + template + static ASIO_CONSTEXPR allowed_t query( + allowed_t) ASIO_NOEXCEPT + { + return allowed_t(); + } + + template + static ASIO_CONSTEXPR allowed_t query( + disallowed_t) ASIO_NOEXCEPT + { + return allowed_t(); + } + + template + typename enable_if< + can_query::value, + typename query_result::type + >::type query(const Property& p) const + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) + { + return asio::query(executor_, p); + } + + template + Executor require(disallowed_t) const ASIO_NOEXCEPT + { + return executor_; + } + + template + typename enable_if< + can_require::value, + adapter::type + >::type> + >::type require(const Property& p) const + ASIO_NOEXCEPT_IF(( + is_nothrow_require::value)) + { + return adapter::type + >::type>(0, asio::require(executor_, p)); + } + + template + typename enable_if< + can_prefer::value, + adapter::type + >::type> + >::type prefer(const Property& p) const + ASIO_NOEXCEPT_IF(( + is_nothrow_prefer::value)) + { + return adapter::type + >::type>(0, asio::prefer(executor_, p)); + } + + template + typename enable_if< + execution::can_execute::value + >::type execute(ASIO_MOVE_ARG(Function) f) const + { + execution::execute(executor_, ASIO_MOVE_CAST(Function)(f)); + } + + friend bool operator==(const adapter& a, const adapter& b) ASIO_NOEXCEPT + { + return a.executor_ == b.executor_; + } + + friend bool operator!=(const adapter& a, const adapter& b) ASIO_NOEXCEPT + { + return a.executor_ != b.executor_; + } + +private: + Executor executor_; +}; + +template +struct allowed_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef blocking_adaptation_t polymorphic_query_result_type; + + ASIO_CONSTEXPR allowed_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = allowed_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR blocking_adaptation_t value() + { + return allowed_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const allowed_t&, const allowed_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const allowed_t&, const allowed_t&) + { + return false; + } + + template + friend adapter require( + const Executor& e, const allowed_t&, + typename enable_if< + is_executor::value + >::type* = 0) + { + return adapter(0, e); + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T allowed_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +class blocking_execute_state +{ +public: + template + blocking_execute_state(ASIO_MOVE_ARG(F) f) + : func_(ASIO_MOVE_CAST(F)(f)), + is_complete_(false) + { + } + + template + void execute_and_wait(ASIO_MOVE_ARG(Executor) ex) + { + handler h = { this }; + execution::execute(ASIO_MOVE_CAST(Executor)(ex), h); + asio::detail::mutex::scoped_lock lock(mutex_); + while (!is_complete_) + event_.wait(lock); + } + + struct cleanup + { + ~cleanup() + { + asio::detail::mutex::scoped_lock lock(state_->mutex_); + state_->is_complete_ = true; + state_->event_.unlock_and_signal_one_for_destruction(lock); + } + + blocking_execute_state* state_; + }; + + struct handler + { + void operator()() + { + cleanup c = { state_ }; + state_->func_(); + } + + blocking_execute_state* state_; + }; + + Function func_; + asio::detail::mutex mutex_; + asio::detail::event event_; + bool is_complete_; +}; + +template +void blocking_execute( + ASIO_MOVE_ARG(Executor) ex, + ASIO_MOVE_ARG(Function) func) +{ + typedef typename decay::type func_t; + blocking_execute_state state(ASIO_MOVE_CAST(Function)(func)); + state.execute_and_wait(ex); +} + +} // namespace blocking_adaptation +} // namespace detail + +typedef detail::blocking_adaptation_t<> blocking_adaptation_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr blocking_adaptation_t blocking_adaptation; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const blocking_adaptation_t& + blocking_adaptation = blocking_adaptation_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free_default::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = (is_nothrow_query::value)); + + typedef execution::blocking_adaptation_t result_type; +}; + +template +struct query_free_default::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::blocking_adaptation_t result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef execution::blocking_adaptation_t::disallowed_t result_type; + + static ASIO_CONSTEXPR result_type value() + { + return result_type(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::blocking_adaptation_t::disallowed_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::blocking_adaptation_t::allowed_t>::value)); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT) + +template +struct require_free_default::type>::value + && execution::is_executor::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef execution::detail::blocking_adaptation::adapter result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +template +struct equality_comparable< + execution::detail::blocking_adaptation::adapter > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + +template +struct execute_member< + execution::detail::blocking_adaptation::adapter, Function> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) + +template +struct query_static_constexpr_member< + execution::detail::blocking_adaptation::adapter, + execution::detail::blocking_adaptation_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef execution::blocking_adaptation_t::allowed_t result_type; + + static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT + { + return result_type(); + } +}; + +template +struct query_static_constexpr_member< + execution::detail::blocking_adaptation::adapter, + execution::detail::blocking_adaptation::allowed_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef execution::blocking_adaptation_t::allowed_t result_type; + + static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT + { + return result_type(); + } +}; + +template +struct query_static_constexpr_member< + execution::detail::blocking_adaptation::adapter, + execution::detail::blocking_adaptation::disallowed_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef execution::blocking_adaptation_t::allowed_t result_type; + + static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT + { + return result_type(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) + +template +struct query_member< + execution::detail::blocking_adaptation::adapter, Property, + typename enable_if< + can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + typedef typename query_result::type result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) + +template +struct require_member< + execution::detail::blocking_adaptation::adapter, + execution::detail::blocking_adaptation::disallowed_t > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef Executor result_type; +}; + +template +struct require_member< + execution::detail::blocking_adaptation::adapter, Property, + typename enable_if< + can_require::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_require::value)); + typedef execution::detail::blocking_adaptation::adapter::type + >::type> result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) + +template +struct prefer_member< + execution::detail::blocking_adaptation::adapter, Property, + typename enable_if< + can_prefer::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_prefer::value)); + typedef execution::detail::blocking_adaptation::adapter::type + >::type> result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_BLOCKING_ADAPTATION_HPP diff --git a/include/asio/include/asio/execution/bulk_execute.hpp b/include/asio/include/asio/execution/bulk_execute.hpp new file mode 100644 index 0000000..001b608 --- /dev/null +++ b/include/asio/include/asio/execution/bulk_execute.hpp @@ -0,0 +1,390 @@ +// +// execution/bulk_execute.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_BULK_EXECUTE_HPP +#define ASIO_EXECUTION_BULK_EXECUTE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/bulk_guarantee.hpp" +#include "asio/execution/detail/bulk_sender.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/sender.hpp" +#include "asio/traits/bulk_execute_member.hpp" +#include "asio/traits/bulk_execute_free.hpp" + +#include "asio/detail/push_options.hpp" + +#if defined(GENERATING_DOCUMENTATION) + +namespace asio { +namespace execution { + +/// A customisation point that creates a bulk sender. +/** + * The name execution::bulk_execute denotes a customisation point + * object. If is_convertible_v is true, then the expression + * execution::bulk_execute(S, F, N) for some subexpressions + * S, F, and N is expression-equivalent to: + * + * @li S.bulk_execute(F, N), if that expression is valid. If the + * function selected does not execute N invocations of the function + * object F on the executor S in bulk with forward progress + * guarantee asio::query(S, execution::bulk_guarantee), and + * the result of that function does not model sender, the + * program is ill-formed with no diagnostic required. + * + * @li Otherwise, bulk_execute(S, F, N), if that expression is valid, + * with overload resolution performed in a context that includes the + * declaration void bulk_execute(); and that does not include a + * declaration of execution::bulk_execute. If the function selected + * by overload resolution does not execute N invocations of the + * function object F on the executor S in bulk with forward + * progress guarantee asio::query(E, + * execution::bulk_guarantee), and the result of that function does not + * model sender, the program is ill-formed with no diagnostic + * required. + * + * @li Otherwise, if the types F and + * executor_index_t> model invocable and + * if asio::query(S, execution::bulk_guarantee) equals + * execution::bulk_guarantee.unsequenced, then + * + * - Evaluates DECAY_COPY(std::forward(F)) on the + * calling thread to create a function object cf. [Note: + * Additional copies of cf may subsequently be created. --end + * note.] + * + * - For each value of i in N, cf(i) (or copy of + * cf)) will be invoked at most once by an execution agent that is + * unique for each value of i. + * + * - May block pending completion of one or more invocations of cf. + * + * - Synchronizes with (C++Std [intro.multithread]) the invocations of + * cf. + * + * @li Otherwise, execution::bulk_execute(S, F, N) is ill-formed. + */ +inline constexpr unspecified bulk_execute = unspecified; + +/// A type trait that determines whether a @c bulk_execute expression is +/// well-formed. +/** + * Class template @c can_bulk_execute is a trait that is derived from @c + * true_type if the expression execution::bulk_execute(std::declval(), + * std::declval(), std::declval) is well formed; otherwise @c + * false_type. + */ +template +struct can_bulk_execute : + integral_constant +{ +}; + +} // namespace execution +} // namespace asio + +#else // defined(GENERATING_DOCUMENTATION) + +namespace asio_execution_bulk_execute_fn { + +using asio::declval; +using asio::enable_if; +using asio::execution::bulk_guarantee_t; +using asio::execution::detail::bulk_sender; +using asio::execution::executor_index; +using asio::execution::is_sender; +using asio::is_convertible; +using asio::is_same; +using asio::remove_cvref; +using asio::result_of; +using asio::traits::bulk_execute_free; +using asio::traits::bulk_execute_member; +using asio::traits::static_require; + +void bulk_execute(); + +enum overload_type +{ + call_member, + call_free, + adapter, + ill_formed +}; + +template +struct call_traits +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef void result_type; +}; + +template +struct call_traits::value + && + bulk_execute_member::is_valid + && + is_sender< + typename bulk_execute_member::result_type + >::value + ) + >::type> : + bulk_execute_member +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member); +}; + +template +struct call_traits::value + && + !bulk_execute_member::is_valid + && + bulk_execute_free::is_valid + && + is_sender< + typename bulk_execute_free::result_type + >::value + ) + >::type> : + bulk_execute_free +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free); +}; + +template +struct call_traits::value + && + !bulk_execute_member::is_valid + && + !bulk_execute_free::is_valid + && + is_sender::value + && + is_same< + typename result_of< + F(typename executor_index::type>::type) + >::type, + typename result_of< + F(typename executor_index::type>::type) + >::type + >::value + && + static_require::is_valid + ) + >::type> +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef bulk_sender result_type; +}; + +struct impl +{ +#if defined(ASIO_HAS_MOVE) + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(S&& s, F&& f, N&& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return ASIO_MOVE_CAST(S)(s).bulk_execute( + ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(S&& s, F&& f, N&& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return bulk_execute(ASIO_MOVE_CAST(S)(s), + ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(S&& s, F&& f, N&& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type( + ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(F)(f), + ASIO_MOVE_CAST(N)(n)); + } +#else // defined(ASIO_HAS_MOVE) + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(S& s, const F& f, const N& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.bulk_execute(ASIO_MOVE_CAST(F)(f), + ASIO_MOVE_CAST(N)(n)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(const S& s, const F& f, const N& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.bulk_execute(ASIO_MOVE_CAST(F)(f), + ASIO_MOVE_CAST(N)(n)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(S& s, const F& f, const N& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return bulk_execute(s, ASIO_MOVE_CAST(F)(f), + ASIO_MOVE_CAST(N)(n)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(const S& s, const F& f, const N& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return bulk_execute(s, ASIO_MOVE_CAST(F)(f), + ASIO_MOVE_CAST(N)(n)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(S& s, const F& f, const N& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type( + s, ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(const S& s, const F& f, const N& n) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type( + s, ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n)); + } +#endif // defined(ASIO_HAS_MOVE) +}; + +template +struct static_instance +{ + static const T instance; +}; + +template +const T static_instance::instance = {}; + +} // namespace asio_execution_bulk_execute_fn +namespace asio { +namespace execution { +namespace { + +static ASIO_CONSTEXPR + const asio_execution_bulk_execute_fn::impl& bulk_execute = + asio_execution_bulk_execute_fn::static_instance<>::instance; + +} // namespace + +template +struct can_bulk_execute : + integral_constant::overload != + asio_execution_bulk_execute_fn::ill_formed> +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +constexpr bool can_bulk_execute_v = can_bulk_execute::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_nothrow_bulk_execute : + integral_constant::is_noexcept> +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +constexpr bool is_nothrow_bulk_execute_v + = is_nothrow_bulk_execute::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct bulk_execute_result +{ + typedef typename asio_execution_bulk_execute_fn::call_traits< + S, void(F, N)>::result_type type; +}; + +} // namespace execution +} // namespace asio + +#endif // defined(GENERATING_DOCUMENTATION) + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_BULK_EXECUTE_HPP diff --git a/include/asio/include/asio/execution/bulk_guarantee.hpp b/include/asio/include/asio/execution/bulk_guarantee.hpp new file mode 100644 index 0000000..4a099f5 --- /dev/null +++ b/include/asio/include/asio/execution/bulk_guarantee.hpp @@ -0,0 +1,1018 @@ +// +// execution/bulk_guarantee.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_BULK_GUARANTEE_HPP +#define ASIO_EXECUTION_BULK_GUARANTEE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/query.hpp" +#include "asio/traits/query_free.hpp" +#include "asio/traits/query_member.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" +#include "asio/traits/static_require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property to communicate the forward progress and ordering guarantees of +/// execution agents associated with the bulk execution. +struct bulk_guarantee_t +{ + /// The bulk_guarantee_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The top-level bulk_guarantee_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The top-level bulk_guarantee_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef bulk_guarantee_t polymorphic_query_result_type; + + /// A sub-property that indicates that execution agents within the same bulk + /// execution may be parallelised and vectorised. + struct unsequenced_t + { + /// The bulk_guarantee_t::unsequenced_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The bulk_guarantee_t::unsequenced_t property can be required. + static constexpr bool is_requirable = true; + + /// The bulk_guarantee_t::unsequenced_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef bulk_guarantee_t polymorphic_query_result_type; + + /// Default constructor. + constexpr unsequenced_t(); + + /// Get the value associated with a property object. + /** + * @returns unsequenced_t(); + */ + static constexpr bulk_guarantee_t value(); + }; + + /// A sub-property that indicates that execution agents within the same bulk + /// execution may not be parallelised and vectorised. + struct sequenced_t + { + /// The bulk_guarantee_t::sequenced_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The bulk_guarantee_t::sequenced_t property can be required. + static constexpr bool is_requirable = true; + + /// The bulk_guarantee_t::sequenced_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef bulk_guarantee_t polymorphic_query_result_type; + + /// Default constructor. + constexpr sequenced_t(); + + /// Get the value associated with a property object. + /** + * @returns sequenced_t(); + */ + static constexpr bulk_guarantee_t value(); + }; + + /// A sub-property that indicates that execution agents within the same bulk + /// execution may be parallelised. + struct parallel_t + { + /// The bulk_guarantee_t::parallel_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The bulk_guarantee_t::parallel_t property can be required. + static constexpr bool is_requirable = true; + + /// The bulk_guarantee_t::parallel_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef bulk_guarantee_t polymorphic_query_result_type; + + /// Default constructor. + constexpr parallel_t(); + + /// Get the value associated with a property object. + /** + * @returns parallel_t(); + */ + static constexpr bulk_guarantee_t value(); + }; + + /// A special value used for accessing the bulk_guarantee_t::unsequenced_t + /// property. + static constexpr unsequenced_t unsequenced; + + /// A special value used for accessing the bulk_guarantee_t::sequenced_t + /// property. + static constexpr sequenced_t sequenced; + + /// A special value used for accessing the bulk_guarantee_t::parallel_t + /// property. + static constexpr parallel_t parallel; + + /// Default constructor. + constexpr bulk_guarantee_t(); + + /// Construct from a sub-property value. + constexpr bulk_guarantee_t(unsequenced_t); + + /// Construct from a sub-property value. + constexpr bulk_guarantee_t(sequenced_t); + + /// Construct from a sub-property value. + constexpr bulk_guarantee_t(parallel_t); + + /// Compare property values for equality. + friend constexpr bool operator==( + const bulk_guarantee_t& a, const bulk_guarantee_t& b) noexcept; + + /// Compare property values for inequality. + friend constexpr bool operator!=( + const bulk_guarantee_t& a, const bulk_guarantee_t& b) noexcept; +}; + +/// A special value used for accessing the bulk_guarantee_t property. +constexpr bulk_guarantee_t bulk_guarantee; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { +namespace bulk_guarantee { + +template struct unsequenced_t; +template struct sequenced_t; +template struct parallel_t; + +} // namespace bulk_guarantee + +template +struct bulk_guarantee_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef bulk_guarantee_t polymorphic_query_result_type; + + typedef detail::bulk_guarantee::unsequenced_t unsequenced_t; + typedef detail::bulk_guarantee::sequenced_t sequenced_t; + typedef detail::bulk_guarantee::parallel_t parallel_t; + + ASIO_CONSTEXPR bulk_guarantee_t() + : value_(-1) + { + } + + ASIO_CONSTEXPR bulk_guarantee_t(unsequenced_t) + : value_(0) + { + } + + ASIO_CONSTEXPR bulk_guarantee_t(sequenced_t) + : value_(1) + { + } + + ASIO_CONSTEXPR bulk_guarantee_t(parallel_t) + : value_(2) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member< + T, bulk_guarantee_t>::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = bulk_guarantee_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + friend ASIO_CONSTEXPR bool operator==( + const bulk_guarantee_t& a, const bulk_guarantee_t& b) + { + return a.value_ == b.value_; + } + + friend ASIO_CONSTEXPR bool operator!=( + const bulk_guarantee_t& a, const bulk_guarantee_t& b) + { + return a.value_ != b.value_; + } + + struct convertible_from_bulk_guarantee_t + { + ASIO_CONSTEXPR convertible_from_bulk_guarantee_t(bulk_guarantee_t) {} + }; + + template + friend ASIO_CONSTEXPR bulk_guarantee_t query( + const Executor& ex, convertible_from_bulk_guarantee_t, + typename enable_if< + can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::unsequenced_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, unsequenced_t()); + } + + template + friend ASIO_CONSTEXPR bulk_guarantee_t query( + const Executor& ex, convertible_from_bulk_guarantee_t, + typename enable_if< + !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::sequenced_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, sequenced_t()); + } + + template + friend ASIO_CONSTEXPR bulk_guarantee_t query( + const Executor& ex, convertible_from_bulk_guarantee_t, + typename enable_if< + !can_query::value + && !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::parallel_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, parallel_t()); + } + + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(unsequenced_t, unsequenced); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(sequenced_t, sequenced); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(parallel_t, parallel); + +#if !defined(ASIO_HAS_CONSTEXPR) + static const bulk_guarantee_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) + +private: + int value_; +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T bulk_guarantee_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const bulk_guarantee_t bulk_guarantee_t::instance; +#endif + +template +const typename bulk_guarantee_t::unsequenced_t +bulk_guarantee_t::unsequenced; + +template +const typename bulk_guarantee_t::sequenced_t +bulk_guarantee_t::sequenced; + +template +const typename bulk_guarantee_t::parallel_t +bulk_guarantee_t::parallel; + +namespace bulk_guarantee { + +template +struct unsequenced_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef bulk_guarantee_t polymorphic_query_result_type; + + ASIO_CONSTEXPR unsequenced_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR unsequenced_t static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query >::value + && !can_query >::value + >::type* = 0) ASIO_NOEXCEPT + { + return unsequenced_t(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = unsequenced_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR bulk_guarantee_t value() + { + return unsequenced_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const unsequenced_t&, const unsequenced_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const unsequenced_t&, const unsequenced_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator==( + const unsequenced_t&, const sequenced_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const unsequenced_t&, const sequenced_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator==( + const unsequenced_t&, const parallel_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const unsequenced_t&, const parallel_t&) + { + return true; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T unsequenced_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct sequenced_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef bulk_guarantee_t polymorphic_query_result_type; + + ASIO_CONSTEXPR sequenced_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = sequenced_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR bulk_guarantee_t value() + { + return sequenced_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const sequenced_t&, const sequenced_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const sequenced_t&, const sequenced_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator==( + const sequenced_t&, const unsequenced_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const sequenced_t&, const unsequenced_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator==( + const sequenced_t&, const parallel_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const sequenced_t&, const parallel_t&) + { + return true; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T sequenced_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct parallel_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef bulk_guarantee_t polymorphic_query_result_type; + + ASIO_CONSTEXPR parallel_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = parallel_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR bulk_guarantee_t value() + { + return parallel_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const parallel_t&, const parallel_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const parallel_t&, const parallel_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator==( + const parallel_t&, const unsequenced_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const parallel_t&, const unsequenced_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator==( + const parallel_t&, const sequenced_t&) + { + return false; + } + + friend ASIO_CONSTEXPR bool operator!=( + const parallel_t&, const sequenced_t&) + { + return true; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T parallel_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace bulk_guarantee +} // namespace detail + +typedef detail::bulk_guarantee_t<> bulk_guarantee_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr bulk_guarantee_t bulk_guarantee; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const bulk_guarantee_t& + bulk_guarantee = bulk_guarantee_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free_default::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::bulk_guarantee_t result_type; +}; + +template +struct query_free_default::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::bulk_guarantee_t result_type; +}; + +template +struct query_free_default::value + && !can_query::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::bulk_guarantee_t result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query::value + && !can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef execution::bulk_guarantee_t::unsequenced_t result_type; + + static ASIO_CONSTEXPR result_type value() + { + return result_type(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::bulk_guarantee_t::unsequenced_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::bulk_guarantee_t::sequenced_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::bulk_guarantee_t::parallel_t>::value)); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_BULK_GUARANTEE_HPP diff --git a/include/asio/include/asio/execution/connect.hpp b/include/asio/include/asio/execution/connect.hpp new file mode 100644 index 0000000..47dd58b --- /dev/null +++ b/include/asio/include/asio/execution/connect.hpp @@ -0,0 +1,486 @@ +// +// execution/connect.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_CONNECT_HPP +#define ASIO_EXECUTION_CONNECT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/detail/as_invocable.hpp" +#include "asio/execution/detail/as_operation.hpp" +#include "asio/execution/detail/as_receiver.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/operation_state.hpp" +#include "asio/execution/receiver.hpp" +#include "asio/execution/sender.hpp" +#include "asio/traits/connect_member.hpp" +#include "asio/traits/connect_free.hpp" + +#include "asio/detail/push_options.hpp" + +#if defined(GENERATING_DOCUMENTATION) + +namespace asio { +namespace execution { + +/// A customisation point that connects a sender to a receiver. +/** + * The name execution::connect denotes a customisation point object. + * For some subexpressions s and r, let S be a type + * such that decltype((s)) is S and let R be a type + * such that decltype((r)) is R. The expression + * execution::connect(s, r) is expression-equivalent to: + * + * @li s.connect(r), if that expression is valid, if its type + * satisfies operation_state, and if S satisfies + * sender. + * + * @li Otherwise, connect(s, r), if that expression is valid, if its + * type satisfies operation_state, and if S satisfies + * sender, with overload resolution performed in a context that + * includes the declaration void connect(); and that does not include + * a declaration of execution::connect. + * + * @li Otherwise, as_operation{s, r}, if r is not an instance + * of as_receiver for some type F, and if + * receiver_of && executor_of, + * as_invocable, S>> is true, where + * as_operation is an implementation-defined class equivalent to + * @code template + * struct as_operation + * { + * remove_cvref_t e_; + * remove_cvref_t r_; + * void start() noexcept try { + * execution::execute(std::move(e_), + * as_invocable, S>{r_}); + * } catch(...) { + * execution::set_error(std::move(r_), current_exception()); + * } + * }; @endcode + * and as_invocable is a class template equivalent to the following: + * @code template + * struct as_invocable + * { + * R* r_; + * explicit as_invocable(R& r) noexcept + * : r_(std::addressof(r)) {} + * as_invocable(as_invocable && other) noexcept + * : r_(std::exchange(other.r_, nullptr)) {} + * ~as_invocable() { + * if(r_) + * execution::set_done(std::move(*r_)); + * } + * void operator()() & noexcept try { + * execution::set_value(std::move(*r_)); + * r_ = nullptr; + * } catch(...) { + * execution::set_error(std::move(*r_), current_exception()); + * r_ = nullptr; + * } + * }; + * @endcode + * + * @li Otherwise, execution::connect(s, r) is ill-formed. + */ +inline constexpr unspecified connect = unspecified; + +/// A type trait that determines whether a @c connect expression is +/// well-formed. +/** + * Class template @c can_connect is a trait that is derived from + * @c true_type if the expression execution::connect(std::declval(), + * std::declval()) is well formed; otherwise @c false_type. + */ +template +struct can_connect : + integral_constant +{ +}; + +/// A type trait to determine the result of a @c connect expression. +template +struct connect_result +{ + /// The type of the connect expression. + /** + * The type of the expression execution::connect(std::declval(), + * std::declval()). + */ + typedef automatically_determined type; +}; + +/// A type alis to determine the result of a @c connect expression. +template +using connect_result_t = typename connect_result::type; + +} // namespace execution +} // namespace asio + +#else // defined(GENERATING_DOCUMENTATION) + +namespace asio_execution_connect_fn { + +using asio::conditional; +using asio::declval; +using asio::enable_if; +using asio::execution::detail::as_invocable; +using asio::execution::detail::as_operation; +using asio::execution::detail::is_as_receiver; +using asio::execution::is_executor_of; +using asio::execution::is_operation_state; +using asio::execution::is_receiver; +using asio::execution::is_sender; +using asio::false_type; +using asio::remove_cvref; +using asio::traits::connect_free; +using asio::traits::connect_member; + +void connect(); + +enum overload_type +{ + call_member, + call_free, + adapter, + ill_formed +}; + +template +struct call_traits +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef void result_type; +}; + +template +struct call_traits::is_valid + && + is_operation_state::result_type>::value + && + is_sender::type>::value + ) + >::type> : + connect_member +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member); +}; + +template +struct call_traits::is_valid + && + connect_free::is_valid + && + is_operation_state::result_type>::value + && + is_sender::type>::value + ) + >::type> : + connect_free +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free); +}; + +template +struct call_traits::is_valid + && + !connect_free::is_valid + && + is_receiver::value + && + conditional< + !is_as_receiver< + typename remove_cvref::type + >::value, + is_executor_of< + typename remove_cvref::type, + as_invocable::type, S> + >, + false_type + >::type::value + ) + >::type> +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef as_operation result_type; +}; + +struct impl +{ +#if defined(ASIO_HAS_MOVE) + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(S&& s, R&& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return ASIO_MOVE_CAST(S)(s).connect(ASIO_MOVE_CAST(R)(r)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(S&& s, R&& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return connect(ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(R)(r)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(S&& s, R&& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type( + ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(R)(r)); + } +#else // defined(ASIO_HAS_MOVE) + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(S& s, R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.connect(r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(const S& s, R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.connect(r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(S& s, R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return connect(s, r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(const S& s, R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return connect(s, r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(S& s, R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type(s, r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(const S& s, R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type(s, r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(S& s, const R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.connect(r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(const S& s, const R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.connect(r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(S& s, const R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return connect(s, r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(const S& s, const R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return connect(s, r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(S& s, const R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type(s, r); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()(const S& s, const R& r) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return typename call_traits::result_type(s, r); + } +#endif // defined(ASIO_HAS_MOVE) +}; + +template +struct static_instance +{ + static const T instance; +}; + +template +const T static_instance::instance = {}; + +} // namespace asio_execution_connect_fn +namespace asio { +namespace execution { +namespace { + +static ASIO_CONSTEXPR const asio_execution_connect_fn::impl& + connect = asio_execution_connect_fn::static_instance<>::instance; + +} // namespace + +template +struct can_connect : + integral_constant::overload != + asio_execution_connect_fn::ill_formed> +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +constexpr bool can_connect_v = can_connect::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_nothrow_connect : + integral_constant::is_noexcept> +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +constexpr bool is_nothrow_connect_v + = is_nothrow_connect::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct connect_result +{ + typedef typename asio_execution_connect_fn::call_traits< + S, void(R)>::result_type type; +}; + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template +using connect_result_t = typename connect_result::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +} // namespace execution +} // namespace asio + +#endif // defined(GENERATING_DOCUMENTATION) + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_CONNECT_HPP diff --git a/include/asio/include/asio/execution/context.hpp b/include/asio/include/asio/execution/context.hpp new file mode 100644 index 0000000..4a535d6 --- /dev/null +++ b/include/asio/include/asio/execution/context.hpp @@ -0,0 +1,185 @@ +// +// execution/context.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_CONTEXT2_HPP +#define ASIO_EXECUTION_CONTEXT2_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" + +#if defined(ASIO_HAS_STD_ANY) +# include +#endif // defined(ASIO_HAS_STD_ANY) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property that is used to obtain the execution context that is associated +/// with an executor. +struct context_t +{ + /// The context_t property applies to executors, senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The context_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The context_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef std::any polymorphic_query_result_type; +}; + +/// A special value used for accessing the context_t property. +constexpr context_t context; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { + +template +struct context_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + +#if defined(ASIO_HAS_STD_ANY) + typedef std::any polymorphic_query_result_type; +#endif // defined(ASIO_HAS_STD_ANY) + + ASIO_CONSTEXPR context_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = context_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) + static const context_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T context_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const context_t context_t::instance; +#endif + +} // namespace detail + +typedef detail::context_t<> context_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr context_t context; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const context_t& context = context_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_CONTEXT2_HPP diff --git a/include/asio/include/asio/execution/context_as.hpp b/include/asio/include/asio/execution/context_as.hpp new file mode 100644 index 0000000..8acc945 --- /dev/null +++ b/include/asio/include/asio/execution/context_as.hpp @@ -0,0 +1,201 @@ +// +// execution/context_as.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_CONTEXT_AS_HPP +#define ASIO_EXECUTION_CONTEXT_AS_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/context.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/query.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property that is used to obtain the execution context that is associated +/// with an executor. +template +struct context_as_t +{ + /// The context_as_t property applies to executors, senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The context_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The context_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef T polymorphic_query_result_type; +}; + +/// A special value used for accessing the context_as_t property. +template +constexpr context_as_t context_as; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { + +template +struct context_as_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + + typedef T polymorphic_query_result_type; + + ASIO_CONSTEXPR context_as_t() + { + } + + ASIO_CONSTEXPR context_as_t(context_t) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const U static_query_v + = context_as_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + template + friend ASIO_CONSTEXPR U query( + const Executor& ex, const context_as_t&, + typename enable_if< + is_same::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, context); + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const U context_as_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if (defined(ASIO_HAS_VARIABLE_TEMPLATES) \ + && defined(ASIO_HAS_CONSTEXPR)) \ + || defined(GENERATING_DOCUMENTATION) +template +constexpr context_as_t context_as{}; +#endif // (defined(ASIO_HAS_VARIABLE_TEMPLATES) + // && defined(ASIO_HAS_CONSTEXPR)) + // || defined(GENERATING_DOCUMENTATION) + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property > + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query, + typename enable_if< + static_query::is_valid + >::type> : static_query +{ +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free, + typename enable_if< + can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef U result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_CONTEXT_AS_HPP diff --git a/include/asio/include/asio/execution/detail/as_invocable.hpp b/include/asio/include/asio/execution/detail/as_invocable.hpp new file mode 100644 index 0000000..d91c700 --- /dev/null +++ b/include/asio/include/asio/execution/detail/as_invocable.hpp @@ -0,0 +1,152 @@ +// +// execution/detail/as_invocable.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_DETAIL_AS_INVOCABLE_HPP +#define ASIO_EXECUTION_DETAIL_AS_INVOCABLE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/atomic_count.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/receiver_invocation_error.hpp" +#include "asio/execution/set_done.hpp" +#include "asio/execution/set_error.hpp" +#include "asio/execution/set_value.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +#if defined(ASIO_HAS_MOVE) + +template +struct as_invocable +{ + Receiver* receiver_; + + explicit as_invocable(Receiver& r) ASIO_NOEXCEPT + : receiver_(asio::detail::addressof(r)) + { + } + + as_invocable(as_invocable&& other) ASIO_NOEXCEPT + : receiver_(other.receiver_) + { + other.receiver_ = 0; + } + + ~as_invocable() + { + if (receiver_) + execution::set_done(ASIO_MOVE_OR_LVALUE(Receiver)(*receiver_)); + } + + void operator()() ASIO_LVALUE_REF_QUAL ASIO_NOEXCEPT + { +#if !defined(ASIO_NO_EXCEPTIONS) + try + { +#endif // !defined(ASIO_NO_EXCEPTIONS) + execution::set_value(ASIO_MOVE_CAST(Receiver)(*receiver_)); + receiver_ = 0; +#if !defined(ASIO_NO_EXCEPTIONS) + } + catch (...) + { +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) + execution::set_error(ASIO_MOVE_CAST(Receiver)(*receiver_), + std::make_exception_ptr(receiver_invocation_error())); + receiver_ = 0; +#else // defined(ASIO_HAS_STD_EXCEPTION_PTR) + std::terminate(); +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + } +#endif // !defined(ASIO_NO_EXCEPTIONS) + } +}; + +#else // defined(ASIO_HAS_MOVE) + +template +struct as_invocable +{ + Receiver* receiver_; + asio::detail::shared_ptr ref_count_; + + explicit as_invocable(Receiver& r, + const asio::detail::shared_ptr< + asio::detail::atomic_count>& c) ASIO_NOEXCEPT + : receiver_(asio::detail::addressof(r)), + ref_count_(c) + { + } + + as_invocable(const as_invocable& other) ASIO_NOEXCEPT + : receiver_(other.receiver_), + ref_count_(other.ref_count_) + { + ++(*ref_count_); + } + + ~as_invocable() + { + if (--(*ref_count_) == 0) + execution::set_done(*receiver_); + } + + void operator()() ASIO_LVALUE_REF_QUAL ASIO_NOEXCEPT + { +#if !defined(ASIO_NO_EXCEPTIONS) + try + { +#endif // !defined(ASIO_NO_EXCEPTIONS) + execution::set_value(*receiver_); + ++(*ref_count_); + } +#if !defined(ASIO_NO_EXCEPTIONS) + catch (...) + { +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) + execution::set_error(*receiver_, + std::make_exception_ptr(receiver_invocation_error())); + ++(*ref_count_); +#else // defined(ASIO_HAS_STD_EXCEPTION_PTR) + std::terminate(); +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + } +#endif // !defined(ASIO_NO_EXCEPTIONS) + } +}; + +#endif // defined(ASIO_HAS_MOVE) + +template +struct is_as_invocable : false_type +{ +}; + +template +struct is_as_invocable > : true_type +{ +}; + +} // namespace detail +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_DETAIL_AS_INVOCABLE_HPP diff --git a/include/asio/include/asio/execution/detail/as_operation.hpp b/include/asio/include/asio/execution/detail/as_operation.hpp new file mode 100644 index 0000000..fcaf5c3 --- /dev/null +++ b/include/asio/include/asio/execution/detail/as_operation.hpp @@ -0,0 +1,105 @@ +// +// execution/detail/as_operation.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_DETAIL_AS_OPERATION_HPP +#define ASIO_EXECUTION_DETAIL_AS_OPERATION_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/memory.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/detail/as_invocable.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/set_error.hpp" +#include "asio/traits/start_member.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct as_operation +{ + typename remove_cvref::type ex_; + typename remove_cvref::type receiver_; +#if !defined(ASIO_HAS_MOVE) + asio::detail::shared_ptr ref_count_; +#endif // !defined(ASIO_HAS_MOVE) + + template + explicit as_operation(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(R) r) + : ex_(ASIO_MOVE_CAST(E)(e)), + receiver_(ASIO_MOVE_CAST(R)(r)) +#if !defined(ASIO_HAS_MOVE) + , ref_count_(new asio::detail::atomic_count(1)) +#endif // !defined(ASIO_HAS_MOVE) + { + } + + void start() ASIO_NOEXCEPT + { +#if !defined(ASIO_NO_EXCEPTIONS) + try + { +#endif // !defined(ASIO_NO_EXCEPTIONS) + execution::execute( + ASIO_MOVE_CAST(typename remove_cvref::type)(ex_), + as_invocable::type, + Executor>(receiver_ +#if !defined(ASIO_HAS_MOVE) + , ref_count_ +#endif // !defined(ASIO_HAS_MOVE) + )); +#if !defined(ASIO_NO_EXCEPTIONS) + } + catch (...) + { +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) + execution::set_error( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)( + receiver_), + std::current_exception()); +#else // defined(ASIO_HAS_STD_EXCEPTION_PTR) + std::terminate(); +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + } +#endif // !defined(ASIO_NO_EXCEPTIONS) + } +}; + +} // namespace detail +} // namespace execution +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT) + +template +struct start_member< + asio::execution::detail::as_operation > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT) + +} // namespace traits +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_DETAIL_AS_OPERATION_HPP diff --git a/include/asio/include/asio/execution/detail/as_receiver.hpp b/include/asio/include/asio/execution/detail/as_receiver.hpp new file mode 100644 index 0000000..e4d74ed --- /dev/null +++ b/include/asio/include/asio/execution/detail/as_receiver.hpp @@ -0,0 +1,128 @@ +// +// execution/detail/as_receiver.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_DETAIL_AS_RECEIVER_HPP +#define ASIO_EXECUTION_DETAIL_AS_RECEIVER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/traits/set_done_member.hpp" +#include "asio/traits/set_error_member.hpp" +#include "asio/traits/set_value_member.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct as_receiver +{ + Function f_; + + template + explicit as_receiver(ASIO_MOVE_ARG(F) f, int) + : f_(ASIO_MOVE_CAST(F)(f)) + { + } + +#if defined(ASIO_MSVC) && defined(ASIO_HAS_MOVE) + as_receiver(as_receiver&& other) + : f_(ASIO_MOVE_CAST(Function)(other.f_)) + { + } +#endif // defined(ASIO_MSVC) && defined(ASIO_HAS_MOVE) + + void set_value() + ASIO_NOEXCEPT_IF(noexcept(declval()())) + { + f_(); + } + + template + void set_error(E) ASIO_NOEXCEPT + { + std::terminate(); + } + + void set_done() ASIO_NOEXCEPT + { + } +}; + +template +struct is_as_receiver : false_type +{ +}; + +template +struct is_as_receiver > : true_type +{ +}; + +} // namespace detail +} // namespace execution +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +template +struct set_value_member< + asio::execution::detail::as_receiver, void()> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); +#if defined(ASIO_HAS_NOEXCEPT) + ASIO_STATIC_CONSTEXPR(bool, + is_noexcept = noexcept(declval()())); +#else // defined(ASIO_HAS_NOEXCEPT) + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); +#endif // defined(ASIO_HAS_NOEXCEPT) + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +template +struct set_error_member< + asio::execution::detail::as_receiver, E> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +template +struct set_done_member< + asio::execution::detail::as_receiver > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +} // namespace traits +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_DETAIL_AS_RECEIVER_HPP diff --git a/include/asio/include/asio/execution/detail/bulk_sender.hpp b/include/asio/include/asio/execution/detail/bulk_sender.hpp new file mode 100644 index 0000000..c1f6de4 --- /dev/null +++ b/include/asio/include/asio/execution/detail/bulk_sender.hpp @@ -0,0 +1,261 @@ +// +// execution/detail/bulk_sender.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_DETAIL_BULK_SENDER_HPP +#define ASIO_EXECUTION_DETAIL_BULK_SENDER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/connect.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/set_done.hpp" +#include "asio/execution/set_error.hpp" +#include "asio/traits/connect_member.hpp" +#include "asio/traits/set_done_member.hpp" +#include "asio/traits/set_error_member.hpp" +#include "asio/traits/set_value_member.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct bulk_receiver +{ + typename remove_cvref::type receiver_; + typename decay::type f_; + typename decay::type n_; + + template + explicit bulk_receiver(ASIO_MOVE_ARG(R) r, + ASIO_MOVE_ARG(F) f, ASIO_MOVE_ARG(N) n) + : receiver_(ASIO_MOVE_CAST(R)(r)), + f_(ASIO_MOVE_CAST(F)(f)), + n_(ASIO_MOVE_CAST(N)(n)) + { + } + + void set_value() + { + for (Index i = 0; i < n_; ++i) + f_(i); + + execution::set_value( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)(receiver_)); + } + + template + void set_error(ASIO_MOVE_ARG(Error) e) ASIO_NOEXCEPT + { + execution::set_error( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)(receiver_), + ASIO_MOVE_CAST(Error)(e)); + } + + void set_done() ASIO_NOEXCEPT + { + execution::set_done( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)(receiver_)); + } +}; + +template +struct bulk_receiver_traits +{ + typedef bulk_receiver< + Receiver, Function, Number, + typename execution::executor_index< + typename remove_cvref::type + >::type + > type; + +#if defined(ASIO_HAS_MOVE) + typedef type arg_type; +#else // defined(ASIO_HAS_MOVE) + typedef const type& arg_type; +#endif // defined(ASIO_HAS_MOVE) +}; + +template +struct bulk_sender : sender_base +{ + typename remove_cvref::type sender_; + typename decay::type f_; + typename decay::type n_; + + template + explicit bulk_sender(ASIO_MOVE_ARG(S) s, + ASIO_MOVE_ARG(F) f, ASIO_MOVE_ARG(N) n) + : sender_(ASIO_MOVE_CAST(S)(s)), + f_(ASIO_MOVE_CAST(F)(f)), + n_(ASIO_MOVE_CAST(N)(n)) + { + } + + template + typename connect_result< + ASIO_MOVE_OR_LVALUE_TYPE(typename remove_cvref::type), + typename bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::type connect(ASIO_MOVE_ARG(Receiver) r, + typename enable_if< + can_connect< + typename remove_cvref::type, + typename bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::value + >::type* = 0) ASIO_RVALUE_REF_QUAL ASIO_NOEXCEPT + { + return execution::connect( + ASIO_MOVE_OR_LVALUE(typename remove_cvref::type)(sender_), + typename bulk_receiver_traits::type( + ASIO_MOVE_CAST(Receiver)(r), + ASIO_MOVE_CAST(typename decay::type)(f_), + ASIO_MOVE_CAST(typename decay::type)(n_))); + } + + template + typename connect_result< + const typename remove_cvref::type&, + typename bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::type connect(ASIO_MOVE_ARG(Receiver) r, + typename enable_if< + can_connect< + const typename remove_cvref::type&, + typename bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::value + >::type* = 0) const ASIO_LVALUE_REF_QUAL ASIO_NOEXCEPT + { + return execution::connect(sender_, + typename bulk_receiver_traits::type( + ASIO_MOVE_CAST(Receiver)(r), f_, n_)); + } +}; + +} // namespace detail +} // namespace execution +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +template +struct set_value_member< + execution::detail::bulk_receiver, + void()> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +template +struct set_error_member< + execution::detail::bulk_receiver, + Error> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +template +struct set_done_member< + execution::detail::bulk_receiver > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT) + +template +struct connect_member< + execution::detail::bulk_sender, + Receiver, + typename enable_if< + execution::can_connect< + ASIO_MOVE_OR_LVALUE_TYPE(typename remove_cvref::type), + typename execution::detail::bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef typename execution::connect_result< + ASIO_MOVE_OR_LVALUE_TYPE(typename remove_cvref::type), + typename execution::detail::bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::type result_type; +}; + +template +struct connect_member< + const execution::detail::bulk_sender, + Receiver, + typename enable_if< + execution::can_connect< + const typename remove_cvref::type&, + typename execution::detail::bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef typename execution::connect_result< + const typename remove_cvref::type&, + typename execution::detail::bulk_receiver_traits< + Sender, Receiver, Function, Number + >::arg_type + >::type result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT) + +} // namespace traits +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_DETAIL_BULK_SENDER_HPP diff --git a/include/asio/include/asio/execution/detail/submit_receiver.hpp b/include/asio/include/asio/execution/detail/submit_receiver.hpp new file mode 100644 index 0000000..5f78356 --- /dev/null +++ b/include/asio/include/asio/execution/detail/submit_receiver.hpp @@ -0,0 +1,233 @@ +// +// execution/detail/submit_receiver.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_DETAIL_SUBMIT_RECEIVER_HPP +#define ASIO_EXECUTION_DETAIL_SUBMIT_RECEIVER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/detail/variadic_templates.hpp" +#include "asio/execution/connect.hpp" +#include "asio/execution/receiver.hpp" +#include "asio/execution/set_done.hpp" +#include "asio/execution/set_error.hpp" +#include "asio/execution/set_value.hpp" +#include "asio/traits/set_done_member.hpp" +#include "asio/traits/set_error_member.hpp" +#include "asio/traits/set_value_member.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct submit_receiver; + +template +struct submit_receiver_wrapper +{ + submit_receiver* p_; + + explicit submit_receiver_wrapper(submit_receiver* p) + : p_(p) + { + } + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + + template + typename enable_if::value>::type + set_value(ASIO_MOVE_ARG(Args)... args) ASIO_RVALUE_REF_QUAL + ASIO_NOEXCEPT_IF((is_nothrow_receiver_of::value)) + { + execution::set_value( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)(p_->r_), + ASIO_MOVE_CAST(Args)(args)...); + delete p_; + } + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + + void set_value() ASIO_RVALUE_REF_QUAL + ASIO_NOEXCEPT_IF((is_nothrow_receiver_of::value)) + { + execution::set_value( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)(p_->r_)); + delete p_; + } + +#define ASIO_PRIVATE_SUBMIT_RECEIVER_SET_VALUE_DEF(n) \ + template \ + typename enable_if::value>::type \ + set_value(ASIO_VARIADIC_MOVE_PARAMS(n)) ASIO_RVALUE_REF_QUAL \ + ASIO_NOEXCEPT_IF((is_nothrow_receiver_of< \ + Receiver, ASIO_VARIADIC_TARGS(n)>::value)) \ + { \ + execution::set_value( \ + ASIO_MOVE_OR_LVALUE( \ + typename remove_cvref::type)(p_->r_), \ + ASIO_VARIADIC_MOVE_ARGS(n)); \ + delete p_; \ + } \ + /**/ +ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SUBMIT_RECEIVER_SET_VALUE_DEF) +#undef ASIO_PRIVATE_SUBMIT_RECEIVER_SET_VALUE_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + + template + void set_error(ASIO_MOVE_ARG(E) e) + ASIO_RVALUE_REF_QUAL ASIO_NOEXCEPT + { + execution::set_error( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)(p_->r_), + ASIO_MOVE_CAST(E)(e)); + delete p_; + } + + void set_done() ASIO_RVALUE_REF_QUAL ASIO_NOEXCEPT + { + execution::set_done( + ASIO_MOVE_OR_LVALUE( + typename remove_cvref::type)(p_->r_)); + delete p_; + } +}; + +template +struct submit_receiver +{ + typename remove_cvref::type r_; +#if defined(ASIO_HAS_MOVE) + typename connect_result >::type state_; +#else // defined(ASIO_HAS_MOVE) + typename connect_result& >::type state_; +#endif // defined(ASIO_HAS_MOVE) + +#if defined(ASIO_HAS_MOVE) + template + explicit submit_receiver(ASIO_MOVE_ARG(S) s, ASIO_MOVE_ARG(R) r) + : r_(ASIO_MOVE_CAST(R)(r)), + state_(execution::connect(ASIO_MOVE_CAST(S)(s), + submit_receiver_wrapper(this))) + { + } +#else // defined(ASIO_HAS_MOVE) + explicit submit_receiver(Sender s, Receiver r) + : r_(r), + state_(execution::connect(s, + submit_receiver_wrapper(this))) + { + } +#endif // defined(ASIO_HAS_MOVE) +}; + +} // namespace detail +} // namespace execution +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct set_value_member< + asio::execution::detail::submit_receiver_wrapper< + Sender, Receiver>, + void(Args...)> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (asio::execution::is_nothrow_receiver_of::value)); + typedef void result_type; +}; + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct set_value_member< + asio::execution::detail::submit_receiver_wrapper< + Sender, Receiver>, + void()> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + asio::execution::is_nothrow_receiver_of::value); + typedef void result_type; +}; + +#define ASIO_PRIVATE_SUBMIT_RECEIVER_TRAIT_DEF(n) \ + template \ + struct set_value_member< \ + asio::execution::detail::submit_receiver_wrapper< \ + Sender, Receiver>, \ + void(ASIO_VARIADIC_TARGS(n))> \ + { \ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); \ + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = \ + (asio::execution::is_nothrow_receiver_of::value)); \ + typedef void result_type; \ + }; \ + /**/ +ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SUBMIT_RECEIVER_TRAIT_DEF) +#undef ASIO_PRIVATE_SUBMIT_RECEIVER_TRAIT_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +template +struct set_error_member< + asio::execution::detail::submit_receiver_wrapper< + Sender, Receiver>, E> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +template +struct set_done_member< + asio::execution::detail::submit_receiver_wrapper< + Sender, Receiver> > +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +} // namespace traits +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_DETAIL_SUBMIT_RECEIVER_HPP diff --git a/include/asio/include/asio/execution/detail/void_receiver.hpp b/include/asio/include/asio/execution/detail/void_receiver.hpp new file mode 100644 index 0000000..87d45b8 --- /dev/null +++ b/include/asio/include/asio/execution/detail/void_receiver.hpp @@ -0,0 +1,90 @@ +// +// execution/detail/void_receiver.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP +#define ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/traits/set_done_member.hpp" +#include "asio/traits/set_error_member.hpp" +#include "asio/traits/set_value_member.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +struct void_receiver +{ + void set_value() ASIO_NOEXCEPT + { + } + + template + void set_error(ASIO_MOVE_ARG(E)) ASIO_NOEXCEPT + { + } + + void set_done() ASIO_NOEXCEPT + { + } +}; + +} // namespace detail +} // namespace execution +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +template <> +struct set_value_member +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +template +struct set_error_member +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +template <> +struct set_done_member +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + typedef void result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + +} // namespace traits +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP diff --git a/include/asio/include/asio/execution/execute.hpp b/include/asio/include/asio/execution/execute.hpp new file mode 100644 index 0000000..277cd18 --- /dev/null +++ b/include/asio/include/asio/execution/execute.hpp @@ -0,0 +1,264 @@ +// +// execution/execute.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_EXECUTE_HPP +#define ASIO_EXECUTION_EXECUTE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/detail/as_invocable.hpp" +#include "asio/execution/detail/as_receiver.hpp" +#include "asio/traits/execute_member.hpp" +#include "asio/traits/execute_free.hpp" + +#include "asio/detail/push_options.hpp" + +#if defined(GENERATING_DOCUMENTATION) + +namespace asio { +namespace execution { + +/// A customisation point that executes a function on an executor. +/** + * The name execution::execute denotes a customisation point object. + * + * For some subexpressions e and f, let E be a type + * such that decltype((e)) is E and let F be a type + * such that decltype((f)) is F. The expression + * execution::execute(e, f) is ill-formed if F does not model + * invocable, or if E does not model either executor + * or sender. Otherwise, it is expression-equivalent to: + * + * @li e.execute(f), if that expression is valid. If the function + * selected does not execute the function object f on the executor + * e, the program is ill-formed with no diagnostic required. + * + * @li Otherwise, execute(e, f), if that expression is valid, with + * overload resolution performed in a context that includes the declaration + * void execute(); and that does not include a declaration of + * execution::execute. If the function selected by overload + * resolution does not execute the function object f on the executor + * e, the program is ill-formed with no diagnostic required. + */ +inline constexpr unspecified execute = unspecified; + +/// A type trait that determines whether a @c execute expression is well-formed. +/** + * Class template @c can_execute is a trait that is derived from + * @c true_type if the expression execution::execute(std::declval(), + * std::declval()) is well formed; otherwise @c false_type. + */ +template +struct can_execute : + integral_constant +{ +}; + +} // namespace execution +} // namespace asio + +#else // defined(GENERATING_DOCUMENTATION) + +namespace asio { +namespace execution { + +template +struct is_sender_to; + +namespace detail { + +template +void submit_helper(ASIO_MOVE_ARG(S) s, ASIO_MOVE_ARG(R) r); + +} // namespace detail +} // namespace execution +} // namespace asio +namespace asio_execution_execute_fn { + +using asio::conditional; +using asio::decay; +using asio::declval; +using asio::enable_if; +using asio::execution::detail::as_receiver; +using asio::execution::detail::is_as_invocable; +using asio::execution::is_sender_to; +using asio::false_type; +using asio::result_of; +using asio::traits::execute_free; +using asio::traits::execute_member; +using asio::true_type; + +void execute(); + +enum overload_type +{ + call_member, + call_free, + adapter, + ill_formed +}; + +template +struct call_traits +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); +}; + +template +struct call_traits::is_valid + ) + >::type> : + execute_member +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member); +}; + +template +struct call_traits::is_valid + && + execute_free::is_valid + ) + >::type> : + execute_free +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free); +}; + +template +struct call_traits::is_valid + && + !execute_free::is_valid + && + conditional::type&()>::type + >::type::value + && + conditional< + !is_as_invocable< + typename decay::type + >::value, + is_sender_to< + T, + as_receiver::type, T> + >, + false_type + >::type::value + ) + >::type> +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter); + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef void result_type; +}; + +struct impl +{ + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()( + ASIO_MOVE_ARG(T) t, + ASIO_MOVE_ARG(F) f) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return ASIO_MOVE_CAST(T)(t).execute(ASIO_MOVE_CAST(F)(f)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()( + ASIO_MOVE_ARG(T) t, + ASIO_MOVE_ARG(F) f) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return execute(ASIO_MOVE_CAST(T)(t), ASIO_MOVE_CAST(F)(f)); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == adapter, + typename call_traits::result_type + >::type + operator()( + ASIO_MOVE_ARG(T) t, + ASIO_MOVE_ARG(F) f) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return asio::execution::detail::submit_helper( + ASIO_MOVE_CAST(T)(t), + as_receiver::type, T>( + ASIO_MOVE_CAST(F)(f), 0)); + } +}; + +template +struct static_instance +{ + static const T instance; +}; + +template +const T static_instance::instance = {}; + +} // namespace asio_execution_execute_fn +namespace asio { +namespace execution { +namespace { + +static ASIO_CONSTEXPR const asio_execution_execute_fn::impl& + execute = asio_execution_execute_fn::static_instance<>::instance; + +} // namespace + +template +struct can_execute : + integral_constant::overload != + asio_execution_execute_fn::ill_formed> +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +constexpr bool can_execute_v = can_execute::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +} // namespace execution +} // namespace asio + +#endif // defined(GENERATING_DOCUMENTATION) + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_EXECUTE_HPP diff --git a/include/asio/include/asio/execution/executor.hpp b/include/asio/include/asio/execution/executor.hpp new file mode 100644 index 0000000..558f6c4 --- /dev/null +++ b/include/asio/include/asio/execution/executor.hpp @@ -0,0 +1,238 @@ +// +// execution/executor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_EXECUTOR_HPP +#define ASIO_EXECUTION_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/execute.hpp" +#include "asio/execution/invocable_archetype.hpp" +#include "asio/traits/equality_comparable.hpp" + +#if defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) +# define ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT 1 +#endif // defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT) + // && defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + // && defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct is_executor_of_impl_base : + integral_constant::type&()>::type + >::type::value + && is_constructible::type, F>::value + && is_move_constructible::type>::value +#if defined(ASIO_HAS_NOEXCEPT) + && is_nothrow_copy_constructible::value + && is_nothrow_destructible::value +#else // defined(ASIO_HAS_NOEXCEPT) + && is_copy_constructible::value + && is_destructible::value +#endif // defined(ASIO_HAS_NOEXCEPT) + && traits::equality_comparable::is_valid + && traits::equality_comparable::is_noexcept + > +{ +}; + +template +struct is_executor_of_impl : + conditional< + can_execute::value, + is_executor_of_impl_base, + false_type + >::type +{ +}; + +template +struct executor_shape +{ + typedef std::size_t type; +}; + +template +struct executor_shape::type> +{ + typedef typename T::shape_type type; +}; + +template +struct executor_index +{ + typedef Default type; +}; + +template +struct executor_index::type> +{ + typedef typename T::index_type type; +}; + +} // namespace detail + +/// The is_executor trait detects whether a type T satisfies the +/// execution::executor concept. +/** + * Class template @c is_executor is a UnaryTypeTrait that is derived from @c + * true_type if the type @c T meets the concept definition for an executor, + * otherwise @c false_type. + */ +template +struct is_executor : +#if defined(GENERATING_DOCUMENTATION) + integral_constant +#else // defined(GENERATING_DOCUMENTATION) + detail::is_executor_of_impl +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +ASIO_CONSTEXPR const bool is_executor_v = is_executor::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +#if defined(ASIO_HAS_CONCEPTS) + +template +ASIO_CONCEPT executor = is_executor::value; + +#define ASIO_EXECUTION_EXECUTOR ::asio::execution::executor + +#else // defined(ASIO_HAS_CONCEPTS) + +#define ASIO_EXECUTION_EXECUTOR typename + +#endif // defined(ASIO_HAS_CONCEPTS) + +/// The is_executor_of trait detects whether a type T satisfies the +/// execution::executor_of concept for some set of value arguments. +/** + * Class template @c is_executor_of is a type trait that is derived from @c + * true_type if the type @c T meets the concept definition for an executor + * that is invocable with a function object of type @c F, otherwise @c + * false_type. + */ +template +struct is_executor_of : +#if defined(GENERATING_DOCUMENTATION) + integral_constant +#else // defined(GENERATING_DOCUMENTATION) + integral_constant::value && detail::is_executor_of_impl::value + > +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +ASIO_CONSTEXPR const bool is_executor_of_v = + is_executor_of::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +#if defined(ASIO_HAS_CONCEPTS) + +template +ASIO_CONCEPT executor_of = is_executor_of::value; + +#define ASIO_EXECUTION_EXECUTOR_OF(f) \ + ::asio::execution::executor_of + +#else // defined(ASIO_HAS_CONCEPTS) + +#define ASIO_EXECUTION_EXECUTOR_OF typename + +#endif // defined(ASIO_HAS_CONCEPTS) + +/// The executor_shape trait detects the type used by an executor to represent +/// the shape of a bulk operation. +/** + * Class template @c executor_shape is a type trait with a nested type alias + * @c type whose type is @c T::shape_type if @c T::shape_type is valid, + * otherwise @c std::size_t. + */ +template +struct executor_shape +#if !defined(GENERATING_DOCUMENTATION) + : detail::executor_shape +#endif // !defined(GENERATING_DOCUMENTATION) +{ +#if defined(GENERATING_DOCUMENTATION) + /// @c T::shape_type if @c T::shape_type is valid, otherwise @c std::size_t. + typedef automatically_determined type; +#endif // defined(GENERATING_DOCUMENTATION) +}; + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template +using executor_shape_t = typename executor_shape::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +/// The executor_index trait detects the type used by an executor to represent +/// an index within a bulk operation. +/** + * Class template @c executor_index is a type trait with a nested type alias + * @c type whose type is @c T::index_type if @c T::index_type is valid, + * otherwise @c executor_shape_t. + */ +template +struct executor_index +#if !defined(GENERATING_DOCUMENTATION) + : detail::executor_index::type> +#endif // !defined(GENERATING_DOCUMENTATION) +{ +#if defined(GENERATING_DOCUMENTATION) + /// @c T::index_type if @c T::index_type is valid, otherwise + /// @c executor_shape_t. + typedef automatically_determined type; +#endif // defined(GENERATING_DOCUMENTATION) +}; + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template +using executor_index_t = typename executor_index::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_EXECUTOR_HPP diff --git a/include/asio/include/asio/execution/impl/bad_executor.ipp b/include/asio/include/asio/execution/impl/bad_executor.ipp new file mode 100644 index 0000000..c36012b --- /dev/null +++ b/include/asio/include/asio/execution/impl/bad_executor.ipp @@ -0,0 +1,40 @@ +// +// exection/impl/bad_executor.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_IMPL_BAD_EXECUTOR_IPP +#define ASIO_EXECUTION_IMPL_BAD_EXECUTOR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/execution/bad_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { + +bad_executor::bad_executor() ASIO_NOEXCEPT +{ +} + +const char* bad_executor::what() const ASIO_NOEXCEPT_OR_NOTHROW +{ + return "bad executor"; +} + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_IMPL_BAD_EXECUTOR_IPP diff --git a/include/asio/include/asio/execution/impl/receiver_invocation_error.ipp b/include/asio/include/asio/execution/impl/receiver_invocation_error.ipp new file mode 100644 index 0000000..1b02007 --- /dev/null +++ b/include/asio/include/asio/execution/impl/receiver_invocation_error.ipp @@ -0,0 +1,36 @@ +// +// exection/impl/receiver_invocation_error.ipp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_IMPL_RECEIVER_INVOCATION_ERROR_IPP +#define ASIO_EXECUTION_IMPL_RECEIVER_INVOCATION_ERROR_IPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/execution/receiver_invocation_error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { + +receiver_invocation_error::receiver_invocation_error() + : std::runtime_error("receiver invocation error") +{ +} + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_IMPL_RECEIVER_INVOCATION_ERROR_IPP diff --git a/include/asio/include/asio/execution/invocable_archetype.hpp b/include/asio/include/asio/execution/invocable_archetype.hpp new file mode 100644 index 0000000..9ccbb8c --- /dev/null +++ b/include/asio/include/asio/execution/invocable_archetype.hpp @@ -0,0 +1,71 @@ +// +// execution/invocable_archetype.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_INVOCABLE_ARCHETYPE_HPP +#define ASIO_EXECUTION_INVOCABLE_ARCHETYPE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/detail/variadic_templates.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { + +/// An archetypal function object used for determining adherence to the +/// execution::executor concept. +struct invocable_archetype +{ +#if !defined(GENERATING_DOCUMENTATION) + // Necessary for compatibility with a C++03 implementation of result_of. + typedef void result_type; +#endif // !defined(GENERATING_DOCUMENTATION) + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \ + || defined(GENERATING_DOCUMENTATION) + + /// Function call operator. + template + void operator()(ASIO_MOVE_ARG(Args)...) + { + } + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + + void operator()() + { + } + +#define ASIO_PRIVATE_INVOCABLE_ARCHETYPE_CALL_DEF(n) \ + template \ + void operator()(ASIO_VARIADIC_UNNAMED_MOVE_PARAMS(n)) \ + { \ + } \ + /**/ + ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INVOCABLE_ARCHETYPE_CALL_DEF) +#undef ASIO_PRIVATE_INVOCABLE_ARCHETYPE_CALL_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) +}; + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_INVOCABLE_ARCHETYPE_HPP + diff --git a/include/asio/include/asio/execution/mapping.hpp b/include/asio/include/asio/execution/mapping.hpp new file mode 100644 index 0000000..acfee66 --- /dev/null +++ b/include/asio/include/asio/execution/mapping.hpp @@ -0,0 +1,917 @@ +// +// execution/mapping.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_MAPPING_HPP +#define ASIO_EXECUTION_MAPPING_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/query.hpp" +#include "asio/traits/query_free.hpp" +#include "asio/traits/query_member.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" +#include "asio/traits/static_require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property to describe what guarantees an executor makes about the mapping +/// of execution agents on to threads of execution. +struct mapping_t +{ + /// The mapping_t property applies to executors, senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The top-level mapping_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The top-level mapping_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef mapping_t polymorphic_query_result_type; + + /// A sub-property that indicates that execution agents are mapped on to + /// threads of execution. + struct thread_t + { + /// The mapping_t::thread_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The mapping_t::thread_t property can be required. + static constexpr bool is_requirable = true; + + /// The mapping_t::thread_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef mapping_t polymorphic_query_result_type; + + /// Default constructor. + constexpr thread_t(); + + /// Get the value associated with a property object. + /** + * @returns thread_t(); + */ + static constexpr mapping_t value(); + }; + + /// A sub-property that indicates that execution agents are mapped on to + /// new threads of execution. + struct new_thread_t + { + /// The mapping_t::new_thread_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The mapping_t::new_thread_t property can be required. + static constexpr bool is_requirable = true; + + /// The mapping_t::new_thread_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef mapping_t polymorphic_query_result_type; + + /// Default constructor. + constexpr new_thread_t(); + + /// Get the value associated with a property object. + /** + * @returns new_thread_t(); + */ + static constexpr mapping_t value(); + }; + + /// A sub-property that indicates that the mapping of execution agents is + /// implementation-defined. + struct other_t + { + /// The mapping_t::other_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The mapping_t::other_t property can be required. + static constexpr bool is_requirable = true; + + /// The mapping_t::other_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef mapping_t polymorphic_query_result_type; + + /// Default constructor. + constexpr other_t(); + + /// Get the value associated with a property object. + /** + * @returns other_t(); + */ + static constexpr mapping_t value(); + }; + + /// A special value used for accessing the mapping_t::thread_t property. + static constexpr thread_t thread; + + /// A special value used for accessing the mapping_t::new_thread_t property. + static constexpr new_thread_t new_thread; + + /// A special value used for accessing the mapping_t::other_t property. + static constexpr other_t other; + + /// Default constructor. + constexpr mapping_t(); + + /// Construct from a sub-property value. + constexpr mapping_t(thread_t); + + /// Construct from a sub-property value. + constexpr mapping_t(new_thread_t); + + /// Construct from a sub-property value. + constexpr mapping_t(other_t); + + /// Compare property values for equality. + friend constexpr bool operator==( + const mapping_t& a, const mapping_t& b) noexcept; + + /// Compare property values for inequality. + friend constexpr bool operator!=( + const mapping_t& a, const mapping_t& b) noexcept; +}; + +/// A special value used for accessing the mapping_t property. +constexpr mapping_t mapping; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { +namespace mapping { + +template struct thread_t; +template struct new_thread_t; +template struct other_t; + +} // namespace mapping + +template +struct mapping_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef mapping_t polymorphic_query_result_type; + + typedef detail::mapping::thread_t thread_t; + typedef detail::mapping::new_thread_t new_thread_t; + typedef detail::mapping::other_t other_t; + + ASIO_CONSTEXPR mapping_t() + : value_(-1) + { + } + + ASIO_CONSTEXPR mapping_t(thread_t) + : value_(0) + { + } + + ASIO_CONSTEXPR mapping_t(new_thread_t) + : value_(1) + { + } + + ASIO_CONSTEXPR mapping_t(other_t) + : value_(2) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = mapping_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + friend ASIO_CONSTEXPR bool operator==( + const mapping_t& a, const mapping_t& b) + { + return a.value_ == b.value_; + } + + friend ASIO_CONSTEXPR bool operator!=( + const mapping_t& a, const mapping_t& b) + { + return a.value_ != b.value_; + } + + struct convertible_from_mapping_t + { + ASIO_CONSTEXPR convertible_from_mapping_t(mapping_t) {} + }; + + template + friend ASIO_CONSTEXPR mapping_t query( + const Executor& ex, convertible_from_mapping_t, + typename enable_if< + can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::thread_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, thread_t()); + } + + template + friend ASIO_CONSTEXPR mapping_t query( + const Executor& ex, convertible_from_mapping_t, + typename enable_if< + !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::new_thread_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, new_thread_t()); + } + + template + friend ASIO_CONSTEXPR mapping_t query( + const Executor& ex, convertible_from_mapping_t, + typename enable_if< + !can_query::value + && !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::other_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, other_t()); + } + + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(thread_t, thread); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(new_thread_t, new_thread); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(other_t, other); + +#if !defined(ASIO_HAS_CONSTEXPR) + static const mapping_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) + +private: + int value_; +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T mapping_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const mapping_t mapping_t::instance; +#endif + +template +const typename mapping_t::thread_t mapping_t::thread; + +template +const typename mapping_t::new_thread_t mapping_t::new_thread; + +template +const typename mapping_t::other_t mapping_t::other; + +namespace mapping { + +template +struct thread_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef mapping_t polymorphic_query_result_type; + + ASIO_CONSTEXPR thread_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR thread_t static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query >::value + && !can_query >::value + >::type* = 0) ASIO_NOEXCEPT + { + return thread_t(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = thread_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR mapping_t value() + { + return thread_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const thread_t&, const thread_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const thread_t&, const thread_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T thread_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct new_thread_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef mapping_t polymorphic_query_result_type; + + ASIO_CONSTEXPR new_thread_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = new_thread_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR mapping_t value() + { + return new_thread_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const new_thread_t&, const new_thread_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const new_thread_t&, const new_thread_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T new_thread_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct other_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef mapping_t polymorphic_query_result_type; + + ASIO_CONSTEXPR other_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = other_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR mapping_t value() + { + return other_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const other_t&, const other_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const other_t&, const other_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T other_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace mapping +} // namespace detail + +typedef detail::mapping_t<> mapping_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr mapping_t mapping; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const mapping_t& mapping = mapping_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free_default::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::mapping_t result_type; +}; + +template +struct query_free_default::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::mapping_t result_type; +}; + +template +struct query_free_default::value + && !can_query::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::mapping_t result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query::value + && !can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef execution::mapping_t::thread_t result_type; + + static ASIO_CONSTEXPR result_type value() + { + return result_type(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::mapping_t::thread_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::mapping_t::new_thread_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::mapping_t::other_t>::value)); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_MAPPING_HPP diff --git a/include/asio/include/asio/execution/occupancy.hpp b/include/asio/include/asio/execution/occupancy.hpp new file mode 100644 index 0000000..00bf867 --- /dev/null +++ b/include/asio/include/asio/execution/occupancy.hpp @@ -0,0 +1,178 @@ +// +// execution/occupancy.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_OCCUPANCY_HPP +#define ASIO_EXECUTION_OCCUPANCY_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property that gives an estimate of the number of execution agents that +/// should occupy the associated execution context. +struct occupancy_t +{ + /// The occupancy_t property applies to executors, senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The occupancy_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The occupancy_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef std::size_t polymorphic_query_result_type; +}; + +/// A special value used for accessing the occupancy_t property. +constexpr occupancy_t occupancy; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { + +template +struct occupancy_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef std::size_t polymorphic_query_result_type; + + ASIO_CONSTEXPR occupancy_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = occupancy_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) + static const occupancy_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T occupancy_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const occupancy_t occupancy_t::instance; +#endif + +} // namespace detail + +typedef detail::occupancy_t<> occupancy_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr occupancy_t occupancy; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const occupancy_t& occupancy = occupancy_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_OCCUPANCY_HPP diff --git a/include/asio/include/asio/execution/operation_state.hpp b/include/asio/include/asio/execution/operation_state.hpp new file mode 100644 index 0000000..7eeb532 --- /dev/null +++ b/include/asio/include/asio/execution/operation_state.hpp @@ -0,0 +1,94 @@ +// +// execution/operation_state.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_OPERATION_STATE_HPP +#define ASIO_EXECUTION_OPERATION_STATE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/start.hpp" + +#if defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT) +# define ASIO_HAS_DEDUCED_EXECUTION_IS_OPERATION_STATE_TRAIT 1 +#endif // defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT) + // && defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct is_operation_state_base : + integral_constant::value + && is_object::value + > +{ +}; + +} // namespace detail + +/// The is_operation_state trait detects whether a type T satisfies the +/// execution::operation_state concept. +/** + * Class template @c is_operation_state is a type trait that is derived from + * @c true_type if the type @c T meets the concept definition for an + * @c operation_state, otherwise @c false_type. + */ +template +struct is_operation_state : +#if defined(GENERATING_DOCUMENTATION) + integral_constant +#else // defined(GENERATING_DOCUMENTATION) + conditional< + can_start::type>::value + && is_nothrow_start::type>::value, + detail::is_operation_state_base, + false_type + >::type +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +ASIO_CONSTEXPR const bool is_operation_state_v = + is_operation_state::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +#if defined(ASIO_HAS_CONCEPTS) + +template +ASIO_CONCEPT operation_state = is_operation_state::value; + +#define ASIO_EXECUTION_OPERATION_STATE \ + ::asio::execution::operation_state + +#else // defined(ASIO_HAS_CONCEPTS) + +#define ASIO_EXECUTION_OPERATION_STATE typename + +#endif // defined(ASIO_HAS_CONCEPTS) + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_OPERATION_STATE_HPP diff --git a/include/asio/include/asio/execution/outstanding_work.hpp b/include/asio/include/asio/execution/outstanding_work.hpp new file mode 100644 index 0000000..4ccc0d2 --- /dev/null +++ b/include/asio/include/asio/execution/outstanding_work.hpp @@ -0,0 +1,721 @@ +// +// execution/outstanding_work.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_OUTSTANDING_WORK_HPP +#define ASIO_EXECUTION_OUTSTANDING_WORK_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/query.hpp" +#include "asio/traits/query_free.hpp" +#include "asio/traits/query_member.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" +#include "asio/traits/static_require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property to describe whether task submission is likely in the future. +struct outstanding_work_t +{ + /// The outstanding_work_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The top-level outstanding_work_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The top-level outstanding_work_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef outstanding_work_t polymorphic_query_result_type; + + /// A sub-property that indicates that the executor does not represent likely + /// future submission of a function object. + struct untracked_t + { + /// The outstanding_work_t::untracked_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The outstanding_work_t::untracked_t property can be required. + static constexpr bool is_requirable = true; + + /// The outstanding_work_t::untracked_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef outstanding_work_t polymorphic_query_result_type; + + /// Default constructor. + constexpr untracked_t(); + + /// Get the value associated with a property object. + /** + * @returns untracked_t(); + */ + static constexpr outstanding_work_t value(); + }; + + /// A sub-property that indicates that the executor represents likely + /// future submission of a function object. + struct tracked_t + { + /// The outstanding_work_t::untracked_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The outstanding_work_t::tracked_t property can be required. + static constexpr bool is_requirable = true; + + /// The outstanding_work_t::tracked_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef outstanding_work_t polymorphic_query_result_type; + + /// Default constructor. + constexpr tracked_t(); + + /// Get the value associated with a property object. + /** + * @returns tracked_t(); + */ + static constexpr outstanding_work_t value(); + }; + + /// A special value used for accessing the outstanding_work_t::untracked_t + /// property. + static constexpr untracked_t untracked; + + /// A special value used for accessing the outstanding_work_t::tracked_t + /// property. + static constexpr tracked_t tracked; + + /// Default constructor. + constexpr outstanding_work_t(); + + /// Construct from a sub-property value. + constexpr outstanding_work_t(untracked_t); + + /// Construct from a sub-property value. + constexpr outstanding_work_t(tracked_t); + + /// Compare property values for equality. + friend constexpr bool operator==( + const outstanding_work_t& a, const outstanding_work_t& b) noexcept; + + /// Compare property values for inequality. + friend constexpr bool operator!=( + const outstanding_work_t& a, const outstanding_work_t& b) noexcept; +}; + +/// A special value used for accessing the outstanding_work_t property. +constexpr outstanding_work_t outstanding_work; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { +namespace outstanding_work { + +template struct untracked_t; +template struct tracked_t; + +} // namespace outstanding_work + +template +struct outstanding_work_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef outstanding_work_t polymorphic_query_result_type; + + typedef detail::outstanding_work::untracked_t untracked_t; + typedef detail::outstanding_work::tracked_t tracked_t; + + ASIO_CONSTEXPR outstanding_work_t() + : value_(-1) + { + } + + ASIO_CONSTEXPR outstanding_work_t(untracked_t) + : value_(0) + { + } + + ASIO_CONSTEXPR outstanding_work_t(tracked_t) + : value_(1) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member< + T, outstanding_work_t>::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member< + T, outstanding_work_t + >::is_noexcept)) + { + return traits::query_static_constexpr_member< + T, outstanding_work_t>::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member< + T, outstanding_work_t>::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member< + T, outstanding_work_t>::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = outstanding_work_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + friend ASIO_CONSTEXPR bool operator==( + const outstanding_work_t& a, const outstanding_work_t& b) + { + return a.value_ == b.value_; + } + + friend ASIO_CONSTEXPR bool operator!=( + const outstanding_work_t& a, const outstanding_work_t& b) + { + return a.value_ != b.value_; + } + + struct convertible_from_outstanding_work_t + { + ASIO_CONSTEXPR convertible_from_outstanding_work_t(outstanding_work_t) + { + } + }; + + template + friend ASIO_CONSTEXPR outstanding_work_t query( + const Executor& ex, convertible_from_outstanding_work_t, + typename enable_if< + can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::untracked_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, untracked_t()); + } + + template + friend ASIO_CONSTEXPR outstanding_work_t query( + const Executor& ex, convertible_from_outstanding_work_t, + typename enable_if< + !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::tracked_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, tracked_t()); + } + + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(untracked_t, untracked); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(tracked_t, tracked); + +#if !defined(ASIO_HAS_CONSTEXPR) + static const outstanding_work_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) + +private: + int value_; +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T outstanding_work_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const outstanding_work_t outstanding_work_t::instance; +#endif + +template +const typename outstanding_work_t::untracked_t +outstanding_work_t::untracked; + +template +const typename outstanding_work_t::tracked_t +outstanding_work_t::tracked; + +namespace outstanding_work { + +template +struct untracked_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef outstanding_work_t polymorphic_query_result_type; + + ASIO_CONSTEXPR untracked_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR untracked_t static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query >::value + >::type* = 0) ASIO_NOEXCEPT + { + return untracked_t(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = untracked_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR outstanding_work_t value() + { + return untracked_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const untracked_t&, const untracked_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const untracked_t&, const untracked_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T untracked_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct tracked_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef outstanding_work_t polymorphic_query_result_type; + + ASIO_CONSTEXPR tracked_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = tracked_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR outstanding_work_t value() + { + return tracked_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const tracked_t&, const tracked_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const tracked_t&, const tracked_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T tracked_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace outstanding_work +} // namespace detail + +typedef detail::outstanding_work_t<> outstanding_work_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr outstanding_work_t outstanding_work; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const outstanding_work_t& + outstanding_work = outstanding_work_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free_default::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::outstanding_work_t result_type; +}; + +template +struct query_free_default::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::outstanding_work_t result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef execution::outstanding_work_t::untracked_t result_type; + + static ASIO_CONSTEXPR result_type value() + { + return result_type(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::outstanding_work_t::untracked_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::outstanding_work_t::tracked_t>::value)); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_OUTSTANDING_WORK_HPP diff --git a/include/asio/include/asio/execution/prefer_only.hpp b/include/asio/include/asio/execution/prefer_only.hpp new file mode 100644 index 0000000..9823dad --- /dev/null +++ b/include/asio/include/asio/execution/prefer_only.hpp @@ -0,0 +1,327 @@ +// +// execution/prefer_only.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_PREFER_ONLY_HPP +#define ASIO_EXECUTION_PREFER_ONLY_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/prefer.hpp" +#include "asio/query.hpp" +#include "asio/traits/static_query.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property adapter that is used with the polymorphic executor wrapper +/// to mark properties as preferable, but not requirable. +template +struct prefer_only +{ + /// The prefer_only adapter applies to the same types as the nested property. + template + static constexpr bool is_applicable_property_v = + is_applicable_property::value; + + /// The context_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The context_t property can be preferred, it the underlying property can + /// be preferred. + /** + * @c true if @c Property::is_preferable is @c true, otherwise @c false. + */ + static constexpr bool is_preferable = automatically_determined; + + /// The type returned by queries against an @c any_executor. + typedef typename Property::polymorphic_query_result_type + polymorphic_query_result_type; +}; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { + +template +struct prefer_only_is_preferable +{ + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); +}; + +template +struct prefer_only_is_preferable::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); +}; + +template +struct prefer_only_polymorphic_query_result_type +{ +}; + +template +struct prefer_only_polymorphic_query_result_type::type> +{ + typedef typename InnerProperty::polymorphic_query_result_type + polymorphic_query_result_type; +}; + +template +struct prefer_only_property +{ + InnerProperty property; + + prefer_only_property(const InnerProperty& p) + : property(p) + { + } +}; + +#if defined(ASIO_HAS_DECLTYPE) \ + && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE) + +template +struct prefer_only_property().value()) + >::type> +{ + InnerProperty property; + + prefer_only_property(const InnerProperty& p) + : property(p) + { + } + + ASIO_CONSTEXPR auto value() const + ASIO_NOEXCEPT_IF(( + noexcept(asio::declval().value()))) + -> decltype(asio::declval().value()) + { + return property.value(); + } +}; + +#else // defined(ASIO_HAS_DECLTYPE) + // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE) + +struct prefer_only_memfns_base +{ + void value(); +}; + +template +struct prefer_only_memfns_derived + : T, prefer_only_memfns_base +{ +}; + +template +struct prefer_only_memfns_check +{ +}; + +template +char (&prefer_only_value_memfn_helper(...))[2]; + +template +char prefer_only_value_memfn_helper( + prefer_only_memfns_check< + void (prefer_only_memfns_base::*)(), + &prefer_only_memfns_derived::value>*); + +template +struct prefer_only_property(0)) != 1 + && !is_same::value + >::type> +{ + InnerProperty property; + + prefer_only_property(const InnerProperty& p) + : property(p) + { + } + + ASIO_CONSTEXPR typename InnerProperty::polymorphic_query_result_type + value() const + { + return property.value(); + } +}; + +#endif // defined(ASIO_HAS_DECLTYPE) + // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE) + +} // namespace detail + +template +struct prefer_only : + detail::prefer_only_is_preferable, + detail::prefer_only_polymorphic_query_result_type, + detail::prefer_only_property +{ + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + + ASIO_CONSTEXPR prefer_only(const InnerProperty& p) + : detail::prefer_only_property(p) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::static_query::is_noexcept)) + { + return traits::static_query::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = prefer_only::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + template + friend ASIO_CONSTEXPR + typename prefer_result::type + prefer(const Executor& ex, const prefer_only& p, + typename enable_if< + is_same::value + && can_prefer::value + >::type* = 0) +#if !defined(ASIO_MSVC) \ + && !defined(__clang__) // Clang crashes if noexcept is used here. + ASIO_NOEXCEPT_IF(( + is_nothrow_prefer::value)) +#endif // !defined(ASIO_MSVC) + // && !defined(__clang__) + { + return asio::prefer(ex, p.property); + } + + template + friend ASIO_CONSTEXPR + typename query_result::type + query(const Executor& ex, const prefer_only& p, + typename enable_if< + is_same::value + && can_query::value + >::type* = 0) +#if !defined(ASIO_MSVC) \ + && !defined(__clang__) // Clang crashes if noexcept is used here. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // !defined(ASIO_MSVC) + // && !defined(__clang__) + { + return asio::query(ex, p.property); + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T prefer_only::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace execution + +template +struct is_applicable_property > + : is_applicable_property +{ +}; + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query > : + static_query +{ +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT) + +template +struct prefer_free_default, + typename enable_if< + can_prefer::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_prefer::value)); + + typedef typename prefer_result::type result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free, + typename enable_if< + can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef typename query_result::type result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_PREFER_ONLY_HPP diff --git a/include/asio/include/asio/execution/receiver.hpp b/include/asio/include/asio/execution/receiver.hpp new file mode 100644 index 0000000..b63f788 --- /dev/null +++ b/include/asio/include/asio/execution/receiver.hpp @@ -0,0 +1,280 @@ +// +// execution/receiver.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_RECEIVER_HPP +#define ASIO_EXECUTION_RECEIVER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/detail/variadic_templates.hpp" +#include "asio/execution/set_done.hpp" +#include "asio/execution/set_error.hpp" +#include "asio/execution/set_value.hpp" + +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) +# include +#else // defined(ASIO_HAS_STD_EXCEPTION_PTR) +# include "asio/error_code.hpp" +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + +#if defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_FREE_TRAIT) \ + && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_MEMBER_TRAIT) +# define ASIO_HAS_DEDUCED_EXECUTION_IS_RECEIVER_TRAIT 1 +#endif // defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT) + // && defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) + // && defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT) + // && defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) + // && defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT) + // && defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) + // && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_FREE_TRAIT) + // && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_MEMBER_TRAIT) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct is_receiver_base : + integral_constant::type>::value + && is_constructible::type, T>::value + > +{ +}; + +} // namespace detail + +#if defined(ASIO_HAS_STD_EXCEPTION_PTR) +# define ASIO_EXECUTION_RECEIVER_ERROR_DEFAULT = std::exception_ptr +#else // defined(ASIO_HAS_STD_EXCEPTION_PTR) +# define ASIO_EXECUTION_RECEIVER_ERROR_DEFAULT \ + = ::asio::error_code +#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR) + +/// The is_receiver trait detects whether a type T satisfies the +/// execution::receiver concept. +/** + * Class template @c is_receiver is a type trait that is derived from @c + * true_type if the type @c T meets the concept definition for a receiver for + * error type @c E, otherwise @c false_type. + */ +template +struct is_receiver : +#if defined(GENERATING_DOCUMENTATION) + integral_constant +#else // defined(GENERATING_DOCUMENTATION) + conditional< + can_set_done::type>::value + && is_nothrow_set_done::type>::value + && can_set_error::type, E>::value + && is_nothrow_set_error::type, E>::value, + detail::is_receiver_base, + false_type + >::type +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +ASIO_CONSTEXPR const bool is_receiver_v = is_receiver::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +#if defined(ASIO_HAS_CONCEPTS) + +template +ASIO_CONCEPT receiver = is_receiver::value; + +#define ASIO_EXECUTION_RECEIVER ::asio::execution::receiver + +#else // defined(ASIO_HAS_CONCEPTS) + +#define ASIO_EXECUTION_RECEIVER typename + +#endif // defined(ASIO_HAS_CONCEPTS) + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \ + || defined(GENERATING_DOCUMENTATION) + +/// The is_receiver_of trait detects whether a type T satisfies the +/// execution::receiver_of concept for some set of value arguments. +/** + * Class template @c is_receiver_of is a type trait that is derived from @c + * true_type if the type @c T meets the concept definition for a receiver for + * value arguments @c Vs, otherwise @c false_type. + */ +template +struct is_receiver_of : +#if defined(GENERATING_DOCUMENTATION) + integral_constant +#else // defined(GENERATING_DOCUMENTATION) + conditional< + is_receiver::value, + can_set_value::type, Vs...>, + false_type + >::type +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +ASIO_CONSTEXPR const bool is_receiver_of_v = + is_receiver_of::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +#if defined(ASIO_HAS_CONCEPTS) + +template +ASIO_CONCEPT receiver_of = is_receiver_of::value; + +#define ASIO_EXECUTION_RECEIVER_OF_0 \ + ::asio::execution::receiver_of + +#define ASIO_EXECUTION_RECEIVER_OF_1(v) \ + ::asio::execution::receiver_of + +#else // defined(ASIO_HAS_CONCEPTS) + +#define ASIO_EXECUTION_RECEIVER_OF_0 typename +#define ASIO_EXECUTION_RECEIVER_OF_1(v) typename + +#endif // defined(ASIO_HAS_CONCEPTS) + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + +template +struct is_receiver_of; + +template +struct is_receiver_of : + conditional< + is_receiver::value, + can_set_value::type>, + false_type + >::type +{ +}; + +#define ASIO_PRIVATE_RECEIVER_OF_TRAITS_DEF(n) \ + template \ + struct is_receiver_of : \ + conditional< \ + conditional, void>::type::value, \ + can_set_value< \ + typename remove_cvref::type, \ + ASIO_VARIADIC_TARGS(n)>, \ + false_type \ + >::type \ + { \ + }; \ + /**/ +ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_RECEIVER_OF_TRAITS_DEF) +#undef ASIO_PRIVATE_RECEIVER_OF_TRAITS_DEF + +#define ASIO_EXECUTION_RECEIVER_OF_0 typename +#define ASIO_EXECUTION_RECEIVER_OF_1(v) typename + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + +#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \ + || defined(GENERATING_DOCUMENTATION) + +/// The is_nothrow_receiver_of trait detects whether a type T satisfies the +/// execution::receiver_of concept for some set of value arguments, with a +/// noexcept @c set_value operation. +/** + * Class template @c is_nothrow_receiver_of is a type trait that is derived + * from @c true_type if the type @c T meets the concept definition for a + * receiver for value arguments @c Vs, and the expression + * execution::set_value(declval(), declval()...) is noexcept, + * otherwise @c false_type. + */ +template +struct is_nothrow_receiver_of : +#if defined(GENERATING_DOCUMENTATION) + integral_constant +#else // defined(GENERATING_DOCUMENTATION) + integral_constant::value + && is_nothrow_set_value::type, Vs...>::value + > +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +ASIO_CONSTEXPR const bool is_nothrow_receiver_of_v = + is_nothrow_receiver_of::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + +template +struct is_nothrow_receiver_of; + +template +struct is_nothrow_receiver_of : + integral_constant::value + && is_nothrow_set_value::type>::value + > +{ +}; + +#define ASIO_PRIVATE_NOTHROW_RECEIVER_OF_TRAITS_DEF(n) \ + template \ + struct is_nothrow_receiver_of : \ + integral_constant::value \ + && is_nothrow_set_value::type, \ + ASIO_VARIADIC_TARGS(n)>::value \ + > \ + { \ + }; \ + /**/ +ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_NOTHROW_RECEIVER_OF_TRAITS_DEF) +#undef ASIO_PRIVATE_NOTHROW_RECEIVER_OF_TRAITS_DEF + +#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_RECEIVER_HPP diff --git a/include/asio/include/asio/execution/receiver_invocation_error.hpp b/include/asio/include/asio/execution/receiver_invocation_error.hpp new file mode 100644 index 0000000..5c4ee6d --- /dev/null +++ b/include/asio/include/asio/execution/receiver_invocation_error.hpp @@ -0,0 +1,48 @@ +// +// execution/receiver_invocation_error.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_RECEIVER_INVOCATION_ERROR_HPP +#define ASIO_EXECUTION_RECEIVER_INVOCATION_ERROR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { + +/// Exception reported via @c set_error when an exception escapes from +/// @c set_value. +class receiver_invocation_error + : public std::runtime_error +#if defined(ASIO_HAS_STD_NESTED_EXCEPTION) + , public std::nested_exception +#endif // defined(ASIO_HAS_STD_NESTED_EXCEPTION) +{ +public: + /// Constructor. + ASIO_DECL receiver_invocation_error(); +}; + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(ASIO_HEADER_ONLY) +# include "asio/execution/impl/receiver_invocation_error.ipp" +#endif // defined(ASIO_HEADER_ONLY) + +#endif // ASIO_EXECUTION_RECEIVER_INVOCATION_ERROR_HPP diff --git a/include/asio/include/asio/execution/relationship.hpp b/include/asio/include/asio/execution/relationship.hpp new file mode 100644 index 0000000..720a339 --- /dev/null +++ b/include/asio/include/asio/execution/relationship.hpp @@ -0,0 +1,720 @@ +// +// execution/relationship.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_RELATIONSHIP_HPP +#define ASIO_EXECUTION_RELATIONSHIP_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/scheduler.hpp" +#include "asio/execution/sender.hpp" +#include "asio/is_applicable_property.hpp" +#include "asio/query.hpp" +#include "asio/traits/query_free.hpp" +#include "asio/traits/query_member.hpp" +#include "asio/traits/query_static_constexpr_member.hpp" +#include "asio/traits/static_query.hpp" +#include "asio/traits/static_require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(GENERATING_DOCUMENTATION) + +namespace execution { + +/// A property to describe whether submitted tasks represent continuations of +/// the calling context. +struct relationship_t +{ + /// The relationship_t property applies to executors, senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The top-level relationship_t property cannot be required. + static constexpr bool is_requirable = false; + + /// The top-level relationship_t property cannot be preferred. + static constexpr bool is_preferable = false; + + /// The type returned by queries against an @c any_executor. + typedef relationship_t polymorphic_query_result_type; + + /// A sub-property that indicates that the executor does not represent a + /// continuation of the calling context. + struct fork_t + { + /// The relationship_t::fork_t property applies to executors, senders, and + /// schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The relationship_t::fork_t property can be required. + static constexpr bool is_requirable = true; + + /// The relationship_t::fork_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef relationship_t polymorphic_query_result_type; + + /// Default constructor. + constexpr fork_t(); + + /// Get the value associated with a property object. + /** + * @returns fork_t(); + */ + static constexpr relationship_t value(); + }; + + /// A sub-property that indicates that the executor represents a continuation + /// of the calling context. + struct continuation_t + { + /// The relationship_t::continuation_t property applies to executors, + /// senders, and schedulers. + template + static constexpr bool is_applicable_property_v = + is_executor_v || is_sender_v || is_scheduler_v; + + /// The relationship_t::continuation_t property can be required. + static constexpr bool is_requirable = true; + + /// The relationship_t::continuation_t property can be preferred. + static constexpr bool is_preferable = true; + + /// The type returned by queries against an @c any_executor. + typedef relationship_t polymorphic_query_result_type; + + /// Default constructor. + constexpr continuation_t(); + + /// Get the value associated with a property object. + /** + * @returns continuation_t(); + */ + static constexpr relationship_t value(); + }; + + /// A special value used for accessing the relationship_t::fork_t property. + static constexpr fork_t fork; + + /// A special value used for accessing the relationship_t::continuation_t + /// property. + static constexpr continuation_t continuation; + + /// Default constructor. + constexpr relationship_t(); + + /// Construct from a sub-property value. + constexpr relationship_t(fork_t); + + /// Construct from a sub-property value. + constexpr relationship_t(continuation_t); + + /// Compare property values for equality. + friend constexpr bool operator==( + const relationship_t& a, const relationship_t& b) noexcept; + + /// Compare property values for inequality. + friend constexpr bool operator!=( + const relationship_t& a, const relationship_t& b) noexcept; +}; + +/// A special value used for accessing the relationship_t property. +constexpr relationship_t relationship; + +} // namespace execution + +#else // defined(GENERATING_DOCUMENTATION) + +namespace execution { +namespace detail { +namespace relationship { + +template struct fork_t; +template struct continuation_t; + +} // namespace relationship + +template +struct relationship_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = false); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = false); + typedef relationship_t polymorphic_query_result_type; + + typedef detail::relationship::fork_t fork_t; + typedef detail::relationship::continuation_t continuation_t; + + ASIO_CONSTEXPR relationship_t() + : value_(-1) + { + } + + ASIO_CONSTEXPR relationship_t(fork_t) + : value_(0) + { + } + + ASIO_CONSTEXPR relationship_t(continuation_t) + : value_(1) + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member< + T, relationship_t>::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member< + T, relationship_t + >::is_noexcept)) + { + return traits::query_static_constexpr_member< + T, relationship_t>::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member< + T, relationship_t>::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template + static ASIO_CONSTEXPR + typename traits::static_query::result_type + static_query( + typename enable_if< + !traits::query_static_constexpr_member< + T, relationship_t>::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type* = 0) ASIO_NOEXCEPT + { + return traits::static_query::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = relationship_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + friend ASIO_CONSTEXPR bool operator==( + const relationship_t& a, const relationship_t& b) + { + return a.value_ == b.value_; + } + + friend ASIO_CONSTEXPR bool operator!=( + const relationship_t& a, const relationship_t& b) + { + return a.value_ != b.value_; + } + + struct convertible_from_relationship_t + { + ASIO_CONSTEXPR convertible_from_relationship_t(relationship_t) + { + } + }; + + template + friend ASIO_CONSTEXPR relationship_t query( + const Executor& ex, convertible_from_relationship_t, + typename enable_if< + can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::fork_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, fork_t()); + } + + template + friend ASIO_CONSTEXPR relationship_t query( + const Executor& ex, convertible_from_relationship_t, + typename enable_if< + !can_query::value + && can_query::value + >::type* = 0) +#if !defined(__clang__) // Clang crashes if noexcept is used here. +#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. + ASIO_NOEXCEPT_IF(( + is_nothrow_query::continuation_t>::value)) +#else // defined(ASIO_MSVC) + ASIO_NOEXCEPT_IF(( + is_nothrow_query::value)) +#endif // defined(ASIO_MSVC) +#endif // !defined(__clang__) + { + return asio::query(ex, continuation_t()); + } + + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(fork_t, fork); + ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(continuation_t, continuation); + +#if !defined(ASIO_HAS_CONSTEXPR) + static const relationship_t instance; +#endif // !defined(ASIO_HAS_CONSTEXPR) + +private: + int value_; +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T relationship_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_CONSTEXPR) +template +const relationship_t relationship_t::instance; +#endif + +template +const typename relationship_t::fork_t +relationship_t::fork; + +template +const typename relationship_t::continuation_t +relationship_t::continuation; + +namespace relationship { + +template +struct fork_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef relationship_t polymorphic_query_result_type; + + ASIO_CONSTEXPR fork_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template + static ASIO_CONSTEXPR fork_t static_query( + typename enable_if< + !traits::query_static_constexpr_member::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query >::value + >::type* = 0) ASIO_NOEXCEPT + { + return fork_t(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = fork_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR relationship_t value() + { + return fork_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const fork_t&, const fork_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const fork_t&, const fork_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T fork_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct continuation_t +{ +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + template + ASIO_STATIC_CONSTEXPR(bool, + is_applicable_property_v = is_executor::value + || is_sender::value || is_scheduler::value); +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + + ASIO_STATIC_CONSTEXPR(bool, is_requirable = true); + ASIO_STATIC_CONSTEXPR(bool, is_preferable = true); + typedef relationship_t polymorphic_query_result_type; + + ASIO_CONSTEXPR continuation_t() + { + } + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + template + static ASIO_CONSTEXPR + typename traits::query_static_constexpr_member::result_type + static_query() + ASIO_NOEXCEPT_IF(( + traits::query_static_constexpr_member::is_noexcept)) + { + return traits::query_static_constexpr_member::value(); + } + + template ())> + static ASIO_CONSTEXPR const T static_query_v + = continuation_t::static_query(); +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + + static ASIO_CONSTEXPR relationship_t value() + { + return continuation_t(); + } + + friend ASIO_CONSTEXPR bool operator==( + const continuation_t&, const continuation_t&) + { + return true; + } + + friend ASIO_CONSTEXPR bool operator!=( + const continuation_t&, const continuation_t&) + { + return false; + } +}; + +#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) +template template +const T continuation_t::static_query_v; +#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +} // namespace relationship +} // namespace detail + +typedef detail::relationship_t<> relationship_t; + +#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +constexpr relationship_t relationship; +#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) +namespace { static const relationship_t& + relationship = relationship_t::instance; } +#endif + +} // namespace execution + +#if !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +template +struct is_applicable_property + : integral_constant::value + || execution::is_sender::value + || execution::is_scheduler::value> +{ +}; + +#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) + +namespace traits { + +#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +template +struct query_free_default::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::relationship_t result_type; +}; + +template +struct query_free_default::value + && can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = + (is_nothrow_query::value)); + + typedef execution::relationship_t result_type; +}; + +#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ + || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::static_query::is_valid + && traits::static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::static_query::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::static_query::value(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +template +struct static_query::is_valid + && !traits::query_member::is_valid + && !traits::query_free::is_valid + && !can_query::value + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef execution::relationship_t::fork_t result_type; + + static ASIO_CONSTEXPR result_type value() + { + return result_type(); + } +}; + +template +struct static_query::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = true); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + + typedef typename traits::query_static_constexpr_member::result_type result_type; + + static ASIO_CONSTEXPR result_type value() + { + return traits::query_static_constexpr_member::value(); + } +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) + // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) + +#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::relationship_t::fork_t>::value)); +}; + +template +struct static_require::is_valid + >::type> +{ + ASIO_STATIC_CONSTEXPR(bool, is_valid = + (is_same::result_type, + execution::relationship_t::continuation_t>::value)); +}; + +#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT) + +} // namespace traits + +#endif // defined(GENERATING_DOCUMENTATION) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_RELATIONSHIP_HPP diff --git a/include/asio/include/asio/execution/schedule.hpp b/include/asio/include/asio/execution/schedule.hpp new file mode 100644 index 0000000..1262735 --- /dev/null +++ b/include/asio/include/asio/execution/schedule.hpp @@ -0,0 +1,290 @@ +// +// execution/schedule.hpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_SCHEDULE_HPP +#define ASIO_EXECUTION_SCHEDULE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/executor.hpp" +#include "asio/traits/schedule_member.hpp" +#include "asio/traits/schedule_free.hpp" + +#include "asio/detail/push_options.hpp" + +#if defined(GENERATING_DOCUMENTATION) + +namespace asio { +namespace execution { + +/// A customisation point that is used to obtain a sender from a scheduler. +/** + * The name execution::schedule denotes a customisation point object. + * For some subexpression s, let S be a type such that + * decltype((s)) is S. The expression + * execution::schedule(s) is expression-equivalent to: + * + * @li s.schedule(), if that expression is valid and its type models + * sender. + * + * @li Otherwise, schedule(s), if that expression is valid and its + * type models sender with overload resolution performed in a context + * that includes the declaration void schedule(); and that does not + * include a declaration of execution::schedule. + * + * @li Otherwise, S if S satisfies executor. + * + * @li Otherwise, execution::schedule(s) is ill-formed. + */ +inline constexpr unspecified schedule = unspecified; + +/// A type trait that determines whether a @c schedule expression is +/// well-formed. +/** + * Class template @c can_schedule is a trait that is derived from @c true_type + * if the expression execution::schedule(std::declval()) is well + * formed; otherwise @c false_type. + */ +template +struct can_schedule : + integral_constant +{ +}; + +} // namespace execution +} // namespace asio + +#else // defined(GENERATING_DOCUMENTATION) + +namespace asio_execution_schedule_fn { + +using asio::decay; +using asio::declval; +using asio::enable_if; +using asio::execution::is_executor; +using asio::traits::schedule_free; +using asio::traits::schedule_member; + +void schedule(); + +enum overload_type +{ + identity, + call_member, + call_free, + ill_formed +}; + +template +struct call_traits +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); + typedef void result_type; +}; + +template +struct call_traits::is_valid + ) + >::type> : + schedule_member +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member); +}; + +template +struct call_traits::is_valid + && + schedule_free::is_valid + ) + >::type> : + schedule_free +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free); +}; + +template +struct call_traits::is_valid + && + !schedule_free::is_valid + && + is_executor::type>::value + ) + >::type> +{ + ASIO_STATIC_CONSTEXPR(overload_type, overload = identity); + ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); + +#if defined(ASIO_HAS_MOVE) + typedef ASIO_MOVE_ARG(S) result_type; +#else // defined(ASIO_HAS_MOVE) + typedef ASIO_MOVE_ARG(typename decay::type) result_type; +#endif // defined(ASIO_HAS_MOVE) +}; + +struct impl +{ + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == identity, + typename call_traits::result_type + >::type + operator()(ASIO_MOVE_ARG(S) s) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return ASIO_MOVE_CAST(S)(s); + } + +#if defined(ASIO_HAS_MOVE) + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(S&& s) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return ASIO_MOVE_CAST(S)(s).schedule(); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(S&& s) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return schedule(ASIO_MOVE_CAST(S)(s)); + } +#else // defined(ASIO_HAS_MOVE) + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(S& s) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.schedule(); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_member, + typename call_traits::result_type + >::type + operator()(const S& s) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return s.schedule(); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(S& s) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return schedule(s); + } + + template + ASIO_CONSTEXPR typename enable_if< + call_traits::overload == call_free, + typename call_traits::result_type + >::type + operator()(const S& s) const + ASIO_NOEXCEPT_IF(( + call_traits::is_noexcept)) + { + return schedule(s); + } +#endif // defined(ASIO_HAS_MOVE) +}; + +template +struct static_instance +{ + static const T instance; +}; + +template +const T static_instance::instance = {}; + +} // namespace asio_execution_schedule_fn +namespace asio { +namespace execution { +namespace { + +static ASIO_CONSTEXPR const asio_execution_schedule_fn::impl& + schedule = asio_execution_schedule_fn::static_instance<>::instance; + +} // namespace + +template +struct can_schedule : + integral_constant::overload != + asio_execution_schedule_fn::ill_formed> +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +constexpr bool can_schedule_v = can_schedule::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +struct is_nothrow_schedule : + integral_constant::is_noexcept> +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +constexpr bool is_nothrow_schedule_v + = is_nothrow_schedule::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +} // namespace execution +} // namespace asio + +#endif // defined(GENERATING_DOCUMENTATION) + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_SCHEDULE_HPP diff --git a/include/asio/include/asio/execution/scheduler.hpp b/include/asio/include/asio/execution/scheduler.hpp new file mode 100644 index 0000000..c6c53ca --- /dev/null +++ b/include/asio/include/asio/execution/scheduler.hpp @@ -0,0 +1,86 @@ +// +// execution/scheduler.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_SCHEDULER_HPP +#define ASIO_EXECUTION_SCHEDULER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/schedule.hpp" +#include "asio/traits/equality_comparable.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace execution { +namespace detail { + +template +struct is_scheduler_base : + integral_constant::type>::value + && traits::equality_comparable::type>::is_valid + > +{ +}; + +} // namespace detail + +/// The is_scheduler trait detects whether a type T satisfies the +/// execution::scheduler concept. +/** + * Class template @c is_scheduler is a type trait that is derived from @c + * true_type if the type @c T meets the concept definition for a scheduler for + * error type @c E, otherwise @c false_type. + */ +template +struct is_scheduler : +#if defined(GENERATING_DOCUMENTATION) + integral_constant +#else // defined(GENERATING_DOCUMENTATION) + conditional< + can_schedule::value, + detail::is_scheduler_base, + false_type + >::type +#endif // defined(GENERATING_DOCUMENTATION) +{ +}; + +#if defined(ASIO_HAS_VARIABLE_TEMPLATES) + +template +ASIO_CONSTEXPR const bool is_scheduler_v = is_scheduler::value; + +#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) + +#if defined(ASIO_HAS_CONCEPTS) + +template +ASIO_CONCEPT scheduler = is_scheduler::value; + +#define ASIO_EXECUTION_SCHEDULER ::asio::execution::scheduler + +#else // defined(ASIO_HAS_CONCEPTS) + +#define ASIO_EXECUTION_SCHEDULER typename + +#endif // defined(ASIO_HAS_CONCEPTS) + +} // namespace execution +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_EXECUTION_SCHEDULER_HPP diff --git a/include/asio/include/asio/execution/sender.hpp b/include/asio/include/asio/execution/sender.hpp new file mode 100644 index 0000000..747e673 --- /dev/null +++ b/include/asio/include/asio/execution/sender.hpp @@ -0,0 +1,311 @@ +// +// execution/sender.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_EXECUTION_SENDER_HPP +#define ASIO_EXECUTION_SENDER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/detail/as_invocable.hpp" +#include "asio/execution/detail/void_receiver.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution/receiver.hpp" + +#include "asio/detail/push_options.hpp" + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) \ + && defined(ASIO_HAS_VARIADIC_TEMPLATES) \ + && defined(ASIO_HAS_DECLTYPE) \ + && !defined(ASIO_MSVC) || (_MSC_VER >= 1910) +# define ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT 1 +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + // && defined(ASIO_HAS_VARIADIC_TEMPLATES) + // && defined(ASIO_HAS_DECLTYPE) + // && !defined(ASIO_MSVC) || (_MSC_VER >= 1910) + +namespace asio { +namespace execution { +namespace detail { + +namespace sender_base_ns { struct sender_base {}; } + +template +struct sender_traits_base +{ + typedef void asio_execution_sender_traits_base_is_unspecialised; +}; + +template +struct sender_traits_base::value + >::type> +{ +}; + +template +struct has_sender_types : false_type +{ +}; + +#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT) + +template < + template < + template class Tuple, + template class Variant + > class> +struct has_value_types +{ + typedef void type; +}; + +template < + template < + template class Variant + > class> +struct has_error_types +{ + typedef void type; +}; + +template +struct has_sender_types::type, + typename has_error_types::type, + typename conditional::type> : true_type +{ +}; + +template +struct sender_traits_base::value + >::type> +{ + template < + template class Tuple, + template class Variant> + using value_types = typename S::template value_types; + + template